| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137 |
- (function($,window){
- '$:nomunge';
-
-
- var undefined,
- aps = Array.prototype.slice,
- decode = decodeURIComponent,
-
-
- jq_param = $.param,
- jq_param_fragment,
- jq_deparam,
- jq_deparam_fragment,
- jq_bbq = $.bbq = $.bbq || {},
- jq_bbq_pushState,
- jq_bbq_getState,
- jq_elemUrlAttr,
- jq_event_special = $.event.special,
-
-
- str_hashchange = 'hashchange',
- str_querystring = 'querystring',
- str_fragment = 'fragment',
- str_elemUrlAttr = 'elemUrlAttr',
- str_location = 'location',
- str_href = 'href',
- str_src = 'src',
-
-
- re_trim_querystring = /^.*\?|#.*$/g,
- re_trim_fragment = /^.*\#/,
- re_no_escape,
-
-
- elemUrlAttr_cache = {};
-
-
-
- function is_string( arg ) {
- return typeof arg === 'string';
- };
-
-
-
- function curry( func ) {
- var args = aps.call( arguments, 1 );
-
- return function() {
- return func.apply( this, args.concat( aps.call( arguments ) ) );
- };
- };
-
-
-
- function get_fragment( url ) {
- return url.replace( /^[^#]*#?(.*)$/, '$1' );
- };
-
-
-
- function get_querystring( url ) {
- return url.replace( /(?:^[^?#]*\?([^#]*).*$)?.*/, '$1' );
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- function jq_param_sub( is_fragment, get_func, url, params, merge_mode ) {
- var result,
- qs,
- matches,
- url_params,
- hash;
-
- if ( params !== undefined ) {
-
-
-
-
-
- matches = url.match( is_fragment ? /^([^#]*)\#?(.*)$/ : /^([^#?]*)\??([^#]*)(#?.*)/ );
-
-
- hash = matches[3] || '';
-
- if ( merge_mode === 2 && is_string( params ) ) {
-
-
- qs = params.replace( is_fragment ? re_trim_fragment : re_trim_querystring, '' );
-
- } else {
-
- url_params = jq_deparam( matches[2] );
-
- params = is_string( params )
-
-
- ? jq_deparam[ is_fragment ? str_fragment : str_querystring ]( params )
-
-
- : params;
-
- qs = merge_mode === 2 ? params
- : merge_mode === 1 ? $.extend( {}, params, url_params )
- : $.extend( {}, url_params, params );
-
-
- qs = jq_param( qs );
-
-
-
-
- if ( is_fragment ) {
- qs = qs.replace( re_no_escape, decode );
- }
- }
-
-
-
-
- result = matches[1] + ( is_fragment ? '#' : qs || !matches[1] ? '?' : '' ) + qs + hash;
-
- } else {
-
-
- result = get_func( url !== undefined ? url : window[ str_location ][ str_href ] );
- }
-
- return result;
- };
-
- jq_param[ str_querystring ] = curry( jq_param_sub, 0, get_querystring );
- jq_param[ str_fragment ] = jq_param_fragment = curry( jq_param_sub, 1, get_fragment );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- jq_param_fragment.noEscape = function( chars ) {
- chars = chars || '';
- var arr = $.map( chars.split(''), encodeURIComponent );
- re_no_escape = new RegExp( arr.join('|'), 'g' );
- };
-
-
-
- jq_param_fragment.noEscape( ',/' );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $.deparam = jq_deparam = function( params, coerce ) {
- var obj = {},
- coerce_types = { 'true': !0, 'false': !1, 'null': null };
-
-
- $.each( params.replace( /\+/g, ' ' ).split( '&' ), function(j,v){
- var param = v.split( '=' ),
- key = decode( param[0] ),
- val,
- cur = obj,
- i = 0,
-
-
-
- keys = key.split( '][' ),
- keys_last = keys.length - 1;
-
-
-
- if ( /\[/.test( keys[0] ) && /\]$/.test( keys[ keys_last ] ) ) {
-
- keys[ keys_last ] = keys[ keys_last ].replace( /\]$/, '' );
-
-
-
- keys = keys.shift().split('[').concat( keys );
-
- keys_last = keys.length - 1;
- } else {
-
- keys_last = 0;
- }
-
-
- if ( param.length === 2 ) {
- val = decode( param[1] );
-
-
- if ( coerce ) {
- val = val && !isNaN(val) ? +val
- : val === 'undefined' ? undefined
- : coerce_types[val] !== undefined ? coerce_types[val]
- : val;
- }
-
- if ( keys_last ) {
-
-
-
-
-
-
-
-
-
- for ( ; i <= keys_last; i++ ) {
- key = keys[i] === '' ? cur.length : keys[i];
- cur = cur[key] = i < keys_last
- ? cur[key] || ( keys[i+1] && isNaN( keys[i+1] ) ? {} : [] )
- : val;
- }
-
- } else {
-
-
-
- if ( $.isArray( obj[key] ) ) {
-
- obj[key].push( val );
-
- } else if ( obj[key] !== undefined ) {
-
-
- obj[key] = [ obj[key], val ];
-
- } else {
-
- obj[key] = val;
- }
- }
-
- } else if ( key ) {
-
- obj[key] = coerce
- ? undefined
- : '';
- }
- });
-
- return obj;
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- function jq_deparam_sub( is_fragment, url_or_params, coerce ) {
- if ( url_or_params === undefined || typeof url_or_params === 'boolean' ) {
-
- coerce = url_or_params;
- url_or_params = jq_param[ is_fragment ? str_fragment : str_querystring ]();
- } else {
- url_or_params = is_string( url_or_params )
- ? url_or_params.replace( is_fragment ? re_trim_fragment : re_trim_querystring, '' )
- : url_or_params;
- }
-
- return jq_deparam( url_or_params, coerce );
- };
-
- jq_deparam[ str_querystring ] = curry( jq_deparam_sub, 0 );
- jq_deparam[ str_fragment ] = jq_deparam_fragment = curry( jq_deparam_sub, 1 );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $[ str_elemUrlAttr ] || ($[ str_elemUrlAttr ] = function( obj ) {
- return $.extend( elemUrlAttr_cache, obj );
- })({
- a: str_href,
- base: str_href,
- iframe: str_src,
- img: str_src,
- input: str_src,
- form: 'action',
- link: str_href,
- script: str_src
- });
-
- jq_elemUrlAttr = $[ str_elemUrlAttr ];
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- function jq_fn_sub( mode, force_attr, params, merge_mode ) {
- if ( !is_string( params ) && typeof params !== 'object' ) {
-
- merge_mode = params;
- params = force_attr;
- force_attr = undefined;
- }
-
- return this.each(function(){
- var that = $(this),
-
-
- attr = force_attr || jq_elemUrlAttr()[ ( this.nodeName || '' ).toLowerCase() ] || '',
-
-
- url = attr && that.attr( attr ) || '';
-
-
- that.attr( attr, jq_param[ mode ]( url, params, merge_mode ) );
- });
-
- };
-
- $.fn[ str_querystring ] = curry( jq_fn_sub, str_querystring );
- $.fn[ str_fragment ] = curry( jq_fn_sub, str_fragment );
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- jq_bbq.pushState = jq_bbq_pushState = function( params, merge_mode ) {
- if ( is_string( params ) && /^#/.test( params ) && merge_mode === undefined ) {
-
-
- merge_mode = 2;
- }
-
- var has_args = params !== undefined,
-
- url = jq_param_fragment( window[ str_location ][ str_href ],
- has_args ? params : {}, has_args ? merge_mode : 2 );
-
-
-
-
- window[ str_location ][ str_href ] = url + ( /#/.test( url ) ? '' : '#' );
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- jq_bbq.getState = jq_bbq_getState = function( key, coerce ) {
- return key === undefined || typeof key === 'boolean'
- ? jq_deparam_fragment( key )
- : jq_deparam_fragment( coerce )[ key ];
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- jq_bbq.removeState = function( arr ) {
- var state = {};
-
-
- if ( arr !== undefined ) {
-
-
- state = jq_bbq_getState();
-
-
-
- $.each( $.isArray( arr ) ? arr : arguments, function(i,v){
- delete state[ v ];
- });
- }
-
-
- jq_bbq_pushState( state, 2 );
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- jq_event_special[ str_hashchange ] = $.extend( jq_event_special[ str_hashchange ], {
-
-
-
-
- add: function( handleObj ) {
- var old_handler;
-
- function new_handler(e) {
-
-
- var hash = e[ str_fragment ] = jq_param_fragment();
-
-
-
- e.getState = function( key, coerce ) {
- return key === undefined || typeof key === 'boolean'
- ? jq_deparam( hash, key )
- : jq_deparam( hash, coerce )[ key ];
- };
-
- old_handler.apply( this, arguments );
- };
-
-
-
- if ( $.isFunction( handleObj ) ) {
-
- old_handler = handleObj;
- return new_handler;
- } else {
-
- old_handler = handleObj.handler;
- handleObj.handler = new_handler;
- }
- }
-
- });
-
- })(jQuery,this);
- (function($,window,undefined){
- '$:nomunge';
-
-
- var fake_onhashchange,
- jq_event_special = $.event.special,
-
-
- str_location = 'location',
- str_hashchange = 'hashchange',
- str_href = 'href',
-
-
-
- browser = $.browser,
- mode = document.documentMode,
- is_old_ie = browser && browser.msie && ( mode === undefined || mode < 8 ),
-
-
-
- supports_onhashchange = 'on' + str_hashchange in window && !is_old_ie;
-
-
-
- function get_fragment( url ) {
- url = url || window[ str_location ][ str_href ];
- return url.replace( /^[^#]*#?(.*)$/, '$1' );
- };
-
-
-
-
-
-
- $[ str_hashchange + 'Delay' ] = 100;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- jq_event_special[ str_hashchange ] = $.extend( jq_event_special[ str_hashchange ], {
-
-
- setup: function() {
-
- if ( supports_onhashchange ) { return false; }
-
-
-
-
- $( fake_onhashchange.start );
- },
-
-
- teardown: function() {
-
- if ( supports_onhashchange ) { return false; }
-
-
- $( fake_onhashchange.stop );
- }
-
- });
-
-
-
-
-
- fake_onhashchange = (function(){
- var self = {},
- timeout_id,
- iframe,
- set_history,
- get_history;
-
-
- function init(){
-
- set_history = get_history = function(val){ return val; };
-
-
- if ( is_old_ie ) {
-
-
-
- iframe = $('<iframe src="javascript:0"/>').hide().insertAfter( 'body' )[0].contentWindow;
-
-
- get_history = function() {
- return get_fragment( iframe.document[ str_location ][ str_href ] );
- };
-
-
-
- set_history = function( hash, history_hash ) {
- if ( hash !== history_hash ) {
- var doc = iframe.document;
- doc.open().close();
- doc[ str_location ].hash = '#' + hash;
- }
- };
-
-
- set_history( get_fragment() );
- }
- };
-
-
- self.start = function() {
-
- if ( timeout_id ) { return; }
-
-
- var last_hash = get_fragment();
-
-
- set_history || init();
-
-
-
-
- (function loopy(){
- var hash = get_fragment(),
- history_hash = get_history( last_hash );
-
- if ( hash !== last_hash ) {
- set_history( last_hash = hash, history_hash );
-
- $(window).trigger( str_hashchange );
-
- } else if ( history_hash !== last_hash ) {
- window[ str_location ][ str_href ] = window[ str_location ][ str_href ].replace( /#.*/, '' ) + '#' + history_hash;
- }
-
- timeout_id = setTimeout( loopy, $[ str_hashchange + 'Delay' ] );
- })();
- };
-
-
-
-
- self.stop = function() {
- if ( !iframe ) {
- timeout_id && clearTimeout( timeout_id );
- timeout_id = 0;
- }
- };
-
- return self;
- })();
-
- })(jQuery,this);
|