forked from 0x2620/oxjs
make it possible to parse keywords from documented source
This commit is contained in:
parent
6c4e520b6d
commit
fb8dd98b8a
5 changed files with 78 additions and 46 deletions
|
|
@ -27,7 +27,7 @@ Ox.ExamplePage = function(options, self) {
|
|||
tooltip: 'Reload',
|
||||
type: 'image'
|
||||
})
|
||||
.css({float: 'right', margin: '4px 4px 4px 2px'})
|
||||
.css({float: 'right', margin: '4px 2px 4px 2px'})
|
||||
.bindEvent({
|
||||
click: function() {
|
||||
self.$frame.attr({src: self.options.html});
|
||||
|
|
@ -39,11 +39,13 @@ Ox.ExamplePage = function(options, self) {
|
|||
buttons: [
|
||||
{
|
||||
id: 'source',
|
||||
title: 'View Source'
|
||||
title: 'View Source',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
id: 'live',
|
||||
title: 'View Live'
|
||||
title: 'View Live',
|
||||
width: 80
|
||||
}
|
||||
],
|
||||
selectable: true,
|
||||
|
|
@ -66,6 +68,22 @@ Ox.ExamplePage = function(options, self) {
|
|||
})
|
||||
.appendTo(self.$toolbar);
|
||||
|
||||
self.$keywordMenu = Ox.MenuButton({
|
||||
items: self.options.keywords.map(function(keyword) {
|
||||
return {id: keyword, title: keyword};
|
||||
}),
|
||||
title: 'select',
|
||||
tooltip: 'Documentation',
|
||||
type: 'image'
|
||||
})
|
||||
.css({float: 'right', margin: '4px 2px 4px 2px'})
|
||||
.bindEvent({
|
||||
click: function(data) {
|
||||
that.triggerEvent('select', {id: data.id});
|
||||
}
|
||||
})
|
||||
.appendTo(self.$toolbar);
|
||||
|
||||
self.$viewer = Ox.SourceViewer({
|
||||
file: self.options.js,
|
||||
replace: self.options.replace
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue