From b71d9148d0c2d9d47e2c6749543b5330b1f8d956 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 12 Jun 2012 14:31:45 +0200 Subject: [PATCH] rename 'keywords' option to 'references' --- source/Ox.UI/js/Code/ExamplePage.js | 7 ++++--- source/Ox.UI/js/Code/ExamplePanel.js | 16 ++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/source/Ox.UI/js/Code/ExamplePage.js b/source/Ox.UI/js/Code/ExamplePage.js index 19b21169..63a11b51 100644 --- a/source/Ox.UI/js/Code/ExamplePage.js +++ b/source/Ox.UI/js/Code/ExamplePage.js @@ -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 diff --git a/source/Ox.UI/js/Code/ExamplePanel.js b/source/Ox.UI/js/Code/ExamplePanel.js index 479f597e..28d25213 100644 --- a/source/Ox.UI/js/Code/ExamplePanel.js +++ b/source/Ox.UI/js/Code/ExamplePanel.js @@ -14,8 +14,8 @@ Ox.ExamplePanel = function(options, self) { .defaults({ element: '', examples: [], - keywords: null, path: '', + references: null, replaceCode: [], replaceComment: [], selected: '', @@ -83,16 +83,16 @@ Ox.ExamplePanel = function(options, self) { var items = []; self.options.examples.forEach(function(example) { var item = { - html: self.options.path + example + '/index.html', - id: example, - js: self.options.path + example + '/js/example.js' - }; + html: self.options.path + example + '/index.html', + id: example, + js: self.options.path + example + '/js/example.js' + }; Ox.get(item.html, function(html) { var title = html.match(/(.+)<\/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,