1 Star 0 Fork 10

Jackey870/iQuery

forked from 南漂一卒/iQuery 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
iQuery.js 152.45 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037
//
// >>> iQuery.js <<<
//
//
// [Version] v2.0 (2016-12-28) Stable
//
// [Usage] A Light-weight jQuery Compatible API
// with IE 8+ compatibility.
//
//
// (C)2015-2016 shiy2008@gmail.com
//
(function () {
if ((typeof this.define != 'function') || (! this.define.amd))
arguments[0]();
else
this.define('iQuery', arguments[0]);
})(function () {
var iQuery = {fn: {
jquery: '1.9.1',
iquery: 2.0
}};
(function (BOM, DOM) {
/* ----- Object Patch ----- */
if (! Object.keys)
Object.keys = function (iObject) {
var iKey = [ ];
for (var _Key_ in iObject)
if ( this.prototype.hasOwnProperty.call(iObject, _Key_) )
iKey.push(_Key_);
return iKey;
};
Object.getPrototypeOf = Object.getPrototypeOf || function (iObject) {
return (iObject != null) && (
iObject.constructor.prototype || iObject.__proto__
);
};
Object.create = Object.create || function (iProto, iProperty) {
if (typeof iProto != 'object')
throw TypeError('Object prototype may only be an Object or null');
function iTemp() { }
iTemp.prototype = iProto;
var iObject = new iTemp();
for (var iKey in iProperty)
if (
this.prototype.hasOwnProperty.call(iProperty, iKey) &&
(iProperty[iKey].value !== undefined)
)
iObject[iKey] = iProperty[iKey].value;
return iObject;
};
/* ----- String Extension ----- */
var _Trim_ = ''.trim;
var Blank_Char = (! _Trim_) && /(^\s*)|(\s*$)/g;
String.prototype.trim = function (iChar) {
if (! iChar)
return _Trim_ ? _Trim_.call(this) : this.replace(Blank_Char, '');
var iFrom = 0, iTo;
for (var i = 0; iChar[i]; i++) {
if ((! iFrom) && (this[0] == iChar[i]))
iFrom = 1;
if ((! iTo) && (this[this.length - 1] == iChar[i]))
iTo = -1;
if (iFrom && iTo) break;
}
return this.slice(iFrom, iTo);
};
String.prototype.repeat = String.prototype.repeat || function (Times) {
return (new Array(Times + 1)).join(this);
};
/* ----- Array Extension ----- */
Array.prototype.indexOf = Array.prototype.indexOf || function () {
for (var i = 0; i < this.length; i++)
if (arguments[0] === this[i])
return i;
return -1;
};
Array.prototype.reduce = Array.prototype.reduce || function () {
var iResult = arguments[1];
for (var i = 1; i < this.length; i++) {
if (i == 1) iResult = this[0];
iResult = arguments[0](iResult, this[i], i, this);
}
return iResult;
};
/* ----- Function Extension ----- */
function FuncName() {
return (this.toString().trim().match(/^function\s+([^\(\s]*)/) || '')[1];
}
if (! ('name' in Function.prototype)) {
if (DOM.documentMode > 8)
Object.defineProperty(Function.prototype, 'name', {get: FuncName});
else
Function.prototype.name = FuncName;
}
/* ----- Date Extension ----- */
Date.now = Date.now || function () { return +(new Date()); };
})(self, self.document);
(function (BOM, DOM) {
if (BOM.Promise) return BOM.Promise;
function Promise(iMain) {
var _Self_ = arguments.callee,
_This_ = {
_public_: this,
state: -1,
value: undefined,
callback: [ ]
};
this.then = function (onResolve, onReject) {
return new _Self_(function (iResolve, iReject) {
var _CB_ = [onResolve, onReject, iResolve, iReject];
if (_This_.state == -1)
_This_.callback.push(_CB_);
else
_Complete_.call(_This_, _CB_);
});
};
BOM.setTimeout(function () {
iMain(function () {
_Complete_All_.call(_This_, 0, arguments[0]);
}, function () {
_Complete_All_.call(_This_, 1, arguments[0]);
});
});
}
function _Complete_(_CB_) {
var _Value_;
try {
if (typeof _CB_[this.state] == 'function') {
_Value_ = _CB_[this.state]( this.value );
if (_Value_ === this._public_)
throw TypeError("Can't return the same Promise object !");
if (typeof (_Value_ || '').then == 'function')
return _Value_.then(_CB_[2], _CB_[3]);
} else
_Value_ = this.value;
_CB_[2](_Value_);
} catch (iError) {
_CB_[3]( iError );
}
}
function _Complete_All_(iType) {
if (this.state > -1) return;
this.state = iType; this.value = arguments[1];
while ( this.callback[0] )
_Complete_.call(this, this.callback.shift());
}
Promise.resolve = function (iValue) {
if (iValue instanceof this) return iValue;
if (typeof (iValue || '').then == 'function')
return new this(function () {
iValue.then.apply(iValue, arguments);
});
return new this(function (iResolve) {
BOM.setTimeout(function () {
iResolve(iValue);
});
});
};
Promise.reject = function (iValue) {
if (typeof (iValue || '').then == 'function')
return new this(function () {
iValue.then.apply(iValue, arguments);
});
return new this(function (_, iReject) {
BOM.setTimeout(function () {
iReject(iValue);
});
});
};
Promise.all = function (pList) {
var _Result_ = [ ];
for (var i = 0; i < pList.length; i++)
if ((! pList[i]) || (typeof pList[i].then != 'function'))
pList[i] = this.resolve( pList[i] );
return i ? new this(function (iResolved, iReject) {
' '.repeat( pList.length ).replace(/ /g, function (_, Index) {
pList[Index].then(function () {
_Result_[Index] = arguments[0];
if (_Result_.length == pList.length)
iResolved(_Result_);
}, iReject);
});
}) : this.resolve(pList);
};
return BOM.Promise = Promise;
})(self, self.document);
(function (BOM, DOM, $) {
var UA = BOM.navigator.userAgent;
var is_Trident = UA.match(/MSIE (\d+)|Trident[^\)]+rv:(\d+)|Edge\/(\d+)\./i),
is_Gecko = UA.match(/; rv:(\d+)[^\/]+Gecko\/\d+/),
is_Webkit = UA.match(/AppleWebkit\/(\d+\.\d+)/i);
var IE_Ver = is_Trident ? Number(is_Trident[1] || is_Trident[2]) : NaN,
FF_Ver = is_Gecko ? Number(is_Gecko[1]) : NaN,
WK_Ver = is_Webkit ? parseFloat(is_Webkit[1]) : NaN;
var is_Pad = UA.match(/Tablet|Pad|Book|Android 3/i),
is_Phone = UA.match(/Phone|Touch|Android 2|Symbian/i);
var is_Mobile = (
is_Pad || is_Phone || UA.match(/Mobile/i)
) && (! UA.match(/ PC /));
var is_iOS = UA.match(/(iTouch|iPhone|iPad|iWatch);[^\)]+CPU[^\)]+OS (\d+_\d+)/i),
is_Android = UA.match(/(Android |Silk\/)(\d+\.\d+)/i);
$.browser = {
msie: IE_Ver,
mozilla: FF_Ver,
webkit: WK_Ver,
modern: ! (IE_Ver < 9),
mobile: !! is_Mobile,
pad: !! is_Pad,
phone: !! is_Phone,
ios: is_iOS ? parseFloat( is_iOS[2].replace('_', '.') ) : NaN,
android: is_Android ? parseFloat(is_Android[2]) : NaN,
versionNumber: IE_Ver || FF_Ver || WK_Ver
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
$.likeArray = function (iObject) {
if ((! iObject) || (typeof iObject != 'object'))
return false;
iObject = (typeof iObject.valueOf == 'function') ?
iObject.valueOf() : iObject;
return Boolean(
iObject &&
(typeof iObject.length == 'number') &&
(typeof iObject != 'string')
);
};
$.makeSet = function () {
var iArgs = arguments, iValue = true, iSet = { };
if (this.likeArray( iArgs[1] )) {
iValue = iArgs[0];
iArgs = iArgs[1];
} else if (this.likeArray( iArgs[0] )) {
iValue = iArgs[1];
iArgs = iArgs[0];
}
for (var i = 0; i < iArgs.length; i++)
iSet[ iArgs[i] ] = (typeof iValue != 'function') ?
iValue : iValue( iArgs[i] );
return iSet;
};
var DataType = $.makeSet('string', 'number', 'boolean');
$.isData = function (iValue) {
var iType = typeof iValue;
return Boolean(iValue) || (iType in DataType) || (
(iValue !== null) && (iType == 'object') &&
(typeof iValue.valueOf() in DataType)
);
};
$.isEqual = function (iLeft, iRight, iDepth) {
iDepth = iDepth || 1;
if (! (iLeft && iRight))
return (iLeft === iRight);
iLeft = iLeft.valueOf(); iRight = iRight.valueOf();
if ((typeof iLeft != 'object') || (typeof iRight != 'object'))
return (iLeft === iRight);
var Left_Key = Object.keys(iLeft), Right_Key = Object.keys(iRight);
if (Left_Key.length != Right_Key.length) return false;
Left_Key.sort(); Right_Key.sort(); --iDepth;
for (var i = 0, _Key_; i < Left_Key.length; i++) {
_Key_ = Left_Key[i];
if (_Key_ != Right_Key[i]) return false;
if (! iDepth) {
if (iLeft[_Key_] !== iRight[_Key_]) return false;
} else {
if (! arguments.callee.call(
this, iLeft[_Key_], iRight[_Key_], iDepth
))
return false;
}
}
return true;
};
$.trace = function (iObject, iName, iCount, iCallback) {
if (typeof iCount == 'function') iCallback = iCount;
iCount = parseInt(iCount);
iCount = isNaN(iCount) ? Infinity : iCount;
var iResult = [ ];
for (
var _Next_, i = 0, j = 0;
iObject[iName] && (j < iCount);
iObject = _Next_, i++
) {
_Next_ = iObject[iName];
if (
(typeof iCallback != 'function') ||
(iCallback.call(_Next_, i, _Next_) !== false)
)
iResult[j++] = _Next_;
}
return iResult;
};
if ($.fn.iquery) $.dir = $.trace;
$.intersect = function () {
if (arguments.length < 2) return arguments[0];
var iArgs = this.makeArray( arguments );
var iArray = this.likeArray( iArgs[0] );
iArgs[0] = this.map(iArgs.shift(), function (iValue, iKey) {
if ( iArray ) {
if (iArgs.indexOf.call(iArgs[0], iValue) > -1)
return iValue;
} else if (
(iArgs[0][iKey] !== undefined) &&
(iArgs[0][iKey] === iValue)
)
return iValue;
});
return arguments.callee.apply(this, iArgs);
};
$.inherit = function (iSup, iSub, iStatic, iProto) {
for (var iKey in iSup)
if (iSup.hasOwnProperty( iKey )) iSub[iKey] = iSup[iKey];
for (var iKey in iStatic) iSub[iKey] = iStatic[iKey];
iSub.prototype = Object.create( iSup.prototype );
iSub.prototype.constructor = iSub;
for (var iKey in iProto) iSub.prototype[iKey] = iProto[iKey];
return iSub;
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
$.isPlainObject = function (iValue) {
return iValue && (typeof iValue == 'object') && (
Object.getPrototypeOf(iValue) === Object.prototype
);
};
function _Extend_(iTarget, iSource, iDeep) {
iTarget = ((! iTarget) && (iSource instanceof Array)) ?
[ ] : Object(iTarget);
iSource = Object(iSource);
for (var iKey in iSource)
if (
(iSource[iKey] !== undefined) &&
Object.prototype.hasOwnProperty.call(iSource, iKey)
) {
iTarget[iKey] = (iDeep && (
(iSource[iKey] instanceof Array) ||
$.isPlainObject( iSource[iKey] )
)) ?
arguments.callee(iTarget[iKey], iSource[iKey], iDeep) :
iSource[iKey];
}
return iTarget;
}
$.makeArray = $.browser.modern ?
function () {
return Array.apply(null, arguments[0]);
} :
function () {
return _Extend_([ ], arguments[0]);
};
$.fn.extend = $.extend = function () {
var iArgs = $.makeArray( arguments );
var iDeep = (iArgs[0] === true) && iArgs.shift();
if (iArgs.length < 2) iArgs.unshift(this);
for (var i = 1; i < iArgs.length; i++)
iArgs[0] = _Extend_(iArgs[0], iArgs[i], iDeep);
return iArgs[0];
};
$.extend({
type: function (iValue) {
if (iValue === null) return 'null';
var iType = typeof (
(iValue && iValue.valueOf) ? iValue.valueOf() : iValue
);
return (iType != 'object') ? iType :
Object.prototype.toString.call(iValue)
.split(' ')[1].slice(0, -1).toLowerCase();
},
isNumeric: function (iValue) {
iValue = (iValue && iValue.valueOf) ? iValue.valueOf() : iValue;
if ((iValue === '') || (iValue === Infinity) || isNaN(iValue))
return false;
switch (typeof iValue) {
case 'string': break;
case 'number': break;
default: return false;
}
return (typeof +iValue == 'number');
},
isEmptyObject: function () {
for (var iKey in arguments[0])
return false;
return true;
},
each: function (Arr_Obj, iEvery) {
if (this.likeArray( Arr_Obj ))
for (var i = 0; i < Arr_Obj.length; i++) try {
if (false === iEvery.call(Arr_Obj[i], i, Arr_Obj[i]))
break;
} catch (iError) {
console.dir( iError.valueOf() );
}
else
for (var iKey in Arr_Obj) try {
if (false === iEvery.call(
Arr_Obj[iKey], iKey, Arr_Obj[iKey]
))
break;
} catch (iError) {
console.dir( iError.valueOf() );
}
return Arr_Obj;
},
map: function (iSource, iCallback) {
var iTarget = { }, iArray;
if (this.likeArray( iSource )) {
iTarget = [ ];
iArray = true;
}
if (typeof iCallback == 'function')
this.each(iSource, function (iKey) {
if (this === undefined) return;
var _Element_ = iCallback(arguments[1], iKey, iSource);
if (_Element_ != null)
if (iArray)
iTarget = iTarget.concat(_Element_);
else
iTarget[iKey] = _Element_;
});
return iTarget;
},
inArray: function () {
return Array.prototype.indexOf.call(arguments[1], arguments[0]);
},
merge: function (iSource) {
if (! (iSource instanceof Array))
iSource = this.makeArray(iSource);
for (var i = 1; i < arguments.length; i++)
Array.prototype.splice.apply(iSource, Array.prototype.concat.apply(
[iSource.length, 0],
($.likeArray( arguments[i] ) && (! $.browser.modern)) ?
$.makeArray( arguments[i] ) : arguments[i]
));
return iSource;
},
unique: function (iArray) {
var iResult = [ ];
for (var i = iArray.length - 1, j = 0; i > -1 ; i--)
if (this.inArray(iArray[i], iArray) == i)
iResult[j++] = iArray[i];
return iResult.reverse();
}
});
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
$.extend({
trim: function () {
return arguments[0].trim();
},
camelCase: function () {
var iName = arguments[0].split(arguments[1] || '-');
for (var i = 1; i < iName.length; i++)
iName[i] = iName[i][0].toUpperCase() + iName[i].slice(1);
return iName.join('');
},
parseJSON: function (iJSON) {
return BOM.JSON.parse(iJSON, function (iKey, iValue) {
if (iKey && (typeof iValue == 'string')) try {
return BOM.JSON.parse(iValue);
} catch (iError) { }
return iValue;
});
},
parseXML: function (iString) {
iString = iString.trim();
if ((iString[0] != '<') || (iString[iString.length - 1] != '>'))
throw 'Illegal XML Format...';
var iXML = (new BOM.DOMParser()).parseFromString(iString, 'text/xml');
var iError = iXML.getElementsByTagName('parsererror');
if (iError.length)
throw new SyntaxError(1, iError[0].childNodes[1].nodeValue);
iXML.cookie; // for old WebKit core to throw Error
return iXML;
},
param: function (iObject) {
var iParameter = [ ], iValue;
if ($.isPlainObject( iObject ))
for (var iName in iObject) {
iValue = iObject[iName];
if ( $.isPlainObject(iValue) )
iValue = BOM.JSON.stringify(iValue);
else if (! $.isData(iValue))
continue;
iParameter.push(iName + '=' + BOM.encodeURIComponent(iValue));
}
else if ($.likeArray( iObject ))
for (var i = 0, j = 0; i < iObject.length; i++)
iParameter[j++] = iObject[i].name + '=' +
BOM.encodeURIComponent( iObject[i].value );
return iParameter.join('&');
},
contains: function (iParent, iChild) {
if (! iChild) return false;
if ($.browser.modern)
return !!(iParent.compareDocumentPosition(iChild) & 16);
else
return (iParent !== iChild) && iParent.contains(iChild);
}
});
/* ---------- Function Wrapper ---------- */
var ProxyCache = {
origin: [ ],
wrapper: [ ]
};
$.proxy = function (iFunction, iContext) {
var iArgs = $.makeArray(arguments);
for (var i = 0; i < ProxyCache.origin.length; i++)
if ($.isEqual(ProxyCache.origin[i], iArgs))
return ProxyCache.wrapper[i];
var Index = ProxyCache.origin.push( iArgs ) - 1;
iArgs = iArgs.slice(2);
return ProxyCache.wrapper[Index] = function () {
return iFunction.apply(
iContext || this, $.merge([ ], iArgs, arguments)
);
};
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
var WindowType = $.makeSet('Window', 'DOMWindow', 'Global');
$.extend({
Type: function (iVar) {
var iType;
try {
iType = $.type( iVar );
var iName = iVar.constructor.name;
iName = (typeof iName == 'function') ?
iName.call( iVar.constructor ) : iName;
if ((iType == 'object') && iName)
iType = iName;
else
iType = iType[0].toUpperCase() + iType.slice(1);
} catch (iError) {
return 'Window';
}
if (! iVar)
return (isNaN(iVar) && (iVar !== iVar)) ? 'NaN' : iType;
if (WindowType[iType] || (
(iVar == iVar.document) && (iVar.document != iVar) // IE 9- Hack
))
return 'Window';
if (iVar.location && (iVar.location === (
iVar.defaultView || iVar.parentWindow || { }
).location))
return 'Document';
if (
iType.match(/HTML\w+?Element$/) ||
(typeof iVar.tagName == 'string')
)
return 'HTMLElement';
if ( this.likeArray(iVar) ) {
iType = 'Array';
if ($.browser.msie < 10) try {
iVar.item();
try {
iVar.namedItem();
return 'HTMLCollection';
} catch (iError) {
return 'NodeList';
}
} catch (iError) { }
}
return iType;
},
split: function (iString, iSplit, iLimit, iJoin) {
iString = iString.split(iSplit);
if (iLimit) {
iString[iLimit - 1] = iString.slice(iLimit - 1).join(
(typeof iJoin == 'string') ? iJoin : iSplit
);
iString.length = iLimit;
}
return iString;
},
hyphenCase: function () {
return arguments[0].replace(/([a-z0-9])[\s_]?([A-Z])/g, function () {
return arguments[1] + '-' + arguments[2].toLowerCase();
});
},
byteLength: function () {
return arguments[0].replace(
/[^\u0021-\u007e\uff61-\uffef]/g, 'xx'
).length;
},
leftPad: function (iRaw, iLength, iPad) {
iPad += '';
if (! iPad) {
if ($.isNumeric( iRaw ))
iPad = '0';
else if (typeof iRaw == 'string')
iPad = ' ';
}
iRaw += '', iLength *= 1;
if (iRaw.length >= iLength) return iRaw;
return iPad.repeat(
Math.ceil((iLength -= iRaw.length) / iPad.length)
).slice(-iLength) + iRaw;
},
curry: function curry(iOrigin) {
return function iProxy() {
return (arguments.length >= iOrigin.length) ?
iOrigin.apply(this, arguments) :
$.proxy.apply($, $.merge([iProxy, this], arguments));
};
},
isSelector: function () {
try {
DOM.querySelector(arguments[0])
} catch (iError) {
return false;
}
return true;
},
formatJSON: function () {
return BOM.JSON.stringify(arguments[0], null, 4)
.replace(/(\s+"[^"]+":) ([^\s]+)/g, '$1 $2');
},
paramJSON: function (Args_Str) {
Args_Str = (
Args_Str ? $.split(Args_Str, '?', 2)[1] : BOM.location.search
).match(/[^\?&\s]+/g);
if (! Args_Str) return { };
var _Args_ = { };
for (var i = 0, iValue; i < Args_Str.length; i++) {
Args_Str[i] = this.split(Args_Str[i], '=', 2);
iValue = BOM.decodeURIComponent( Args_Str[i][1] );
if (
(! $.isNumeric(iValue)) ||
(parseInt(iValue).toString().length < 21)
) try {
iValue = $.parseJSON(iValue);
} catch (iError) { }
_Args_[ Args_Str[i][0] ] = iValue;
}
return _Args_;
},
extendURL: function () {
var iArgs = $.makeArray( arguments );
var iURL = $.split(iArgs.shift(), '?', 2);
if (! iArgs[0]) return arguments[0];
iArgs.unshift( $.paramJSON('?' + iURL[1]) );
return iURL[0] + '?' + $.param($.extend.apply($, iArgs));
},
fileName: function () {
return (
arguments[0] || BOM.location.pathname
).match(/([^\?\#]+)(\?|\#)?/)[1].split('/').slice(-1)[0];
},
filePath: function () {
return (
arguments[0] || BOM.location.href
).match(/([^\?\#]+)(\?|\#)?/)[1].split('/').slice(0, -1).join('/');
},
urlDomain: function () {
return ((
arguments[0] || BOM.location.href
).match(/^(\w+:)?\/\/[^\/]+/) || '')[0];
},
isCrossDomain: function () {
var iDomain = this.urlDomain( arguments[0] );
return iDomain && (
iDomain != [
BOM.location.protocol, '//', DOM.domain, (
BOM.location.port ? (':' + BOM.location.port) : ''
)
].join('')
);
},
cssPX: RegExp([
'width', 'height', 'padding', 'border-radius', 'margin',
'top', 'right', 'bottom', 'left'
].join('|'))
});
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
var _Timer_ = { };
$.extend({
_Root_: BOM,
now: Date.now,
every: function (iSecond, iCallback) {
var _BOM_ = this._Root_,
iTimeOut = (iSecond || 0.01) * 1000,
iStart = this.now(),
Index = 0;
return _BOM_.setTimeout(function () {
var iDuring = (Date.now() - iStart) / 1000;
var iReturn = iCallback.call(_BOM_, ++Index, iDuring);
if ((typeof iReturn == 'undefined') || iReturn)
_BOM_.setTimeout(arguments.callee, iTimeOut);
}, iTimeOut);
},
wait: function (iSecond, iCallback) {
return this.every(iSecond, function () {
iCallback.apply(this, arguments);
return false;
});
},
start: function (iName) {
return (_Timer_[iName] = this.now());
},
end: function (iName) {
return (this.now() - _Timer_[iName]) / 1000;
},
throttle: function (iSecond, iOrigin) {
if (typeof iSecond != 'number') {
iOrigin = iSecond;
iSecond = 0;
}
iSecond = (iSecond || 0.25) * 1000;
var Last_Exec = 0;
return function () {
var iNow = Date.now();
if (Last_Exec + iSecond <= iNow) {
Last_Exec = iNow;
return iOrigin.apply(this, arguments);
}
};
},
uuid: function () {
return (arguments[0] || 'uuid') + '_' +
(this.now() + Math.random()).toString(36)
.replace('.', '').toUpperCase();
}
});
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- jQuery Object Core ---------- */
var DOM_Type = $.makeSet('Window', 'Document', 'HTMLElement');
function iQuery(Element_Set, iContext) {
/* ----- Global Wrapper ----- */
var _Self_ = arguments.callee;
if (! (this instanceof _Self_))
return new _Self_(Element_Set, iContext);
if (Element_Set instanceof _Self_)
return Element_Set;
/* ----- Constructor ----- */
this.length = 0;
if (! Element_Set) return;
var iType = $.Type(Element_Set);
if (iType == 'String') {
Element_Set = Element_Set.trim();
if (Element_Set[0] != '<') {
this.context = iContext || DOM;
this.selector = Element_Set;
Element_Set = $.find(Element_Set, this.context);
Element_Set = (Element_Set.length < 2) ?
Element_Set : $.uniqueSort(Element_Set);
} else {
Element_Set = $.map(_Self_.parseHTML(Element_Set), function () {
if (arguments[0].nodeType == 1) return arguments[0];
});
if ((Element_Set.length == 1) && $.isPlainObject( iContext ))
for (var iKey in iContext) {
if (typeof this[iKey] == 'function')
(new _Self_( Element_Set[0] ))[iKey]( iContext[iKey] );
else
(new _Self_( Element_Set[0] )).attr(iKey, iContext[iKey]);
}
}
} else if (iType in DOM_Type)
Element_Set = [ Element_Set ];
if (! $.likeArray(Element_Set))
return;
$.extend(this, Element_Set, {
length: Element_Set.length,
context: (Element_Set.length == 1) ?
(Element_Set[0] || '').ownerDocument : this.context
});
}
/* ----- iQuery Static Method ----- */
var TagWrapper = $.extend(
{
area: {before: '<map>'},
legend: {before: '<fieldset>'},
param: {before: '<object>'}
},
$.makeSet(['caption', 'thead', 'tbody', 'tfoot', 'tr'], {
before: '<table>',
after: '</table>',
depth: 2
}),
$.makeSet(['th', 'td'], {
before: '<table><tr>',
depth: 3
}),
$.makeSet(['optgroup', 'option'], {before: '<select multiple>'})
);
function QuerySelector(iPath) {
var iRoot = this;
if ((this.nodeType == 9) || (! this.parentNode))
return iRoot.querySelectorAll(iPath);
var _ID_ = this.getAttribute('id');
if (! _ID_) {
_ID_ = $.uuid('iQS');
this.setAttribute('id', _ID_);
}
iPath = '#' + _ID_ + ' ' + iPath;
iRoot = this.parentNode;
iPath = iRoot.querySelectorAll(iPath);
if (_ID_.slice(0, 3) == 'iQS') this.removeAttribute('id');
return iPath;
}
iQuery.fn = iQuery.prototype;
$ = BOM.iQuery = $.extend(true, iQuery, $, {
parseHTML: function (iHTML) {
var iTag = iHTML.match(
/^\s*<([^\s\/\>]+)\s*([^<]*?)\s*(\/?)>([^<]*)((<\/\1>)?)([\s\S]*)/
) || [ ];
if (iTag[5] === undefined) iTag[5] = '';
if (
(iTag[5] && (! (iTag.slice(2, 5).join('') + iTag[6]))) ||
(iTag[3] && (! (iTag[2] + iTag.slice(4).join(''))))
)
return [DOM.createElement( iTag[1] )];
var iWrapper = TagWrapper[ iTag[1] ],
iNew = DOM.createElement('div');
if (! iWrapper)
iNew.innerHTML = iHTML;
else {
iNew.innerHTML =
iWrapper.before + iHTML + (iWrapper.after || '');
iNew = $.trace(iNew, 'firstChild', iWrapper.depth || 1)
.slice(-1)[0];
}
return $.map(
$.makeArray(iNew.childNodes),
function (iDOM) {
return iDOM.parentNode.removeChild(iDOM);
}
);
},
find: function (iSelector, iRoot) {
var _Self_ = arguments.callee;
return $.map(iSelector.split(/\s*,\s*/), function (_Selector_) {
var iPseudo = [ ], _Before_, _After_ = _Selector_;
while (! (iPseudo[1] in $.expr[':'])) {
iPseudo = _After_.match(/:(\w+)(\(('|")?([^'"]*)\3?\))?/);
if (! iPseudo)
return $.makeArray(QuerySelector.call(iRoot, _Selector_));
_Before_ = iPseudo.index ?
_After_.slice(0, iPseudo.index) : '*';
_After_ = _After_.slice(iPseudo.index + iPseudo[0].length)
}
if (_Before_.match(/[\s>\+~]\s*$/)) _Before_ += '*';
iPseudo.splice(2, 1);
return $.map(
QuerySelector.call(iRoot, _Before_),
function (iDOM, Index) {
if ($.expr[':'][iPseudo[1]](iDOM, Index, iPseudo))
return _Self_(_After_, iDOM);
}
);
});
},
uniqueSort: $.browser.msie ?
function (iSet) {
var $_Temp = [ ], $_Result = [ ];
for (var i = 0; i < iSet.length; i++) {
$_Temp[i] = new String(iSet[i].sourceIndex + 1e8);
$_Temp[i].DOM = iSet[i];
}
$_Temp.sort();
for (var i = 0, j = 0; i < $_Temp.length; i++)
if ((! i) || (
$_Temp[i].valueOf() != $_Temp[i - 1].valueOf()
) || (
$_Temp[i].DOM.outerHTML != $_Temp[i - 1].DOM.outerHTML
))
$_Result[j++] = $_Temp[i].DOM;
return $_Result;
} :
function (iSet) {
iSet.sort(function (A, B) {
return (A.compareDocumentPosition(B) & 2) - 1;
});
var $_Result = [ ];
for (var i = 0, j = 0; i < iSet.length; i++) {
if (i && (iSet[i] === iSet[i - 1])) continue;
$_Result[j++] = iSet[i];
}
return $_Result;
}
});
if (typeof BOM.jQuery != 'function') BOM.$ = BOM.jQuery = $;
/* ----- iQuery Instance Method ----- */
$.fn.extend = $.extend;
$.fn.extend({
splice: Array.prototype.splice,
pushStack: function ($_New) {
$_New = $($.uniqueSort(
($_New instanceof Array) ? $_New : $.makeArray($_New)
));
$_New.prevObject = this;
return $_New;
},
index: function (iTarget) {
if (! iTarget)
return $.trace(this[0], 'previousElementSibling').length;
var iType = $.Type(iTarget);
switch (true) {
case (iType == 'String'):
return $.inArray(this[0], $(iTarget));
case ($.likeArray( iTarget )):
if (! (iType in DOM_Type)) {
iTarget = iTarget[0];
iType = $.Type(iTarget);
}
case (iType in DOM_Type):
return $.inArray(iTarget, this);
}
return -1;
}
});
return $;
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- DOM Info Operator - Get first, Set all. ---------- */
var _DOM_ = {
TypeMap: {
Get_Name: $.makeSet('string', 'array', 'undefined'),
root: $.makeSet('Document', 'Window')
},
operate: function (iType, iElement, iName, iValue) {
if (iValue === null) {
if (this[iType].clear)
for (var i = 0; i < iElement.length; i++)
this[iType].clear(iElement[i], iName);
return iElement;
}
if (
(iValue === undefined) &&
($.type(iName) in this.TypeMap.Get_Name)
) {
if (! iElement.length) return;
if (iName instanceof Array) {
var iData = { };
for (var i = 0; i < iName.length; i++)
iData[iName[i]] = this[iType].get(iElement[0], iName[i]);
return iData;
}
return this[iType].get(iElement[0], iName);
}
if (typeof iName == 'string') {
if (typeof iValue == 'function') {
for (var i = 0; i < iElement.length; i++)
this[iType].set(iElement[i], iName, iValue.call(
iElement[i], i, this[iType].get(iElement[i], iName)
));
return iElement;
} else {
var _Value_ = { };
_Value_[iName] = iValue;
iName = _Value_;
}
}
for (var i = 0; i < iElement.length; i++)
for (var iKey in iName)
this[iType].set(iElement[i], iKey, iName[iKey]);
return iElement;
}
};
/* ----- DOM Attribute ----- */
_DOM_.Attribute = {
get: function (iElement, iName) {
if ($.Type(iElement) in _DOM_.TypeMap.root) return;
if (! iName) return iElement.attributes;
var iValue = iElement.getAttribute(iName);
if (iValue !== null) return iValue;
},
set: function (iElement, iName, iValue) {
if (
(! ($.Type(iElement) in _DOM_.TypeMap.root)) &&
(iValue !== undefined)
)
iElement.setAttribute(iName, iValue);
},
clear: function (iElement, iName) {
iElement.removeAttribute(iName);
}
};
/* ----- DOM Property ----- */
_DOM_.Property = {
get: function (iElement, iName) {
return iName ? iElement[iName] : iElement;
},
set: function (iElement, iName, iValue) {
iElement[iName] = iValue;
}
};
/* ----- DOM Style ----- */
_DOM_.Style = {
get: function (iElement, iName) {
if ((! iElement) || ($.Type(iElement) in _DOM_.TypeMap.root))
return;
var iStyle = DOM.defaultView.getComputedStyle(iElement, null);
if (iName && iStyle) {
iStyle = iStyle.getPropertyValue(iName);
if (! iStyle) {
if (iName.match( $.cssPX ))
iStyle = 0;
} else if (iStyle.indexOf(' ') == -1) {
var iNumber = parseFloat(iStyle);
iStyle = isNaN(iNumber) ? iStyle : iNumber;
}
}
return $.isData(iStyle) ? iStyle : '';
},
set: function (iElement, iName, iValue) {
if ($.Type(iElement) in _DOM_.TypeMap.root) return false;
if ($.isNumeric(iValue) && iName.match($.cssPX))
iValue += 'px';
iElement.style.setProperty(iName, String(iValue), 'important');
}
};
/* ----- DOM Data ----- */
_DOM_.Data = {
_Data_: [ ],
set: function (iElement, iName, iValue) {
if (typeof iElement.dataIndex != 'number')
iElement.dataIndex = this._Data_.push({ }) - 1;
this._Data_[iElement.dataIndex][iName] = iValue;
},
get: function (iElement, iName) {
var iData = this._Data_[iElement.dataIndex] || iElement.dataset;
if (iName) {
iData = iData || { };
iData = iData[iName] || iData[$.camelCase( iName )];
if (typeof iData == 'string') try {
iData = BOM.JSON.parseAll(iData);
} catch (iError) { }
}
return ((iData instanceof Array) || $.isPlainObject(iData)) ?
$.extend(true, null, iData) : iData;
},
clear: function (iElement, iName) {
if (typeof iElement.dataIndex != 'number') return;
if (iName)
delete this._Data_[iElement.dataIndex][iName];
else {
delete this._Data_[iElement.dataIndex];
delete iElement.dataIndex;
}
}
};
$.extend({
data: function (iElement, iName, iValue) {
return _DOM_.operate('Data', [iElement], iName, iValue);
}
});
$.fn.extend({
attr: function () {
return _DOM_.operate('Attribute', this, arguments[0], arguments[1]);
},
prop: function () {
return _DOM_.operate('Property', this, arguments[0], arguments[1]);
},
data: function () {
return _DOM_.operate('Data', this, arguments[0], arguments[1]);
},
css: function () {
return _DOM_.operate('Style', this, arguments[0], arguments[1]);
},
addClass: function (new_Class) {
if (typeof new_Class != 'string') return this;
new_Class = new_Class.trim().split(/\s+/);
return this.attr('class', function (_Index_, old_Class) {
old_Class = (old_Class || '').trim().split(/\s+/);
for (var i = 0, j = old_Class.length; i < new_Class.length; i++)
if ($.inArray(new_Class[i], old_Class) == -1)
old_Class[j++] = new_Class[i];
return old_Class.join(' ').trim();
});
},
removeClass: function (iClass) {
if (typeof iClass != 'string') return this;
iClass = iClass.trim().split(/\s+/);
return this.attr('class', function (_Index_, old_Class) {
old_Class = (old_Class || '').trim().split(/\s+/);
if (! old_Class[0]) return;
var new_Class = [ ];
for (var i = 0, j = 0; i < old_Class.length; i++)
if ($.inArray(old_Class[i], iClass) == -1)
new_Class[j++] = old_Class[i];
return new_Class.join(' ');
});
},
hasClass: function (iName) {
return (!! $.map(this, function () {
return arguments[0].classList.contains(iName);
})[0]);
}
});
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
$.expr = { };
var pVisible = {
display: 'none',
width: 0,
height: 0
};
$.expr[':'] = $.expr.filters = {
visible: function () {
var iStyle = BOM.getComputedStyle( arguments[0] );
for (var iKey in pVisible)
if (iStyle[iKey] === pVisible[iKey]) return;
return true;
},
hidden: function () {
return (! this.visible(arguments[0]));
},
header: function () {
return (arguments[0] instanceof HTMLHeadingElement);
},
parent: function (iDOM) {
if (iDOM.children.length) return true;
iDOM = iDOM.childNodes;
for (var i = 0; iDOM[i]; i++)
if (iDOM[i].nodeType == 3) return true;
},
empty: function () {
return (! this.parent(arguments[0]));
},
contains: function (iDOM, Index, iMatch) {
return (iDOM.textContent.indexOf(iMatch[3]) > -1);
},
not: function (iDOM, Index, iMatch) {
return (! $.fn.is.call([iDOM], iMatch[3]));
}
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- Enhance jQuery Pseudo ---------- */
/* ----- :image ----- */
var pImage = $.extend($.makeSet('IMG', 'SVG', 'CANVAS'), {
INPUT: {type: 'image'},
LINK: {type: 'image/x-icon'}
});
$.expr[':'].image = function (iDOM) {
if (iDOM.tagName in pImage)
return (pImage[iDOM.tagName] === true) ||
(pImage[iDOM.tagName].type == iDOM.type.toLowerCase());
return (! $(iDOM).css('background-image').indexOf('url('));
};
/* ----- :button ----- */
var pButton = $.makeSet('button', 'image', 'submit', 'reset');
$.expr[':'].button = function (iDOM) {
return (iDOM.tagName == 'BUTTON') || (
(iDOM.tagName == 'INPUT') && (iDOM.type.toLowerCase() in pButton)
);
};
/* ----- :input ----- */
var pInput = $.makeSet('INPUT', 'TEXTAREA', 'BUTTON', 'SELECT');
$.expr[':'].input = function (iDOM) {
return (iDOM.tagName in pInput) ||
(typeof iDOM.getAttribute('contentEditable') == 'string') ||
iDOM.designMode;
};
/* ---------- iQuery Extended Pseudo ---------- */
/* ----- :list, :data ----- */
var pList = $.makeSet('UL', 'OL', 'DL', 'TBODY', 'SELECT', 'DATALIST');
$.extend($.expr[':'], {
list: function () {
return (arguments[0].tagName in pList);
},
data: function (iDOM, Index, iMatch) {
return Boolean($.data(iDOM, iMatch[3]));
}
});
/* ----- :focusable ----- */
var pFocusable = [
'a[href], map[name] area[href]',
'label, input, textarea, button, select, option, object',
'*[tabIndex], *[contentEditable]'
].join(', ');
$.expr[':'].focusable = function () {
return arguments[0].matches(pFocusable);
};
/* ----- :field ----- */
$.expr[':'].field = function (iDOM) {
return (
iDOM.getAttribute('name') && $.expr[':'].input(iDOM)
) && !(
iDOM.disabled ||
$.expr[':'].button(iDOM) ||
$(iDOM).parents('fieldset[disabled]')[0]
)
};
/* ----- :scrollable ----- */
var Rolling_Style = $.makeSet('auto', 'scroll');
$.expr[':'].scrollable = function (iDOM) {
if (iDOM === iDOM.ownerDocument.scrollingElement) return true;
var iCSS = $(iDOM).css([
'width', 'height',
'max-width', 'max-height',
'overflow-x', 'overflow-y'
]);
return (
(
(parseFloat(iCSS.width) || parseFloat(iCSS['max-width'])) &&
(iCSS['overflow-x'] in Rolling_Style)
) ||
(
(parseFloat(iCSS.height) || parseFloat(iCSS['max-height'])) &&
(iCSS['overflow-y'] in Rolling_Style)
)
);
};
/* ----- :media ----- */
var pMedia = $.makeSet('IFRAME', 'OBJECT', 'EMBED', 'AUDIO', 'VIDEO');
$.expr[':'].media = function (iDOM) {
return (iDOM.tagName in pMedia) || $.expr[':'].image(iDOM);
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
var Array_Reverse = Array.prototype.reverse;
function DOM_Map() {
var iArgs = $.makeArray( arguments );
var CoreBack = (typeof iArgs.slice(-1)[0] == 'function') && iArgs.pop();
var _Not_ = iArgs.shift(), _Reverse_ = iArgs[0];
return function ($_Filter) {
var $_Result = this;
if (CoreBack) $_Result = $.map($_Result, CoreBack);
if ($.isNumeric( $_Filter ))
$_Result = $.map($_Result, function (iDOM) {
return (iDOM.nodeType == $_Filter) ? iDOM : null;
});
else if ($_Filter)
$_Result = $.map($_Result, function (iDOM) {
var _Is_ = $( iDOM ).is( $_Filter );
return (_Not_ ? (! _Is_) : _Is_) ? iDOM : null;
});
$_Result = this.pushStack( $_Result );
return _Reverse_ ? Array_Reverse.call( $_Result ) : $_Result;
};
}
$.fn.extend({
is: function ($_Match) {
var iPath = (typeof $_Match == 'string'),
iCallback = (typeof $_Match == 'function'),
iMatch = (typeof Element.prototype.matches == 'function');
for (var i = 0; this[i]; i++) {
if ((this[i] === $_Match) || (
iCallback && $_Match.call(this[i], i)
))
return true;
if (iPath && iMatch) try {
if (this[i].matches( $_Match )) return true;
} catch (iError) { }
if ((this[i].nodeType < 9) && (! this[i].parentElement))
$('<div />')[0].appendChild( this[i] );
if (-1 < $.inArray(this[i], (
iPath ? $($_Match, this[i].parentNode) : $($_Match)
)))
return true;
}
return false;
},
add: function () {
return this.pushStack( $.merge(this, $.apply(BOM, arguments)) );
},
addBack: function () {
return this.pushStack( $.merge(this, this.prevObject) );
},
filter: DOM_Map(),
not: DOM_Map(true),
parent: DOM_Map(function (iDOM) {
return iDOM.parentElement;
}),
parents: DOM_Map('', true, function (iDOM) {
return $.trace(iDOM, 'parentElement').slice(0, -1);
}),
parentsUntil: function () {
return Array_Reverse.call(
this.parents().not( $(arguments[0]).parents().addBack() )
);
},
children: DOM_Map(function (iDOM) {
return $.makeArray( iDOM.children );
}),
contents: DOM_Map(function (iDOM) {
return (iDOM.tagName != 'IFRAME') ?
$.makeArray( iDOM.childNodes ) : iDOM.contentWindow.document;
}),
prev: DOM_Map(function (iDOM) {
return iDOM.previousElementSibling;
}),
prevAll: DOM_Map('', true, function (iDOM) {
return $.trace(iDOM, 'previousElementSibling');
}),
next: DOM_Map(function (iDOM) {
return iDOM.nextElementSibling;
}),
nextAll: DOM_Map(function (iDOM) {
return $.trace(iDOM, 'nextElementSibling');
}),
siblings: function () {
var $_Result = this.prevAll().add( this.nextAll() );
return this.pushStack(
arguments[0] ? $_Result.filter(arguments[0]) : $_Result
);
},
offsetParent: DOM_Map(function (iDOM) {
return iDOM.offsetParent;
}),
find: function () {
var $_Result = [ ];
for (var i = 0; i < this.length; i++)
$_Result = $.merge($_Result, $.find(arguments[0], this[i]));
return this.pushStack( $_Result );
},
has: function ($_Filter) {
if (typeof $_Filter != 'string') {
var _UUID_ = $.uuid('Has');
$($_Filter).addClass(_UUID_);
$_Filter = '.' + _UUID_;
}
return this.pushStack($.map(this, function () {
if ( $($_Filter, arguments[0]).removeClass(_UUID_).length )
return arguments[0];
}));
}
});
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
function DOM_Size(iName) {
iName = {
scroll: 'scroll' + iName,
inner: 'inner' + iName,
client: 'client' + iName,
css: iName.toLowerCase()
};
return function (iValue) {
if (! this[0]) return arguments.length ? this : 0;
switch ( $.Type(this[0]) ) {
case 'Document':
return Math.max(
this[0].documentElement[iName.scroll],
this[0].body[iName.scroll]
);
case 'Window':
return this[0][iName.inner] || Math.max(
this[0].document.documentElement[iName.client],
this[0].document.body[iName.client]
);
}
if (! $.isNumeric(iValue))
return this[0][iName.client] + (
(this[0].tagName == 'TABLE') ? 4 : 0
);
for (var i = 0, $_This, _Size_; this[i]; i++) {
$_This = $( this[i] );
_Size_ = $_This.css(iName.css, iValue).css(iName.css);
if (this[i].tagName == 'TABLE')
$_This.css(iName.css, _Size_ + 4);
}
return this;
};
}
var Scroll_Root = $.makeSet('#document', 'HTML', 'BODY');
function Scroll_DOM() {
return (this.nodeName in Scroll_Root) ? DOM.scrollingElement : this;
}
function DOM_Scroll(iName) {
iName = {
scroll: 'scroll' + iName,
offset: (iName == 'Top') ? 'pageYOffset' : 'pageXOffset'
};
return function (iPX) {
iPX = parseFloat(iPX);
if ( isNaN(iPX) ) {
iPX = Scroll_DOM.call(this[0])[iName.scroll];
return (iPX != null) ? iPX : (
this[0].documentElement[iName.scroll] ||
this[0].defaultView[iName.offset] ||
this[0].body[iName.scroll]
);
}
for (var i = 0; i < this.length; i++) {
if (this[i][iName.scroll] !== undefined) {
Scroll_DOM.call(this[i])[iName.scroll] = iPX;
continue;
}
this[i].documentElement[iName.scroll] =
this[i].defaultView[iName.offset] =
this[i].body[iName.scroll] = iPX;
}
return this;
};
}
$.fn.extend({
slice: function () {
return this.pushStack( [ ].slice.apply(this, arguments) );
},
eq: function (Index) {
return this.pushStack(
[ ].slice.call(this, Index, (Index + 1) || undefined)
);
},
each: function () {
return $.each(this, arguments[0]);
},
removeAttr: function (iAttr) {
iAttr = iAttr.trim().split(/\s+/);
for (var i = 0; i < iAttr.length; i++)
this.attr(iAttr[i], null);
return this;
},
detach: function () {
for (var i = 0; i < this.length; i++)
if (this[i].parentNode)
this[i].parentNode.removeChild(this[i]);
return this;
},
remove: function () {
return this.detach().data('', null);
},
empty: function () {
this.children().remove();
for (var i = 0, iChild; i < this.length; i++) {
iChild = this[i].childNodes;
for (var j = 0; j < iChild.length; j++)
this[i].removeChild(iChild[j]);
}
return this;
},
text: function (iText) {
var iGetter = (! $.isData(iText)), iResult = [ ];
if (! iGetter) this.empty();
for (var i = 0, j = 0; i < this.length; i++)
if (iGetter)
iResult[j++] = this[i].textContent;
else
this[i].textContent = iText;
return iResult.length ? iResult.join('') : this;
},
html: function (iHTML) {
if (! $.isData(iHTML))
return this[0].innerHTML;
this.empty();
for (var i = 0; i < this.length; i++)
this[i].innerHTML = iHTML;
return this;
},
width: DOM_Size('Width'),
height: DOM_Size('Height'),
scrollTop: DOM_Scroll('Top'),
scrollLeft: DOM_Scroll('Left'),
position: function () {
return {
left: this[0].offsetLeft,
top: this[0].offsetTop
};
},
offset: function (iCoordinate) {
if ( $.isPlainObject(iCoordinate) )
return this.css($.extend({
position: 'fixed'
}, iCoordinate));
var _DOM_ = (this[0] || { }).ownerDocument;
var _Body_ = _DOM_ && $('body', _DOM_)[0];
if (! (_DOM_ && _Body_ && $.contains(_Body_, this[0])))
return {left: 0, top: 0};
var $_DOM_ = $(_DOM_), iBCR = this[0].getBoundingClientRect();
return {
left: parseFloat(
($_DOM_.scrollLeft() + iBCR.left).toFixed(4)
),
top: parseFloat(
($_DOM_.scrollTop() + iBCR.top).toFixed(4)
)
};
},
val: function (iValue) {
if (iValue != null) {
if (iValue instanceof Array)
this.filter('select[multiple]').each(function () {
for (var i = 0; this.options[i]; i++)
if ($.inArray(this.options[i].value, iValue))
this.options[i].selected = true;
});
else if ($.isData( iValue ))
this.not('input[type="file"]').prop('value', iValue);
return this;
}
if (! this[0]) return;
if (this[0].tagName != 'SELECT') return this[0].value;
iValue = $.map(this[0].selectedOptions, function () {
return arguments[0].value;
});
return (iValue.length < 2) ? iValue[0] : iValue;
},
serializeArray: function () {
var $_Value = this.find('*:field'), iValue = [ ];
for (var i = 0, j = 0; i < $_Value.length; i++)
if (
(! $_Value[i].type.match(/radio|checkbox/i)) ||
$_Value[i].checked
)
iValue[j++] = $($_Value[i]).prop(['name', 'value']);
return iValue;
},
serialize: function () {
return $.param( this.serializeArray() );
}
});
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
var Mutation_Event = $.makeSet(
'DOMContentLoaded',
'DOMAttrModified', 'DOMAttributeNameChanged',
'DOMCharacterDataModified',
'DOMElementNameChanged',
'DOMNodeInserted', 'DOMNodeInsertedIntoDocument',
'DOMNodeRemoved', 'DOMNodeRemovedFromDocument',
'DOMSubtreeModified'
);
function isOriginalEvent() {
return (
('on' + this.type) in
Object.getPrototypeOf(this.target || DOM.documentElement)
) || (
$.browser.modern && (this.type in Mutation_Event)
);
}
function W3C_Event_Object(iType, iCustom, iDetail) {
var iEvent = DOM.createEvent(iCustom ? 'CustomEvent' : 'HTMLEvents');
iEvent['init' + (iCustom ? 'CustomEvent' : 'Event')](
iType, true, true, iDetail
);
return iEvent;
}
var IE_Event = {
create: function (iEvent) {
iEvent = (iEvent && (typeof iEvent == 'object')) ? iEvent : { };
return this.isCustom ?
$.extend({ }, iEvent, arguments[1]) : DOM.createEventObject();
},
fix: function (iEvent) {
var iOffset = $(iEvent.srcElement).offset() || { };
$.extend(this, {
type: iEvent.type,
pageX: iOffset.left,
pageY: iOffset.top,
target: iEvent.srcElement,
relatedTarget: ({
mouseover: iEvent.fromElement,
mouseout: iEvent.toElement,
mouseenter: iEvent.fromElement || iEvent.toElement,
mouseleave: iEvent.toElement || iEvent.fromElement
})[iEvent.type],
which:
(iEvent.type && (iEvent.type.slice(0, 3) == 'key')) ?
iEvent.keyCode :
[0, 1, 3, 0, 2, 0, 0, 0][iEvent.button],
wheelDelta: iEvent.wheelDelta
});
}
};
$.Event = function (iEvent, iProperty) {
// Instantiation without "new"
var _Self_ = arguments.callee;
if (iEvent instanceof _Self_)
return $.isPlainObject(iProperty) ?
$.extend(iEvent, iProperty) : iEvent;
if (! (this instanceof _Self_))
return new _Self_(iEvent, iProperty);
// Default Property
$.extend(this, {
bubbles: true,
cancelable: true,
isTrusted: true,
detail: 0,
view: BOM,
eventPhase: 3
});
// Special Property
var iCreate = (typeof iEvent == 'string');
if (! iCreate) {
if ($.isPlainObject( iEvent ))
$.extend(this, iEvent);
else if ($.browser.modern) {
for (var iKey in iEvent)
if ((typeof iEvent[iKey] != 'function') && (iKey[0] > 'Z'))
this[iKey] = iEvent[iKey];
} else
IE_Event.fix.call(this, iEvent);
}
if ($.isPlainObject( iProperty )) $.extend(this, iProperty);
this.type = iCreate ? iEvent : this.type;
this.isCustom = (! isOriginalEvent.call(this));
this.originalEvent = (iCreate || $.isPlainObject(iEvent)) ?
(
$.browser.modern ?
W3C_Event_Object(this.type, this.isCustom, this.detail) :
IE_Event.create.apply(this, arguments)
) : iEvent;
};
$.extend($.Event.prototype, {
preventDefault: function () {
if ($.browser.modern)
this.originalEvent.preventDefault();
else
this.originalEvent.returnValue = false;
this.defaultPrevented = true;
},
stopPropagation: function () {
if ($.browser.modern)
this.originalEvent.stopPropagation();
else
this.originalEvent.cancelBubble = true;
this.cancelBubble = true;
}
});
function Proxy_Handler(iEvent, iCallback) {
iEvent = $.Event(iEvent);
var $_Target = $(iEvent.target);
var iHandler = iCallback ?
[iCallback] :
($(this).data('_event_') || { })[iEvent.type],
iArgs = [iEvent].concat( $_Target.data('_trigger_') ),
iThis = this;
if (! (iHandler && iHandler.length)) return;
for (var i = 0; i < iHandler.length; i++)
if (false === (
iHandler[i] && iHandler[i].apply(iThis, iArgs)
)) {
iEvent.preventDefault();
iEvent.stopPropagation();
}
$_Target.data('_trigger_', null);
}
$.event = {
dispatch: function (iEvent, iFilter) {
iEvent = $.Event(iEvent);
var iTarget = iEvent.target, $_Path;
switch ( $.Type(iTarget) ) {
case 'HTMLElement': {
$_Path = $(iTarget).parents().addBack();
$_Path = iFilter ?
Array.prototype.reverse.call( $_Path.filter(iFilter) ) :
$($.makeArray($_Path).reverse().concat([
iTarget.ownerDocument, iTarget.ownerDocument.defaultView
]));
break;
}
case 'Document': iTarget = [iTarget, iTarget.defaultView];
case 'Window': {
if (iFilter) return;
$_Path = $(iTarget);
}
}
for (var i = 0; i < $_Path.length; i++) {
iEvent.currentTarget = $_Path[i];
Proxy_Handler.call($_Path[i], iEvent, (! i) && arguments[2]);
if (iEvent.cancelBubble) break;
}
}
};
$.extend(IE_Event, {
type: function (iType) {
if (
((BOM !== BOM.top) && (iType == 'DOMContentLoaded')) ||
((iType == 'load') && ($.Type(this) != 'Window'))
)
return 'onreadystatechange';
iType = 'on' + iType;
if (! (iType in Object.getPrototypeOf(this)))
return 'onpropertychange';
return iType;
},
handler: function () {
var iEvent = $.Event(BOM.event), Loaded;
iEvent.currentTarget = this;
switch (iEvent.type) {
case 'readystatechange': iEvent.type = 'load';
case 'load':
Loaded = (this.readyState == (
(this.tagName == 'SCRIPT') ? 'loaded' : 'complete'
));
break;
case 'propertychange': {
var iType = iEvent.originalEvent.propertyName.match(/^on(.+)/i);
if (iType && (
IE_Event.type.call(this, iType[1]) == 'onpropertychange'
))
iEvent.type = iType[1];
else {
iEvent.type = 'DOMAttrModified';
iEvent.attrName = iEvent.propertyName;
}
}
default: Loaded = true;
}
if (Loaded) arguments[0].call(this, iEvent);
},
bind: function () {
this[((arguments[0] == '+') ? 'at' : 'de') + 'tachEvent'](
IE_Event.type.call(this, arguments[1]),
$.proxy(IE_Event.handler, this, arguments[2])
);
}
});
function Direct_Bind(iType, iCallback) {
return this.data('_event_', function () {
var Event_Data = arguments[1] || { };
if (! Event_Data[iType]) {
Event_Data[iType] = [ ];
if ($.browser.modern)
this.addEventListener(iType, Proxy_Handler, false);
else if (isOriginalEvent.call({
type: iType,
target: this
}))
IE_Event.bind.call(this, '+', iType, Proxy_Handler);
}
Event_Data[iType].push(iCallback);
return Event_Data;
});
}
$.fn.extend({
bind: function (iType) {
iType = (typeof iType == 'string') ?
$.makeSet.apply($, iType.trim().split(/\s+/)) : iType;
for (var _Type_ in iType)
Direct_Bind.apply(this, [
_Type_,
(iType[_Type_] === true) ? arguments[1] : iType[_Type_]
]);
return this;
},
unbind: function (iType, iCallback) {
iType = iType.trim().split(/\s+/);
return this.data('_event_', function () {
var Event_Data = arguments[1] || { };
for (var i = 0, iHandler; i < iType.length; i++) {
iHandler = Event_Data[iType[i]];
if (! iHandler) continue;
if (typeof iCallback == 'function')
iHandler.splice(iHandler.indexOf(iCallback), 1);
else
delete Event_Data[iType[i]];
if ( Event_Data[iType[i]] ) continue;
if ($.browser.modern)
this.removeEventListener(iType[i], Proxy_Handler);
else
IE_Event.bind.call(this, '-', iType[i], Proxy_Handler);
}
return Event_Data;
});
},
on: function (iType, iFilter, iCallback) {
if (typeof iFilter != 'string')
return this.bind.apply(this, arguments);
return this.bind(iType, function () {
$.event.dispatch(arguments[0], iFilter, iCallback);
});
},
one: function () {
var iArgs = $.makeArray(arguments), $_This = this;
var iCallback = iArgs[iArgs.length - 1];
iArgs.splice(-1, 1, function () {
$.fn.unbind.apply($_This, (
(iArgs.length > 2) ? [iArgs[0], iArgs[2]] : iArgs
));
return iCallback.apply(this, arguments);
});
return this.on.apply(this, iArgs);
},
trigger: function () {
this.data('_trigger_', arguments[1]);
for (var i = 0, iEvent; i < this.length; i++) {
iEvent = $.Event(arguments[0], {target: this[i]});
if ($.browser.modern) {
this[i].dispatchEvent(
$.extend(iEvent.originalEvent, iEvent)
);
continue;
}
if (! iEvent.isCustom)
this[i].fireEvent(
'on' + iEvent.type, $.extend(iEvent.originalEvent, iEvent)
);
else
BOM.setTimeout(function () {
$.event.dispatch(iEvent);
});
}
return this;
},
triggerHandler: function () {
var iHandler = $(this[0]).data('_event_'), iReturn;
iHandler = iHandler && iHandler[arguments[0]];
if (! iHandler) return;
for (var i = 0; i < iHandler.length; i++)
iReturn = iHandler[i].apply(
this[0], $.merge([ ], arguments)
);
return iReturn;
},
clone: function (iDeep) {
return $($.map(this, function () {
var $_Old = $(arguments[0]);
var $_New = $( $_Old[0].cloneNode(iDeep) );
if (iDeep) {
$_Old = $_Old.find('*').addBack();
$_New = $_New.find('*').addBack();
}
for (var i = 0, iData; i < $_Old.length; i++) {
$_New[i].dataIndex = null;
iData = $($_Old[i]).data();
if ($.isEmptyObject( iData )) continue;
$($_New[i]).data(iData);
for (var iType in iData._event_) {
if ($.browser.modern) {
$_New[i].addEventListener(iType, Proxy_Handler, false);
continue;
}
IE_Event.bind.call($_New[i], '+', iType, Proxy_Handler);
}
}
return $_New[0];
}));
}
});
/* ---------- Event ShortCut ---------- */
$.fn.off = $.fn.unbind;
function Event_Method(iName) {
return function (iCallback) {
if ((typeof iCallback == 'function') || (iCallback === false))
return this.bind(iName, arguments[0]);
for (var i = 0; i < this.length; i++) try {
this[i][iName]();
} catch (iError) {
$(this[i]).trigger(iName);
}
return this;
};
}
for (var iName in $.makeSet(
'abort', 'error',
'keydown', 'keypress', 'keyup',
'mousedown', 'mouseup', 'mousemove', 'mousewheel',
'click', 'dblclick', 'scroll', 'resize',
'select', 'focus', 'blur', 'change', 'submit', 'reset',
'tap', 'press', 'swipe'
))
$.fn[iName] = Event_Method(iName);
/* ---------- Complex Events ---------- */
/* ----- DOM Ready ----- */
var $_DOM = $(DOM);
$.start('DOM_Ready');
function DOM_Ready_Event() {
if ((typeof arguments[2] == 'number') && (
(DOM.readyState != 'complete') || (! (DOM.body || { }).lastChild)
))
return;
if (! DOM.isReady) {
DOM.isReady = true;
$_DOM.data('Load_During', $.end('DOM_Ready'))
.data('Ready_Event', arguments[0]);
console.info('[DOM Ready Event]');
console.log(this, arguments);
$_DOM.trigger('ready');
}
return false;
}
$.every(0.5, DOM_Ready_Event);
$_DOM.one('DOMContentLoaded', DOM_Ready_Event);
$(BOM).one('load', DOM_Ready_Event);
$.fn.ready = function (iCallback) {
if ($.Type(this[0]) != 'Document')
throw 'The Ready Method is only used for Document Object !';
if (! DOM.isReady)
$_DOM.one('ready', iCallback);
else
iCallback.call(this[0], $_DOM.data('Ready_Event'));
return this;
};
/* ----- Mouse Hover ----- */
var _Float_ = {
absolute: true,
fixed: true
};
$.fn.hover = function (iEnter, iLeave) {
return this.bind('mouseover', function () {
if (
$.contains(this, arguments[0].relatedTarget) ||
($(arguments[0].target).css('position') in _Float_)
)
return false;
iEnter.apply(this, arguments);
}).bind('mouseout', function () {
if (
$.contains(this, arguments[0].relatedTarget) ||
($(arguments[0].target).css('position') in _Float_)
)
return false;
(iLeave || iEnter).apply(this, arguments);
});
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- Event from Pseudo ---------- */
$.Event.prototype.isPseudo = function () {
var $_This = $(this.currentTarget);
var iOffset = $_This.offset();
return Boolean(
(this.pageX && (
(this.pageX < iOffset.left) ||
(this.pageX > (iOffset.left + parseFloat($_This.css('width'))))
)) ||
(this.pageY && (
(this.pageY < iOffset.top) ||
(this.pageY > (iOffset.top + parseFloat($_This.css('height'))))
))
);
};
/* ---------- Focus AnyWhere ---------- */
var DOM_Focus = $.fn.focus;
$.fn.focus = function () {
this.not(':focusable').attr('tabIndex', -1).css('outline', 'none');
return DOM_Focus.apply(this, arguments);
};
/* ---------- Single Finger Touch ---------- */
var $_DOM = $(DOM);
function get_Touch(iEvent) {
var iTouch = iEvent;
if ($.browser.mobile) try {
iTouch = iEvent.changedTouches[0];
} catch (iError) {
iTouch = iEvent.touches[0];
}
iTouch.timeStamp = iEvent.timeStamp || $.now();
return iTouch;
}
$_DOM.bind(
$.browser.mobile ? 'touchstart MSPointerDown' : 'mousedown',
function (iEvent) {
$(iEvent.target).data(
'_Gesture_Event_', get_Touch( iEvent.originalEvent )
);
}
).bind(
$.browser.mobile ? 'touchend touchcancel MSPointerUp' : 'mouseup',
function (iEvent) {
var $_Target = $(iEvent.target);
var iStart = $_Target.data('_Gesture_Event_');
if (! iStart) return;
$_Target.data('_Gesture_Event_', null);
var iEnd = get_Touch( iEvent.originalEvent );
iEvent = {
target: $_Target[0],
detail: iEnd.timeStamp - iStart.timeStamp,
deltaX: iStart.pageX - iEnd.pageX,
deltaY: iStart.pageY - iEnd.pageY
};
var iShift = Math.sqrt(
Math.pow(iEvent.deltaX, 2) + Math.pow(iEvent.deltaY, 2)
);
if (iEvent.detail > 300)
iEvent.type = 'press';
else if (iShift < 22)
iEvent.type = 'tap';
else {
iEvent.type = 'swipe';
iEvent.detail = iShift;
}
$_Target.trigger(iEvent);
}
);
/* ---------- Text Input Event ---------- */
function TypeBack(iHandler, iKey, iEvent) {
var $_This = $(this);
var iValue = $_This[iKey]();
if (false !== iHandler.call(iEvent.target, iEvent, iValue))
return;
iValue = iValue.split('');
iValue.splice(
BOM.getSelection().getRangeAt(0).startOffset - 1, 1
);
$_This[iKey]( iValue.join('') );
}
$.fn.input = function (iHandler) {
this.filter('input, textarea').on(
$.browser.modern ? 'input' : 'propertychange',
function (iEvent) {
if ($.browser.modern || (iEvent.propertyName == 'value'))
TypeBack.call(this, iHandler, 'val', iEvent);
}
);
this.not('input, textarea').on('paste', function (iEvent) {
return iHandler.call(
iEvent.target,
iEvent,
($.browser.modern ? iEvent : BOM).clipboardData.getData(
$.browser.modern ? 'text/plain' : 'text'
)
);
}).keyup(function (iEvent) {
var iKey = iEvent.which;
if (
(iKey < 48) || (iKey > 105) ||
((iKey > 90) && (iKey < 96)) ||
iEvent.ctrlKey || iEvent.shiftKey || iEvent.altKey
)
return;
TypeBack.call(iEvent.target, iHandler, 'text', iEvent);
});
return this;
};
/* ---------- User Idle Event ---------- */
var End_Event = 'keydown mousedown scroll';
$.fn.onIdleFor = function (iSecond, iCallback) {
return this.each(function () {
var iNO, _Self_ = arguments.callee, $_This = $(this);
function iCancel() {
BOM.clearTimeout( iNO );
$_This.off(End_Event, arguments.callee);
_Self_.call( $_This[0] );
}
iNO = $.wait(iSecond, function () {
$_This.off(End_Event, iCancel);
iCallback.call($_This[0], $.Event({
type: 'idle',
target: $_This[0]
}));
_Self_.call( $_This[0] );
});
$_This.one(End_Event, iCancel);
});
};
/* ---------- Cross Page Event ---------- */
function CrossPageEvent(iType, iSource) {
if (typeof iType == 'string') {
this.type = iType;
this.target = iSource;
} else
$.extend(this, iType);
if (! (iSource && (iSource instanceof Element))) return;
$.extend(this, $.map(iSource.dataset, function (iValue) {
if (typeof iValue == 'string') try {
return $.parseJSON(iValue);
} catch (iError) { }
return iValue;
}));
}
CrossPageEvent.prototype.valueOf = function () {
var iValue = $.extend({ }, this);
delete iValue.data;
delete iValue.target;
delete iValue.valueOf;
return iValue;
};
var $_BOM = $(BOM);
$.fn.onReply = function (iType, iData, iCallback) {
var iTarget = this[0], $_Source;
if (typeof iTarget.postMessage != 'function') return this;
if (arguments.length == 4) {
$_Source = $(iData);
iData = iCallback;
iCallback = arguments[3];
}
var _Event_ = new CrossPageEvent(iType, ($_Source || { })[0]);
if (typeof iCallback == 'function')
$_BOM.on('message', function (iEvent) {
iEvent = iEvent.originalEvent || iEvent;
var iReturn = new CrossPageEvent(
(typeof iEvent.data == 'string') ?
$.parseJSON(iEvent.data) : iEvent.data
);
if (
(iEvent.source === iTarget) &&
(iReturn.type == iType) &&
$.isEqual(iReturn, _Event_)
) {
iCallback.call($_Source ? $_Source[0] : this, iReturn);
$_BOM.off('message', arguments.callee);
}
});
iData = $.extend({data: iData}, _Event_.valueOf());
iTarget.postMessage(
($.browser.msie < 10) ? JSON.stringify(iData) : iData, '*'
);
};
/* ---------- Mouse Wheel Event ---------- */
if (! $.browser.mozilla) return;
$_DOM.on('DOMMouseScroll', function (iEvent) {
$(iEvent.target).trigger({
type: 'mousewheel',
wheelDelta: -iEvent.detail * 40
});
});
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
if ($.browser.modern) return;
/* ---------- Document ShortCut ---------- */
DOM.defaultView = DOM.parentWindow;
DOM.head = DOM.documentElement.firstChild;
/* ---------- DOM ShortCut ---------- */
var iGetter = {
firstElementChild: function () {
return this.children[0];
},
lastElementChild: function () {
return this.children[this.children.length - 1];
},
previousElementSibling: function () {
return $.trace(this, 'previousSibling', 1, function () {
return (this.nodeType == 1);
})[0];
},
nextElementSibling: function () {
return $.trace(this, 'nextSibling', function () {
return (this.nodeType == 1);
})[0];
}
},
DOM_Proto = Element.prototype;
for (var iName in iGetter)
Object.defineProperty(DOM_Proto, iName, {get: iGetter[iName]});
/* ---------- DOM Text Content ---------- */
Object.defineProperty(DOM_Proto, 'textContent', {
get: function () {
return this.innerText;
},
set: function (iText) {
switch ( this.tagName.toLowerCase() ) {
case 'style': return this.styleSheet.cssText = iText;
case 'script': return this.text = iText;
}
this.innerText = iText;
}
});
/* ---------- DOM Attribute Name ---------- */
var iAlias = {
'class': 'className',
'for': 'htmlFor'
},
Get_Attribute = DOM_Proto.getAttribute,
Set_Attribute = DOM_Proto.setAttribute,
Remove_Attribute = DOM_Proto.removeAttribute;
$.extend(DOM_Proto, {
getAttribute: function (iName) {
return iAlias[iName] ?
this[iAlias[iName]] : Get_Attribute.call(this, iName, 0);
},
setAttribute: function (iName, iValue) {
if (iAlias[iName])
this[iAlias[iName]] = iValue;
else
Set_Attribute.call(this, iName, iValue, 0);
},
removeAttribute: function (iName) {
return Remove_Attribute.call(this, iAlias[iName] || iName, 0);
}
});
/* ---------- Computed Style ---------- */
var PX_Attr = $.makeSet('left', 'right', 'top', 'bottom', 'width', 'height'),
DX_Filter = 'DXImageTransform.Microsoft.';
function ValueUnit(iValue) {
return iValue.slice((parseFloat(iValue) + '').length);
}
function toPX(iName) {
var iValue = this[iName];
var iNumber = parseFloat(iValue);
if (isNaN( iNumber )) return;
if (iNumber !== 0)
switch (ValueUnit( iValue )) {
case 'em': {
var Font_Size =
this.ownerNode.parentNode.currentStyle.fontSize;
iNumber *= parseFloat(Font_Size);
if (ValueUnit(Font_Size) != 'pt') break;
}
case 'pt': iNumber *= (BOM.screen.deviceXDPI / 72); break;
default: return;
}
this[iName] = iNumber + 'px';
}
function CSSStyleDeclaration(iDOM) {
var iStyle = iDOM.currentStyle;
$.extend(this, {
length: 0,
cssText: '',
ownerNode: iDOM
});
for (var iName in iStyle) {
this[iName] = (iName in PX_Attr) && iStyle[
$.camelCase('pixel-' + iName)
];
this[iName] = (typeof this[iName] == 'number') ?
(this[iName] + 'px') : (iStyle[iName] + '');
if (typeof this[iName] == 'string') toPX.call(this, iName);
this.cssText += [
iName, ': ', this[iName], '; '
].join('');
}
this.cssText = this.cssText.trim();
var iAlpha = iDOM.filters.Alpha || iDOM.filters[DX_Filter + 'Alpha'];
this.opacity = (iAlpha ? (iAlpha.opacity / 100) : 1) + '';
}
CSSStyleDeclaration.prototype.getPropertyValue = function () {
return this[$.camelCase( arguments[0] )];
};
BOM.getComputedStyle = function () {
return new CSSStyleDeclaration(arguments[0]);
};
/* ---------- Set Style ---------- */
function toHexInt(iDec, iLength) {
var iHex = parseInt( Number(iDec).toFixed(0) ).toString(16);
if (iLength && (iLength > iHex.length))
iHex = '0'.repeat(iLength - iHex.length) + iHex;
return iHex;
}
function RGB_Hex(iRed, iGreen, iBlue) {
var iArgs = $.makeArray(arguments);
if ((iArgs.length == 1) && (typeof iArgs[0] == 'string'))
iArgs = iArgs[0].replace(/rgb\(([^\)]+)\)/i, '$1').replace(/,\s*/g, ',').split(',');
for (var i = 0; i < 3; i++)
iArgs[i] = toHexInt(iArgs[i], 2);
return iArgs.join('');
}
Object.getPrototypeOf( DOM.documentElement.style ).setProperty =
function (iName, iValue) {
var iString = '', iWrapper, iScale = 1, iConvert;
var iRGBA = (typeof iValue == 'string') &&
iValue.match(/\s*rgba\(([^\)]+),\s*(\d\.\d+)\)/i);
if (iName == 'opacity') {
iName = 'filter';
iWrapper = 'progid:' + DX_Filter + 'Alpha(opacity={n})';
iScale = 100;
} else if (iRGBA) {
iString = iValue.replace(iRGBA[0], '');
if (iString)
iString += arguments.callee.call(this, iName, iString);
if (iName != 'background')
iString += arguments.callee.apply(this, [
(iName.indexOf('-color') > -1) ? iName : (iName + '-color'),
'rgb(' + iRGBA[1] + ')'
]);
iName = 'filter';
iWrapper = 'progid:' + DX_Filter +
'Gradient(startColorStr=#{n},endColorStr=#{n})';
iConvert = function (iAlpha, iRGB) {
return toHexInt(parseFloat(iAlpha) * 256, 2) + RGB_Hex(iRGB);
};
}
if (iWrapper)
iValue = iWrapper.replace(
/\{n\}/g,
iConvert ? iConvert(iRGBA[2], iRGBA[1]) : (iValue * iScale)
);
this.setAttribute(iName, iValue, arguments[2]);
};
/* ---------- DOM Event ---------- */
var $_DOM = $(DOM);
// DOM Content Loading
if (BOM === BOM.top)
$.every(0.01, function () {
try {
DOM.documentElement.doScroll('left');
$_DOM.trigger('DOMContentLoaded');
return false;
} catch (iError) {
return;
}
});
// Patch for Change Event
var $_Change_Target = 'input[type="radio"], input[type="checkbox"]';
$_DOM.on('click', $_Change_Target, function () {
this.blur();
this.focus();
}).on('click', 'label', function () {
var $_This = $(this);
var _ID_ = $_This.attr('for');
if (_ID_)
$('input[id="' + _ID_ + '"]')[0].click();
else
$_This.find($_Change_Target).click();
});
// Submit & Reset Bubble
function Event_Hijack(iEvent) {
iEvent.preventDefault();
this[iEvent.type]();
}
$_DOM.on('click', 'input, button', function () {
if ( this.type.match(/submit|reset/) )
$(this.form).one(this.type, Event_Hijack);
}).on('keydown', 'form input, form select', function () {
if ((this.type != 'button') && (arguments[0].which == 13))
$(this.form).one((this.type == 'reset') ? 'reset' : 'submit', Event_Hijack);
});
var $_BOM = $(BOM),
_Submit_ = HTMLFormElement.prototype.submit,
_Reset_ = HTMLFormElement.prototype.reset;
function Fake_Bubble(iType, iMethod) {
var $_This = $(this);
$_BOM.on(iType, function (iEvent) {
if (iEvent.target !== $_This[0]) return;
if (! iEvent.defaultPrevented) iMethod.call(iEvent.target);
$_BOM.off(iType, arguments.callee);
});
var iEvent = arguments.callee.caller.arguments[0];
BOM.setTimeout(function () {
$.event.dispatch(
((iEvent instanceof $.Event) && (iEvent.type == iType)) ?
iEvent : {
type: iType,
target: $_This[0]
}
);
});
}
$.extend(HTMLFormElement.prototype, {
submit: $.proxy(Fake_Bubble, null, 'submit', _Submit_),
reset: $.proxy(Fake_Bubble, null, 'reset', _Reset_)
});
/* ---------- XML DOM Parser ---------- */
var IE_DOMParser = (function () {
for (var i = 0; arguments[i]; i++) try {
new ActiveXObject( arguments[i] );
return arguments[i];
} catch (iError) { }
})(
'MSXML2.DOMDocument.6.0', 'MSXML2.DOMDocument.5.0',
'MSXML2.DOMDocument.4.0', 'MSXML2.DOMDocument.3.0',
'MSXML2.DOMDocument', 'Microsoft.XMLDOM'
);
function XML_Create() {
var iXML = new ActiveXObject(IE_DOMParser);
iXML.async = false;
iXML.loadXML(arguments[0]);
return iXML;
}
BOM.DOMParser = function () { };
BOM.DOMParser.prototype.parseFromString = function () {
var iXML = XML_Create(arguments[0]);
if (iXML.parseError.errorCode)
iXML = XML_Create([
'<xml><parsererror><h3>This page contains the following errors:</h3><div>',
iXML.parseError.reason,
'</div></parsererror></xml>'
].join(''));
return iXML;
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- Document Current Script ---------- */
var Stack_Prefix = {
webkit: 'at ',
mozilla: '@',
msie: 'at Global code \\('
};
function Script_URL() {
try {
throw new Error('AMD_Loader');
} catch (iError) {
var iURL;
for (var iCore in Stack_Prefix)
if ( $.browser[iCore] ) {
iURL = iError.stack.match(RegExp(
"\\s+" + Stack_Prefix[iCore] + "(http(s)?:\\/\\/\\S+.js)"
));
return iURL && iURL[1];
}
}
}
if (! ('currentScript' in DOM))
Object.defineProperty(Object.getPrototypeOf(DOM), 'currentScript', {
get: function () {
var iURL = ($.browser.msie < 10) || Script_URL();
for (var i = 0; DOM.scripts[i]; i++)
if ((iURL === true) ?
(DOM.scripts[i].readyState == 'interactive') :
(DOM.scripts[i].src == iURL)
)
return DOM.scripts[i];
}
});
/* ---------- ParentNode Children ---------- */
function HTMLCollection(DOM_Array) {
for (var i = 0, j = 0; DOM_Array[i]; i++)
if (DOM_Array[i].nodeType == 1){
this[j] = DOM_Array[i];
if (this[j++].name) this[this[j - 1].name] = this[j - 1];
}
this.length = j;
}
HTMLCollection.prototype.item = HTMLCollection.prototype.namedItem =
function () {
return this[ arguments[0] ] || null;
};
var Children_Define = {
get: function () {
return new HTMLCollection( this.childNodes );
}
};
if (! DOM.createDocumentFragment().children)
Object.defineProperty(
($.browser.modern ? DocumentFragment : DOM.constructor).prototype,
'children',
Children_Define
);
if (! DOM.head.children[0])
Object.defineProperty(DOM_Proto, 'children', Children_Define);
/* ---------- Scrolling Element ---------- */
var DocProto = DOM.constructor.prototype;
if (! Object.getOwnPropertyDescriptor(DocProto, 'scrollingElement'))
Object.defineProperty(DocProto, 'scrollingElement', {
get: function () {
return ($.browser.webkit || (DOM.compatMode == 'BackCompat')) ?
DOM.body : DOM.documentElement;
}
});
/* ---------- Selected Options ---------- */
if ($.browser.msie < 12)
Object.defineProperty(HTMLSelectElement.prototype, 'selectedOptions', {
get: function () {
return new HTMLCollection(
$.map(this.options, function (iOption) {
return iOption.selected ? iOption : null;
})
);
}
});
/* ---------- Element CSS Selector Match ---------- */
var DOM_Proto = Element.prototype;
DOM_Proto.matches = DOM_Proto.matches || DOM_Proto.webkitMatchesSelector ||
DOM_Proto.msMatchesSelector || DOM_Proto.mozMatchesSelector ||
function () {
if (! this.parentNode) $('<div />')[0].appendChild(this);
return ($.inArray(
this, this.parentNode.querySelectorAll( arguments[0] )
) > -1);
};
if (! ($.browser.msie < 11)) return;
/* ---------- Element Data Set ---------- */
function DOMStringMap(iElement) {
for (var i = 0, iAttr; i < iElement.attributes.length; i++) {
iAttr = iElement.attributes[i];
if (iAttr.nodeName.slice(0, 5) == 'data-')
this[$.camelCase( iAttr.nodeName.slice(5) )] = iAttr.nodeValue;
}
}
Object.defineProperty(DOM_Proto, 'dataset', {
get: function () {
return new DOMStringMap(this);
}
});
/* ---------- URL Origin ---------- */
var Origin_Define = {
get: function () {
return $.urlDomain( this.href ) || '';
}
};
Object.defineProperty(
BOM.location.constructor.prototype, 'origin', Origin_Define
);
Object.defineProperty(HTMLAnchorElement.prototype, 'origin', Origin_Define);
if (! ($.browser.msie < 10)) return;
/* ---------- Error Useful Information ---------- */
// Thanks "Kevin Yang" ---
//
// http://www.imkevinyang.com/2010/01/%E8%A7%A3%E6%9E%90ie%E4%B8%AD%E7%9A%84javascript-error%E5%AF%B9%E8%B1%A1.html
Error.prototype.valueOf = function () {
return $.extend(this, {
code: this.number & 0x0FFFF,
helpURL: 'https://msdn.microsoft.com/en-us/library/1dk3k160(VS.85).aspx'
});
};
/* ---------- DOM Class List ---------- */
function DOMTokenList() {
var iClass = (arguments[0].getAttribute('class') || '').trim().split(/\s+/);
$.extend(this, iClass);
this.length = iClass.length;
}
DOMTokenList.prototype.contains = function (iClass) {
if (iClass.match(/\s+/))
throw new DOMException([
"Failed to execute 'contains' on 'DOMTokenList': The token provided (",
iClass,
") contains HTML space characters, which are not valid in tokens."
].join("'"));
return (Array.prototype.indexOf.call(this, iClass) > -1);
};
Object.defineProperty(DOM_Proto, 'classList', {
get: function () {
return new DOMTokenList(this);
}
});
/* ---------- DOM InnerHTML ---------- */
var InnerHTML = Object.getOwnPropertyDescriptor(DOM_Proto, 'innerHTML');
Object.defineProperty(DOM_Proto, 'innerHTML', {
set: function (iHTML) {
if (! String(iHTML).match(
/^[^<]*<\s*(head|meta|title|link|style|script|noscript|(!--[^>]*--))[^>]*>/i
))
return InnerHTML.set.call(this, iHTML);
InnerHTML.set.call(this, 'IE_Scope' + iHTML);
var iChild = this.childNodes;
iChild[0].nodeValue = iChild[0].nodeValue.slice(8);
if (! iChild[0].nodeValue[0]) this.removeChild( iChild[0] );
}
});
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
$.buildFragment = $.buildFragment || function (iNode) {
var iFragment = (arguments[1] || DOM).createDocumentFragment();
for (var i = 0; iNode[i]; i++)
iFragment.appendChild( iNode[i] );
return iFragment;
};
$.fn.insertTo = function ($_Target, Index) {
var DOM_Set = $.buildFragment(this, DOM), $_This = [ ];
$($_Target).each(function () {
var iAfter = $(this.children).eq(Index || 0)[0];
DOM_Set = arguments[0] ? DOM_Set.cloneNode(true) : DOM_Set;
$.merge($_This, DOM_Set.children);
this[iAfter ? 'insertBefore' : 'appendChild'](DOM_Set, iAfter);
});
return this.pushStack($_This);
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
$.fn.extend({
appendTo: function () {
return this.insertTo(arguments[0], Infinity);
},
prependTo: function () {
return this.insertTo( arguments[0] );
},
insertBefore: function ($_Target) {
var $_This = this;
return this.pushStack($.map($($_Target), function (iDOM) {
return $_This.insertTo(iDOM.parentNode, $(iDOM).index());
}));
},
insertAfter: function ($_Target) {
var $_This = this;
return this.pushStack($.map($($_Target), function (iDOM) {
return $_This.insertTo(iDOM.parentNode, $(iDOM).index() + 1);
}));
}
});
$.each(
{
appendTo: 'append',
prependTo: 'prepend',
insertBefore: 'before',
insertAfter: 'after'
},
function (iMethod) {
$.fn[arguments[1]] = function () {
$( arguments[0] )[iMethod](this);
return this;
};
}
);
$.globalEval = function () {
$('<script />').prop('text', arguments[0]).appendTo('head');
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- CSS Prefix ---------- */
var CSS_Prefix = (function (iHash) {
for (var iKey in iHash)
if ( $.browser[iKey] ) return iHash[iKey];
})({
mozilla: 'moz',
webkit: 'webkit',
msie: 'ms'
});
$.cssName = $.curry(function (Test_Type, iName) {
return BOM[Test_Type] ? iName : ('-' + CSS_Prefix + '-' + iName);
});
/* ---------- CSS Rule ---------- */
var Code_Indent = $.browser.modern ? '' : ' '.repeat(4);
function CSS_Attribute(iName, iValue) {
if ($.isNumeric(iValue) && iName.match($.cssPX))
iValue += 'px';
return [iName, ':', Code_Indent, iValue].join('');
}
function CSS_Rule2Text(iRule) {
var Rule_Text = [''], Rule_Block, _Rule_Block_;
$.each(iRule, function (iSelector) {
Rule_Block = iSelector + ' {';
_Rule_Block_ = [ ];
for (var iName in this)
_Rule_Block_.push(
CSS_Attribute(iName, this[iName])
.replace(/^(\w)/m, Code_Indent + '$1')
);
Rule_Text.push(
[Rule_Block, _Rule_Block_.join(";\n"), '}'].join("\n")
);
});
Rule_Text.push('');
return Rule_Text.join("\n");
}
$.cssRule = function (At_Wrapper, iRule) {
if (typeof At_Wrapper != 'string') {
iRule = At_Wrapper;
At_Wrapper = null;
}
var CSS_Text = CSS_Rule2Text(iRule);
var $_Style = $('<style />', {
type: 'text/css',
'class': 'iQuery_CSS-Rule',
text: (! At_Wrapper) ? CSS_Text : [
At_Wrapper + ' {',
CSS_Text.replace(/\n/m, "\n "),
'}'
].join("\n")
}).appendTo(DOM.head);
return ($_Style[0].sheet || $_Style[0].styleSheet);
};
function CSS_Rule_Search(iStyleSheet, iFilter) {
return $.map(iStyleSheet || DOM.styleSheets, function () {
var iRule = arguments[0].cssRules, _Self_ = arguments.callee;
if (! iRule) return;
return $.map(iRule, function (_Rule_) {
return (_Rule_.cssRules ? _Self_ : iFilter)(_Rule_);
});
});
}
function CSSRuleList() {
$.extend(this, arguments[0]);
this.length = arguments[0].length;
}
if (typeof BOM.getMatchedCSSRules != 'function')
BOM.getMatchedCSSRules = function (iElement, iPseudo) {
if (! (iElement instanceof Element)) return null;
if (typeof iPseudo == 'string') {
iPseudo = (iPseudo.match(/^\s*:{1,2}([\w\-]+)\s*$/) || [ ])[1];
if (! iPseudo) return null;
} else if (iPseudo)
iPseudo = null;
return new CSSRuleList(CSS_Rule_Search(null, function (iRule) {
var iSelector = iRule.selectorText;
if (iPseudo) {
iSelector = iSelector.replace(/:{1,2}([\w\-]+)$/, function () {
return (arguments[1] == iPseudo) ? '' : arguments[0];
});
if (iSelector == iRule.selectorText) return;
}
if (iElement.matches( iSelector )) return iRule;
}));
};
$.fn.cssRule = function (iRule, iCallback) {
if (! $.isPlainObject(iRule)) {
var $_This = this;
return ($_This[0] && CSS_Rule_Search(null, function (_Rule_) {
if ((
(typeof $_This.selector != 'string') ||
($_This.selector != _Rule_.selectorText)
) &&
(! $_This[0].matches(_Rule_.selectorText))
)
return;
if ((! iRule) || (iRule && _Rule_.style[iRule]))
return _Rule_;
}));
}
return this.each(function () {
var _Rule_ = { }, _ID_ = this.getAttribute('id');
if (! _ID_) {
_ID_ = $.uuid();
this.setAttribute('id', _ID_);
}
for (var iSelector in iRule)
_Rule_['#' + _ID_ + iSelector] = iRule[iSelector];
var iSheet = $.cssRule(_Rule_);
if (typeof iCallback == 'function') iCallback.call(this, iSheet);
});
};
/* ---------- Smart zIndex ---------- */
function Get_zIndex() {
for (
var $_This = $(this), zIndex;
$_This[0];
$_This = $($_This[0].offsetParent)
)
if ($_This.css('position') != 'static') {
zIndex = parseInt( $_This.css('z-index') );
if (zIndex > 0) return zIndex;
}
return 0;
}
function Set_zIndex() {
var $_This = $(this), _Index_ = 0;
$_This.siblings().addBack().filter(':visible').each(function () {
_Index_ = Math.max(_Index_, Get_zIndex.call(this));
});
$_This.css('z-index', ++_Index_);
}
$.fn.zIndex = function (new_Index) {
if (! $.isData(new_Index))
return Get_zIndex.call(this[0]);
else if (new_Index == '+')
return this.each(Set_zIndex);
else
return this.css('z-index', parseInt(new_Index) || 'auto');
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- JS-Timer Animation ---------- */
var FPS = 60,
Animate_Property = {
scrollLeft: true,
scrollTop: true
};
function KeyFrame(iStart, iEnd, During_Second) {
During_Second = Number(During_Second) || 1;
var iKF = [ ], KF_Sum = FPS * During_Second;
var iStep = (iEnd - iStart) / KF_Sum;
for (var i = 0, KFV = iStart, j = 0; i < KF_Sum; i++) {
KFV += iStep;
iKF[j++] = Number( KFV.toFixed(2) );
}
return iKF;
}
function JSTimer_Animate(CSS_Final, During_Second, iEasing) {
var iAnimate = [ ], $_This = this;
$.each(CSS_Final, function (iName) {
var iStyle = this;
iAnimate.push(new Promise(function (iResolve, iReject) {
if (! $.isNumeric(iStyle)) {
$_This.css(iName, iStyle);
return iResolve();
}
var iSpecial = (iName in Animate_Property);
var iKeyFrame = KeyFrame(
iSpecial ? $_This[iName]() : $_This.css(iName),
iStyle,
During_Second
);
$.every(1 / FPS, function () {
if (! $_This.data('_Animate_'))
iReject('Animating stoped');
else if ( iKeyFrame.length ) {
if (iSpecial)
$_This[iName]( iKeyFrame.shift() );
else
$_This.css(iName, iKeyFrame.shift());
return;
} else
iResolve();
return false;
});
}));
});
return Promise.all( iAnimate );
}
/* ---------- CSS Animation ---------- */
var NameFixer = $.cssName('AnimationEvent');
function KeyFrame_Animate(iEffect) {
if (typeof iEffect != 'string') {
var CSS_Final = iEffect; iEffect = $.uuid();
var iStyle = $.cssRule(
'@' + NameFixer('keyframes') + ' ' + iEffect,
{to: CSS_Final}
);
}
var iAnimation = { }, $_This = this;
iAnimation[ NameFixer('animation-name') ] = iEffect;
iAnimation[ NameFixer('animation-duration') ] = arguments[1] + 's';
iAnimation[ NameFixer('animation-timing-function') ] = arguments[2];
return new Promise(function (iResolve) {
$_This.one('animationend WebkitAnimationEnd', function () {
if (iStyle) $( iStyle.ownerNode ).remove();
iResolve();
}).css( iAnimation );
});
}
/* ---------- Animation Core ---------- */
$.fn.extend({
animate: function (CSS_Final) {
if (! this[0]) return this;
var iEngine = KeyFrame_Animate;
if (typeof CSS_Final != 'string') {
var iCSS = Object.keys( CSS_Final );
this.data('_Animate_', 1).data('_CSS_Animate_', function () {
return $.extend(arguments[1], $(this).css(iCSS));
});
iEngine = (
(($.browser.msie < 10) || (! $.isEmptyObject(
$.intersect($.makeSet.apply($, iCSS), Animate_Property)
))) ?
JSTimer_Animate : KeyFrame_Animate
);
}
var iArgs = $.makeArray( arguments ).slice(1);
var During_Second = $.isNumeric( iArgs[0] ) ?
(iArgs.shift() / 1000) : 0.4,
iEasing = (typeof iArgs[0] == 'string') ? iArgs.shift() : '',
iCallback = (typeof iArgs[0] == 'function') && iArgs[0];
return this.data('_Animate_Queue_', function (_, iQueue) {
var $_This = $(this);
var iProcess = $.proxy(
iEngine, $_This, CSS_Final, During_Second, iEasing
);
var qCount = $_This.data('_Queue_Count_') || 0;
$_This.data('_Queue_Count_', ++qCount);
iQueue = (iQueue ? iQueue.then(iProcess) : iProcess())
.then(function () {
var qCount = $_This.data('_Queue_Count_');
if (--qCount)
$_This.data('_Queue_Count_', qCount);
else
$_This.data({
_Queue_Count_: null,
_Animate_Queue_: null
});
});
iQueue.then(iCallback);
return iQueue;
});
},
stop: function () {
if ( arguments[0] ) this.data('_Animate_Queue_', null);
return this.data('_Animate_', 0)
.css(NameFixer('animation-play-state'), 'paused');
},
promise: function () {
return Promise.all($.map(this, function (iDOM) {
return $(iDOM).data('_Animate_Queue_');
}));
}
});
$.expr[':'].animated = function () {
var $_This = $( arguments[0] );
return $_This.data('_Animate_') || (
$_This.css( NameFixer('animation-play-state') ) == 'running'
);
};
$.fn.effect = $.fn.animate;
$.fx = {interval: 1000 / FPS};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- Atom Effect ---------- */
var Pseudo_Class = $.makeSet([
':link', 'visited', 'hover', 'active', 'focus', 'lang',
'enabled', 'disabled', 'checked',
'first-child', 'last-child', 'first-of-type', 'last-of-type',
'nth-child', 'nth-of-type', 'nth-last-child', 'nth-last-of-type',
'only-child', 'only-of-type', 'empty'
].join(' :').split(' '));
function CSS_Selector_Priority(iSelector) {
var iPriority = [0, 0, 0];
if ( iSelector.match(/\#[^\s>\+~]+/) ) iPriority[0]++ ;
var iPseudo = (iSelector.match(/:[^\s>\+~]+/g) || [ ]);
var pClass = $.map(iPseudo, function () {
if (arguments[0] in Pseudo_Class) return arguments[0];
});
iPriority[1] += (
iSelector.match(/\.[^\s>\+~]+/g) || [ ]
).concat(
iSelector.match(/\[[^\]]+\]/g) || [ ]
).concat(pClass).length;
iPriority[2] += ((
iSelector.match(/[^\#\.\[:]?[^\s>\+~]+/g) || [ ]
).length + (
iPseudo.length - pClass.length
));
return iPriority;
}
function CSS_Rule_Sort(A, B) {
var pA = CSS_Selector_Priority(A.selectorText),
pB = CSS_Selector_Priority(B.selectorText);
for (var i = 0; i < pA.length; i++)
if (pA[i] == pB[i]) continue;
else
return (pA[i] > pB[i]) ? -1 : 1;
return 0;
}
var Tag_Style = { }, _BOM_;
$(DOM).ready(function () {
_BOM_ = $('<iframe />', {
id: '_CSS_SandBox_',
src: 'about:blank',
css: {display: 'none'}
}).appendTo(this.body)[0].contentWindow;
});
function Tag_Default_CSS(iTagName) {
if (! Tag_Style[iTagName]) {
var $_Default = $('<' + iTagName + ' />').appendTo(
_BOM_.document.body
);
Tag_Style[iTagName] = $.extend(
{ }, BOM.getComputedStyle( $_Default[0] )
);
$_Default.remove();
}
return Tag_Style[iTagName];
}
var Disable_Value = $.makeSet('none', '0', '0px', 'hidden');
function Last_Valid_CSS(iName) {
var iRule = [this[0]].concat(
this.cssRule( iName ).sort( CSS_Rule_Sort ),
{
style: Tag_Default_CSS( this[0].tagName.toLowerCase() )
}
);
for (var i = 0, iValue; i < iRule.length; i++) {
iValue = iRule[i].style[iName];
if (iValue && (! (iValue in Disable_Value)))
return iValue;
}
}
$.fn.extend({
hide: function () {
return this.css('display', function () {
if (arguments[1] != 'none')
$(this).data('_CSS_Display_', arguments[1]);
return 'none';
});
},
show: function () {
return this.each(function () {
var $_This = $(this);
var iStyle = $_This.css(['display', 'visibility', 'opacity']);
if (iStyle.display == 'none')
$_This.css('display', (
$_This.data('_CSS_Display_') ||
Last_Valid_CSS.call($_This, 'display')
));
if (iStyle.visibility == 'hidden')
$_This.css('visibility', 'visible');
if (iStyle.opacity == 0)
$_This.css('opacity', 1);
});
}
});
/* ---------- Animation ShortCut ---------- */
$.fn.extend($.map({
fadeIn: {opacity: 1},
fadeOut: {opacity: 0},
slideUp: {
overflow: 'hidden',
height: 0,
'padding-left': 0,
'padding-right': 0,
'padding-top': 0,
'padding-bottom': 0,
opacity: 0
},
slideDown: {
overflow: 'auto',
height: 'auto',
'padding-left': 'auto',
'padding-right': 'auto',
'padding-top': 'auto',
'padding-bottom': 'auto',
opacity: 1
}
}, function (CSS_Next) {
return function () {
if (! this[0]) return this;
var $_This = this, CSS_Prev = this.data('_CSS_Animate_');
return this.animate.apply(this, $.merge(
[$.map(CSS_Next, function (iValue, iKey) {
if (iValue == 'auto') {
iValue = (CSS_Prev || { })[iKey];
if ((! iValue) && (iValue !== 0))
iValue = Last_Valid_CSS.call($_This, iKey);
}
return (iValue || (iValue === 0)) ?
iValue : CSS_Next[iKey];
})],
arguments
));
};
}));
$.fn.toggle = function () {
return this[[
['show', 'hide'], ['slideDown', 'slideUp']
][
arguments.length && 1
][
this.height() && 1
]].apply(
this, arguments
);
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
var iOperator = {
'+': function () {
return arguments[0] + arguments[1];
},
'-': function () {
return arguments[0] - arguments[1];
}
},
Array_Reverse = $.fn.iquery ?
Array.prototype.reverse : function () { return this; };
$.fn.extend({
reduce: function (iMethod, iKey, iCallback) {
if (arguments.length < 3) {
iCallback = iKey;
iKey = undefined;
}
if (typeof iCallback == 'string') iCallback = iOperator[iCallback];
return $.map(this, function () {
return $( arguments[0] )[iMethod](iKey);
}).reduce(iCallback);
},
sameParents: function () {
if (this.length < 2) return this.parents();
var iMin = $.trace(this[0], 'parentNode').slice(0, -1),
iPrev;
for (var i = 1, iLast; i < this.length; i++) {
iLast = $.trace(this[i], 'parentNode').slice(0, -1);
if (iLast.length < iMin.length) {
iPrev = iMin;
iMin = iLast;
}
}
iPrev = iPrev || iLast;
var iDiff = iPrev.length - iMin.length, $_Result = [ ];
for (var i = 0; i < iMin.length; i++)
if (iMin[i] === iPrev[i + iDiff]) {
$_Result = iMin.slice(i);
break;
}
return Array_Reverse.call(this.pushStack(
arguments[0] ? $($_Result).filter(arguments[0]) : $_Result
));
},
scrollParents: function () {
return Array_Reverse.call(this.pushStack($.merge(
this.eq(0).parents(':scrollable'), [ DOM ]
)));
},
inViewport: function () {
for (var i = 0, _OS_, $_BOM, BOM_W, BOM_H; this[i]; i++) {
_OS_ = this[i].getBoundingClientRect();
$_BOM = $( this[i].ownerDocument.defaultView );
BOM_W = $_BOM.width(), BOM_H = $_BOM.height();
if (
(_OS_.left < 0) || (_OS_.left > BOM_W) ||
(_OS_.top < 0) || (_OS_.top > BOM_H)
)
return false;
}
return true;
},
scrollTo: function () {
if (! this[0]) return this;
var $_This = this;
$( arguments[0] ).each(function () {
var $_Scroll = $_This.has(this);
var iCoord = $(this).offset(), _Coord_ = $_Scroll.offset();
if (! $_Scroll.length) return;
$_Scroll.animate({
scrollTop: (! _Coord_.top) ? iCoord.top : (
$_Scroll.scrollTop() + (iCoord.top - _Coord_.top)
),
scrollLeft: (! _Coord_.left) ? iCoord.left : (
$_Scroll.scrollLeft() + (iCoord.left - _Coord_.left)
)
});
});
return this;
}
});
/* ----- DOM UI Data Operator ----- */
var RE_URL = /^(\w+:)?\/\/[\u0021-\u007e\uff61-\uffef]+$/;
function Value_Operator(iValue) {
var $_This = $(this), End_Element = (! this.children.length);
var _Set_ = $.isData(iValue),
iURL = (typeof iValue == 'string') && iValue.trim();
var isURL = iURL && iURL.split('#')[0].match(RE_URL);
switch ( this.tagName.toLowerCase() ) {
case 'a': {
if (_Set_) {
if ( isURL )
this.href = iURL;
else if (iURL.match( /.+?@[^@]{3,}/ ))
this.href = 'mailto:' + iURL;
if (End_Element) this.textContent = iValue;
return;
}
return this.href || (End_Element && this.textContent);
}
case 'img':
return this[(_Set_ ? 'set' : 'get') + 'Attribute']('src', iValue);
case 'textarea': ;
case 'select': if (_Set_) {
this.value = iValue;
break;
}
case 'option': if (_Set_) {
this[this.hasAttribute('value') ? 'value' : 'textContent'] = iValue;
break;
} else
return this.value;
case 'input': {
var _Value_ = this.value;
if (this.getAttribute('type') != 'tel') try {
_Value_ = JSON.parse(_Value_);
} catch (iError) { }
if ((this.type || '').match(/radio|checkbox/i)) {
if (_Set_) {
if ((! _Value_) || (_Value_ == 'on'))
this.value = iValue;
else if (_Value_ === iValue)
this.checked = true;
} else
return this.checked && _Value_;
} else if (_Set_)
this.value = iValue;
return _Value_;
}
default: {
if (_Set_) {
if ((! End_Element) && isURL)
$_This.css('background-image', 'url("' + iURL + '")');
else
$_This.html(iValue);
return;
}
iURL = $_This.css('background-image').match(
/^url\(('|")?([^'"]+)('|")?\)/
);
return End_Element ? this.textContent : (iURL && iURL[2]);
}
}
}
$.fn.value = function (iAttr, iFiller) {
var $_Value = $.isEmptyObject( iFiller ) ?
('[' + iAttr + ']') :
$.map(Object.keys(iFiller), function () {
return '[' + iAttr + '="' + arguments[0] + '"]';
}).join(', ');
$_Value = this.filter( $_Value ).add( this.find($_Value) );
if (! iFiller)
return Value_Operator.call( $_Value[0] );
var Data_Set = (typeof iFiller != 'function');
$_Value = this.pushStack($.map($_Value, function (iDOM) {
var iKey = iDOM.getAttribute( iAttr );
var iValue = Data_Set ? iFiller[iKey] : iFiller.apply(iDOM, [
iKey, arguments[0], $_Value
]);
if (iValue != null) {
Value_Operator.call(iDOM, iValue);
return iDOM;
}
}));
$_Value.filter(':input').change();
return $_Value;
};
/* ---------- HTML DOM SandBox ---------- */
$.fn.sandBox = function () {
var iArgs = $.makeArray(arguments);
var iCallback = (typeof iArgs.slice(-1)[0] == 'function') && iArgs.pop();
var iHTML = $.isSelector(iArgs[0]) ? '' : iArgs.shift();
var iSelector = iArgs[0];
var $_iFrame = this.filter('iframe').eq(0);
if (! $_iFrame.length)
$_iFrame = $('<iframe style="display: none"></iframe>');
$_iFrame.one('load', function () {
var _DOM_ = this.contentWindow.document;
function Frame_Ready() {
if (! (_DOM_.body && _DOM_.body.childNodes.length))
return;
var $_Content = $(iSelector || 'body > *', _DOM_);
if (iCallback && (false === iCallback.call(
$_iFrame[0], $($.merge(
$.makeArray($('head style, head script', _DOM_)),
$_Content[0] ? $_Content : _DOM_.body.childNodes
))
)))
$_iFrame.remove();
if ($.browser.msie) BOM.CollectGarbage();
return false;
}
if (! iHTML) Frame_Ready();
$.every(0.04, Frame_Ready);
_DOM_.write(iHTML);
_DOM_.close();
}).attr('src', ((! iHTML.match(/<.+?>/)) && iHTML.trim()) || 'about:blank');
return $_iFrame[0].parentElement ? this : $_iFrame.appendTo(DOM.body);
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
var W3C_Selection = (! ($.browser.msie < 10));
function Select_Node(iSelection) {
var iFocus = W3C_Selection ?
iSelection.focusNode : iSelection.createRange().parentElement();
var iActive = iFocus.ownerDocument.activeElement;
return $.contains(iActive, iFocus) ? iFocus : iActive;
}
function Find_Selection() {
var iDOM = this.document || this.ownerDocument || this;
if (iDOM.activeElement.tagName.toLowerCase() == 'iframe') try {
return arguments.callee.call( iDOM.activeElement.contentWindow );
} catch (iError) { }
var iSelection = W3C_Selection ? iDOM.getSelection() : iDOM.selection;
var iNode = Select_Node(iSelection);
return $.contains(
(this instanceof Element) ? this : iDOM, iNode
) && [
iSelection, iNode
];
}
$.fn.selection = function (iContent) {
if (iContent === undefined) {
var iSelection = Find_Selection.call(this[0])[0];
return W3C_Selection ?
iSelection.toString() : iSelection.createRange().htmlText;
}
return this.each(function () {
var iSelection = Find_Selection.call(this);
var iNode = iSelection[1];
iSelection = iSelection[0];
iNode = (iNode.nodeType == 1) ? iNode : iNode.parentNode;
if (! W3C_Selection) {
iSelection = iSelection.createRange();
return iSelection.text = (
(typeof iContent == 'function') ?
iContent.call(iNode, iSelection.text) : iContent
);
}
var iProperty, iStart, iEnd;
if ((iNode.tagName || '').match(/input|textarea/i)) {
iProperty = 'value';
iStart = Math.min(iNode.selectionStart, iNode.selectionEnd);
iEnd = Math.max(iNode.selectionStart, iNode.selectionEnd);
} else {
iProperty = 'innerHTML';
iStart = Math.min(iSelection.anchorOffset, iSelection.focusOffset);
iEnd = Math.max(iSelection.anchorOffset, iSelection.focusOffset);
}
var iValue = iNode[iProperty];
iNode[iProperty] = iValue.slice(0, iStart) + (
(typeof iContent == 'function') ?
iContent.call(iNode, iValue.slice(iStart, iEnd)) : iContent
) + iValue.slice(iEnd);
});
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
function Observer() {
this.requireArgs = arguments[0] || 0;
this.filter = arguments[1] || [ ];
this.table = [ ];
return this;
}
function Each_Row() {
var _This_ = this, iArgs = $.makeArray(arguments);
if (typeof iArgs[iArgs.length - 1] != 'function') return;
var WrapCall = iArgs.pop();
$.each(this.table, function () {
var iCallback = this[this.length - 1];
if (iCallback == null) return;
for (var i = 0; i < iArgs.length; i++) {
if (typeof this[i] == 'function') break;
if (this[i] === undefined) {
if (i < _This_.requireArgs) return;
} else if (
(typeof _This_.filter[i] == 'function') ? (
false === _This_.filter[i].call(
_This_, this[i], iArgs[i]
)
) : (
(this[i] != iArgs[i]) && (! iArgs[i].match(this[i]))
)
)
return;
}
if (false === WrapCall.call(_This_, iCallback))
this[this.length - 1] = null;
});
}
$.extend(Observer.prototype, {
on: function () {
if (typeof arguments[arguments.length - 1] == 'function') {
var iArgs = $.makeArray(arguments);
for (var i = 0; this.table[i]; i++)
if ($.isEqual(this.table[i], iArgs))
return this;
this.table.push(iArgs);
}
return this;
},
off: function () {
var iArgs = $.makeArray(arguments);
var iCallback = (typeof iArgs[iArgs.length - 1] == 'function') &&
iArgs.pop();
iArgs.push(function () {
return (iCallback !== false) && (iCallback !== arguments[0]);
});
Each_Row.apply(this, iArgs);
return this;
},
one: function () {
var iArgs = $.makeArray(arguments);
if (typeof iArgs[iArgs.length - 1] == 'function') {
var iCallback = iArgs.pop();
iArgs.push(function () {
this.off.apply(this, iArgs);
return iCallback.apply(this, arguments);
});
this.on.apply(this, iArgs);
}
return this;
},
trigger: function () {
var iArgs = $.makeArray(arguments), iReturn = [ ];
var iData = $.likeArray(iArgs[iArgs.length - 1]) && iArgs.pop();
iArgs.push(function () {
var _Return_ = arguments[0].apply(this, iData);
if ($.isData(_Return_)) iReturn.push(_Return_);
});
Each_Row.apply(this, iArgs);
return iReturn;
}
});
$.Observer = Observer;
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- Custom API ---------- */
var $_DOM = $(DOM), iAJAX = new $.Observer(1);
function AJAX_Register(iName) {
var iArgs = $.makeArray(arguments).slice(1);
var iCallback = iArgs[iArgs.length - 1];
if (typeof iCallback != 'function') return;
iArgs.splice(-1, 1, function () {
return iCallback.apply(BOM, $.makeArray(arguments).slice(1));
});
iAJAX.on.apply(iAJAX, [iName].concat(iArgs));
}
$.extend({
ajaxPrefilter: $.proxy(AJAX_Register, $, 'prefilter'),
ajaxTransport: $.proxy(AJAX_Register, $, 'transport')
});
/* ---------- Original XHR ---------- */
$.ajaxTransport(function (iOption) {
var iXHR;
return {
send: function (iHeader, iComplete) {
iXHR = new BOM.XMLHttpRequest();
iXHR.open(iOption.type, iOption.url, true);
iXHR[iOption.crossDomain ? 'onload' : 'onreadystatechange'] =
function () {
if (! (iOption.crossDomain || (iXHR.readyState == 4)))
return;
var iResponse = {text: iXHR.responseText};
iResponse[ iXHR.responseType ] = iXHR.response;
iComplete(
iXHR.status,
iXHR.statusText,
iResponse,
iXHR.getAllResponseHeaders()
);
};
if (iOption.xhrFields) $.extend(iXHR, iOption.xhrFields);
if (! iOption.crossDomain)
iOption.headers = $.extend(iOption.headers || { }, iHeader, {
'X-Requested-With': 'XMLHttpRequest',
Accept: '*/*'
});
for (var iKey in iOption.headers)
iXHR.setRequestHeader(iKey, iOption.headers[iKey]);
var iData = iOption.data;
if ((iData instanceof Array) || $.isPlainObject(iData))
iData = $.param(iData);
if ((typeof iData == 'string') || iOption.contentType)
iXHR.setRequestHeader('Content-Type', (
iOption.contentType || 'application/x-www-form-urlencoded'
));
iOption.data = iData;
iXHR.send(iData);
},
abort: function () {
iXHR.onload = iXHR.onreadystatechange = null;
iXHR.abort();
iXHR = null;
}
};
});
/* ---------- Response Data ---------- */
var ResponseType = $.makeSet('html', 'xml', 'json');
function AJAX_Complete(iResolve, iReject, iCode) {
var iHeader = { };
if (arguments[5])
$.each(arguments[5].split("\r\n"), function () {
var _Header_ = $.split(this, /:\s+/, 2);
iHeader[_Header_[0]] = _Header_[1];
});
var iType = (iHeader['Content-Type'] || '').split(';')[0].split('/');
$.extend(this, {
status: iCode,
statusText: arguments[3],
responseText: arguments[4].text,
responseType:
((iType[1] in ResponseType) ? iType[1] : iType[0]) || 'text'
});
this.response = this.responseText;
switch ( this.responseType ) {
case 'text': ;
case 'html': if (this.responseText.match(/^\s*<.+?>/)) {
try {
this.response = $.parseXML( this.responseText );
this.responseType = 'xml';
} catch (iError) {
this.response = $.buildFragment(
$.parseHTML( this.responseText )
);
this.responseType = 'html';
}
break;
}
case 'json':
try {
this.response = $.parseJSON( this.responseText );
this.responseType = 'json';
} catch (iError) { }
break;
case 'xml': this.response = this.responseXML;
}
if (iCode < 400)
iResolve( this.response );
else
iReject( this.statusText );
}
/* ---------- Request Core ---------- */
var Default_Option = {
type: 'GET',
dataType: 'text'
};
function Complete_Event(iStatus, iOption) {
$_DOM.trigger('ajaxComplete', [this, iOption]);
if (typeof iOption.complete == 'function')
iOption.complete(this, iStatus);
}
$.ajax = function (iURL, iOption) {
if ($.isPlainObject( iURL ))
iOption = iURL;
else {
iOption = iOption || { };
iOption.url = iURL;
}
// Option Object
var _Option_ = $.extend({
url: BOM.location.href
}, Default_Option, iOption);
iURL = _Option_.url;
_Option_.crossDomain = $.isCrossDomain(iURL);
_Option_.url = iURL = iURL.replace(/&?(\w+)=\?/, function () {
if (_Option_.jsonp = arguments[1]) _Option_.dataType = 'jsonp';
return '';
});
if (_Option_.type == 'GET') {
var File_Name = $.fileName(iURL);
if (! (_Option_.jsonp || $.browser.modern || $.map(
$('link[rel="next"], link[rel="prefetch"]'),
function () {
if ($.fileName( arguments[0].href ) == File_Name)
return iURL;
}
).length))
_Option_.data._ = $.now();
_Option_.data = $.extend($.paramJSON(iURL), _Option_.data);
_Option_.url = $.extendURL(iURL, _Option_.data);
}
// Prefilter & Transport
var iXHR = new BOM.XMLHttpRequest(), iArgs = [_Option_, iOption, iXHR];
iAJAX.trigger('prefilter', iArgs);
iXHR = iAJAX.trigger('transport', _Option_.dataType, iArgs).slice(-1)[0];
// Async Promise
var iResult = new Promise(function (iResolve, iReject) {
if (_Option_.timeout)
$.wait(_Option_.timeout / 1000, function () {
iXHR.abort();
var iError = new Error('XMLHttpRequest Timeout');
iReject(iError);
$_DOM.trigger('ajaxError', [iXHR, _Option_, iError]);
});
iXHR.send({ }, $.proxy(AJAX_Complete, iXHR, iResolve, iReject));
$_DOM.trigger('ajaxSend', [iXHR, _Option_]);
});
iArgs = [iXHR, _Option_];
iResult.then(function () {
$_DOM.trigger('ajaxSuccess', iArgs);
if (typeof _Option_.success == 'function')
_Option_.success(arguments[0], 'success', iXHR);
Complete_Event.call(iXHR, 'success', _Option_);
}, function (iError) {
$_DOM.trigger('ajaxError', iArgs.concat(iError));
if (typeof _Option_.error == 'function')
_Option_.error(iXHR, 'error', iError);
Complete_Event.call(iXHR, 'error', _Option_);
});
return iResult;
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- RESTful API ---------- */
function HTTP_Request(iMethod, iURL, iData, iCallback, DataType) {
if (typeof iData == 'function') {
DataType = iCallback;
iCallback = iData;
iData = null;
}
return $.ajax({
type: iMethod,
url: iURL,
crossDomain: true,
data: iData,
dataType: DataType,
success: iCallback
});
}
var _Patch_ = ($ !== BOM.iQuery);
var HTTP_Method = $.makeSet.apply(
$, ['PUT', 'DELETE'].concat(_Patch_ ? [ ] : ['GET', 'POST'])
);
for (var iMethod in HTTP_Method)
$[ iMethod.toLowerCase() ] = $.proxy(HTTP_Request, BOM, iMethod);
if (! _Patch_) $.getJSON = $.get;
/* ---------- Smart Load ---------- */
function HTML_Exec($_Fragment) {
var $_Insert = [ ];
for (var j = 0; $_Fragment[0]; ) {
if ($_Fragment[0].tagName != 'SCRIPT')
$_Insert[j++] = $_Fragment[0];
else {
this.append( $_Insert );
$_Insert.length = j = 0;
if (! $_Fragment[0].src)
this.each(function () {
$('<script />').prop('text', $_Fragment[0].text)
.appendTo(this);
});
else
return Promise.all($.map(this, function (_This_) {
return new Promise(function () {
_This_.appendChild(
$('<script />')
.on('load', arguments[0])
.on('error', arguments[1])
.prop('src', $_Fragment[0].src)[0]
);
$_Fragment.shift();
});
})).then($.proxy(arguments.callee, this, $_Fragment));
}
$_Fragment.shift();
}
this.append( $_Insert );
return Promise.resolve('');
}
$.fn.htmlExec = function () {
return HTML_Exec.call(this, $.makeArray( $(arguments[0]) ));
};
$.fn.load = function (iURL, iData, iCallback) {
if (! this[0]) return this;
if (typeof iData == 'function') {
iCallback = iData;
iData = null;
}
var $_This = this;
iURL = iURL.trim().split(/\s+/);
$[iData ? 'post' : 'get'](iURL[0], iData, function (iHTML, _, iXHR) {
iHTML = (typeof iHTML == 'string') ? iHTML : iXHR.responseText;
Promise.resolve(
$_This.children().fadeOut(200).promise()
).then(function () {
$_This.empty();
if (! iURL[1]) return $_This.htmlExec(iHTML);
$('<div />').append( iHTML ).find( iURL[1] ).appendTo( $_This );
}).then(function () {
if (typeof iCallback == 'function')
$_This.each($.proxy(iCallback, null, iHTML, _, iXHR));
});
}, 'html');
return this;
};
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
if (! (($.browser.msie < 10) || $.browser.ios))
return;
/* ---------- Placeholder ---------- */
var _Value_ = {
INPUT: Object.getOwnPropertyDescriptor(
HTMLInputElement.prototype, 'value'
),
TEXTAREA: Object.getOwnPropertyDescriptor(
HTMLTextAreaElement.prototype, 'value'
)
};
function getValue() {
return _Value_[this.tagName].get.call(this);
}
function PH_Blur() {
if (getValue.call( this )) return;
this.value = this.placeholder;
this.style.color = 'gray';
}
function PH_Focus() {
if (this.placeholder != getValue.call(this)) return;
this.value = '';
this.style.color = '';
}
var iPlaceHolder = {
get: function () {
return this.getAttribute('placeholder');
},
set: function () {
if ($.browser.modern)
this.setAttribute('placeholder', arguments[0]);
PH_Blur.call(this);
$(this).off('focus', PH_Focus).off('blur', PH_Blur)
.focus(PH_Focus).blur(PH_Blur);
}
};
Object.defineProperty(
HTMLInputElement.prototype, 'placeholder', iPlaceHolder
);
Object.defineProperty(
HTMLTextAreaElement.prototype, 'placeholder', iPlaceHolder
);
$(DOM).ready(function () {
$('input[placeholder], textarea[placeholder]')
.prop('placeholder', function () {
return this.placeholder;
});
});
/* ---------- Field Value ---------- */
var Value_Patch = {
get: function () {
var iValue = getValue.call(this);
return (
(iValue == this.placeholder) && (this.style.color == 'gray')
) ?
'' : iValue;
}/*,
set: function () {
_Value_.set.call(this, arguments[0]);
if (this.style.color == 'gray') this.style.color = '';
}*/
};
Object.defineProperty(HTMLInputElement.prototype, 'value', Value_Patch);
Object.defineProperty(HTMLTextAreaElement.prototype, 'value', Value_Patch);
/* ---------- Form Data Object ---------- */
if (! ($.browser.msie < 10)) return;
BOM.FormData = function () {
this.ownerNode = arguments[0];
};
$.extend(BOM.FormData.prototype, {
append: function () {
this[ arguments[0] ] = arguments[1];
},
toString: function () {
return $(this.ownerNode).serialize();
}
});
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
/* ---------- DOM HTTP Request ---------- */
BOM.DOMHttpRequest = function () {
this.status = 0;
this.readyState = 0;
this.responseType = 'text';
};
var Success_State = {
readyState: 4,
status: 200,
statusText: 'OK'
};
function Allow_Send() {
return (this.readyState == 1) || (this.readyState == 4);
}
function iFrame_Send() {
var iDHR = this,
iTarget = this.$_Transport.submit(
$.proxy(Allow_Send, this)
).attr('target');
if ((! iTarget) || iTarget.match(/^_(top|parent|self|blank)$/i)) {
iTarget = $.uuid('DHR');
this.$_Transport.attr('target', iTarget);
}
$('iframe[name="' + iTarget + '"]').sandBox(function () {
$.extend(iDHR, Success_State, {
responseType: 'text',
response: iDHR.responseText =
$(this).contents().find('body').text()
});
iDHR.onload();
return false;
}).attr('name', iTarget);
this.$_Transport.submit();
}
var JSONP_Map = { };
BOM.DOMHttpRequest.JSONP = function (iData) {
iData = $.extend({
responseType: 'json',
response: iData,
responseText: JSON.stringify( iData )
}, Success_State);
var iDHR = JSONP_Map[ DOM.currentScript.src ];
for (var i = 0; iDHR[i]; i++) {
$.extend(iDHR[i], iData).onload();
iDHR[i].$_Transport.remove();
}
iDHR.length = 0;
};
function Script_Send() {
this.responseURL = $.extendURL(
this.responseURL.replace(/(\w+)=\?/, '$1=DOMHttpRequest.JSONP'),
arguments[0]
);
this.$_Transport = $('<script />', {
type: 'text/javascript',
charset: 'UTF-8',
src: this.responseURL
}).appendTo( DOM.head );
var iURL = this.$_Transport[0].src;
(JSONP_Map[iURL] = JSONP_Map[iURL] || [ ]).push( this );
}
$.extend(BOM.DOMHttpRequest.prototype, {
open: function () {
this.responseURL = arguments[1];
this.readyState = 1;
},
setRequestHeader: function () {
console.warn("JSONP/iframe doesn't support Changing HTTP Headers...");
},
send: function (iData) {
if (! Allow_Send.call(this)) return;
this.$_Transport =
(iData instanceof BOM.FormData) && $(iData.ownerNode);
if (this.$_Transport && (
iData.ownerNode.method.toUpperCase() == 'POST'
))
iFrame_Send.call( this );
else
Script_Send.call(this, iData);
this.readyState = 2;
},
abort: function () {
this.$_Transport = null;
this.readyState = 0;
}
});
/* ---------- AJAX for IE 10- ---------- */
function DHR_Transport(iOption) {
var iXHR;
return (iOption.dataType == 'jsonp') && {
send: function (iHeader, iComplete) {
if (! $.fn.iquery) {
iOption.url = iOption.url.replace(
RegExp('&?' + iOption.jsonp + '=\\w+'), ''
).trim('?');
iOption.dataTypes.shift();
}
iOption.url += (iOption.url.split('?')[1] ? '&' : '?') +
iOption.jsonp + '=?';
iXHR = new BOM.DOMHttpRequest();
iXHR.open(iOption.type, iOption.url);
iXHR.onload = function () {
var iResponse = {text: this.responseText};
iResponse[ this.responseType ] = this.response;
iComplete(this.status, this.statusText, iResponse);
};
iXHR.send( iOption.data );
},
abort: function () {
iXHR.abort();
}
};
}
// JSONP for iQuery
$.ajaxTransport('+script', DHR_Transport);
if ($.browser.msie < 10)
$.ajaxTransport('+*', function (iOption) {
var iXHR, iForm = (iOption.data || '').ownerNode;
if (
(iOption.data instanceof BOM.FormData) &&
$(iForm).is('form') &&
$('input[type="file"]', iForm)[0]
)
return DHR_Transport(iOption);
return iOption.crossDomain && {
send: function (iHeader, iComplete) {
iXHR = new BOM.XDomainRequest();
iXHR.open(iOption.type, iOption.url, true);
iXHR.onload = function () {
iComplete(
200,
'OK',
{text: iXHR.responseText},
'Content-Type: ' + iXHR.contentType
);
};
iXHR.onerror = function () {
iComplete(500, 'Internal Server Error', {
text: iXHR.responseText
});
};
iXHR.send(iOption.data);
},
abort: function () {
iXHR.abort();
iXHR = null;
}
};
});
/* ---------- Form Field Validation ---------- */
function Value_Check() {
if ((! this.value) && (this.getAttribute('required') != null))
return false;
var iRegEx = this.getAttribute('pattern');
if (iRegEx) try {
return RegExp( iRegEx ).test( this.value );
} catch (iError) { }
if (
(this.tagName == 'INPUT') &&
(this.getAttribute('type') == 'number')
) {
var iNumber = Number( this.value ),
iMin = Number( this.getAttribute('min') );
if (
isNaN(iNumber) ||
(iNumber < iMin) ||
(iNumber > Number(this.getAttribute('max') || Infinity)) ||
((iNumber - iMin) % Number( this.getAttribute('step') ))
)
return false;
}
return true;
}
$.fn.validate = function () {
var $_Field = this.find(':field').removeClass('invalid');
for (var i = 0; $_Field[i]; i++)
if ((
(typeof $_Field[i].checkValidity == 'function') &&
(! $_Field[i].checkValidity())
) || (
! Value_Check.call( $_Field[i] )
)) {
$_Field = $( $_Field[i] ).addClass('invalid');
$_Field.scrollParents().eq(0).scrollTo( $_Field.focus() );
return false;
}
return true;
};
/* ---------- Form Element AJAX Submit ---------- */
$.fn.ajaxSubmit = function (DataType, iCallback) {
if (! this[0]) return this;
if (typeof DataType == 'function') {
iCallback = DataType;
DataType = '';
}
function AJAX_Submit() {
var $_Form = $(this);
if ((! $_Form.validate()) || $_Form.data('_AJAX_Submitting_'))
return false;
$_Form.data('_AJAX_Submitting_', 1);
var iMethod = ($_Form.attr('method') || 'Get').toLowerCase();
if (typeof $[iMethod] != 'function') return;
arguments[0].preventDefault();
var iOption = {
type: iMethod,
dataType: DataType || 'json'
};
if (! $_Form.find('input[type="file"]')[0])
iOption.data = $_Form.serialize();
else {
iOption.data = new BOM.FormData( $_Form[0] );
iOption.contentType = iOption.processData = false;
}
$.ajax(this.action, iOption).then(function () {
$_Form.data('_AJAX_Submitting_', 0);
if (typeof iCallback == 'function')
iCallback.call($_Form[0], arguments[0]);
});
}
var $_This = (this.length < 2) ? this : this.sameParents().eq(0);
if ($_This[0].tagName == 'FORM')
$_This.submit( AJAX_Submit );
else
$_This.on('submit', 'form', AJAX_Submit);
return this;
};
})(self, self.document, self.iQuery || iQuery);
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/Jackey_870/iQuery.git
git@gitee.com:Jackey_870/iQuery.git
Jackey_870
iQuery
iQuery
master

搜索帮助