Commit 0a448f5f authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Top 100 classes

Cherry-picked from nick/alt-tabs branch.
parent d5b516da
Loading
Loading
Loading
Loading

template/app/Top100.js

0 → 100644
+12 −0
Original line number Diff line number Diff line
/**
 * Top 100 Classes
 */
Ext.define("Docs.Top100", {
    extend: 'Docs.LocalStore',
    storeName: 'Top100',
    singleton: true,
    autoLoad: true

});

+12 −2
Original line number Diff line number Diff line
@@ -13,13 +13,15 @@ Ext.define('Docs.controller.Classes', {
    stores: [
        'Favorites',
        'History',
        'Settings'
        'Settings',
        'Top100'
    ],

    models: [
        'Favorite',
        'History',
        'Setting'
        'Setting',
        'Top100'
    ],

    refs: [
@@ -225,6 +227,14 @@ Ext.define('Docs.controller.Classes', {
        });
    },

    showPage: function(pageName) {
        if (pageName.match(/^Ext./)) {
            this.loadClass(pageName);
        } else {
            this.showGuide(pageName);
        }
    },

    /**
     * Returns base URL used for making AJAX requests.
     * @return {String} URL
+11 −0
Original line number Diff line number Diff line
/**
 * Previously visited classes / guides
 */
Ext.define('Docs.model.Top100', {
    fields: ['id', 'cls'],
    extend: 'Ext.data.Model',
    proxy: {
        type: ('localStorage' in window && window['localStorage'] !== null) ? 'localstorage' : 'memory',
        id  : 'docs-top100'
    }
});
+13 −0
Original line number Diff line number Diff line
/**
 * Top 100 Store
 */
Ext.define('Docs.store.Top100', {
    extend: 'Ext.data.Store',
    model: 'Docs.model.Top100',
    // Sort history with latest on top
    sorters: [
        { property: 'id', direction: 'DESC' }
    ],

    data: [{cls:'Ext.data.Store'},{cls:'Ext'},{cls:'Ext.grid.Panel'},{cls:'Ext.panel.Panel'},{cls:'getting_started'},{cls:'Ext.form.field.ComboBox'},{cls:'application_architecture'},{cls:'Ext.form.Panel'},{cls:'Ext.data.Model'},{cls:'Ext.button.Button'},{cls:'Ext.tree.Panel'},{cls:'Ext.Component'},{cls:'Ext.app.Application'},{cls:'Ext.window.Window'},{cls:'Ext.form.Basic'},{cls:'Ext.core.Element'},{cls:'Ext.form.field.Text'},{cls:'Ext.grid.column.Column'},{cls:'Ext.data.proxy.Ajax'},{cls:'Ext.container.Container'},{cls:'Ext.tab.Panel'},{cls:'Ext.data.proxy.Proxy'},{cls:'Ext.data.TreeStore'},{cls:'Ext.app.Controller'},{cls:'data'},{cls:'Ext.Ajax'},{cls:'class_system'},{cls:'Ext.grid.View'},{cls:'grid'},{cls:'Ext.data.reader.Json'},{cls:'Ext.AbstractComponent'},{cls:'Ext.container.Viewport'},{cls:'Ext.view.View'},{cls:'layouts_and_containers'},{cls:'Ext.toolbar.Toolbar'},{cls:'Ext.window.MessageBox'},{cls:'Ext.Loader'},{cls:'Ext.layout.Layout'},{cls:'Ext.chart.Chart'},{cls:'Ext.tree.View'},{cls:'Ext.form.field.Field'},{cls:'Ext.Base'},{cls:'Ext.data.reader.Reader'},{cls:'Ext.ComponentQuery'},{cls:'Ext.panel.Table'},{cls:'Ext.selection.Model'},{cls:'Ext.tab.Tab'},{cls:'Ext.menu.Menu'},{cls:'theming'},{cls:'Ext.grid.column.Action'},{cls:'Ext.form.field.Checkbox'},{cls:'Ext.data.Tree'},{cls:'Ext.grid.property.Grid'},{cls:'Ext.util.Observable'},{cls:'Ext.JSON'},{cls:'Ext.data.NodeInterface'},{cls:'Ext.layout.container.Border'},{cls:'Ext.data.Field'},{cls:'components'},{cls:'Ext.layout.container.HBox'},{cls:'Ext.form.FieldSet'},{cls:'tree'},{cls:'Ext.form.field.Base'},{cls:'Ext.XTemplate'},{cls:'Ext.Date'},{cls:'Ext.Class'},{cls:'Ext.form.Label'},{cls:'Ext.container.AbstractContainer'},{cls:'Ext.form.action.Action'},{cls:'Ext.form.field.Date'},{cls:'Ext.layout.container.VBox'},{cls:'drawing_and_charting'},{cls:'Ext.Array'},{cls:'Ext.data.proxy.Server'},{cls:'Ext.grid.plugin.RowEditing'},{cls:'Ext.ClassManager'},{cls:'Ext.data.proxy.Rest'},{cls:'Ext.layout.container.Card'},{cls:'Ext.data.AbstractStore'},{cls:'Ext.layout.container.Box'},{cls:'Ext.grid.plugin.CellEditing'},{cls:'Ext.form.FieldContainer'},{cls:'Ext.data.proxy.Direct'},{cls:'Ext.layout.container.Table'},{cls:'Ext.selection.RowModel'},{cls:'Ext.layout.container.Fit'},{cls:'Ext.ComponentLoader'},{cls:'Ext.grid.feature.Feature'},{cls:'Ext.layout.container.Anchor'},{cls:'Ext.toolbar.Paging'},{cls:'Ext.util.MixedCollection'},{cls:'Ext.Function'},{cls:'Ext.data.Operation'},{cls:'Ext.data.proxy.JsonP'},{cls:'Ext.form.field.TextArea'},{cls:'Ext.grid.header.Container'},{cls:'Ext.data.StoreManager'},{cls:'Ext.selection.CheckboxModel'},{cls: 'Ext.layout.container.Container'}]
});
+32 −17
Original line number Diff line number Diff line
@@ -14,6 +14,12 @@ Ext.define('Docs.view.ClassGrid', {
     */
    icons: {},

    /**
     * @cfg {Boolean} enableClose
     * Show or hide the close column
     */
    enableClose: true,

    initComponent: function() {
        this.addEvents(
            /**
@@ -42,7 +48,11 @@ Ext.define('Docs.view.ClassGrid', {
            {
                dataIndex: 'cls',
                flex: true
            },
            }
        ];

        if (this.enableClose) {
            this.columns = this.columns.concat([
                {
                    xtype: 'actioncolumn',
                    width: 18,
@@ -53,7 +63,8 @@ Ext.define('Docs.view.ClassGrid', {
                    },
                    scope: this
                }
        ];
            ]);
        }

        this.callParent(arguments);

@@ -77,13 +88,17 @@ Ext.define('Docs.view.ClassGrid', {
        // when grid hasn't been rendered yet, trying to select will give us error.
        if (this.rendered) {
            var index = this.getStore().findExact('cls', cls);
            var sm = this.getSelectionModel();
            this.selectIndex(index);
        }
    },

    selectIndex: function(index) {
        if (index > -1) {
                sm.select(index, false, true);
            this.view.focusRow(index);
            this.getSelectionModel().select(index, false, true);
        }
        else {
                sm.deselectAll(true);
            }
            this.getSelectionModel().deselectAll(true);
        }
    }

Loading