rename 'keywords' option to 'references'
This commit is contained in:
parent
9c044300ef
commit
b71d9148d0
2 changed files with 12 additions and 11 deletions
|
@ -14,6 +14,7 @@ Ox.ExamplePage = function(options, self) {
|
|||
.defaults({
|
||||
html: '',
|
||||
js: '',
|
||||
references: [],
|
||||
replaceCode: [],
|
||||
replaceComment: [],
|
||||
selected: 'source',
|
||||
|
@ -113,9 +114,9 @@ Ox.ExamplePage = function(options, self) {
|
|||
})
|
||||
.appendTo(self.$toolbar);
|
||||
|
||||
self.$keywordMenu = Ox.MenuButton({
|
||||
items: self.options.keywords.map(function(keyword) {
|
||||
return {id: keyword, title: keyword};
|
||||
self.$referencesMenu = Ox.MenuButton({
|
||||
items: self.options.references.map(function(reference) {
|
||||
return {id: reference, title: reference};
|
||||
}),
|
||||
//title: 'Documentation',
|
||||
//width: 128
|
||||
|
|
|
@ -14,8 +14,8 @@ Ox.ExamplePanel = function(options, self) {
|
|||
.defaults({
|
||||
element: '',
|
||||
examples: [],
|
||||
keywords: null,
|
||||
path: '',
|
||||
references: null,
|
||||
replaceCode: [],
|
||||
replaceComment: [],
|
||||
selected: '',
|
||||
|
@ -91,8 +91,8 @@ Ox.ExamplePanel = function(options, self) {
|
|||
var title = html.match(/<title>(.+)<\/title>/);
|
||||
item.title = title ? title[1] : 'Untitled'
|
||||
Ox.get(item.js, function(js) {
|
||||
var keywords = js.match(self.options.keywords);
|
||||
item.keywords = keywords ? Ox.unique(keywords).sort(function(a, b) {
|
||||
var references = js.match(self.options.references);
|
||||
item.references = references ? Ox.unique(references).sort(function(a, b) {
|
||||
a = a.toLowerCase();
|
||||
b = b.toLowerCase();
|
||||
return a < b ? -1 : a > b ? 1 : 0;
|
||||
|
@ -113,7 +113,7 @@ Ox.ExamplePanel = function(options, self) {
|
|||
height: window.innerHeight,
|
||||
html: item.html,
|
||||
js: item.js,
|
||||
keywords: item.keywords,
|
||||
references: item.references,
|
||||
replaceCode: self.options.replaceCode,
|
||||
replaceComment: self.options.replaceComment,
|
||||
title: item.title,
|
||||
|
|
Loading…
Reference in a new issue