diff --git a/lib/jsduck/app.rb b/lib/jsduck/app.rb index 25c4e46de9cf13aac8a1eb8805cc02e0f4f22b91..6dfda5fdd9f706ec2429d953f987d9f04b56be96 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 673d453aa2e29c11ef17f5448f327943b38f7fdd..a2d17898eeb7def39ce67cde287247a0ad7ef364 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 44dffcae07d9fe4d4c71d89983d80ba6a6ddc977..f4279ba58145e0a78eee2641d9be160846bfb583 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 598c9bf939cb5763c39c5c9248d68cb428ff3ebe..89b03b679c0b047d822a66b882ed842234fac8d6 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 e0f99d53b6964eb1b992bf1a6fe391acfe5e3fd9..0000000000000000000000000000000000000000 --- 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 66f50f13cb4f6df3f9a2fdacdcdcc61cfb3ac48b..0000000000000000000000000000000000000000 --- 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 b01993403c47ac02c301973cde8a900cc33e5ee4..0000000000000000000000000000000000000000 --- 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 5cf06d0fd51d2bb82735de26d5c1266284e80343..a393eb610f7fe835fde90f3174f3d1905ac73d3d 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 af574ca2f7b7e26d67448880d38f8d33fe6b3bb7..0000000000000000000000000000000000000000 --- 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 9ac45d4de23dbb96163f0f20e06704f7684cc135..cd4dfa9701e3ac372efd8eb08468a09fdb0bae89 100644 --- a/template/index.html +++ b/template/index.html @@ -30,7 +30,6 @@ - {head_html}