Commit f313cdac authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Make all URL-s use singular form.

Instead of /videos and /examples we now have /video and /example,
so it fits in with everything else:

- #/api/
- #/guide/
- #/video/
- #/example/
parent fd1080fd
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -29,16 +29,16 @@ Ext.define("Docs.History", {
        else if (url.type === "guide") {
            Docs.App.getController('Guides').loadGuide(url.url, true);
        }
        else if (url.url === "/videos") {
        else if (url.url === "/video") {
            Docs.App.getController('Videos').loadIndex(true);
        }
        else if (url.type === "videos") {
        else if (url.type === "video") {
            Docs.App.getController('Videos').loadVideo(url.url, true);
        }
        else if (url.url === "/examples") {
        else if (url.url === "/example") {
            Docs.App.getController('Examples').loadIndex();
        }
        else if (url.type === "examples") {
        else if (url.type === "example") {
            Docs.App.getController('Examples').loadExample(url.url, true);
        }
        else {
@@ -48,7 +48,7 @@ Ext.define("Docs.History", {

    // Parses current browser location
    parseToken: function(token) {
        var matches = token && token.match(/\/(api|guide|examples|videos)(\/(.*))?/);
        var matches = token && token.match(/\/(api|guide|example|video)(\/(.*))?/);
        return matches ? {type: matches[1], url: matches[0]} : {};
    },

+2 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ Ext.define('Docs.controller.Examples', {
    },

    loadIndex: function() {
        Ext.getCmp('doctabs').activateTab('#/examples');
        Ext.getCmp('doctabs').activateTab('#/example');
        Ext.getCmp('card-panel').layout.setActiveItem('examples');
        Ext.getCmp('tree-container').layout.setActiveItem(1);
        Ext.getCmp('tree-container').show();
@@ -53,7 +53,7 @@ Ext.define('Docs.controller.Examples', {
        this.fireEvent('showExample', url);

        var ifr = document.getElementById("exampleIframe");
        ifr.contentWindow.location.replace('extjs/' + url);
        ifr.contentWindow.location.replace('extjs/' + url.replace(/\/example\//, "/examples/"));
        setTimeout(this.activateExampleCard, 150); // Prevent previous example from flashing up
    },

+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ Ext.define('Docs.controller.Videos', {
    },

    loadIndex: function() {
        Ext.getCmp('doctabs').activateTab('#/videos');
        Ext.getCmp('doctabs').activateTab('#/video');
        Ext.getCmp('card-panel').layout.setActiveItem('videos');
        Ext.getCmp('tree-container').layout.setActiveItem(3);
        Ext.getCmp('tree-container').show();
+2 −2
Original line number Diff line number Diff line
@@ -27,8 +27,8 @@ Ext.define('Docs.view.Tabs', {
            { cls: 'index',    href: '#' },
            { cls: 'classes',  href: '#/api' },
            { cls: 'guides',   href: '#/guide' },
            { cls: 'videos',   href: '#/videos' },
            { cls: 'examples', href: '#/examples' }
            { cls: 'videos',   href: '#/video' },
            { cls: 'examples', href: '#/example' }
        ]);

        this.callParent();
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ Ext.define('Docs.view.examples.Tree', {
            var children = Ext.Array.map(group.items, function(sample) {
                return Ext.apply(sample, {
                    leaf: true,
                    url: '/examples/' + sample.url,
                    url: '/example/' + sample.url,
                    iconCls: 'icon-example'
                });
            });
Loading