From 3f6dd8ce8fdf6bf0f81bb504c0aa68b24a89b95c Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Mon, 11 Jul 2011 15:52:32 +0300 Subject: [PATCH] Remove the Examples tab completely for now. Removing this whole thing temporarily. I'm trying to concentrate on inline examples and this thing is just getting on my way. --- lib/jsduck/app.rb | 8 ------ template/app/Application.js | 2 -- template/app/controller/Classes.js | 8 ++---- template/app/controller/Examples.js | 7 +---- template/app/model/Example.js | 11 -------- template/app/store/Examples.js | 7 ----- template/app/view/cls/Examples.js | 40 --------------------------- template/app/view/cls/TabPanel.js | 4 --- template/exampleData.json | 42 ----------------------------- template/index.html | 1 - 10 files changed, 3 insertions(+), 127 deletions(-) delete mode 100644 template/app/model/Example.js delete mode 100644 template/app/store/Examples.js delete mode 100644 template/app/view/cls/Examples.js delete mode 100644 template/exampleData.json diff --git a/lib/jsduck/app.rb b/lib/jsduck/app.rb index 25c4e46d..6dfda5fd 100644 --- a/lib/jsduck/app.rb +++ b/lib/jsduck/app.rb @@ -133,7 +133,6 @@ module JsDuck @timer.time(:generating) { write_search_data(@output_dir+"/output/searchData.js", relations) } @timer.time(:generating) { write_classes(@output_dir+"/output", relations) } @timer.time(:generating) { @guides.write(@output_dir+"/guides") } - @timer.time(:generating) { write_examples(@output_dir+"/output/exampleData.js") } end @timer.report @@ -225,13 +224,6 @@ module JsDuck File.open(filename, 'w') {|f| f.write(js) } end - # Write examples in JSON form into a file. - def write_examples(filename) - examples = JSON.parse(IO.read(@template_dir+"/exampleData.json")) - js = "Docs.examplesData = " + JSON.generate( examples ) + ";" - File.open(filename, 'w') {|f| f.write(js) } - end - # Writes JsonP export file for each class def write_classes(path, relations) exporter = Exporter.new(relations, get_doc_formatter(relations)) diff --git a/template/app/Application.js b/template/app/Application.js index 673d453a..a2d17898 100644 --- a/template/app/Application.js +++ b/template/app/Application.js @@ -30,8 +30,6 @@ Ext.define('Docs.Application', { Docs.Favorites.init(); Docs.Settings.init(); - Ext.getStore('Examples').add(Docs.examplesData.examples); - Ext.create('Docs.view.Viewport'); // Update favorites grid height between browser tabs if changed diff --git a/template/app/controller/Classes.js b/template/app/controller/Classes.js index 44dffcae..f4279ba5 100644 --- a/template/app/controller/Classes.js +++ b/template/app/controller/Classes.js @@ -8,20 +8,17 @@ Ext.define('Docs.controller.Classes', { requires: [ 'Docs.History', 'Docs.Syntax', - 'Docs.view.cls.Overview', - 'Docs.view.cls.Examples' + 'Docs.view.cls.Overview' ], stores: [ - 'Examples', 'Favorites', 'Settings' ], models: [ 'Favorite', - 'Setting', - 'Example' + 'Setting' ], refs: [ @@ -230,7 +227,6 @@ Ext.define('Docs.controller.Classes', { if (!this.getOverview()) { this.getTabPanel().add(Ext.create('Docs.view.cls.Overview')); - this.getTabPanel().add(Ext.create('Docs.view.cls.Examples')); this.getTabPanel().setActiveTab(0); } diff --git a/template/app/controller/Examples.js b/template/app/controller/Examples.js index 598c9bf9..89b03b67 100644 --- a/template/app/controller/Examples.js +++ b/template/app/controller/Examples.js @@ -1,5 +1,5 @@ /** - * Controller for both examples tab and inline examples. + * Controller for inline examples. */ Ext.define('Docs.controller.Examples', { extend: 'Ext.app.Controller', @@ -62,11 +62,6 @@ Ext.define('Docs.controller.Examples', { afterload: function() { this.replaceExampleDivs(); } - }, - 'gridpanel[cmpName=examplelist]': { - itemclick: function(view, record, item, index, event) { - this.showExample(Ext.getCmp('standAloneCodeExample'), record.data.location); - } } }); }, diff --git a/template/app/model/Example.js b/template/app/model/Example.js deleted file mode 100644 index e0f99d53..00000000 --- a/template/app/model/Example.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Key-value pairs of Docs app settings. - */ -Ext.define('Docs.model.Example', { - fields: ['id', 'primaryClass', 'referencesClasses', 'title', 'description', 'location'], - extend: 'Ext.data.Model', - proxy: { - type: 'memory', - id : 'docs-examples' - } -}); diff --git a/template/app/store/Examples.js b/template/app/store/Examples.js deleted file mode 100644 index 66f50f13..00000000 --- a/template/app/store/Examples.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Store for keeping examples index. - */ -Ext.define('Docs.store.Examples', { - extend: 'Ext.data.Store', - model: 'Docs.model.Example' -}); \ No newline at end of file diff --git a/template/app/view/cls/Examples.js b/template/app/view/cls/Examples.js deleted file mode 100644 index b0199340..00000000 --- a/template/app/view/cls/Examples.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Panel with grid listing all examples and an area for viewing them. - */ -Ext.define('Docs.view.cls.Examples', { - extend: 'Ext.panel.Panel', - alias: 'widget.classexamples', - requires: [ - 'Docs.view.examples.Inline' - ], - - cls: 'iScroll', - title: 'Examples', - autoScroll: true, - - layout: 'border', - - items: [ - { - region: 'west', - width: 200, - xtype: 'gridpanel', - store: 'Examples', - cmpName: 'examplelist', - padding: '10', - columns: [ - { - text: 'Example', - dataIndex: 'title', - flex: true - } - ] - }, - { - region: 'center', - padding: '10', - id: 'standAloneCodeExample', - xtype: 'inlineexample' - } - ] -}); diff --git a/template/app/view/cls/TabPanel.js b/template/app/view/cls/TabPanel.js index 5cf06d0f..a393eb61 100644 --- a/template/app/view/cls/TabPanel.js +++ b/template/app/view/cls/TabPanel.js @@ -5,10 +5,6 @@ Ext.define('Docs.view.cls.TabPanel', { extend: 'Ext.tab.Panel', alias: 'widget.classtabpanel', - requires: [ - 'Docs.view.cls.Overview', - 'Docs.view.cls.Examples' - ], plain: true, diff --git a/template/exampleData.json b/template/exampleData.json deleted file mode 100644 index af574ca2..00000000 --- a/template/exampleData.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "examples": [ - { - "title": "Simple Button", - "primaryClass": "Ext.button.Button", - "description": "Simple button with click handler", - "location": "Ext.button.Button/01_simple.js" - }, - { - "title": "Toggle Button", - "primaryClass": "Ext.button.Button", - "description": "A button which retains its click state", - "location": "Ext.button.Button/02_toggle.js" - }, - { - "title": "Menu Button", - "primaryClass": "Ext.button.Button", - "referencedClasses": ["Ext.menu.Menu"], - "description": "Menu button with bottom aligned arrow", - "location": "Ext.button.Button/03_menu.js" - }, - { - "title": "Basic Grid Panel", - "primaryClass": "Ext.panel.Grid", - "description": "Basic grid panel", - "location": "Ext.grid.Panel/01_basic.js" - }, - { - "title": "Grouping Grid Panel", - "primaryClass": "Ext.panel.Grid", - "description": "Grouping grid panel", - "location": "Ext.grid.Panel/02_grouping.js" - }, - { - "title": "Gist Grid Panel", - "primaryClass": "Ext.panel.Grid", - "referencedClasses": ["Ext.data.Store"], - "description": "Basic grid panel", - "location": "https://api.github.com/gists/dec585d34846a55928fb" - } - ] -} \ No newline at end of file diff --git a/template/index.html b/template/index.html index 9ac45d4d..cd4dfa97 100644 --- a/template/index.html +++ b/template/index.html @@ -30,7 +30,6 @@ - {head_html} -- GitLab