Git Repository Public Repository

namibia

URLs

Copy to Clipboard
 
bb2698c383a0585633180c7996aba816667c9e6d
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
;(function(){

	_App.Router = function()
	{
		this.initialize();
	};

	_App.Router.prototype =
	{

		routes :
		{
			// Public
			'#/thankyouvaluation'    : 'thankyouvaluation',
			'#/thankyoucontact'      : 'thankyoucontact',
			'#/publicfaq'            : 'publicfaq',
			'#/publiccontact_us'     : 'publiccontact_us',
			'#/publicvaluation'      : 'publicvaluation',
			'#/publichome'           : 'publichome',

			// Brochure
			''                       : 'home',
			'#/'                     : 'home',
			'#/dealerhome'           : 'dealerhome',
			'#/faq'                  : 'faq',
			'#/login'                : 'login',
			'#/forgot'               : 'forgot',
			'#/contact'              : 'contact',
			'#/register'             : 'register',
			'#/registered'           : 'registered',
			'#/contact_us'           : 'contact_us',
			'#/about_us'             : 'about_us',
			'#/terms_and_conditions' : 'terms_and_conditions',
			'#/unsubscribe-newsletter': 'unsubscribenewsletter',
            '#/customervaluation'      : 'customervaluation',
            '#/customercompletevaluation'      : 'customercompletevaluation',


			// Portal
			'#/auction'              : 'auction',
			'#/bidview'              : 'bidview',
			'#/historyview'          : 'historyview',
			'#/stock'                : 'stock',
			'#/stockview'            : 'stockview',
			'#/limitedstockview'     : 'limitedstockview',
			'#/tcstock'              : 'tcstock',
			'#/tcstockview'          : 'tcstockview',
			'#/limitedtcstockview'   : 'limitedtcstockview',
			'#/valuations'           : 'valuations',
			'#/valuationview'        : 'valuationview',
			'#/limitedvaluationview' : 'limitedvaluationview',
			'#/valuationreport'      : 'valuationreport',
			'#/settings'             : 'settings',
			'#/userview'             : 'userview',
			'#/dealerview'           : 'dealerview',
			'#/membershipview'       : 'membershipview',
			'#/clubview'             : 'clubview',
			'#/memberview'           : 'memberview',
			'#/disputeview'          : 'disputeview',
			'#/questionview'         : 'questionview',
			'#/replyview'            : 'replyview',
			'#/retailview'           : 'retailview',
			'#/priceguide'           : 'priceguide',
			'#/offerview'            : 'offerview',
			'#/changepinview'        : 'changepinview',
      		'#/historicaldata'       : 'historicaldata',
            '#/valuationcalendar'      : 'valuationcalendar',
            '#/appointmentedit'      : 'appointmentedit',


			// Admin
			'#/switch'               : 'switch',
			'#/admin'                : 'admin',
			'#/userpermissions'      : 'userpermissions',
			'#/viewuserpermissions'  : 'viewuserpermissions',
			'#/systemusers'          : 'systemusers',
			'#/systemuserview'       : 'systemuserview',
			'#/systemauctions'       : 'systemauctions',
			'#/systembidview'        : 'systembidview',
			'#/systemdisputes'       : 'systemdisputes',
			'#/systemdisputeview'    : 'systemdisputeview',
			'#/override'             : 'override',
			'#/dealers'              : 'dealers',
			'#/systemdealerview'     : 'systemdealerview',
			'#/xmlrpcrequestlog'     : 'xmlrpcrequestlog',
			'#/xmlrpccallbacklog'    : 'xmlrpccallbacklog',
			'#/xmlrpcclients'        : 'xmlrpcclients',
			'#/xmlrpcclientview'     : 'xmlrpcclientview',
			'#/systemsettings'       : 'systemsettings',
			'#/configview'           : 'configview',
			'#/accessories'          : 'accessories',
			'#/damages'              : 'damages',
			'#/increments'           : 'increments',
			'#/groups'               : 'groups',
			'#/divisions'            : 'divisions',
			'#/holidays'             : 'holidays',
			'#/regionalmanager'      : 'regionalmanager',
			'#/opendays'             : 'opendays',
			'#/newsletters'          : 'newsletters',
			'#/newsletterview'       : 'newsletterview',
			'#/reports'              : 'reports',
			'#/smsreport'            : 'smsreport',
			'#/invreport'            : 'invreport',
			'#/auctionreport'        : 'auctionreport',
            '#/stockauctionreport'        : 'stockauctionreport',
            '#/stockbulkimporter'        : 'stockbulkimporter',
			'#/hpilogreport'         : 'hpilogreport',
            '#/hpiaccidentlogreport'         : 'hpiaccidentlogreport',
			'#/pgreport'             : 'pgreport',
			'#/traderreport'         : 'traderreport',
			'#/adhreport'			 : 'adhreport',
			'#/loadvssoldreport'	 : 'loadvssoldreport',
			'#/loadvssolddetreport'	 : 'loadvssolddetreport',
			'#/pgfreport'	 		 : 'pgfreport',
			'#/pgsreport'	 		 : 'pgsreport',
			'#/auctionadherence'	 : 'auctionadherence',
			'#/nomatch'	 			 : 'nomatch',
			'#/priceguideflash'	 	 : 'priceguideflash',
			'#/emailreport'	         : 'emailreport',
			'#/loginreport'	         : 'loginreport',
			'#/adminvaluationreport' : 'adminvaluationreport',
			'#/valuationstatreport'  : 'valuationstatreport',
      		'#/auctiontraderreport'  : 'auctiontraderreport',
      		'#/transunionupload'     : 'transunionupload'
		},

		requireMenu : {
			'thankyou'             : 'PublicMenu',
			'publicfaq'            : 'PublicMenu',
			'publiccontact_us'     : 'PublicMenu',
			'publicvaluation'      : 'PublicMenu',
            'customervaluation'      : 'PublicMenu',
			'publichome'           : 'PublicMenu',
			'home'                 : 'PublicMenu',
			'faq'                  : 'BrochureMenu',
			'login'                : 'BrochureMenu',
			'forgot'               : 'BrochureMenu',
			'contact'              : 'BrochureMenu',
			'register'             : 'BrochureMenu',
			'registered'           : 'BrochureMenu',
			'contact_us'           : 'BrochureMenu',
			'about_us'             : 'BrochureMenu',
			'terms_and_conditions' : 'BrochureMenu',
			'dealerhome'           : 'BrochureMenu'
		},

		requireAuth : {
			'auction'              : true,
			'bidview'              : true,
			'historyview'          : true,
			'stock'                : true,
			'stockview'            : true,
			'limitedstockview'     : true,
			'tcstock'              : true,
			'tcstockview'          : true,
			'limitedtcstockview'   : true,
			'valuations'           : true,
			'valuationview'        : true,
			'limitedvaluationview' : true,
			'valuationreport'      : true,
			'settings'             : true,
			'userview'             : true,
			'changepinview'        : true,
			'dealerview'           : true,
			'membershipview'       : true,
			'clubview'             : true,
			'memberview'           : true,
			'disputeview'          : true,
			'questionview'         : true,
			'replyview'            : true,
			'retailview'           : true,
			'priceguide'           : true,
			'offerview'            : true,
			'switch'               : true,
			'admin'                : true,
			'userpermissions'      : true,
			'viewuserpermissions'  : true,
			'systemusers'          : true,
			'systemuserview'       : true,
			'systemauctions'       : true,
			'systembidview'        : true,
			'systemdisputes'       : true,
			'systemdisputeview'    : true,
			'override'             : true,
			'dealers'              : true,
			'systemdealerview'     : true,
			'xmlrpcrequestlog'     : true,
			'xmlrpccallbacklog'    : true,
			'xmlrpcclients'        : true,
			'xmlrpcclientview'     : true,
			'systemsettings'       : true,
			'configview'           : true,
			'accessories'          : true,
			'damages'              : true,
			'increments'           : true,
			'groups'               : true,
			'divisions'            : true,
			'holidays'             : true,
			'regionalmanager'      : true,
			'opendays'             : true,
			'newsletters'          : true,
			'newsletterview'       : true,
			'reports'              : true,
			'smsreport'            : true,
			'invreport'            : true,
			'auctionreport'        : true,
			'hpilogreport'         : true,
            'hpiaccidentlogreport'         : true,
			'pgreport'             : true,
			'traderreport'         : true,
			'adhreport'            : true,
			'loadvssoldreport'     : true,
			'loadvssolddetreport'  : true,
			'pgfreport'  		   : true,
			'pgsreport'  		   : true,
			'auctionadherence' 	   : true,
			'NoMatch' 	   		   : true,
			'priceguideflash'  	   : true,
			'emailreport'          : true,
			'loginreport'          : true,
			'adminvaluationreport' : true,
			'valuationstatreport'  : true,
			'auctiontraderreport'  : true,
      		'historicaldata'       : true

		},
		initialize : function()
		{
			if( !window.location.hash.length )
			{
				window.location.hash = '/';
			}
			this.setupHashChangeListener();
		},

		setupHashChangeListener : function()
		{
			if( !( 'onhashchange' in window ) )
			{
				this.pollHash();
			}
			$(window).on('hashchange', $.proxy( this.handleHashChange, this ));
		},

		pollHash : function()
		{
			var currentHash = window.location.hash;
			setInterval( function(){
			if( window.location.hash != currentHash )
			{
				$(window).trigger('hashchange');
				currentHash = window.location.hash;
			}
			}, 250);
		},

		handleHashChange : function()
		{
			var hashLoc = window.location.hash.split("?");
			var page = this.routes[hashLoc[0]];
			if (this.requireAuth[page] && !App.Authenticated)
			{
				App.redirect = window.location.hash;
				window.location.hash = '/login';
				return;
			}

            if ('home' == page
                && ('cash-cars.local' == window.location.host
                || 'cash-cars.nirph.com' == window.location.host
                || 'www.wepay4cars.co.za' == window.location.host
                || 'wepay4cars.co.za' == window.location.host
                || 'www.wepay4cars.co.za' == window.location.host
                || 'wepay4cars.co.za' == window.location.host))
            {
                page = 'customervaluation';
            }

			if ('home' == page
				&& ('bid4cars.local' == window.location.host
					|| 'bid4cars.nirph.com' == window.location.host
					|| 'www.bid4cars.com.na' == window.location.host))
			{
				page = 'dealerhome';
			}
			if (this.requireMenu[page])
			{
				$('.is-brochure-menu').hide();
				$('#' + this.requireMenu[page]).show();
				$('#Mobi' + this.requireMenu[page]).show();
			}
			App.Controller.changePage( page );
			$(window).trigger('pageChange');
		}

	};

})();

Commits for namibiapublic/js/app/router.js

Diff revisions: vs.
Revision Author Commited Message
bb2698 ... Diff Diff Mark Mon 24 Oct, 2016 08:44:08 +0000

latest update

df0489 ... Mark Fri 14 Oct, 2016 10:01:00 +0000

initial commit