forked from williamngan/pts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af10a8f
commit 66f7161
Showing
8 changed files
with
11,321 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ node_modules/ | |
temp/ | ||
*.js.map | ||
.DS_Store | ||
*.mp4 | ||
*.mp4 | ||
docsn/**/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<html> | ||
<head> | ||
<script type="text/javascript" src="./js/vue.js"></script> | ||
<style type="text/css"> | ||
body { | ||
font-family: "Helvetica", sans-serif; | ||
font-size: 13px; | ||
line-height: 1.35; | ||
margin: 0; | ||
} | ||
#modules { | ||
position: absolute; | ||
top: 0; left: 0; bottom: 0; width: 25vw; | ||
overflow: auto; | ||
padding: 20px; | ||
} | ||
#contents { | ||
position: absolute; | ||
top: 0; left: 30vw; bottom: 0; right: 0; | ||
overflow: auto; | ||
padding: 20px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div id="docapp"> | ||
<div id="modules"> | ||
<div v-for="m in modules"> | ||
<h4>{{ m[0] }}</h4> | ||
<div v-for="c in m[1]" v-on:click="loadClass( m[0], c )">{{ c }}</div> | ||
</div> | ||
</div> | ||
<div id="contents"> | ||
<h1>{{ contents.name }}</h1> | ||
<h3>Methods</h3> | ||
<div v-for="m in contents.methods"> | ||
<h4>{{ m.name }}</h4> | ||
<div> | ||
<div v-for="s in m.signatures"> | ||
<div>{{ s.comment }}</div> | ||
<div v-for="p in s.parameters"> | ||
{{ p.name }} ({{ p.type}}) : {{ p.comment }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script type="text/javascript" src="./js/doc.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
var app = new Vue({ | ||
el: '#docapp', | ||
data: { | ||
message: 'Hello Vue!', | ||
modules: [], | ||
contents: { name: "...", methods: [{name: "test"}]} | ||
}, | ||
methods: { | ||
test: function( m ) { | ||
this.message = m; | ||
}, | ||
loadClass: function( mod, cls ) { | ||
loadContents( mod+"_"+cls ); | ||
} | ||
} | ||
}) | ||
|
||
|
||
|
||
function loadJSON( url, callback ) { | ||
var request = new XMLHttpRequest(); | ||
request.open('GET', url, true); | ||
|
||
request.onload = function() { | ||
if (request.status >= 200 && request.status < 400) { | ||
callback( JSON.parse(request.responseText), "success" ); | ||
} else { | ||
callback( false, "server error" ); | ||
} | ||
}; | ||
|
||
request.onerror = function() { | ||
callback( false, "connection error" ); | ||
}; | ||
|
||
request.send(); | ||
} | ||
|
||
|
||
loadJSON( "./json/modules.json", (data, status) => { | ||
let ms = []; | ||
for (var k in data) { | ||
let m = [ k ]; | ||
m.push( data[k] ); | ||
ms.push( m ); | ||
} | ||
|
||
console.log( ms ); | ||
app.modules = ms; | ||
}); | ||
|
||
function loadContents( id ) { | ||
console.log( id ); | ||
loadJSON( `./json/${id}.json`, (data, status) => { | ||
app.contents.name = data.name; | ||
app.contents.methods = data.methods; | ||
}); | ||
} |
Oops, something went wrong.