3 _App.Router = function()
8 _App.Router.prototype =
14 '#/thankyouvaluation' : 'thankyouvaluation',
15 '#/thankyoucontact' : 'thankyoucontact',
16 '#/publicfaq' : 'publicfaq',
17 '#/publiccontact_us' : 'publiccontact_us',
18 '#/publicvaluation' : 'publicvaluation',
19 '#/publichome' : 'publichome',
24 '#/dealerhome' : 'dealerhome',
27 '#/forgot' : 'forgot',
28 '#/contact' : 'contact',
29 '#/register' : 'register',
30 '#/registered' : 'registered',
31 '#/contact_us' : 'contact_us',
32 '#/about_us' : 'about_us',
33 '#/terms_and_conditions' : 'terms_and_conditions',
34 '#/unsubscribe-newsletter': 'unsubscribenewsletter',
35 '#/customervaluation' : 'customervaluation',
36 '#/customercompletevaluation' : 'customercompletevaluation',
40 '#/auction' : 'auction',
41 '#/bidview' : 'bidview',
42 '#/historyview' : 'historyview',
44 '#/stockview' : 'stockview',
45 '#/limitedstockview' : 'limitedstockview',
46 '#/tcstock' : 'tcstock',
47 '#/tcstockview' : 'tcstockview',
48 '#/limitedtcstockview' : 'limitedtcstockview',
49 '#/valuations' : 'valuations',
50 '#/valuationview' : 'valuationview',
51 '#/limitedvaluationview' : 'limitedvaluationview',
52 '#/valuationreport' : 'valuationreport',
53 '#/settings' : 'settings',
54 '#/userview' : 'userview',
55 '#/dealerview' : 'dealerview',
56 '#/membershipview' : 'membershipview',
57 '#/clubview' : 'clubview',
58 '#/memberview' : 'memberview',
59 '#/disputeview' : 'disputeview',
60 '#/questionview' : 'questionview',
61 '#/replyview' : 'replyview',
62 '#/retailview' : 'retailview',
63 '#/priceguide' : 'priceguide',
64 '#/offerview' : 'offerview',
65 '#/changepinview' : 'changepinview',
66 '#/historicaldata' : 'historicaldata',
67 '#/valuationcalendar' : 'valuationcalendar',
68 '#/appointmentedit' : 'appointmentedit',
72 '#/switch' : 'switch',
74 '#/userpermissions' : 'userpermissions',
75 '#/viewuserpermissions' : 'viewuserpermissions',
76 '#/systemusers' : 'systemusers',
77 '#/systemuserview' : 'systemuserview',
78 '#/systemauctions' : 'systemauctions',
79 '#/systembidview' : 'systembidview',
80 '#/systemdisputes' : 'systemdisputes',
81 '#/systemdisputeview' : 'systemdisputeview',
82 '#/override' : 'override',
83 '#/dealers' : 'dealers',
84 '#/systemdealerview' : 'systemdealerview',
85 '#/xmlrpcrequestlog' : 'xmlrpcrequestlog',
86 '#/xmlrpccallbacklog' : 'xmlrpccallbacklog',
87 '#/xmlrpcclients' : 'xmlrpcclients',
88 '#/xmlrpcclientview' : 'xmlrpcclientview',
89 '#/systemsettings' : 'systemsettings',
90 '#/configview' : 'configview',
91 '#/accessories' : 'accessories',
92 '#/damages' : 'damages',
93 '#/increments' : 'increments',
94 '#/groups' : 'groups',
95 '#/divisions' : 'divisions',
96 '#/holidays' : 'holidays',
97 '#/regionalmanager' : 'regionalmanager',
98 '#/opendays' : 'opendays',
99 '#/newsletters' : 'newsletters',
100 '#/newsletterview' : 'newsletterview',
101 '#/reports' : 'reports',
102 '#/smsreport' : 'smsreport',
103 '#/invreport' : 'invreport',
104 '#/auctionreport' : 'auctionreport',
105 '#/stockauctionreport' : 'stockauctionreport',
106 '#/stockbulkimporter' : 'stockbulkimporter',
107 '#/hpilogreport' : 'hpilogreport',
108 '#/hpiaccidentlogreport' : 'hpiaccidentlogreport',
109 '#/pgreport' : 'pgreport',
110 '#/traderreport' : 'traderreport',
111 '#/adhreport' : 'adhreport',
112 '#/loadvssoldreport' : 'loadvssoldreport',
113 '#/loadvssolddetreport' : 'loadvssolddetreport',
114 '#/pgfreport' : 'pgfreport',
115 '#/pgsreport' : 'pgsreport',
116 '#/auctionadherence' : 'auctionadherence',
117 '#/nomatch' : 'nomatch',
118 '#/priceguideflash' : 'priceguideflash',
119 '#/emailreport' : 'emailreport',
120 '#/loginreport' : 'loginreport',
121 '#/adminvaluationreport' : 'adminvaluationreport',
122 '#/valuationstatreport' : 'valuationstatreport',
123 '#/auctiontraderreport' : 'auctiontraderreport',
124 '#/transunionupload' : 'transunionupload'
128 'thankyou' : 'PublicMenu',
129 'publicfaq' : 'PublicMenu',
130 'publiccontact_us' : 'PublicMenu',
131 'publicvaluation' : 'PublicMenu',
132 'customervaluation' : 'PublicMenu',
133 'publichome' : 'PublicMenu',
134 'home' : 'PublicMenu',
135 'faq' : 'BrochureMenu',
136 'login' : 'BrochureMenu',
137 'forgot' : 'BrochureMenu',
138 'contact' : 'BrochureMenu',
139 'register' : 'BrochureMenu',
140 'registered' : 'BrochureMenu',
141 'contact_us' : 'BrochureMenu',
142 'about_us' : 'BrochureMenu',
143 'terms_and_conditions' : 'BrochureMenu',
144 'dealerhome' : 'BrochureMenu'
150 'historyview' : true,
153 'limitedstockview' : true,
155 'tcstockview' : true,
156 'limitedtcstockview' : true,
158 'valuationview' : true,
159 'limitedvaluationview' : true,
160 'valuationreport' : true,
163 'changepinview' : true,
165 'membershipview' : true,
168 'disputeview' : true,
169 'questionview' : true,
176 'userpermissions' : true,
177 'viewuserpermissions' : true,
178 'systemusers' : true,
179 'systemuserview' : true,
180 'systemauctions' : true,
181 'systembidview' : true,
182 'systemdisputes' : true,
183 'systemdisputeview' : true,
186 'systemdealerview' : true,
187 'xmlrpcrequestlog' : true,
188 'xmlrpccallbacklog' : true,
189 'xmlrpcclients' : true,
190 'xmlrpcclientview' : true,
191 'systemsettings' : true,
193 'accessories' : true,
199 'regionalmanager' : true,
201 'newsletters' : true,
202 'newsletterview' : true,
206 'auctionreport' : true,
207 'hpilogreport' : true,
208 'hpiaccidentlogreport' : true,
210 'traderreport' : true,
212 'loadvssoldreport' : true,
213 'loadvssolddetreport' : true,
216 'auctionadherence' : true,
218 'priceguideflash' : true,
219 'emailreport' : true,
220 'loginreport' : true,
221 'adminvaluationreport' : true,
222 'valuationstatreport' : true,
223 'auctiontraderreport' : true,
224 'historicaldata' : true
227 initialize : function()
229 if( !window.location.hash.length )
231 window.location.hash = '/';
233 this.setupHashChangeListener();
236 setupHashChangeListener : function()
238 if( !( 'onhashchange' in window ) )
242 $(window).on('hashchange', $.proxy( this.handleHashChange, this ));
245 pollHash : function()
247 var currentHash = window.location.hash;
248 setInterval( function(){
249 if( window.location.hash != currentHash )
251 $(window).trigger('hashchange');
252 currentHash = window.location.hash;
257 handleHashChange : function()
259 var hashLoc = window.location.hash.split("?");
260 var page = this.routes[hashLoc[0]];
261 if (this.requireAuth[page] && !App.Authenticated)
263 App.redirect = window.location.hash;
264 window.location.hash = '/login';
269 && ('cash-cars.local' == window.location.host
270 || 'cash-cars.nirph.com' == window.location.host
271 || 'www.wepay4cars.co.za' == window.location.host
272 || 'wepay4cars.co.za' == window.location.host
273 || 'www.wepay4cars.co.za' == window.location.host
274 || 'wepay4cars.co.za' == window.location.host))
276 page = 'customervaluation';
280 && ('namibia.local' == window.location.host
281 || 'namibia.nirph.com' == window.location.host
282 || 'www.bid4cars.com.na' == window.location.host))
286 if (this.requireMenu[page])
288 $('.is-brochure-menu').hide();
289 $('#' + this.requireMenu[page]).show();
290 $('#Mobi' + this.requireMenu[page]).show();
292 App.Controller.changePage( page );
293 $(window).trigger('pageChange');