ajax 0.1.2
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.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +291 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/app/controllers/ajax_controller.rb +3 -0
- data/app/views/ajax/framework.html.erb +7 -0
- data/config/initializers/ajax.rb +14 -0
- data/lib/ajax.rb +79 -0
- data/lib/ajax/action_controller.rb +154 -0
- data/lib/ajax/action_view.rb +56 -0
- data/lib/ajax/helpers.rb +15 -0
- data/lib/ajax/helpers/request_helper.rb +76 -0
- data/lib/ajax/helpers/robot_helper.rb +31 -0
- data/lib/ajax/helpers/url_helper.rb +47 -0
- data/lib/ajax/railtie.rb +7 -0
- data/lib/ajax/routes.rb +12 -0
- data/lib/ajax/spec/extension.rb +34 -0
- data/lib/ajax/spec/helpers.rb +95 -0
- data/lib/ajax/tasks.rb +1 -0
- data/lib/rack-ajax.rb +60 -0
- data/lib/rack-ajax/decision_tree.rb +60 -0
- data/lib/rack-ajax/parser.rb +115 -0
- data/public/images/loading-icon-large.gif +0 -0
- data/public/images/loading-icon-small.gif +0 -0
- data/public/javascripts/ajax.js +529 -0
- data/public/javascripts/jquery.address-1.1.js +450 -0
- data/public/javascripts/jquery.address-1.1.min.js +11 -0
- data/public/javascripts/jquery.address-1.2.js +528 -0
- data/public/javascripts/jquery.address-1.2.min.js +25 -0
- data/public/javascripts/jquery.address-1.2rc.js +599 -0
- data/public/javascripts/jquery.address-1.2rc.min.js +27 -0
- data/public/javascripts/jquery.json-2.2.js +178 -0
- data/public/javascripts/jquery.json-2.2.min.js +31 -0
- data/rails/init.rb +4 -0
- data/rails/install.rb +23 -0
- data/rails/uninstall.rb +1 -0
- data/spec/ajax/helpers_spec.rb +102 -0
- data/spec/ajax/request_helper_spec.rb +33 -0
- data/spec/integration/ajax_spec.rb +146 -0
- data/spec/rack-ajax/parser_spec.rb +62 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +18 -0
- data/tasks/ajax_tasks.rake +15 -0
- metadata +106 -0
@@ -0,0 +1,450 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery Address Plugin v1.1
|
3
|
+
* http://www.asual.com/jquery/address/
|
4
|
+
*
|
5
|
+
* Copyright (c) 2009 Rostislav Hristov
|
6
|
+
* Dual licensed under the MIT and GPL licenses.
|
7
|
+
* http://docs.jquery.com/License
|
8
|
+
*
|
9
|
+
* Date: 2009-12-23 14:27:00 +0200 (Wed, 23 Dec 2009)
|
10
|
+
*/
|
11
|
+
(function ($) {
|
12
|
+
|
13
|
+
$.address = (function () {
|
14
|
+
|
15
|
+
var _trigger = function(name) {
|
16
|
+
$(this).trigger(
|
17
|
+
$.extend($.Event(name),
|
18
|
+
(function() {
|
19
|
+
var event = {
|
20
|
+
value: this.value(),
|
21
|
+
path: this.path(),
|
22
|
+
pathNames: this.pathNames(),
|
23
|
+
parameterNames: this.parameterNames(),
|
24
|
+
parameters: {},
|
25
|
+
queryString: this.queryString()
|
26
|
+
};
|
27
|
+
for (var i = 0, l = event.parameterNames.length; i < l; i++)
|
28
|
+
event.parameters[event.parameterNames[i]] = this.parameter(event.parameterNames[i]);
|
29
|
+
return event;
|
30
|
+
}).call(this)
|
31
|
+
)
|
32
|
+
);
|
33
|
+
};
|
34
|
+
|
35
|
+
var _init = function() {
|
36
|
+
_trigger.call($.address, 'init');
|
37
|
+
};
|
38
|
+
|
39
|
+
var _change = function() {
|
40
|
+
_trigger.call($.address, 'change');
|
41
|
+
};
|
42
|
+
|
43
|
+
var _getHash = function() {
|
44
|
+
var index = _l.href.indexOf('#');
|
45
|
+
return index != -1 ? _ec(_dc(_l.href.substr(index + 1))) : '';
|
46
|
+
};
|
47
|
+
|
48
|
+
var _getWindow = function() {
|
49
|
+
try {
|
50
|
+
return top.document != undefined ? top : window;
|
51
|
+
} catch (e) {
|
52
|
+
return window;
|
53
|
+
}
|
54
|
+
};
|
55
|
+
|
56
|
+
var _strictCheck = function(value, force) {
|
57
|
+
if (_opts.strict)
|
58
|
+
value = force ? (value.substr(0, 1) != '/' ? '/' + value : value) : (value == '' ? '/' : value);
|
59
|
+
return value;
|
60
|
+
};
|
61
|
+
|
62
|
+
var _ieLocal = function(value, direction) {
|
63
|
+
return (_msie && _l.protocol == 'file:') ?
|
64
|
+
(direction ? _value.replace(/\?/, '%3F') : _value.replace(/%253F/, '?')) : value;
|
65
|
+
};
|
66
|
+
|
67
|
+
var _searchScript = function(el) {
|
68
|
+
for (var i = 0, l = el.childNodes.length, s; i < l; i++) {
|
69
|
+
if (el.childNodes[i].src)
|
70
|
+
_url = String(el.childNodes[i].src);
|
71
|
+
if (s = _searchScript(el.childNodes[i]))
|
72
|
+
return s;
|
73
|
+
}
|
74
|
+
};
|
75
|
+
|
76
|
+
var _listen = function() {
|
77
|
+
if (!_silent) {
|
78
|
+
var hash = _getHash();
|
79
|
+
var diff = !(_value == hash);
|
80
|
+
if (_safari && _version < 523) {
|
81
|
+
if (_length != _h.length) {
|
82
|
+
_length = _h.length;
|
83
|
+
if (typeof _stack[_length - 1] != UNDEFINED)
|
84
|
+
_value = _stack[_length - 1];
|
85
|
+
_update(false);
|
86
|
+
}
|
87
|
+
} else if (_msie && _version < 7 && diff) {
|
88
|
+
_l.reload();
|
89
|
+
} else if (diff) {
|
90
|
+
_value = hash;
|
91
|
+
_update(false);
|
92
|
+
}
|
93
|
+
}
|
94
|
+
};
|
95
|
+
|
96
|
+
var _update = function(internal) {
|
97
|
+
_change();
|
98
|
+
if (internal) {
|
99
|
+
_trigger.call($.address, 'internalChange');
|
100
|
+
} else {
|
101
|
+
_trigger.call($.address, 'externalChange');
|
102
|
+
}
|
103
|
+
_st(_track, 10);
|
104
|
+
};
|
105
|
+
|
106
|
+
var _track = function() {
|
107
|
+
var value = (_l.pathname + (/\/$/.test(_l.pathname) ? '' : '/') + _getters.value()).replace(/\/\//, '/').replace(/^\/$/, '');
|
108
|
+
var fn = window[_opts.tracker];
|
109
|
+
if (typeof fn == FUNCTION)
|
110
|
+
fn(value);
|
111
|
+
else if (typeof pageTracker != UNDEFINED && typeof pageTracker._trackPageview == FUNCTION)
|
112
|
+
pageTracker._trackPageview(value);
|
113
|
+
else if (typeof urchinTracker == FUNCTION)
|
114
|
+
urchinTracker(value);
|
115
|
+
};
|
116
|
+
|
117
|
+
var _htmlWrite = function() {
|
118
|
+
var doc = _frame.contentWindow.document;
|
119
|
+
doc.open();
|
120
|
+
doc.write('<html><head><title>' + _d.title + '</title><script>var ' + ID + ' = "' + _getHash() + '";</script></head></html>');
|
121
|
+
doc.close();
|
122
|
+
};
|
123
|
+
|
124
|
+
var _load = function() {
|
125
|
+
if (!_loaded) {
|
126
|
+
_loaded = TRUE;
|
127
|
+
if (_msie && _version < 8) {
|
128
|
+
var frameset = _d.getElementsByTagName('frameset')[0];
|
129
|
+
_frame = _d.createElement((frameset ? '' : 'i') + 'frame');
|
130
|
+
if (frameset) {
|
131
|
+
frameset.insertAdjacentElement('beforeEnd', _frame);
|
132
|
+
frameset[frameset.cols ? 'cols' : 'rows'] += ',0';
|
133
|
+
_frame.src = 'javascript:false';
|
134
|
+
_frame.noResize = true;
|
135
|
+
_frame.frameBorder = _frame.frameSpacing = 0;
|
136
|
+
} else {
|
137
|
+
_frame.src = 'javascript:false';
|
138
|
+
_frame.style.display = 'none';
|
139
|
+
_d.body.insertAdjacentElement('afterBegin', _frame);
|
140
|
+
}
|
141
|
+
_st(function() {
|
142
|
+
$(_frame).bind('load', function() {
|
143
|
+
var win = _frame.contentWindow;
|
144
|
+
var src = win.location.href;
|
145
|
+
_value = (typeof win[ID] != UNDEFINED ? win[ID] : '');
|
146
|
+
if (_value != _getHash()) {
|
147
|
+
_update(false);
|
148
|
+
_l.hash = _ieLocal(_value, TRUE);
|
149
|
+
}
|
150
|
+
});
|
151
|
+
if (typeof _frame.contentWindow[ID] == UNDEFINED)
|
152
|
+
_htmlWrite();
|
153
|
+
}, 50);
|
154
|
+
} else if (_safari) {
|
155
|
+
if (_version < 418) {
|
156
|
+
$(_d.body).append('<form id="' + ID + '" style="position:absolute;top:-9999px;" method="get"></form>');
|
157
|
+
_form = _d.getElementById(ID);
|
158
|
+
}
|
159
|
+
if (typeof _l[ID] == UNDEFINED) _l[ID] = {};
|
160
|
+
if (typeof _l[ID][_l.pathname] != UNDEFINED) _stack = _l[ID][_l.pathname].split(',');
|
161
|
+
}
|
162
|
+
|
163
|
+
_st(function() {
|
164
|
+
_init();
|
165
|
+
_update(false);
|
166
|
+
}, 1);
|
167
|
+
|
168
|
+
if (_msie && _version >= 8)
|
169
|
+
_d.body.onhashchange = _listen;
|
170
|
+
else
|
171
|
+
_si(_listen, 50);
|
172
|
+
$('a[rel*=address:]').address();
|
173
|
+
}
|
174
|
+
};
|
175
|
+
|
176
|
+
var _getters = {
|
177
|
+
baseURL: function() {
|
178
|
+
var url = _l.href;
|
179
|
+
if (url.indexOf('#') != -1)
|
180
|
+
url = url.substr(0, url.indexOf('#'));
|
181
|
+
if (url.substr(url.length - 1) == '/')
|
182
|
+
url = url.substr(0, url.length - 1);
|
183
|
+
return url;
|
184
|
+
},
|
185
|
+
strict: function() {
|
186
|
+
return _opts.strict;
|
187
|
+
},
|
188
|
+
history: function() {
|
189
|
+
return _opts.history;
|
190
|
+
},
|
191
|
+
tracker: function() {
|
192
|
+
return _opts.tracker;
|
193
|
+
},
|
194
|
+
title: function() {
|
195
|
+
return _d.title;
|
196
|
+
},
|
197
|
+
value: function() {
|
198
|
+
if (!_supported) return null;
|
199
|
+
return _dc(_strictCheck(_ieLocal(_value, FALSE), FALSE));
|
200
|
+
},
|
201
|
+
path: function() {
|
202
|
+
var value = this.value();
|
203
|
+
return (value.indexOf('?') != -1) ? value.split('?')[0] : value;
|
204
|
+
},
|
205
|
+
pathNames: function() {
|
206
|
+
var path = this.path();
|
207
|
+
var names = path.split('/');
|
208
|
+
if (path.substr(0, 1) == '/' || path.length == 0)
|
209
|
+
names.splice(0, 1);
|
210
|
+
if (path.substr(path.length - 1, 1) == '/')
|
211
|
+
names.splice(names.length - 1, 1);
|
212
|
+
return names;
|
213
|
+
},
|
214
|
+
queryString: function() {
|
215
|
+
var value = this.value();
|
216
|
+
var index = value.indexOf('?');
|
217
|
+
if (index != -1 && index < value.length)
|
218
|
+
return value.substr(index + 1);
|
219
|
+
},
|
220
|
+
parameter: function(param) {
|
221
|
+
var value = this.value();
|
222
|
+
var index = value.indexOf('?');
|
223
|
+
if (index != -1) {
|
224
|
+
value = value.substr(index + 1);
|
225
|
+
var params = value.split('&');
|
226
|
+
var p, i = params.length, r = [];
|
227
|
+
while(i--) {
|
228
|
+
p = params[i].split('=');
|
229
|
+
if (p[0] == param)
|
230
|
+
r.push(p[1]);
|
231
|
+
}
|
232
|
+
if (r.length != 0)
|
233
|
+
return r.length != 1 ? r : r[0];
|
234
|
+
}
|
235
|
+
},
|
236
|
+
parameterNames: function() {
|
237
|
+
var value = this.value();
|
238
|
+
var index = value.indexOf('?');
|
239
|
+
var names = [];
|
240
|
+
if (index != -1) {
|
241
|
+
value = value.substr(index + 1);
|
242
|
+
if (value != '' && value.indexOf('=') != -1) {
|
243
|
+
var params = value.split('&');
|
244
|
+
var i = 0;
|
245
|
+
while(i < params.length) {
|
246
|
+
names.push(params[i].split('=')[0]);
|
247
|
+
i++;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
}
|
251
|
+
return names;
|
252
|
+
}
|
253
|
+
};
|
254
|
+
|
255
|
+
var _setters = {
|
256
|
+
strict: function(strict) {
|
257
|
+
_opts.strict = strict;
|
258
|
+
},
|
259
|
+
history: function(history) {
|
260
|
+
_opts.history = history;
|
261
|
+
},
|
262
|
+
tracker: function(tracker) {
|
263
|
+
_opts.tracker = tracker;
|
264
|
+
},
|
265
|
+
title: function(title) {
|
266
|
+
title = _dc(title);
|
267
|
+
_st(function() {
|
268
|
+
_title = _d.title = title;
|
269
|
+
if (_juststart && _frame && _frame.contentWindow && _frame.contentWindow.document) {
|
270
|
+
_frame.contentWindow.document.title = title;
|
271
|
+
_juststart = FALSE;
|
272
|
+
}
|
273
|
+
if (!_justset && _mozilla)
|
274
|
+
_l.replace(_l.href.indexOf('#') != -1 ? _l.href : _l.href + '#');
|
275
|
+
_justset = FALSE;
|
276
|
+
}, 50);
|
277
|
+
},
|
278
|
+
value: function(value) {
|
279
|
+
value = _ec(_dc(_strictCheck(value, TRUE)));
|
280
|
+
if (value == '/') value = '';
|
281
|
+
if (_value == value) return;
|
282
|
+
_justset = TRUE;
|
283
|
+
_value = value;
|
284
|
+
_silent = TRUE;
|
285
|
+
_update(true);
|
286
|
+
_stack[_h.length] = _value;
|
287
|
+
if (_safari) {
|
288
|
+
if (_opts.history) {
|
289
|
+
_l[ID][_l.pathname] = _stack.toString();
|
290
|
+
_length = _h.length + 1;
|
291
|
+
if (_version < 418) {
|
292
|
+
if (_l.search == '') {
|
293
|
+
_form.action = '#' + _value;
|
294
|
+
_form.submit();
|
295
|
+
}
|
296
|
+
} else if (_version < 523 || _value == '') {
|
297
|
+
var evt = _d.createEvent('MouseEvents');
|
298
|
+
evt.initEvent('click', TRUE, TRUE);
|
299
|
+
var anchor = _d.createElement('a');
|
300
|
+
anchor.href = '#' + _value;
|
301
|
+
anchor.dispatchEvent(evt);
|
302
|
+
} else {
|
303
|
+
_l.hash = '#' + _value;
|
304
|
+
}
|
305
|
+
} else {
|
306
|
+
_l.replace('#' + _value);
|
307
|
+
}
|
308
|
+
} else if (_value != _getHash()) {
|
309
|
+
if (_opts.history)
|
310
|
+
_l.hash = '#' + _ieLocal(_value, TRUE);
|
311
|
+
else
|
312
|
+
_l.replace('#' + _value);
|
313
|
+
}
|
314
|
+
if ((_msie && _version < 8) && _opts.history) {
|
315
|
+
_st(_htmlWrite, 50);
|
316
|
+
}
|
317
|
+
if (_safari)
|
318
|
+
_st(function(){ _silent = FALSE; }, 1);
|
319
|
+
else
|
320
|
+
_silent = FALSE;
|
321
|
+
}
|
322
|
+
};
|
323
|
+
|
324
|
+
var ID = 'jQueryAddress',
|
325
|
+
FUNCTION = 'function',
|
326
|
+
UNDEFINED = 'undefined',
|
327
|
+
TRUE = true,
|
328
|
+
FALSE = false,
|
329
|
+
_browser = $.browser,
|
330
|
+
_version = parseFloat($.browser.version),
|
331
|
+
_mozilla = _browser.mozilla,
|
332
|
+
_msie = _browser.msie,
|
333
|
+
_opera = _browser.opera,
|
334
|
+
_safari = _browser.safari,
|
335
|
+
_supported = FALSE,
|
336
|
+
_t = _getWindow(),
|
337
|
+
_d = _t.document,
|
338
|
+
_h = _t.history,
|
339
|
+
_l = _t.location,
|
340
|
+
_si = setInterval,
|
341
|
+
_st = setTimeout,
|
342
|
+
_dc = decodeURI,
|
343
|
+
_ec = encodeURI,
|
344
|
+
_agent = navigator.userAgent,
|
345
|
+
_frame,
|
346
|
+
_form,
|
347
|
+
_url,
|
348
|
+
_title = _d.title,
|
349
|
+
_length = _h.length,
|
350
|
+
_silent = FALSE,
|
351
|
+
_loaded = FALSE,
|
352
|
+
_justset = TRUE,
|
353
|
+
_juststart = TRUE,
|
354
|
+
_stack = [],
|
355
|
+
_listeners = {},
|
356
|
+
_value = _getHash(),
|
357
|
+
_api = {},
|
358
|
+
_opts = {history: TRUE, strict: TRUE};
|
359
|
+
|
360
|
+
if (_msie) {
|
361
|
+
_version = parseFloat(_agent.substr(_agent.indexOf('MSIE') + 4));
|
362
|
+
if (_d.documentMode && _d.documentMode != _version)
|
363
|
+
_version = _d.documentMode != 8 ? 7 : 8;
|
364
|
+
}
|
365
|
+
|
366
|
+
_supported =
|
367
|
+
(_mozilla && _version >= 1) ||
|
368
|
+
(_msie && _version >= 6) ||
|
369
|
+
(_opera && _version >= 9.5) ||
|
370
|
+
(_safari && _version >= 312);
|
371
|
+
|
372
|
+
if (_supported) {
|
373
|
+
|
374
|
+
for (var i = 1; i < _length; i++)
|
375
|
+
_stack.push('');
|
376
|
+
|
377
|
+
_stack.push(_getHash());
|
378
|
+
|
379
|
+
if (_msie && _l.hash != _getHash())
|
380
|
+
_l.hash = '#' + _ieLocal(_getHash(), TRUE);
|
381
|
+
|
382
|
+
if (_opera)
|
383
|
+
history.navigationMode = 'compatible';
|
384
|
+
|
385
|
+
_searchScript(document);
|
386
|
+
var _qi = _url.indexOf('?');
|
387
|
+
if (_url && _qi > -1) {
|
388
|
+
var param, params = _url.substr(_qi + 1).split('&');
|
389
|
+
for (var i = 0, p; p = params[i]; i++) {
|
390
|
+
param = p.split('=');
|
391
|
+
if (/^(history|strict)$/.test(param[0])) {
|
392
|
+
_opts[param[0]] = (isNaN(param[1]) ? /^(true|yes)$/i.test(param[1]) : (parseInt(param[1]) != 0));
|
393
|
+
}
|
394
|
+
if (/^tracker$/.test(param[0]))
|
395
|
+
_opts[param[0]] = param[1];
|
396
|
+
}
|
397
|
+
}
|
398
|
+
|
399
|
+
$(_load);
|
400
|
+
|
401
|
+
} else if ((!_supported && _l.href.indexOf('#') != -1) ||
|
402
|
+
(_safari && _version < 418 && _l.href.indexOf('#') != -1 && _l.search != '')){
|
403
|
+
_d.open();
|
404
|
+
_d.write('<html><head><meta http-equiv="refresh" content="0;url=' +
|
405
|
+
_l.href.substr(0, _l.href.indexOf('#')) + '" /></head></html>');
|
406
|
+
_d.close();
|
407
|
+
} else {
|
408
|
+
_track();
|
409
|
+
}
|
410
|
+
|
411
|
+
$.each(('init,change,internalChange,externalChange').split(','), function(i, name){
|
412
|
+
_api[name] = function(data, fn){
|
413
|
+
$($.address).bind(name, fn || data, fn && data);
|
414
|
+
return this;
|
415
|
+
};
|
416
|
+
});
|
417
|
+
|
418
|
+
$.each(('strict,history,tracker,title,value').split(','), function(i, name){
|
419
|
+
_api[name] = function(value){
|
420
|
+
if (typeof value != 'undefined') {
|
421
|
+
if (_supported)
|
422
|
+
_setters[name](value);
|
423
|
+
return $.address;
|
424
|
+
} else {
|
425
|
+
return _getters[name]();
|
426
|
+
}
|
427
|
+
};
|
428
|
+
});
|
429
|
+
|
430
|
+
$.each(('baseURL,path,pathNames,queryString,parameter,parameterNames').split(','), function(i, name){
|
431
|
+
_api[name] = function(value){
|
432
|
+
return _getters[name](value);
|
433
|
+
};
|
434
|
+
});
|
435
|
+
|
436
|
+
return _api;
|
437
|
+
|
438
|
+
})();
|
439
|
+
|
440
|
+
$.fn.address = function (fn) {
|
441
|
+
$(this).click(function() {
|
442
|
+
var value = fn ? fn.call(this) :
|
443
|
+
/address:/.test($(this).attr('rel')) ? $(this).attr('rel').split('address:')[1].split(' ')[0] :
|
444
|
+
$(this).attr('href').replace(/^#/, '');
|
445
|
+
$.address.value(value);
|
446
|
+
return false;
|
447
|
+
});
|
448
|
+
};
|
449
|
+
|
450
|
+
}(jQuery));
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery Address Plugin v1.1
|
3
|
+
* http://www.asual.com/jquery/address/
|
4
|
+
*
|
5
|
+
* Copyright (c) 2009 Rostislav Hristov
|
6
|
+
* Dual licensed under the MIT and GPL licenses.
|
7
|
+
* http://docs.jquery.com/License
|
8
|
+
*
|
9
|
+
* Date: 2009-12-23 14:27:00 +0200 (Wed, 23 Dec 2009)
|
10
|
+
*/
|
11
|
+
(function(a){a.address=(function(){var c=function(i){a(this).trigger(a.extend(a.Event(i),(function(){var ah={value:this.value(),path:this.path(),pathNames:this.pathNames(),parameterNames:this.parameterNames(),parameters:{},queryString:this.queryString()};for(var ag=0,p=ah.parameterNames.length;ag<p;ag++){ah.parameters[ah.parameterNames[ag]]=this.parameter(ah.parameterNames[ag])}return ah}).call(this)))};var V=function(){c.call(a.address,"init")};var o=function(){c.call(a.address,"change")};var P=function(){var i=U.href.indexOf("#");return i!=-1?ae(q(U.href.substr(i+1))):""};var h=function(){try{return top.document!=undefined?top:window}catch(i){return window}};var F=function(p,i){if(C.strict){p=i?(p.substr(0,1)!="/"?"/"+p:p):(p==""?"/":p)}return p};var r=function(i,p){return(j&&U.protocol=="file:")?(p?Q.replace(/\?/,"%3F"):Q.replace(/%253F/,"?")):i};var af=function(ai){for(var ag=0,p=ai.childNodes.length,ah;ag<p;ag++){if(ai.childNodes[ag].src){l=String(ai.childNodes[ag].src)}if(ah=af(ai.childNodes[ag])){return ah}}};var X=function(){if(!t){var p=P();var i=!(Q==p);if(u&&s<523){if(E!=Y.length){E=Y.length;if(typeof z[E-1]!=G){Q=z[E-1]}T(false)}}else{if(j&&s<7&&i){U.reload()}else{if(i){Q=p;T(false)}}}}};var T=function(i){o();if(i){c.call(a.address,"internalChange")}else{c.call(a.address,"externalChange")}n(w,10)};var w=function(){var p=(U.pathname+(/\/$/.test(U.pathname)?"":"/")+D.value()).replace(/\/\//,"/").replace(/^\/$/,"");var i=window[C.tracker];if(typeof i==g){i(p)}else{if(typeof pageTracker!=G&&typeof pageTracker._trackPageview==g){pageTracker._trackPageview(p)}else{if(typeof urchinTracker==g){urchinTracker(p)}}}};var e=function(){var i=f.contentWindow.document;i.open();i.write("<html><head><title>"+ac.title+"</title><script>var "+x+' = "'+P()+'";<\/script></head></html>');i.close()};var N=function(){if(!S){S=B;if(j&&s<8){var i=ac.getElementsByTagName("frameset")[0];f=ac.createElement((i?"":"i")+"frame");if(i){i.insertAdjacentElement("beforeEnd",f);i[i.cols?"cols":"rows"]+=",0";f.src="javascript:false";f.noResize=true;f.frameBorder=f.frameSpacing=0}else{f.src="javascript:false";f.style.display="none";ac.body.insertAdjacentElement("afterBegin",f)}n(function(){a(f).bind("load",function(){var p=f.contentWindow;var ag=p.location.href;Q=(typeof p[x]!=G?p[x]:"");if(Q!=P()){T(false);U.hash=r(Q,B)}});if(typeof f.contentWindow[x]==G){e()}},50)}else{if(u){if(s<418){a(ac.body).append('<form id="'+x+'" style="position:absolute;top:-9999px;" method="get"></form>');J=ac.getElementById(x)}if(typeof U[x]==G){U[x]={}}if(typeof U[x][U.pathname]!=G){z=U[x][U.pathname].split(",")}}}n(function(){V();T(false)},1);if(j&&s>=8){ac.body.onhashchange=X}else{v(X,50)}a("a[rel*=address:]").address()}};var D={baseURL:function(){var i=U.href;if(i.indexOf("#")!=-1){i=i.substr(0,i.indexOf("#"))}if(i.substr(i.length-1)=="/"){i=i.substr(0,i.length-1)}return i},strict:function(){return C.strict},history:function(){return C.history},tracker:function(){return C.tracker},title:function(){return ac.title},value:function(){if(!ab){return null}return q(F(r(Q,Z),Z))},path:function(){var i=this.value();return(i.indexOf("?")!=-1)?i.split("?")[0]:i},pathNames:function(){var p=this.path();var i=p.split("/");if(p.substr(0,1)=="/"||p.length==0){i.splice(0,1)}if(p.substr(p.length-1,1)=="/"){i.splice(i.length-1,1)}return i},queryString:function(){var p=this.value();var i=p.indexOf("?");if(i!=-1&&i<p.length){return p.substr(i+1)}},parameter:function(am){var aj=this.value();var ag=aj.indexOf("?");if(ag!=-1){aj=aj.substr(ag+1);var al=aj.split("&");var ak,ah=al.length,ai=[];while(ah--){ak=al[ah].split("=");if(ak[0]==am){ai.push(ak[1])}}if(ai.length!=0){return ai.length!=1?ai:ai[0]}}},parameterNames:function(){var ah=this.value();var p=ah.indexOf("?");var ai=[];if(p!=-1){ah=ah.substr(p+1);if(ah!=""&&ah.indexOf("=")!=-1){var aj=ah.split("&");var ag=0;while(ag<aj.length){ai.push(aj[ag].split("=")[0]);ag++}}}return ai}};var H={strict:function(i){C.strict=i},history:function(i){C.history=i},tracker:function(i){C.tracker=i},title:function(i){i=q(i);n(function(){I=ac.title=i;if(K&&f&&f.contentWindow&&f.contentWindow.document){f.contentWindow.document.title=i;K=Z}if(!M&&aa){U.replace(U.href.indexOf("#")!=-1?U.href:U.href+"#")}M=Z},50)},value:function(ag){ag=ae(q(F(ag,B)));if(ag=="/"){ag=""}if(Q==ag){return}M=B;Q=ag;t=B;T(true);z[Y.length]=Q;if(u){if(C.history){U[x][U.pathname]=z.toString();E=Y.length+1;if(s<418){if(U.search==""){J.action="#"+Q;J.submit()}}else{if(s<523||Q==""){var i=ac.createEvent("MouseEvents");i.initEvent("click",B,B);var p=ac.createElement("a");p.href="#"+Q;p.dispatchEvent(i)}else{U.hash="#"+Q}}}else{U.replace("#"+Q)}}else{if(Q!=P()){if(C.history){U.hash="#"+r(Q,B)}else{U.replace("#"+Q)}}}if((j&&s<8)&&C.history){n(e,50)}if(u){n(function(){t=Z},1)}else{t=Z}}};var x="jQueryAddress",g="function",G="undefined",B=true,Z=false,A=a.browser,s=parseFloat(a.browser.version),aa=A.mozilla,j=A.msie,L=A.opera,u=A.safari,ab=Z,O=h(),ac=O.document,Y=O.history,U=O.location,v=setInterval,n=setTimeout,q=decodeURI,ae=encodeURI,ad=navigator.userAgent,f,J,l,I=ac.title,E=Y.length,t=Z,S=Z,M=B,K=B,z=[],y={},Q=P(),k={},C={history:B,strict:B};if(j){s=parseFloat(ad.substr(ad.indexOf("MSIE")+4));if(ac.documentMode&&ac.documentMode!=s){s=ac.documentMode!=8?7:8}}ab=(aa&&s>=1)||(j&&s>=6)||(L&&s>=9.5)||(u&&s>=312);if(ab){for(var W=1;W<E;W++){z.push("")}z.push(P());if(j&&U.hash!=P()){U.hash="#"+r(P(),B)}if(L){history.navigationMode="compatible"}af(document);var b=l.indexOf("?");if(l&&b>-1){var m,d=l.substr(b+1).split("&");for(var W=0,R;R=d[W];W++){m=R.split("=");if(/^(history|strict)$/.test(m[0])){C[m[0]]=(isNaN(m[1])?/^(true|yes)$/i.test(m[1]):(parseInt(m[1])!=0))}if(/^tracker$/.test(m[0])){C[m[0]]=m[1]}}}a(N)}else{if((!ab&&U.href.indexOf("#")!=-1)||(u&&s<418&&U.href.indexOf("#")!=-1&&U.search!="")){ac.open();ac.write('<html><head><meta http-equiv="refresh" content="0;url='+U.href.substr(0,U.href.indexOf("#"))+'" /></head></html>');ac.close()}else{w()}}a.each(("init,change,internalChange,externalChange").split(","),function(ag,p){k[p]=function(ah,i){a(a.address).bind(p,i||ah,i&&ah);return this}});a.each(("strict,history,tracker,title,value").split(","),function(ag,p){k[p]=function(i){if(typeof i!="undefined"){if(ab){H[p](i)}return a.address}else{return D[p]()}}});a.each(("baseURL,path,pathNames,queryString,parameter,parameterNames").split(","),function(ag,p){k[p]=function(i){return D[p](i)}});return k})();a.fn.address=function(b){a(this).click(function(){var c=b?b.call(this):/address:/.test(a(this).attr("rel"))?a(this).attr("rel").split("address:")[1].split(" ")[0]:a(this).attr("href").replace(/^#/,"");a.address.value(c);return false})}}(jQuery));
|