-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathApp.js
84 lines (71 loc) · 2.17 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*jshint strict:false */
define([
"dojo/_base/declare",
"dojo/_base/lang",
"routed/Request",
"dojomat/Application",
"dojomat/populateRouter",
"./routing-map",
"require",
"dojo/domReady!"
], function (
declare,
lang,
Request,
Application,
populateRouter,
routingMap,
require
) {
var trackPage = function (request) {
var q = request.getQueryString(),
r = request.getPathname() + ((q !== '') ? '?' : '') + q
;
if (window._gaq) {
window._gaq.push(['_trackPageview', r]);
}
};
return declare([Application], {
constructor: function () {
populateRouter(this, routingMap);
this.run();
},
makeNotFoundPage: function () {
var request = new Request(window.location.href),
makePage = function (Page) {
this.clearCss();
this.prepareDomNode();
var page = new Page({
request: request,
router: this.router
}, this.domNode);
page.startup();
this.notification.clear();
}
;
require(['./ui/error/NotFoundPage'], lang.hitch(this, makePage));
trackPage(request);
},
makeErrorPage: function (error) {
var request = new Request(window.location.href),
makePage = function (Page) {
this.clearCss();
this.prepareDomNode();
var page = new Page({
request: request,
router: this.router,
error: error
}, this.domNode);
page.startup();
this.notification.clear();
}
;
require(['./ui/error/ErrorPage'], lang.hitch(this, makePage));
trackPage(request);
},
makePage: function (request, widget, layers, stylesheets) {
this.inherited(arguments);
trackPage(request);
}
});
});