imagine_cms 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.rdoc +8 -7
- data/app/assets/javascripts/imagine.js +3 -2
- data/app/assets/javascripts/imagine_cms.js +1 -1394
- data/app/assets/stylesheets/{cropper.css → cropper.css.scss} +2 -2
- data/app/assets/stylesheets/{imagine_cms.css → imagine_cms.css.scss} +2 -2
- data/app/assets/stylesheets/{imagine_controls.css → imagine_controls.css.scss} +0 -0
- data/app/assets/stylesheets/{management.css → management.css.scss} +0 -0
- data/app/controllers/cms/content_controller.rb +3 -3
- data/app/controllers/management/cms_controller.rb +16 -11
- data/app/controllers/util_controller.rb +1 -1
- data/app/models/cms_page.rb +1 -1
- data/app/views/management/cms/_crop_feature_image.html.erb +2 -2
- data/app/views/management/cms/_crop_image.html.erb +2 -2
- data/app/views/management/cms/_crop_thumb.html.erb +2 -2
- data/app/views/management/cms/_image_details.html.erb +1 -1
- data/app/views/management/cms/_select_gallery.html.erb +1 -1
- data/app/views/management/users/index.html.erb +3 -3
- data/config/initializers/config_file.rb +3 -4
- data/imagine_cms.gemspec +4 -4
- data/lib/acts_as_versioned/test/versioned_test.rb +1 -1
- data/lib/extensions/{action_controller.rb → action_controller_extensions.rb} +4 -3
- data/lib/extensions/{array.rb → array_extensions.rb} +0 -0
- data/lib/imagine_cms/engine.rb +3 -3
- data/lib/imagine_cms/version.rb +1 -1
- data/test/dummy/config/imagine_cms.yml +5 -4
- metadata +24 -19
- data/vendor/.DS_Store +0 -0
@@ -6,1397 +6,4 @@
|
|
6
6
|
//= require jquery_no_conflict
|
7
7
|
//= require builder
|
8
8
|
//= require cropper
|
9
|
-
|
10
|
-
/********************************
|
11
|
-
* default settings, override *
|
12
|
-
* in application.js *
|
13
|
-
********************************/
|
14
|
-
|
15
|
-
// Fixes gallery reordering (Scriptaculous Sortable)
|
16
|
-
Position.includeScrollOffsets = true;
|
17
|
-
|
18
|
-
var defaultXMenuOffset = 0;
|
19
|
-
var defaultYMenuOffset = 0;
|
20
|
-
var defaultXOffset = 0;
|
21
|
-
var defaultYOffset = 0;
|
22
|
-
var showRolloverEffect = Effect.Appear;
|
23
|
-
var showRolloverEffectOptions = { duration: 0.2 };
|
24
|
-
var showRolloverMenuEffect = Effect.BlindDown;
|
25
|
-
var showRolloverMenuEffectOptions = { duration: 0.2 };
|
26
|
-
var hideRolloverDelay = 120;
|
27
|
-
var hideRolloverEffect = Effect.Fade;
|
28
|
-
var hideRolloverEffectOptions = { duration: 0.3 };
|
29
|
-
var hideRolloverMenuEffect = Effect.BlindUp;
|
30
|
-
var hideRolloverMenuEffectOptions = { duration: 0.2 };
|
31
|
-
|
32
|
-
|
33
|
-
/********************************
|
34
|
-
* framework code follows *
|
35
|
-
********************************/
|
36
|
-
|
37
|
-
var currentEffect = [];
|
38
|
-
|
39
|
-
function getElementPosition(sourceObj) {
|
40
|
-
if (sourceObj.style.left && sourceObj.style.top) {
|
41
|
-
// for the W3C-compliant crowd
|
42
|
-
return [parseInt(sourceObj.style.left), parseInt(sourceObj.style.top)];
|
43
|
-
} else {
|
44
|
-
// for the other awful browsers...
|
45
|
-
x = sourceObj.offsetLeft;
|
46
|
-
y = sourceObj.offsetTop;
|
47
|
-
temp = sourceObj;
|
48
|
-
while (temp = temp.offsetParent) {
|
49
|
-
x += temp.offsetLeft;
|
50
|
-
y += temp.offsetTop;
|
51
|
-
}
|
52
|
-
|
53
|
-
return [x, y];
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
/********************************
|
58
|
-
* rollover/menu functions *
|
59
|
-
********************************/
|
60
|
-
|
61
|
-
var hideRolloverTimeouts = [];
|
62
|
-
var hoveredButtons = [];
|
63
|
-
|
64
|
-
function showRollover(target, xMenuOffset, yMenuOffset, xOffset, yOffset) {
|
65
|
-
try {
|
66
|
-
if (hideRolloverTimeouts[target]) {
|
67
|
-
clearTimeout(hideRolloverTimeouts[target]);
|
68
|
-
hideRolloverTimeouts[target] = null;
|
69
|
-
return;
|
70
|
-
}
|
71
|
-
|
72
|
-
if (hoveredButtons[target]) {
|
73
|
-
return;
|
74
|
-
}
|
75
|
-
|
76
|
-
var el = $(target + '_hover');
|
77
|
-
var sourceObj = $(target + '_std');
|
78
|
-
|
79
|
-
var coords = getElementPosition(sourceObj);
|
80
|
-
if (typeof(xMenuOffset) == 'undefined') xMenuOffset = defaultXMenuOffset;
|
81
|
-
if (typeof(yMenuOffset) == 'undefined') yMenuOffset = defaultYMenuOffset;
|
82
|
-
if (typeof(xOffset) == 'undefined') xOffset = defaultXOffset;
|
83
|
-
if (typeof(yOffset) == 'undefined') yOffset = defaultYOffset;
|
84
|
-
|
85
|
-
el.style.position = 'absolute';
|
86
|
-
el.style.left = coords[0] + xOffset + 'px';
|
87
|
-
el.style.top = coords[1] + yOffset + 'px';
|
88
|
-
el.style.margin = '0';
|
89
|
-
el.style.zIndex = '100';
|
90
|
-
|
91
|
-
if (currentEffect[el.id]) currentEffect[el.id].cancel();
|
92
|
-
currentEffect[el.id] = showRolloverEffect(el.id, showRolloverEffectOptions);
|
93
|
-
|
94
|
-
if (el = $(target + '_menu')) {
|
95
|
-
el.style.display = 'none';
|
96
|
-
el.style.position = 'absolute';
|
97
|
-
el.style.left = (coords[0] + xMenuOffset) + 'px';
|
98
|
-
el.style.top = (coords[1] + yMenuOffset) + 'px';
|
99
|
-
el.style.margin = '0';
|
100
|
-
el.style.zIndex = '100';
|
101
|
-
|
102
|
-
for (var i = 0; i < el.childNodes.length; i++) {
|
103
|
-
if (el.childNodes[i].tagName == 'DIV') {
|
104
|
-
el.style.width = el.childNodes[i].style.width;
|
105
|
-
el.style.height = el.childNodes[i].style.height;
|
106
|
-
break;
|
107
|
-
}
|
108
|
-
}
|
109
|
-
if (currentEffect[el.id]) currentEffect[el.id].cancel();
|
110
|
-
currentEffect[el.id] = showRolloverMenuEffect(el.id, showRolloverMenuEffectOptions);
|
111
|
-
}
|
112
|
-
|
113
|
-
hoveredButtons[target] = true;
|
114
|
-
} catch (e) { }
|
115
|
-
}
|
116
|
-
|
117
|
-
function hideRollover(target) {
|
118
|
-
try {
|
119
|
-
hideRolloverTimeouts[target] = setTimeout('hideRolloverComplete("' + target + '");', hideRolloverDelay);
|
120
|
-
} catch (e) {}
|
121
|
-
}
|
122
|
-
|
123
|
-
function hideRolloverComplete(target) {
|
124
|
-
try {
|
125
|
-
hideRolloverTimeouts[target] = null;
|
126
|
-
|
127
|
-
if (el = $(target + '_hover')) {
|
128
|
-
if (currentEffect[el.id]) currentEffect[el.id].cancel();
|
129
|
-
currentEffect[el.id] = hideRolloverEffect(el.id, hideRolloverEffectOptions);
|
130
|
-
}
|
131
|
-
|
132
|
-
if (el = $(target + '_menu')) {
|
133
|
-
if (currentEffect[el.id]) currentEffect[el.id].cancel();
|
134
|
-
currentEffect[el.id] = hideRolloverMenuEffect(el.id, hideRolloverMenuEffectOptions);
|
135
|
-
}
|
136
|
-
|
137
|
-
hoveredButtons[target] = false;
|
138
|
-
} catch (e) {}
|
139
|
-
}
|
140
|
-
|
141
|
-
|
142
|
-
var hideSimpleRolloverTimeouts = [];
|
143
|
-
function showSimpleRollover(target, xOffset, yOffset) {
|
144
|
-
try {
|
145
|
-
// if we were planning to hide this element in the future, no need for that now
|
146
|
-
if (hideSimpleRolloverTimeouts[target]) {
|
147
|
-
clearTimeout(hideSimpleRolloverTimeouts[target]);
|
148
|
-
hideSimpleRolloverTimeouts[target] = null;
|
149
|
-
return;
|
150
|
-
}
|
151
|
-
|
152
|
-
// if other elements are waiting to be hidden, get it over with now
|
153
|
-
$H(hideSimpleRolloverTimeouts)._each(function (pair) {
|
154
|
-
clearTimeout(pair[1]);
|
155
|
-
hideSimpleRolloverComplete(pair[0]);
|
156
|
-
});
|
157
|
-
} catch (e) {}
|
158
|
-
|
159
|
-
try {
|
160
|
-
var el = document.getElementById(target + '_std');
|
161
|
-
el.oldsrc = el.src;
|
162
|
-
el.src = el.src.replace(/(_hover)?.gif$/, '_hover.gif');
|
163
|
-
if (!(is.ie && is.mac)) showSimpleRolloverMenu(target, xOffset, yOffset);
|
164
|
-
} catch (e) {}
|
165
|
-
}
|
166
|
-
|
167
|
-
function showSimpleRolloverMenu(target, xOffset, yOffset, useRelative) {
|
168
|
-
try {
|
169
|
-
if (hideSimpleRolloverTimeouts[target]) {
|
170
|
-
clearTimeout(hideSimpleRolloverTimeouts[target]);
|
171
|
-
hideSimpleRolloverTimeouts[target] = null;
|
172
|
-
return;
|
173
|
-
}
|
174
|
-
|
175
|
-
var el = document.getElementById(target + '_std');
|
176
|
-
if (el) {
|
177
|
-
var coords = getElementPosition(el);
|
178
|
-
|
179
|
-
if (typeof(xOffset) == 'undefined') xOffset = 0;
|
180
|
-
if (typeof(yOffset) == 'undefined') yOffset = 30;
|
181
|
-
if (typeof(useRelative) == 'undefined') useRelative = false;
|
182
|
-
|
183
|
-
if (el = document.getElementById(target + '_menu')) {
|
184
|
-
el.style.zIndex = 100;
|
185
|
-
el.style.position = 'absolute';
|
186
|
-
if (useRelative) {
|
187
|
-
el.style.left = xOffset + 'px';
|
188
|
-
el.style.top = yOffset + 'px';
|
189
|
-
} else {
|
190
|
-
el.style.left = (coords[0] + xOffset) + 'px';
|
191
|
-
el.style.top = (coords[1] + yOffset) + 'px';
|
192
|
-
}
|
193
|
-
el.style.display = '';
|
194
|
-
}
|
195
|
-
}
|
196
|
-
} catch (e) {}
|
197
|
-
}
|
198
|
-
|
199
|
-
function hideSimpleRollover(target) {
|
200
|
-
try {
|
201
|
-
hideSimpleRolloverTimeouts[target] = setTimeout('hideSimpleRolloverComplete("' + target + '")', 200);
|
202
|
-
} catch (e) {}
|
203
|
-
}
|
204
|
-
|
205
|
-
function hideSimpleRolloverComplete(target) {
|
206
|
-
try {
|
207
|
-
var el = document.getElementById(target + '_std');
|
208
|
-
if (el.oldsrc) el.src = el.oldsrc;
|
209
|
-
hideSimpleRolloverMenuComplete(target);
|
210
|
-
} catch (e) {}
|
211
|
-
}
|
212
|
-
|
213
|
-
function hideSimpleRolloverMenu(target) {
|
214
|
-
try {
|
215
|
-
hideSimpleRolloverTimeouts[target] = setTimeout('hideSimpleRolloverMenuComplete("' + target + '")', 200);
|
216
|
-
} catch (e) {}
|
217
|
-
}
|
218
|
-
|
219
|
-
function hideSimpleRolloverMenuComplete(target) {
|
220
|
-
try {
|
221
|
-
hideSimpleRolloverTimeouts[target] = null;
|
222
|
-
|
223
|
-
var el = document.getElementById(target + '_std');
|
224
|
-
var coords = getElementPosition(el);
|
225
|
-
|
226
|
-
if (el = document.getElementById(target + '_menu')) {
|
227
|
-
el.style.display = 'none';
|
228
|
-
}
|
229
|
-
} catch (e) {}
|
230
|
-
}
|
231
|
-
|
232
|
-
|
233
|
-
/********************************
|
234
|
-
* slideshow functions *
|
235
|
-
********************************/
|
236
|
-
|
237
|
-
var currentSlideIndex = 0;
|
238
|
-
var maxSlideIndex = -1;
|
239
|
-
|
240
|
-
function getNumSlides() {
|
241
|
-
if (maxSlideIndex > -1) return maxSlideIndex;
|
242
|
-
maxSlideIndex = 0;
|
243
|
-
|
244
|
-
while ($('img_slideshow' + maxSlideIndex)) maxSlideIndex++;
|
245
|
-
return maxSlideIndex;
|
246
|
-
}
|
247
|
-
|
248
|
-
function nextSlide(delay, transition) {
|
249
|
-
if (typeof(transition) == 'undefined') transition = 'SlideAppear';
|
250
|
-
changeSlide(delay, transition, 1);
|
251
|
-
}
|
252
|
-
|
253
|
-
function prevSlide(delay, transition) {
|
254
|
-
if (typeof(transition) == 'undefined') transition = 'SlideAppear';
|
255
|
-
changeSlide(delay, transition, -1);
|
256
|
-
}
|
257
|
-
|
258
|
-
// controls elements named img_slideshowX
|
259
|
-
// uses a global named currentSlideIndex to keep track of its state
|
260
|
-
// uses a global named maxSlideIndex to cache the discovered maximum slide index
|
261
|
-
function changeSlide(delay, transition, increment) {
|
262
|
-
try {
|
263
|
-
if (typeof(delay) == 'undefined') delay = -1;
|
264
|
-
if (typeof(transition) == 'undefined') transition = 'SlideAppear';
|
265
|
-
|
266
|
-
// this element is used for positioning
|
267
|
-
origimg = $('img_slideshow');
|
268
|
-
|
269
|
-
nextSlideIndex = currentSlideIndex + increment;
|
270
|
-
if (!$('img_slideshow' + nextSlideIndex)) {
|
271
|
-
if (increment > 0) {
|
272
|
-
nextSlideIndex = 0;
|
273
|
-
} else {
|
274
|
-
nextSlideIndex = getNumSlides() - 1;
|
275
|
-
}
|
276
|
-
}
|
277
|
-
|
278
|
-
if ((curimg = $('img_slideshow' + currentSlideIndex)) &&
|
279
|
-
(nextimg = $('img_slideshow' + nextSlideIndex))) {
|
280
|
-
// push old images back
|
281
|
-
for (var i = 0; i < getNumSlides(); i++) {
|
282
|
-
$('img_slideshow' + i).style.zIndex = ((increment > 0) ? i : (getNumSlides() - i));
|
283
|
-
}
|
284
|
-
nextimg.style.zIndex = '90';
|
285
|
-
nextimg.style.margin = '0';
|
286
|
-
|
287
|
-
// really shouldn't have to do this, but I just can't figure it out...
|
288
|
-
curimg.style.zIndex = '89';
|
289
|
-
|
290
|
-
// drag the new image over the main image
|
291
|
-
var coords = getElementPosition(origimg);
|
292
|
-
nextimg.style.position = 'absolute';
|
293
|
-
nextimg.style.left = coords[0] + 'px';
|
294
|
-
nextimg.style.top = coords[1] + 'px';
|
295
|
-
|
296
|
-
eval('Effect.' + transition + '(nextimg.id, { duration: 1.8 });');
|
297
|
-
setTimeout('$("' + curimg.id + '").style.display = "none"', 1900);
|
298
|
-
if (delay > 0) setTimeout('changeSlide(' + delay + ', "' + transition + '", ' + increment + ');', delay);
|
299
|
-
|
300
|
-
currentSlideIndex = nextSlideIndex;
|
301
|
-
}
|
302
|
-
} catch (e) {}
|
303
|
-
}
|
304
|
-
|
305
|
-
// positions slide navigation elements (named btn_slidenext and btn_slideprev)
|
306
|
-
// relative to img_slideshow (x and y are the relative offsets)
|
307
|
-
function positionSlideNav(x, y) {
|
308
|
-
try {
|
309
|
-
img = $('img_slideshow');
|
310
|
-
nav = $('div_slidenav');
|
311
|
-
|
312
|
-
// move the buttons to their proper places
|
313
|
-
nav.style.zIndex = '95';
|
314
|
-
nav.style.position = 'relative';
|
315
|
-
nav.style.left = x + 'px';
|
316
|
-
nav.style.top = y + 'px';
|
317
|
-
} catch (e) {}
|
318
|
-
}
|
319
|
-
|
320
|
-
|
321
|
-
/********************************
|
322
|
-
* dialog/popup functions *
|
323
|
-
********************************/
|
324
|
-
|
325
|
-
function openDialog(url, w, h, opts) {
|
326
|
-
window.open(url, '_blank', (w && h ? 'width=' + w + ',height=' + h : '') + (typeof(opts) == 'undefined' ? '' : ',' + opts));
|
327
|
-
}
|
328
|
-
|
329
|
-
// resize the window to fit the content
|
330
|
-
function autoResize(masterDiv) {
|
331
|
-
if (typeof(masterDiv) == 'undefined') {
|
332
|
-
masterDiv = $('masterDiv');
|
333
|
-
} else {
|
334
|
-
masterDiv = $(masterDiv);
|
335
|
-
}
|
336
|
-
var max = Math.min(screen.height - 100, 800);
|
337
|
-
var ht = Math.min(masterDiv.scrollHeight, max);
|
338
|
-
|
339
|
-
if (typeof(window.innerWidth) == 'number') {
|
340
|
-
//Non-IE
|
341
|
-
myWidth = window.innerWidth;
|
342
|
-
myHeight = window.innerHeight;
|
343
|
-
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
|
344
|
-
//IE 6+ in 'standards compliant mode'
|
345
|
-
myWidth = document.documentElement.clientWidth;
|
346
|
-
myHeight = document.documentElement.clientHeight;
|
347
|
-
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
|
348
|
-
//IE 4 compatible
|
349
|
-
myWidth = document.body.clientWidth;
|
350
|
-
myHeight = document.body.clientHeight;
|
351
|
-
}
|
352
|
-
|
353
|
-
resizeBy(0, ht - myHeight);
|
354
|
-
}
|
355
|
-
|
356
|
-
|
357
|
-
// the opposite... resize the content to fit the window
|
358
|
-
function autoResizeDiv(masterDiv, adjustment) {
|
359
|
-
if (typeof(masterDiv) == 'undefined') {
|
360
|
-
masterDiv = $('masterDiv');
|
361
|
-
} else {
|
362
|
-
masterDiv = $(masterDiv);
|
363
|
-
}
|
364
|
-
if (typeof(adjustment) == 'undefined') adjustment = 0;
|
365
|
-
|
366
|
-
var max = Math.min(screen.height - 100, 800);
|
367
|
-
var ht = Math.min(masterDiv.scrollHeight, max);
|
368
|
-
|
369
|
-
if (typeof(window.innerWidth) == 'number') {
|
370
|
-
//Non-IE
|
371
|
-
myWidth = window.innerWidth;
|
372
|
-
myHeight = window.innerHeight;
|
373
|
-
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
|
374
|
-
//IE 6+ in 'standards compliant mode'
|
375
|
-
myWidth = document.documentElement.clientWidth;
|
376
|
-
myHeight = document.documentElement.clientHeight;
|
377
|
-
} else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
|
378
|
-
//IE 4 compatible
|
379
|
-
myWidth = document.body.clientWidth;
|
380
|
-
myHeight = document.body.clientHeight;
|
381
|
-
}
|
382
|
-
|
383
|
-
masterDiv.style.height = myHeight - 200 + adjustment + 'px';
|
384
|
-
}
|
385
|
-
|
386
|
-
|
387
|
-
/********************************
|
388
|
-
* date picker functions *
|
389
|
-
********************************/
|
390
|
-
|
391
|
-
function showDatePicker(object, method_prefix) {
|
392
|
-
// anchor picker to the icon
|
393
|
-
var coords = getElementPosition($('date_picker_' + object + '_' + method_prefix + 'icon'));
|
394
|
-
var el = $('date_picker_' + object + '_' + method_prefix + 'main');
|
395
|
-
el.hide();
|
396
|
-
el.style.position = 'absolute';
|
397
|
-
el.show();
|
398
|
-
}
|
399
|
-
|
400
|
-
function hideDatePicker(object, method_prefix) {
|
401
|
-
$('date_picker_' + object + '_' + method_prefix + 'main').hide();
|
402
|
-
}
|
403
|
-
|
404
|
-
function dpPrevMonth(object, method_prefix, min_year) {
|
405
|
-
try {
|
406
|
-
if ($(object + '_' + method_prefix + '_month_sel').value > 1) {
|
407
|
-
$(object + '_' + method_prefix + '_month_sel').value--;
|
408
|
-
} else if ($(object + '_' + method_prefix + '_year_sel').value > min_year) {
|
409
|
-
$(object + '_' + method_prefix + '_month_sel').value = 12;
|
410
|
-
$(object + '_' + method_prefix + '_year_sel').value--;
|
411
|
-
}
|
412
|
-
} catch (e) {}
|
413
|
-
}
|
414
|
-
|
415
|
-
function dpNextMonth(object, method_prefix, max_year) {
|
416
|
-
try {
|
417
|
-
if ($(object + '_' + method_prefix + '_month_sel').value < 12) {
|
418
|
-
$(object + '_' + method_prefix + '_month_sel').value++;
|
419
|
-
} else if ($(object + '_' + method_prefix + '_year_sel').value < max_year) {
|
420
|
-
$(object + '_' + method_prefix + '_month_sel').value = 1;
|
421
|
-
$(object + '_' + method_prefix + '_year_sel').value++;
|
422
|
-
}
|
423
|
-
} catch (e) {}
|
424
|
-
}
|
425
|
-
|
426
|
-
|
427
|
-
/********************************
|
428
|
-
* custom effects *
|
429
|
-
********************************/
|
430
|
-
|
431
|
-
Effect.BlindRight = function(element) {
|
432
|
-
element = $(element);
|
433
|
-
var oldWidth = Element.getStyle(element, 'width');
|
434
|
-
var elementDimensions = Element.getDimensions(element);
|
435
|
-
return new Effect.Scale(element, 100,
|
436
|
-
Object.extend({
|
437
|
-
scaleContent: false,
|
438
|
-
scaleY: false,
|
439
|
-
scaleFrom: 0,
|
440
|
-
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
441
|
-
restoreAfterFinish: true,
|
442
|
-
afterSetup: function(effect) { with(Element) {
|
443
|
-
makeClipping(effect.element);
|
444
|
-
setStyle(effect.element, {width: '0px'});
|
445
|
-
show(effect.element);
|
446
|
-
}}
|
447
|
-
}, arguments[1] || {})
|
448
|
-
);
|
449
|
-
}
|
450
|
-
|
451
|
-
Effect.SlideAppear = function(element) {
|
452
|
-
element = $(element);
|
453
|
-
new Effect.Appear(element, arguments[2] || arguments[1] || {});
|
454
|
-
new Effect.BlindRight(element, arguments[1] || {});
|
455
|
-
}
|
456
|
-
|
457
|
-
|
458
|
-
/********************************
|
459
|
-
* column browser interface *
|
460
|
-
********************************/
|
461
|
-
|
462
|
-
var cbNumColumns = 0;
|
463
|
-
var cbColWidth = '200px';
|
464
|
-
var cbColHeight = '240px';
|
465
|
-
var cbBorderWidth = '1px';
|
466
|
-
var cbColWidthFull = 202;
|
467
|
-
|
468
|
-
function cbAddColumn() {
|
469
|
-
var currentWidth = parseInt($('columnBrowser').style.width, 10);
|
470
|
-
// if (currentWidth < ((cbNumColumns+1) * cbColWidthFull)) {
|
471
|
-
$('columnBrowser').style.width = '' + ((cbNumColumns+1) * cbColWidthFull) + 'px';
|
472
|
-
$('columnBrowserContainer').scrollLeft = $('columnBrowserContainer').scrollWidth;
|
473
|
-
// }
|
474
|
-
$('columnBrowser').innerHTML += "<div id=\"columnBrowserLevel" + cbNumColumns + "\" style=\"width: " + cbColWidth + "; height: " + cbColHeight + "; overflow: auto; float: left; border-width: " + cbBorderWidth + " " + cbBorderWidth + " " + cbBorderWidth + " " + (cbNumColumns == 0 ? cbBorderWidth : '0') + "; border-style: solid; border-color: gray;\">Loading...</div>";
|
475
|
-
cbNumColumns++;
|
476
|
-
}
|
477
|
-
|
478
|
-
function getScrollbarPosition(el) {
|
479
|
-
el = $(el);
|
480
|
-
return { x: el.scrollLeft, y: el.scrollTop };
|
481
|
-
}
|
482
|
-
|
483
|
-
function setScrollbarPosition(el, coords) {
|
484
|
-
el = $(el);
|
485
|
-
el.scrollLeft = coords.x;
|
486
|
-
el.scrollTop = coords.y;
|
487
|
-
}
|
488
|
-
|
489
|
-
function cbSelectItem(el, currentLevel, urlForNextLevel) {
|
490
|
-
var el = $(el);
|
491
|
-
coords = getScrollbarPosition(el.parentNode);
|
492
|
-
|
493
|
-
// remove all higher levels and unselect all other same-level divs
|
494
|
-
for (var i = currentLevel + 1; i <= cbNumColumns; i++) {
|
495
|
-
d = $('columnBrowserLevel' + i);
|
496
|
-
if (d) d.parentNode.removeChild(d);
|
497
|
-
}
|
498
|
-
cbNumColumns = currentLevel + 1;
|
499
|
-
|
500
|
-
prefix = 'cb_item_';
|
501
|
-
$A(el.parentNode.childNodes).each(function (d) {
|
502
|
-
if (d.id && d.id.substring(0, prefix.length) == prefix) {
|
503
|
-
d.className = 'cb_item';
|
504
|
-
}
|
505
|
-
})
|
506
|
-
|
507
|
-
// select and expand current dept div
|
508
|
-
el.className = 'cb_item cb_item_selected';
|
509
|
-
|
510
|
-
cbAddColumn();
|
511
|
-
el = $(el.id);
|
512
|
-
new Ajax.Updater('columnBrowserLevel' + (currentLevel+1), urlForNextLevel, {method: 'GET', asynchronous:true, evalScripts:true});
|
513
|
-
|
514
|
-
setScrollbarPosition(el.parentNode, coords);
|
515
|
-
}
|
516
|
-
|
517
|
-
|
518
|
-
/********************************
|
519
|
-
* text field hints *
|
520
|
-
********************************/
|
521
|
-
|
522
|
-
function addLoadEvent(func) {
|
523
|
-
var oldonload = window.onload;
|
524
|
-
if (typeof window.onload != 'function') {
|
525
|
-
window.onload = func;
|
526
|
-
} else {
|
527
|
-
window.onload = function() {
|
528
|
-
oldonload();
|
529
|
-
func();
|
530
|
-
}
|
531
|
-
}
|
532
|
-
}
|
533
|
-
|
534
|
-
function addUnloadEvent(func) {
|
535
|
-
var oldonunload = window.onunload;
|
536
|
-
if (typeof window.onunload != 'function') {
|
537
|
-
window.onunload = func;
|
538
|
-
} else {
|
539
|
-
window.onunload = function() {
|
540
|
-
oldonunload();
|
541
|
-
func();
|
542
|
-
}
|
543
|
-
}
|
544
|
-
}
|
545
|
-
|
546
|
-
var textFieldHints = new Array();
|
547
|
-
function setupTextFieldHints() {
|
548
|
-
textFieldHints.each(function (a) {
|
549
|
-
$A(document.getElementsByName(a.name)).each(function (el) {
|
550
|
-
var clearHint = function () {
|
551
|
-
el.value = '';
|
552
|
-
el.style.color = el.style.origColor ? el.style.origColor : 'black';
|
553
|
-
el.onfocus = el.oldOnFocus;
|
554
|
-
el.oldOnBlur = el.onblur;
|
555
|
-
el.onblur = function () {
|
556
|
-
if (typeof(el.oldOnBlur) == 'function') el.oldOnBlur();
|
557
|
-
setHint();
|
558
|
-
}
|
559
|
-
};
|
560
|
-
var setHint = function () {
|
561
|
-
if (!el.value || el.value == a.hint) {
|
562
|
-
el.value = a.hint;
|
563
|
-
el.style.origColor = el.style.color;
|
564
|
-
el.style.color = 'gray';
|
565
|
-
if (typeof(el.oldOnBlur) != 'undefined') el.onblur = el.oldOnBlur;
|
566
|
-
el.oldOnFocus = el.onfocus;
|
567
|
-
el.onfocus = function () {
|
568
|
-
if (typeof(el.oldOnFocus) == 'function') el.oldOnFocus();
|
569
|
-
clearHint();
|
570
|
-
}
|
571
|
-
}
|
572
|
-
}
|
573
|
-
setHint();
|
574
|
-
})
|
575
|
-
});
|
576
|
-
}
|
577
|
-
addLoadEvent(setupTextFieldHints);
|
578
|
-
|
579
|
-
function teardownTextFieldHints() {
|
580
|
-
textFieldHints.each(function (a) {
|
581
|
-
var el = document.getElementsByName(a.name)[0];
|
582
|
-
if (el.value == a.hint) {
|
583
|
-
el.value = '';
|
584
|
-
el.style.color = el.origColor ? el.origColor : 'black';
|
585
|
-
el.onfocus = null;
|
586
|
-
}
|
587
|
-
});
|
588
|
-
}
|
589
|
-
|
590
|
-
function addTextFieldHint(name, hint) {
|
591
|
-
if (textFieldHints.select(function (a) { return a.name == name }).length == 0) {
|
592
|
-
textFieldHints.push({ name: name, hint: hint });
|
593
|
-
}
|
594
|
-
}
|
595
|
-
|
596
|
-
|
597
|
-
/********************************
|
598
|
-
* horizontal tab interface *
|
599
|
-
********************************/
|
600
|
-
|
601
|
-
function setPageVisibility() {
|
602
|
-
var opts = $A($('page_select').options);
|
603
|
-
opts.each(function (opt) {
|
604
|
-
$(opt.value).hide();
|
605
|
-
});
|
606
|
-
$($F('page_select')).show();
|
607
|
-
}
|
608
|
-
|
609
|
-
|
610
|
-
/********************************
|
611
|
-
* vertical tab interface *
|
612
|
-
********************************/
|
613
|
-
|
614
|
-
function selectTab(tabName, tabArray, tabBtnPrefix, tabDivPrefix, hiddenTextFieldId) {
|
615
|
-
tabArray._each(function (tab) {
|
616
|
-
$(tabBtnPrefix + tab).className = 'tab_normal';
|
617
|
-
$(tabDivPrefix + tab).style.display = 'none';
|
618
|
-
})
|
619
|
-
$('pmtbtn_' + tabName).className = 'tab_selected';
|
620
|
-
$('pmtinfo_' + tabName).style.display = '';
|
621
|
-
$(hiddenTextFieldId).value = tabName;
|
622
|
-
}
|
623
|
-
|
624
|
-
|
625
|
-
/********************************
|
626
|
-
* cms support *
|
627
|
-
********************************/
|
628
|
-
|
629
|
-
// support for autocompletes
|
630
|
-
var attrlist = [];
|
631
|
-
var taglist = [];
|
632
|
-
|
633
|
-
var dialogStack = [];
|
634
|
-
function showDojoDialog(id, titleText) {
|
635
|
-
if (!is.ie) changeOverflowAutoToHidden();
|
636
|
-
|
637
|
-
dlg = dojo.widget.byId(id);
|
638
|
-
if (!dlg) dlg = dojo.widget.createWidget(id);
|
639
|
-
if (!dlg) return false;
|
640
|
-
|
641
|
-
dlg.closeWindow = function () { hideDojoDialog(id); };
|
642
|
-
dlg.show();
|
643
|
-
|
644
|
-
if (typeof(titleText) != 'undefined') {
|
645
|
-
try {
|
646
|
-
document.getElementById('propertiesDialog').getElementsByTagName('div')[0].getElementsByTagName('div')[4].innerHTML = titleText;
|
647
|
-
} catch (e) {}
|
648
|
-
}
|
649
|
-
|
650
|
-
if (dialogStack.length > 0) dojo.widget.byId(dialogStack[dialogStack.length-1]).hide();
|
651
|
-
dialogStack.push(id);
|
652
|
-
}
|
653
|
-
|
654
|
-
function hideDojoDialog(id) {
|
655
|
-
dialogStack.pop();
|
656
|
-
|
657
|
-
dojo.widget.byId(id).hide();
|
658
|
-
if (!is.ie) changeOverflowHiddenToAuto();
|
659
|
-
|
660
|
-
if (dialogStack.length > 0) {
|
661
|
-
dojo.widget.byId(dialogStack[dialogStack.length-1]).show();
|
662
|
-
}
|
663
|
-
}
|
664
|
-
|
665
|
-
function editProperties(url, titleText) {
|
666
|
-
$('properties_dialog_content').innerHTML = 'Loading...';
|
667
|
-
new Ajax.Updater('properties_dialog_content', url, {method:'get', asynchronous:true, evalScripts:true});
|
668
|
-
|
669
|
-
showDojoDialog('properties_dialog', titleText);
|
670
|
-
}
|
671
|
-
|
672
|
-
function cancelEditProperties() {
|
673
|
-
hideDojoDialog('properties_dialog');
|
674
|
-
}
|
675
|
-
|
676
|
-
function insertImage(url) {
|
677
|
-
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
|
678
|
-
imageNode = dojo.withGlobal(curInst.window, "getSelectedElement", dojo.html.selection);
|
679
|
-
if (!imageNode) {
|
680
|
-
imageNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ['img']);
|
681
|
-
}
|
682
|
-
if (imageNode) {
|
683
|
-
dojo.require("dojo.widget.Editor2Plugin.InsertImageDialog");
|
684
|
-
w = dojo.widget.createWidget("Editor2InsertImageDialog");
|
685
|
-
w.show();
|
686
|
-
} else {
|
687
|
-
$('insert_image_dialog_content').innerHTML = 'Loading...';
|
688
|
-
new Ajax.Updater('insert_image_dialog_content', url, {method:'get', asynchronous:true, evalScripts:true});
|
689
|
-
showDojoDialog('insert_image_dialog');
|
690
|
-
}
|
691
|
-
try { if (cropper) cropper.remove(); } catch (e) {}
|
692
|
-
}
|
693
|
-
|
694
|
-
function cancelInsertImage() {
|
695
|
-
hideDojoDialog('insert_image_dialog');
|
696
|
-
try { if (cropper) cropper.remove(); } catch (e) {}
|
697
|
-
}
|
698
|
-
|
699
|
-
function insertFile(url) {
|
700
|
-
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
|
701
|
-
curInst.saveSelection(); //save selection (none-activeX IE)
|
702
|
-
var html = dojo.withGlobal(curInst.window, "getSelectedText", dojo.html.selection);
|
703
|
-
if (html == null || html.length == 0) {
|
704
|
-
alert("Please select some text to create a file link.");
|
705
|
-
return false; //do not show the dialog
|
706
|
-
}
|
707
|
-
|
708
|
-
$('insert_file_dialog_content').innerHTML = 'Loading...';
|
709
|
-
new Ajax.Updater('insert_file_dialog_content', url, {method:'get', asynchronous:true, evalScripts:true});
|
710
|
-
showDojoDialog('insert_file_dialog');
|
711
|
-
}
|
712
|
-
|
713
|
-
function cancelInsertFile() {
|
714
|
-
hideDojoDialog('insert_file_dialog');
|
715
|
-
}
|
716
|
-
|
717
|
-
function selectThumbnail(url) {
|
718
|
-
$('select_thumbnail_dialog_content').innerHTML = 'Loading...';
|
719
|
-
new Ajax.Updater('select_thumbnail_dialog_content', url, {asynchronous:true, evalScripts:true});
|
720
|
-
showDojoDialog('select_thumbnail_dialog');
|
721
|
-
}
|
722
|
-
|
723
|
-
function cancelSelectThumbnail() {
|
724
|
-
hideDojoDialog('select_thumbnail_dialog');
|
725
|
-
}
|
726
|
-
|
727
|
-
var gallerySize = [];
|
728
|
-
function changeGalleryImage(galleryName, index) {
|
729
|
-
var target = galleryName + '_image_' + index;
|
730
|
-
var caption = galleryName + '_caption_' + index;
|
731
|
-
if (!$(target)) return false;
|
732
|
-
|
733
|
-
var queue = Effect.Queues.get('global');
|
734
|
-
queue.each(function(e) { e.cancel() });
|
735
|
-
|
736
|
-
for (var i = 0; i < gallerySize[galleryName]; i++) {
|
737
|
-
el = $(galleryName + '_image_' + i);
|
738
|
-
if (el.id != target && el.style.display != 'none') Effect.Fade(el, { duration: 0.6 });
|
739
|
-
|
740
|
-
el = $(galleryName + '_thumb_' + i);
|
741
|
-
if (el) {
|
742
|
-
if (i == index) {
|
743
|
-
el.oldOnmouseover = el.onmouseover;
|
744
|
-
el.oldOnmouseout = el.onmouseout;
|
745
|
-
el.onmouseover = null;
|
746
|
-
el.onmouseout = null;
|
747
|
-
el.addClassName('current');
|
748
|
-
} else {
|
749
|
-
el.removeClassName('current');
|
750
|
-
if (!el.onmouseover) el.onmouseover = el.oldOnmouseover;
|
751
|
-
if (!el.onmouseout) el.onmouseout = el.oldOnmouseout;
|
752
|
-
}
|
753
|
-
}
|
754
|
-
}
|
755
|
-
|
756
|
-
Effect.Appear(target, { duration: 0.6 });
|
757
|
-
|
758
|
-
if($(caption).innerHTML != '') {
|
759
|
-
$(galleryName + '_caption').style.display = 'block';
|
760
|
-
$(galleryName + '_caption').innerHTML = $(caption).innerHTML;
|
761
|
-
} else {
|
762
|
-
$(galleryName + '_caption').style.display = 'none';
|
763
|
-
}
|
764
|
-
|
765
|
-
prevIndex = index == 0 ? gallerySize[galleryName] - 1 : index-1;
|
766
|
-
nextIndex = index == gallerySize[galleryName] - 1 ? 0 : index+1;
|
767
|
-
$(galleryName + '_prev_button').onclick = function () { changeGalleryImage(galleryName, prevIndex) };
|
768
|
-
$(galleryName + '_next_button').onclick = function () { changeGalleryImage(galleryName, nextIndex) };
|
769
|
-
}
|
770
|
-
|
771
|
-
var galleryTimeouts = [];
|
772
|
-
function advanceGallerySlideshow(galleryName, delay) {
|
773
|
-
$(galleryName + '_next_button').onclick();
|
774
|
-
galleryTimeouts[galleryName] = setTimeout(function() { advanceGallerySlideshow(galleryName, delay); }, delay);
|
775
|
-
}
|
776
|
-
|
777
|
-
|
778
|
-
// this doesn't seem to work... argh
|
779
|
-
function disableEnterKey(e) {
|
780
|
-
// get event if not passed
|
781
|
-
if (!e) var e = window.event;
|
782
|
-
|
783
|
-
var numCharCode;
|
784
|
-
|
785
|
-
// get character code of key pressed
|
786
|
-
if (e.keyCode) {
|
787
|
-
numCharCode = e.keyCode;
|
788
|
-
} else if (e.which) {
|
789
|
-
numCharCode = e.which;
|
790
|
-
}
|
791
|
-
|
792
|
-
if (numCharCode == 13) {
|
793
|
-
e.cancelBubble = true;
|
794
|
-
if (e.stopPropagation) e.stopPropagation();
|
795
|
-
return false;
|
796
|
-
}
|
797
|
-
}
|
798
|
-
|
799
|
-
var overflowAutoDivs = [];
|
800
|
-
function changeOverflowAutoToHidden() {
|
801
|
-
var divs = [];
|
802
|
-
$$('div').each(function (div) {
|
803
|
-
if (div.style.overflow == 'auto') {
|
804
|
-
divs.push(div);
|
805
|
-
div.style.overflow = 'hidden';
|
806
|
-
}
|
807
|
-
});
|
808
|
-
overflowAutoDivs.push(divs);
|
809
|
-
}
|
810
|
-
|
811
|
-
function changeOverflowHiddenToAuto() {
|
812
|
-
$A(overflowAutoDivs.pop).each(function (div) {
|
813
|
-
div.style.overflow = 'auto';
|
814
|
-
});
|
815
|
-
}
|
816
|
-
|
817
|
-
var pageBrowserFieldID = null;
|
818
|
-
function showPageBrowser(field_id) {
|
819
|
-
pageBrowserFieldID = field_id;
|
820
|
-
path = $(field_id).value;
|
821
|
-
|
822
|
-
$('page_browser').innerHTML = 'Loading...'
|
823
|
-
new Ajax.Updater('page_browser', '/manage/cms/select_page?path=' + path, {asynchronous:true, evalScripts:true});
|
824
|
-
$('page_browser_selection').value = path;
|
825
|
-
showDojoDialog('page_browser_dialog');
|
826
|
-
}
|
827
|
-
|
828
|
-
function closePageBrowser() {
|
829
|
-
hideDojoDialog('page_browser_dialog');
|
830
|
-
$(pageBrowserFieldID).value = $('page_browser_selection').value;
|
831
|
-
}
|
832
|
-
|
833
|
-
var cmsPageObjects = [];
|
834
|
-
function scanForPageObjects(page_id, parent_key, version) {
|
835
|
-
found = [];
|
836
|
-
|
837
|
-
var regex = /<%=\s*insert_object\(?\s*['"]([-\w\s\d]+)['"],\s*:(\w+)\s*(.*?)\)?\s*%>/gm;
|
838
|
-
if (!$('page_objects_' + parent_key).value) return;
|
839
|
-
|
840
|
-
var matches = $('page_objects_' + parent_key).value.match(regex);
|
841
|
-
$A(matches).each(function (match) {
|
842
|
-
// regex2 should be exactly the same as regex. Global regexes have a lastIndex which is not reset.
|
843
|
-
var regex2 = /<%=\s*insert_object\(?\s*['"]([-\w\s\d]+)['"],\s*:(\w+)\s*(.*?)\)?\s*%>/gm;
|
844
|
-
if (regex2.test(match)) {
|
845
|
-
name = match.replace(regex2, "$1");
|
846
|
-
type = match.replace(regex2, "$2");
|
847
|
-
opts = match.replace(regex2, "$3");
|
848
|
-
found[name] = type;
|
849
|
-
}
|
850
|
-
});
|
851
|
-
|
852
|
-
// remove the cruft
|
853
|
-
$H(cmsPageObjects).each(function(pair) {
|
854
|
-
if (cmsPageObjects[pair.key] != found[pair.key]) {
|
855
|
-
type = cmsPageObjects[pair.key];
|
856
|
-
obj_key = type + '_container_obj-' + pair.value + '-' + pair.key.replace(/[^\w]/g, '_');
|
857
|
-
if ($(obj_key)) {
|
858
|
-
$(obj_key).parentNode.removeChild($(obj_key));
|
859
|
-
}
|
860
|
-
cmsPageObjects[pair.key] = null;
|
861
|
-
}
|
862
|
-
});
|
863
|
-
|
864
|
-
// bring in the new
|
865
|
-
$H(found).each(function (obj) {
|
866
|
-
name = obj.key
|
867
|
-
type = obj.value
|
868
|
-
if (!cmsPageObjects[name]) {
|
869
|
-
cmsPageObjects[name] = type;
|
870
|
-
new Ajax.Request('/manage/cms/insert_page_object_config/' + page_id + '?version= ' + version +
|
871
|
-
'&name=' + name + '&type=' + type + '&parent_key=' + parent_key,
|
872
|
-
{ method:'get', asynchronous: true, evalScripts: true });
|
873
|
-
}
|
874
|
-
});
|
875
|
-
}
|
876
|
-
|
877
|
-
function blockUserInput() {
|
878
|
-
var dims = { width: document.body.scrollWidth, height: document.body.scrollHeight };
|
879
|
-
$('preview_cover').show();
|
880
|
-
$('preview_cover').style.position = 'absolute';
|
881
|
-
$('preview_cover').style.left = '0px';
|
882
|
-
$('preview_cover').style.top = '0px';
|
883
|
-
$('preview_cover').style.width = dims.width + 'px';
|
884
|
-
$('preview_cover').style.height = dims.height + 'px';
|
885
|
-
}
|
886
|
-
|
887
|
-
function insertAtCaret(obj, text) {
|
888
|
-
if(document.selection) {
|
889
|
-
obj.focus();
|
890
|
-
var orig = obj.value.replace(/\r\n/g, "\n");
|
891
|
-
var range = document.selection.createRange();
|
892
|
-
|
893
|
-
if(range.parentElement() != obj) {
|
894
|
-
return false;
|
895
|
-
}
|
896
|
-
|
897
|
-
range.text = text;
|
898
|
-
|
899
|
-
var actual = tmp = obj.value.replace(/\r\n/g, "\n");
|
900
|
-
|
901
|
-
for(var diff = 0; diff < orig.length; diff++) {
|
902
|
-
if(orig.charAt(diff) != actual.charAt(diff)) break;
|
903
|
-
}
|
904
|
-
|
905
|
-
for(var index = 0, start = 0;
|
906
|
-
tmp.match(text)
|
907
|
-
&& (tmp = tmp.replace(text, ""))
|
908
|
-
&& index <= diff;
|
909
|
-
index = start + text.length
|
910
|
-
) {
|
911
|
-
start = actual.indexOf(text, index);
|
912
|
-
}
|
913
|
-
} else if(obj.selectionStart) {
|
914
|
-
var start = obj.selectionStart;
|
915
|
-
var end = obj.selectionEnd;
|
916
|
-
|
917
|
-
obj.value = obj.value.substr(0, start)
|
918
|
-
+ text
|
919
|
-
+ obj.value.substr(end, obj.value.length);
|
920
|
-
}
|
921
|
-
|
922
|
-
if(start != null) {
|
923
|
-
setCaretTo(obj, start + text.length);
|
924
|
-
} else {
|
925
|
-
obj.value += text;
|
926
|
-
}
|
927
|
-
}
|
928
|
-
|
929
|
-
function setCaretTo(obj, pos) {
|
930
|
-
if(obj.createTextRange) {
|
931
|
-
var range = obj.createTextRange();
|
932
|
-
range.move('character', pos);
|
933
|
-
range.select();
|
934
|
-
} else if(obj.selectionStart) {
|
935
|
-
obj.focus();
|
936
|
-
obj.setSelectionRange(pos, pos);
|
937
|
-
}
|
938
|
-
}
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
// utility function to fix # of decimal places
|
943
|
-
function setPrecision(val, p, dontPad, addCommas) {
|
944
|
-
if (typeof(p) == 'undefined') p = 2;
|
945
|
-
if (typeof(dontPad) == 'undefined') dontPad = false;
|
946
|
-
if (typeof(addCommas) == 'undefined') addCommas = true;
|
947
|
-
|
948
|
-
if (val.toString() == 'NaN') return '';
|
949
|
-
var m = Math.pow(10, p);
|
950
|
-
var ret = parseInt(Math.round(val * m), 10) / m;
|
951
|
-
var idx = (''+ret).indexOf('.');
|
952
|
-
if (idx < 0) {
|
953
|
-
ret += '.';
|
954
|
-
idx = (''+ret).indexOf('.');
|
955
|
-
}
|
956
|
-
|
957
|
-
if (!dontPad && (''+ret).substring(idx).length <= p) {
|
958
|
-
for (var i = (''+ret).substring(idx).length; i <= p; i++) {
|
959
|
-
ret += '0';
|
960
|
-
}
|
961
|
-
}
|
962
|
-
|
963
|
-
if (addCommas) {
|
964
|
-
var pieces = (''+ret).split('.');
|
965
|
-
if (p > 0) {
|
966
|
-
ret = '.' + pieces[1];
|
967
|
-
} else {
|
968
|
-
ret = pieces[1];
|
969
|
-
}
|
970
|
-
for (var i = 0; i < pieces[0].length; i++) {
|
971
|
-
if (i % 3 == 2) {
|
972
|
-
ret = ',' + pieces[0].charAt(pieces[0].length - i - 1) + ret;
|
973
|
-
} else {
|
974
|
-
ret = pieces[0].charAt(pieces[0].length - i - 1) + ret;
|
975
|
-
}
|
976
|
-
}
|
977
|
-
ret = ret.replace(/^,/, '');
|
978
|
-
}
|
979
|
-
|
980
|
-
return ret;
|
981
|
-
}
|
982
|
-
|
983
|
-
|
984
|
-
function setReportDates(interval) {
|
985
|
-
startDateField = $('report_start_date');
|
986
|
-
endDateField = $('report_end_date');
|
987
|
-
today = startDate = endDate = new Date();
|
988
|
-
|
989
|
-
switch (interval) {
|
990
|
-
case 'yesterday':
|
991
|
-
startDate = new Date('' + (today.getMonth()+1) + '/' + (today.getDate()-1) + '/' + today.getYear());
|
992
|
-
endDate = startDate;
|
993
|
-
break;
|
994
|
-
|
995
|
-
case 'last_month':
|
996
|
-
startDate = new Date('' + today.getMonth() + '/1/' + today.getYear());
|
997
|
-
endDate = new Date('' + (today.getMonth()+1) + '/0/' + today.getYear());
|
998
|
-
break;
|
999
|
-
|
1000
|
-
case 'last_quarter':
|
1001
|
-
startMonth = Math.floor(today.getMonth() / 3) * 3 - 3;
|
1002
|
-
startYear = today.getYear();
|
1003
|
-
if (startMonth < 0) {
|
1004
|
-
startMonth += 12;
|
1005
|
-
startYear--;
|
1006
|
-
}
|
1007
|
-
endMonth = startMonth + 3;
|
1008
|
-
endYear = startYear;
|
1009
|
-
if (endMonth > 11) {
|
1010
|
-
endMonth -= 12;
|
1011
|
-
endYear++;
|
1012
|
-
}
|
1013
|
-
startDate = new Date('' + (startMonth+1) + '/1/' + startYear);
|
1014
|
-
endDate = new Date('' + (endMonth+1) + '/0/' + endYear);
|
1015
|
-
break;
|
1016
|
-
|
1017
|
-
case 'last_year':
|
1018
|
-
startDate = new Date('1/1/' + (today.getYear()-1));
|
1019
|
-
endDate = new Date('12/31/' + (today.getYear()-1));
|
1020
|
-
break;
|
1021
|
-
|
1022
|
-
case 'today':
|
1023
|
-
startDate = new Date('' + (today.getMonth()+1 )+ '/' + today.getDate() + '/' + today.getYear());
|
1024
|
-
endDate = startDate;
|
1025
|
-
break;
|
1026
|
-
|
1027
|
-
case 'this_month':
|
1028
|
-
startDate = new Date('' + (today.getMonth()+1) + '/1/' + today.getYear());
|
1029
|
-
endDate = new Date('' + (today.getMonth()+2) + '/0/' + today.getYear());
|
1030
|
-
break;
|
1031
|
-
|
1032
|
-
case 'this_quarter':
|
1033
|
-
startMonth = Math.floor(today.getMonth() / 3) * 3;
|
1034
|
-
endMonth = startMonth + 3;
|
1035
|
-
endYear = startYear;
|
1036
|
-
if (endMonth > 11) {
|
1037
|
-
endMonth -= 12;
|
1038
|
-
endYear++;
|
1039
|
-
}
|
1040
|
-
startDate = new Date('' + (startMonth+1) + '/1/' + today.getYear());
|
1041
|
-
endDate = new Date('' + (endMonth+1) + '/0/' + endYear);
|
1042
|
-
break;
|
1043
|
-
|
1044
|
-
case 'this_year':
|
1045
|
-
startDate = new Date('1/1/' + today.getYear());
|
1046
|
-
endDate = new Date('12/31/' + today.getYear());
|
1047
|
-
break;
|
1048
|
-
|
1049
|
-
case 'all_time':
|
1050
|
-
startDate = new Date('1/1/' + (today.getYear()-5));
|
1051
|
-
endDate = new Date('12/31/' + (today.getYear()+50));
|
1052
|
-
break;
|
1053
|
-
|
1054
|
-
default:
|
1055
|
-
// same as "today"
|
1056
|
-
startDate = new Date('' + (today.getMonth()+1 )+ '/' + today.getDate() + '/' + today.getYear());
|
1057
|
-
endDate = startDate;
|
1058
|
-
break;
|
1059
|
-
}
|
1060
|
-
|
1061
|
-
startDateField.value = startDate.format('mm/dd/yyyy');
|
1062
|
-
endDateField.value = endDate.format('mm/dd/yyyy');
|
1063
|
-
}
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
/*
|
1068
|
-
Date Format 1.1
|
1069
|
-
(c) 2007 Steven Levithan <stevenlevithan.com>
|
1070
|
-
MIT license
|
1071
|
-
With code by Scott Trenda (Z and o flags, and enhanced brevity)
|
1072
|
-
*/
|
1073
|
-
|
1074
|
-
/*** dateFormat
|
1075
|
-
Accepts a date, a mask, or a date and a mask.
|
1076
|
-
Returns a formatted version of the given date.
|
1077
|
-
The date defaults to the current date/time.
|
1078
|
-
The mask defaults ``"ddd mmm d yyyy HH:MM:ss"``.
|
1079
|
-
*/
|
1080
|
-
var dateFormat = function () {
|
1081
|
-
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloZ]|"[^"]*"|'[^']*'/g,
|
1082
|
-
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
|
1083
|
-
timezoneClip = /[^-+\dA-Z]/g,
|
1084
|
-
pad = function (value, length) {
|
1085
|
-
value = String(value);
|
1086
|
-
length = parseInt(length) || 2;
|
1087
|
-
while (value.length < length)
|
1088
|
-
value = "0" + value;
|
1089
|
-
return value;
|
1090
|
-
};
|
1091
|
-
|
1092
|
-
// Regexes and supporting functions are cached through closure
|
1093
|
-
return function (date, mask) {
|
1094
|
-
// Treat the first argument as a mask if it doesn't contain any numbers
|
1095
|
-
if (
|
1096
|
-
arguments.length == 1 &&
|
1097
|
-
(typeof date == "string" || date instanceof String) &&
|
1098
|
-
!/\d/.test(date)
|
1099
|
-
) {
|
1100
|
-
mask = date;
|
1101
|
-
date = undefined;
|
1102
|
-
}
|
1103
|
-
|
1104
|
-
date = date ? new Date(date) : new Date();
|
1105
|
-
if (isNaN(date))
|
1106
|
-
throw "invalid date";
|
1107
|
-
|
1108
|
-
var dF = dateFormat;
|
1109
|
-
mask = String(dF.masks[mask] || mask || dF.masks["default"]);
|
1110
|
-
|
1111
|
-
var d = date.getDate(),
|
1112
|
-
D = date.getDay(),
|
1113
|
-
m = date.getMonth(),
|
1114
|
-
y = date.getFullYear()+1900,
|
1115
|
-
H = date.getHours(),
|
1116
|
-
M = date.getMinutes(),
|
1117
|
-
s = date.getSeconds(),
|
1118
|
-
L = date.getMilliseconds(),
|
1119
|
-
o = date.getTimezoneOffset(),
|
1120
|
-
flags = {
|
1121
|
-
d: d,
|
1122
|
-
dd: pad(d),
|
1123
|
-
ddd: dF.i18n.dayNames[D],
|
1124
|
-
dddd: dF.i18n.dayNames[D + 7],
|
1125
|
-
m: m + 1,
|
1126
|
-
mm: pad(m + 1),
|
1127
|
-
mmm: dF.i18n.monthNames[m],
|
1128
|
-
mmmm: dF.i18n.monthNames[m + 12],
|
1129
|
-
yy: String(y).slice(2),
|
1130
|
-
yyyy: y,
|
1131
|
-
h: H % 12 || 12,
|
1132
|
-
hh: pad(H % 12 || 12),
|
1133
|
-
H: H,
|
1134
|
-
HH: pad(H),
|
1135
|
-
M: M,
|
1136
|
-
MM: pad(M),
|
1137
|
-
s: s,
|
1138
|
-
ss: pad(s),
|
1139
|
-
l: pad(L, 3),
|
1140
|
-
L: pad(L > 99 ? Math.round(L / 10) : L),
|
1141
|
-
t: H < 12 ? "a" : "p",
|
1142
|
-
tt: H < 12 ? "am" : "pm",
|
1143
|
-
T: H < 12 ? "A" : "P",
|
1144
|
-
TT: H < 12 ? "AM" : "PM",
|
1145
|
-
Z: (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
|
1146
|
-
o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4)
|
1147
|
-
};
|
1148
|
-
|
1149
|
-
return mask.replace(token, function ($0) {
|
1150
|
-
return ($0 in flags) ? flags[$0] : $0.slice(1, $0.length - 1);
|
1151
|
-
});
|
1152
|
-
};
|
1153
|
-
}();
|
1154
|
-
|
1155
|
-
// Some common format strings
|
1156
|
-
dateFormat.masks = {
|
1157
|
-
"default": "ddd mmm d yyyy HH:MM:ss",
|
1158
|
-
shortDate: "m/d/yy",
|
1159
|
-
mediumDate: "mmm d, yyyy",
|
1160
|
-
longDate: "mmmm d, yyyy",
|
1161
|
-
fullDate: "dddd, mmmm d, yyyy",
|
1162
|
-
shortTime: "h:MM TT",
|
1163
|
-
mediumTime: "h:MM:ss TT",
|
1164
|
-
longTime: "h:MM:ss TT Z",
|
1165
|
-
isoDate: "yyyy-mm-dd",
|
1166
|
-
isoTime: "HH:MM:ss",
|
1167
|
-
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
|
1168
|
-
isoFullDateTime: "yyyy-mm-dd'T'HH:MM:ss.lo"
|
1169
|
-
};
|
1170
|
-
|
1171
|
-
// Internationalization strings
|
1172
|
-
dateFormat.i18n = {
|
1173
|
-
dayNames: [
|
1174
|
-
"Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat",
|
1175
|
-
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
1176
|
-
],
|
1177
|
-
monthNames: [
|
1178
|
-
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
1179
|
-
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
1180
|
-
]
|
1181
|
-
};
|
1182
|
-
|
1183
|
-
// For convenience...
|
1184
|
-
Date.prototype.format = function (mask) {
|
1185
|
-
return dateFormat(this, mask);
|
1186
|
-
}
|
1187
|
-
|
1188
|
-
|
1189
|
-
// Ultimate client-side JavaScript client sniff. Version 3.03
|
1190
|
-
// (C) Netscape Communications 1999. Permission granted to reuse and distribute.
|
1191
|
-
// Revised 17 May 99 to add is.nav5up and is.ie5up (see below).
|
1192
|
-
// Revised 21 Nov 00 to add is.gecko and is.ie5_5 Also Changed is.nav5 and is.nav5up to is.nav6 and is.nav6up
|
1193
|
-
// Revised 22 Feb 01 to correct Javascript Detection for IE 5.x, Opera 4,
|
1194
|
-
// correct Opera 5 detection
|
1195
|
-
// add support for winME and win2k
|
1196
|
-
// synch with browser-type-oo.js
|
1197
|
-
// Revised 26 Mar 01 to correct Opera detection
|
1198
|
-
// Revised 02 Oct 01 to add IE6 detection
|
1199
|
-
|
1200
|
-
// Everything you always wanted to know about your JavaScript client
|
1201
|
-
// but were afraid to ask ... "Is" is the constructor function for "is" object,
|
1202
|
-
// which has properties indicating:
|
1203
|
-
// (1) browser vendor:
|
1204
|
-
// is.nav, is.ie, is.opera, is.hotjava, is.webtv, is.TVNavigator, is.AOLTV
|
1205
|
-
// (2) browser version number:
|
1206
|
-
// is.major (integer indicating major version number: 2, 3, 4 ...)
|
1207
|
-
// is.minor (float indicating full version number: 2.02, 3.01, 4.04 ...)
|
1208
|
-
// (3) browser vendor AND major version number
|
1209
|
-
// is.nav2, is.nav3, is.nav4, is.nav4up, is.nav6, is.nav6up, is.gecko, is.ie3,
|
1210
|
-
// is.ie4, is.ie4up, is.ie5, is.ie5up, is.ie5_5, is.ie5_5up, is.ie6, is.ie6up, is.hotjava3, is.hotjava3up
|
1211
|
-
// (4) JavaScript version number:
|
1212
|
-
// is.js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
|
1213
|
-
// (5) OS platform and version:
|
1214
|
-
// is.win, is.win16, is.win32, is.win31, is.win95, is.winnt, is.win98, is.winme, is.win2k
|
1215
|
-
// is.os2
|
1216
|
-
// is.mac, is.mac68k, is.macppc
|
1217
|
-
// is.unix
|
1218
|
-
// is.sun, is.sun4, is.sun5, is.suni86
|
1219
|
-
// is.irix, is.irix5, is.irix6
|
1220
|
-
// is.hpux, is.hpux9, is.hpux10
|
1221
|
-
// is.aix, is.aix1, is.aix2, is.aix3, is.aix4
|
1222
|
-
// is.linux, is.sco, is.unixware, is.mpras, is.reliant
|
1223
|
-
// is.dec, is.sinix, is.freebsd, is.bsd
|
1224
|
-
// is.vms
|
1225
|
-
//
|
1226
|
-
// See http://www.it97.de/JavaScript/JS_tutorial/bstat/navobj.html and
|
1227
|
-
// http://www.it97.de/JavaScript/JS_tutorial/bstat/Browseraol.html
|
1228
|
-
// for detailed lists of userAgent strings.
|
1229
|
-
//
|
1230
|
-
// Note: you don't want your Nav4 or IE4 code to "turn off" or
|
1231
|
-
// stop working when Nav5 and IE5 (or later) are released, so
|
1232
|
-
// in conditional code forks, use is.nav4up ("Nav4 or greater")
|
1233
|
-
// and is.ie4up ("IE4 or greater") instead of is.nav4 or is.ie4
|
1234
|
-
// to check version in code which you want to work on future
|
1235
|
-
// versions.
|
1236
|
-
|
1237
|
-
|
1238
|
-
function Is ()
|
1239
|
-
{ // convert all characters to lowercase to simplify testing
|
1240
|
-
var agt=navigator.userAgent.toLowerCase();
|
1241
|
-
|
1242
|
-
// *** BROWSER VERSION ***
|
1243
|
-
// Note: On IE5, these return 4, so use is.ie5up to detect IE5.
|
1244
|
-
|
1245
|
-
this.major = parseInt(navigator.appVersion);
|
1246
|
-
this.minor = parseFloat(navigator.appVersion);
|
1247
|
-
|
1248
|
-
// Note: Opera and WebTV spoof Navigator. We do strict client detection.
|
1249
|
-
// If you want to allow spoofing, take out the tests for opera and webtv.
|
1250
|
-
this.nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
|
1251
|
-
&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
|
1252
|
-
&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
|
1253
|
-
this.nav2 = (this.nav && (this.major == 2));
|
1254
|
-
this.nav3 = (this.nav && (this.major == 3));
|
1255
|
-
this.nav4 = (this.nav && (this.major == 4));
|
1256
|
-
this.nav4up = (this.nav && (this.major >= 4));
|
1257
|
-
this.navonly = (this.nav && ((agt.indexOf(";nav") != -1) ||
|
1258
|
-
(agt.indexOf("; nav") != -1)) );
|
1259
|
-
this.nav6 = (this.nav && (this.major == 5));
|
1260
|
-
this.nav6up = (this.nav && (this.major >= 5));
|
1261
|
-
this.gecko = (agt.indexOf('gecko') != -1);
|
1262
|
-
|
1263
|
-
|
1264
|
-
this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
|
1265
|
-
this.ie3 = (this.ie && (this.major < 4));
|
1266
|
-
this.ie4 = (this.ie && (this.major == 4) && (agt.indexOf("msie 4")!=-1) );
|
1267
|
-
this.ie4up = (this.ie && (this.major >= 4));
|
1268
|
-
this.ie5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
|
1269
|
-
this.ie5_5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
|
1270
|
-
this.ie5up = (this.ie && !this.ie3 && !this.ie4);
|
1271
|
-
this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5);
|
1272
|
-
this.ie6 = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.")!=-1) );
|
1273
|
-
this.ie6up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);
|
1274
|
-
this.ie7 = (this.ie && (this.major == 4) && (agt.indexOf("msie 7.")!=-1) );
|
1275
|
-
this.ie7up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5 && !this.ie6);
|
1276
|
-
|
1277
|
-
// KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
|
1278
|
-
// or if this is the first browser window opened. Thus the
|
1279
|
-
// variables is.aol, is.aol3, and is.aol4 aren't 100% reliable.
|
1280
|
-
this.aol = (agt.indexOf("aol") != -1);
|
1281
|
-
this.aol3 = (this.aol && this.ie3);
|
1282
|
-
this.aol4 = (this.aol && this.ie4);
|
1283
|
-
this.aol5 = (agt.indexOf("aol 5") != -1);
|
1284
|
-
this.aol6 = (agt.indexOf("aol 6") != -1);
|
1285
|
-
|
1286
|
-
this.opera = (agt.indexOf("opera") != -1);
|
1287
|
-
this.opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
|
1288
|
-
this.opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
|
1289
|
-
this.opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
|
1290
|
-
this.opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
|
1291
|
-
this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4);
|
1292
|
-
|
1293
|
-
this.webtv = (agt.indexOf("webtv") != -1);
|
1294
|
-
|
1295
|
-
this.TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1));
|
1296
|
-
this.AOLTV = this.TVNavigator;
|
1297
|
-
|
1298
|
-
this.hotjava = (agt.indexOf("hotjava") != -1);
|
1299
|
-
this.hotjava3 = (this.hotjava && (this.major == 3));
|
1300
|
-
this.hotjava3up = (this.hotjava && (this.major >= 3));
|
1301
|
-
|
1302
|
-
// *** JAVASCRIPT VERSION CHECK ***
|
1303
|
-
if (this.nav2 || this.ie3) this.js = 1.0;
|
1304
|
-
else if (this.nav3) this.js = 1.1;
|
1305
|
-
else if (this.opera5up) this.js = 1.3;
|
1306
|
-
else if (this.opera) this.js = 1.1;
|
1307
|
-
else if ((this.nav4 && (this.minor <= 4.05)) || this.ie4) this.js = 1.2;
|
1308
|
-
else if ((this.nav4 && (this.minor > 4.05)) || this.ie5) this.js = 1.3;
|
1309
|
-
else if (this.hotjava3up) this.js = 1.4;
|
1310
|
-
else if (this.nav6 || this.gecko) this.js = 1.5;
|
1311
|
-
// NOTE: In the future, update this code when newer versions of JS
|
1312
|
-
// are released. For now, we try to provide some upward compatibility
|
1313
|
-
// so that future versions of Nav and IE will show they are at
|
1314
|
-
// *least* JS 1.x capable. Always check for JS version compatibility
|
1315
|
-
// with > or >=.
|
1316
|
-
else if (this.nav6up) this.js = 1.5;
|
1317
|
-
// note ie5up on mac is 1.4
|
1318
|
-
else if (this.ie5up) this.js = 1.3
|
1319
|
-
|
1320
|
-
// HACK: no idea for other browsers; always check for JS version with > or >=
|
1321
|
-
else this.js = 0.0;
|
1322
|
-
|
1323
|
-
// *** PLATFORM ***
|
1324
|
-
this.win = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
|
1325
|
-
// NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
|
1326
|
-
// Win32, so you can't distinguish between Win95 and WinNT.
|
1327
|
-
this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
|
1328
|
-
|
1329
|
-
// is this a 16 bit compiled version?
|
1330
|
-
this.win16 = ((agt.indexOf("win16")!=-1) ||
|
1331
|
-
(agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
|
1332
|
-
(agt.indexOf("windows 16-bit")!=-1) );
|
1333
|
-
|
1334
|
-
this.win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
|
1335
|
-
(agt.indexOf("windows 16-bit")!=-1));
|
1336
|
-
|
1337
|
-
// NOTE: Reliable detection of Win98 may not be possible. It appears that:
|
1338
|
-
// - On Nav 4.x and before you'll get plain "Windows" in userAgent.
|
1339
|
-
// - On Mercury client, the 32-bit version will return "Win98", but
|
1340
|
-
// the 16-bit version running on Win98 will still return "Win95".
|
1341
|
-
this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
|
1342
|
-
this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
|
1343
|
-
this.win32 = (this.win95 || this.winnt || this.win98 ||
|
1344
|
-
((this.major >= 4) && (navigator.platform == "Win32")) ||
|
1345
|
-
(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
|
1346
|
-
|
1347
|
-
this.winme = ((agt.indexOf("win 9x 4.90")!=-1));
|
1348
|
-
this.win2k = ((agt.indexOf("windows nt 5.0")!=-1));
|
1349
|
-
|
1350
|
-
this.os2 = ((agt.indexOf("os/2")!=-1) ||
|
1351
|
-
(navigator.appVersion.indexOf("OS/2")!=-1) ||
|
1352
|
-
(agt.indexOf("ibm-webexplorer")!=-1));
|
1353
|
-
|
1354
|
-
this.mac = (agt.indexOf("mac")!=-1);
|
1355
|
-
// hack ie5 js version for mac
|
1356
|
-
if (this.mac && this.ie5up) this.js = 1.4;
|
1357
|
-
this.mac68k = (this.mac && ((agt.indexOf("68k")!=-1) ||
|
1358
|
-
(agt.indexOf("68000")!=-1)));
|
1359
|
-
this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1) ||
|
1360
|
-
(agt.indexOf("powerpc")!=-1)));
|
1361
|
-
|
1362
|
-
this.sun = (agt.indexOf("sunos")!=-1);
|
1363
|
-
this.sun4 = (agt.indexOf("sunos 4")!=-1);
|
1364
|
-
this.sun5 = (agt.indexOf("sunos 5")!=-1);
|
1365
|
-
this.suni86= (this.sun && (agt.indexOf("i86")!=-1));
|
1366
|
-
this.irix = (agt.indexOf("irix") !=-1); // SGI
|
1367
|
-
this.irix5 = (agt.indexOf("irix 5") !=-1);
|
1368
|
-
this.irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
|
1369
|
-
this.hpux = (agt.indexOf("hp-ux")!=-1);
|
1370
|
-
this.hpux9 = (this.hpux && (agt.indexOf("09.")!=-1));
|
1371
|
-
this.hpux10= (this.hpux && (agt.indexOf("10.")!=-1));
|
1372
|
-
this.aix = (agt.indexOf("aix") !=-1); // IBM
|
1373
|
-
this.aix1 = (agt.indexOf("aix 1") !=-1);
|
1374
|
-
this.aix2 = (agt.indexOf("aix 2") !=-1);
|
1375
|
-
this.aix3 = (agt.indexOf("aix 3") !=-1);
|
1376
|
-
this.aix4 = (agt.indexOf("aix 4") !=-1);
|
1377
|
-
this.linux = (agt.indexOf("inux")!=-1);
|
1378
|
-
this.sco = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
|
1379
|
-
this.unixware = (agt.indexOf("unix_system_v")!=-1);
|
1380
|
-
this.mpras = (agt.indexOf("ncr")!=-1);
|
1381
|
-
this.reliant = (agt.indexOf("reliantunix")!=-1);
|
1382
|
-
this.dec = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
|
1383
|
-
(agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
|
1384
|
-
(agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
|
1385
|
-
this.sinix = (agt.indexOf("sinix")!=-1);
|
1386
|
-
this.freebsd = (agt.indexOf("freebsd")!=-1);
|
1387
|
-
this.bsd = (agt.indexOf("bsd")!=-1);
|
1388
|
-
this.unix = ((agt.indexOf("x11")!=-1) || this.sun || this.irix || this.hpux ||
|
1389
|
-
this.sco ||this.unixware || this.mpras || this.reliant ||
|
1390
|
-
this.dec || this.sinix || this.aix || this.linux || this.bsd || this.freebsd);
|
1391
|
-
|
1392
|
-
this.vms = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
|
1393
|
-
}
|
1394
|
-
|
1395
|
-
var is;
|
1396
|
-
var isIE3Mac = false;
|
1397
|
-
// this section is designed specifically for IE3 for the Mac
|
1398
|
-
|
1399
|
-
if ((navigator.appVersion.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1) &&
|
1400
|
-
(parseInt(navigator.appVersion)==3))
|
1401
|
-
isIE3Mac = true;
|
1402
|
-
else is = new Is();
|
9
|
+
//= require imagine
|