fix doc demo
This commit is contained in:
parent
01e17e644a
commit
9bd5568579
5 changed files with 1459 additions and 35 deletions
|
|
@ -1,39 +1,46 @@
|
|||
Ox.load('UI', {
|
||||
debug: true,
|
||||
theme: 'classic'
|
||||
}, function() {
|
||||
Ox.Theme('classic');
|
||||
$.getJSON(Ox.UI.PATH + 'json/Ox.UI.files.json', function(files) {
|
||||
doc = Ox.DocPanel({
|
||||
files: Ox.merge([
|
||||
'Ox.js',
|
||||
'Ox.Geo/Ox.Geo.js',
|
||||
'Ox.Image/Ox.Image.js',
|
||||
], files.filter(function(file) {
|
||||
return Ox.endsWith(file, '.js');
|
||||
})),
|
||||
getModule: function(item) {
|
||||
var file = item.file.replace(Ox.PATH, '');
|
||||
return file == 'Ox.js' ? 'Ox' : file.split('/')[0];
|
||||
},
|
||||
getSection: function(item) {
|
||||
var file = item.file.replace(Ox.PATH, '');
|
||||
return item.section || file.split('/')[2];
|
||||
},
|
||||
path: Ox.PATH
|
||||
}).bindEvent({
|
||||
load: function() {
|
||||
doc.selectItem(document.location.hash.substring(1));
|
||||
},
|
||||
select: function(data) {
|
||||
if (data.ids) {
|
||||
document.location.hash = data.ids[0];
|
||||
Ox.getJSON(Ox.PATH + 'Ox/json/Ox.json', function(oxFiles) {
|
||||
Ox.getJSON(Ox.PATH + 'Ox.UI/json/Ox.UI.files.json', function(oxuiFiles) {
|
||||
doc = Ox.DocPanel({
|
||||
files: Ox.merge(
|
||||
Ox.flatten(oxFiles),
|
||||
oxuiFiles.filter(function(file) {
|
||||
return Ox.endsWith(file, '.js');
|
||||
}),
|
||||
[
|
||||
'Ox.Geo/Ox.Geo.js',
|
||||
'Ox.Image/Ox.Image.js',
|
||||
'Ox.Unicode/Ox.Unicode.js'
|
||||
]
|
||||
),
|
||||
getModule: function(item) {
|
||||
var file = item.file.replace(Ox.PATH, '');
|
||||
return file.split('/')[0];
|
||||
},
|
||||
getSection: function(item) {
|
||||
var file = item.file.replace(Ox.PATH, '');
|
||||
return item.section || file.split('/')[2];
|
||||
},
|
||||
path: Ox.PATH
|
||||
}).bindEvent({
|
||||
load: function() {
|
||||
if (document.location.hash.substring(1)) {
|
||||
doc.selectItem(document.location.hash.substring(1));
|
||||
}
|
||||
},
|
||||
select: function(data) {
|
||||
if (data.ids) {
|
||||
document.location.hash = data.ids[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
doc.appendTo(Ox.UI.$body);
|
||||
window.onhashchange = function() {
|
||||
doc.selectItem(document.location.hash.substring(1))
|
||||
};
|
||||
});
|
||||
doc.appendTo(Ox.UI.$body);
|
||||
window.onhashchange = function() {
|
||||
doc.selectItem(document.location.hash.substring(1))
|
||||
};
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue