Commit 5b3bed61 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Friendlier 404 error message.

Well... before this there was no error message at all - just
the load mask stayed on.
parent 98ec8005
Loading
Loading
Loading
Loading
+20 −3
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ Ext.define('Docs.controller.Classes', {
                    this.showClass(json, member);
                },
                failure: function(response, opts) {
                    // console.log('Fail');
                    this.showFailure("Class <b>"+cls+"</b> was not found.");
                },
                scope: this
            });
@@ -236,10 +236,27 @@ Ext.define('Docs.controller.Classes', {
                this.getTree().selectUrl(url);
                this.getFavoritesGrid().selectUrl(url);
            },
            failure: function(response, opts) {
                this.showFailure("Guide <b>"+name+"</b> was not found.");
            },
            scope: this
        });
    },

    showFailure: function(msg) {
        this.getOverview().setLoading(false);
        var tpl = new Ext.XTemplate(
            "<h1>Oops...</h1>",
            "<p>{msg}</p>",
            "<p>Maybe it was renamed to something else? Or maybe it has passed away permanently to the 404 land? ",
            "This would be sad. Hopefully it's just a bug in our side. ",
            "Report it to <a href='http://www.sencha.com/forum/showthread.php?135036'>Sencha Forum</a> if you feel so.</p>",
            "<p>Sorry for all this :(</p>"
        );
        Ext.getCmp("failure").update(tpl.apply({msg: msg}));
        Ext.getCmp('card-panel').layout.setActiveItem("failure");
    },

    /**
     * Returns base URL used for making AJAX requests.
     * @return {String} URL
+4 −0
Original line number Diff line number Diff line
@@ -217,6 +217,10 @@ Ext.define('Docs.view.Viewport', {
                            autoScroll: true,
                            xtype: 'container',
                            id: 'guide'
                        },
                        {
                            xtype: 'container',
                            id: 'failure'
                        }
                    ]
                }
+12 −0
Original line number Diff line number Diff line
@@ -528,6 +528,18 @@ a {
  hr {
    display: none; } }

#failure {
  h1 {
    padding: 10px 0;
    font-family: $docs-heading-font;
    letter-spacing: -1px;
    margin-bottom: 16px;
    font-size: 2.3em;
    color: #66ab16; }
  p {
    margin: 0 0 0.8em; } }


// Nice styles for headings inside documentation
#center-container .doc-contents {
  h1, h2 {