5 Star 18 Fork 4

南漂一卒 / EasyImport.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
EasyImport.js 173.64 KB
一键复制 编辑 原始数据 按行查看 历史
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896
//
// >>> iQuery.js <<<
//
//
// [Version] v2.0 (2017-06-06) Stable
//
// [Usage] A Light-weight jQuery Compatible API
// with IE 8+ compatibility.
//
//
// (C)2015-2017 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();
iObject.__proto__ = iProto;
for (var iKey in iProperty)
if (
this.prototype.hasOwnProperty.call(iProperty, iKey) &&
(iProperty[iKey].value !== undefined)
)
iObject[iKey] = iProperty[iKey].value;
return iObject;
};
/* ----- Number Extension ----- */
Number.isInteger = Number.isInteger || function (value) {
return (typeof value === 'number') && isFinite( value ) &&
(Math.floor(value) === value);
};
Number.MAX_SAFE_INTEGER = Math.pow(2, 53) - 1;
Number.MIN_SAFE_INTEGER = -Number.MAX_SAFE_INTEGER;
Number.isSafeInteger = Number.isSafeInteger || function (value) {
return this.isInteger( value ) && (
Math.abs( value ) <= this.MAX_SAFE_INTEGER
);
};
/* ----- 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.from = Array.from || function (iterator) {
var array = [ ], _This_;
if (Number.isInteger( iterator.length )) {
if (DOM.documentMode > 8)
return Array.apply(null, iterator);
else {
for (var i = 0; i < iterator.length; i++)
array[i] = iterator[i];
return array;
}
} else if (iterator.next instanceof Function) {
while ((_This_ = iterator.next()).done === false)
array.push( _This_.value );
return array;
}
throw TypeError('Cannot convert undefined or null to object');
};
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 (callback, value) {
for (var i = 1; i < this.length; i++) {
if (i == 1) value = this[0];
value = callback(value, this[i], i, this);
}
return value;
};
/* ----- 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 instanceof Function) return BOM.Promise;
/* ---------- Promise/A+ Core ---------- */
function Promise() {
this.__value__ = undefined;
this.__state__ = -1;
this.__callback__ = [ ];
var _This_ = this;
arguments[0](function () {
_This_.resolve( arguments[0] );
}, function () {
_This_.reject( arguments[0] );
});
}
var __Private__ = { };
Promise.prototype.reject = function () {
__Private__.endBy.call(this, 1, arguments[0]);
};
Promise.prototype.resolve = function (_Value_) {
if (_Value_ == this)
throw TypeError("Can't return the same Promise object !");
if (typeof (_Value_ || '').then != 'function')
return __Private__.endBy.call(this, 0, _Value_);
var _This_ = this;
_Value_.then(function () {
_This_.resolve( arguments[0] );
}, function () {
_This_.reject( arguments[0] );
});
};
__Private__.endBy = function (iState, iValue) {
if (this.__state__ > -1) return;
var _This_ = this;
setTimeout(function () {
_This_.__value__ = iValue;
_This_.__state__ = iState;
__Private__.exec.call(_This_);
});
};
__Private__.exec = function () {
var _CB_;
if (this.__state__ > -1)
while (_CB_ = this.__callback__.shift())
if (typeof _CB_[this.__state__] == 'function') try {
_CB_[2]( _CB_[this.__state__]( this.__value__ ) );
} catch (iError) {
_CB_[3]( iError );
}
};
Promise.prototype.then = function (iResolve, iReject) {
var _This_ = this;
return new Promise(function () {
_This_.__callback__.push([
iResolve, iReject, arguments[0], arguments[1]
]);
__Private__.exec.call(_This_);
});
};
/* ---------- ES 6 Promise Helper ---------- */
Promise.resolve = function (iValue) {
return (iValue instanceof this) ? iValue : new this(function () {
arguments[0]( iValue );
});
};
Promise.reject = function (iError) {
return new this(function () {
arguments[1]( iError );
});
};
Promise.all = function (iQueue) {
var iValue = [ ], iSum = iQueue.length;
return iSum ? (new this(function (iResolve, iReject) {
' '.repeat( iSum ).replace(/ /g, function (_, Index) {
Promise.resolve( iQueue[Index] ).then(function () {
iValue[ Index ] = arguments[0];
if (! --iSum) iResolve( iValue );
}, iReject);
});
})) : this.resolve( iQueue );
};
Promise.race = function (iQueue) {
return new Promise(function () {
for (var i = 0; iQueue[i]; i++)
Promise.resolve( iQueue[i] ).then(arguments[0], arguments[1]);
});
};
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) || (is_Mobile && (! is_Pad)),
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;
};
$.makeIterator = function (array) {
var nextIndex = 0;
return {
next: function () {
return (nextIndex >= array.length) ?
{done: true} :
{done: false, value: array[nextIndex++]};
}
};
};
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 (iCount instanceof 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 = Array.from( 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 = $.extend(
Object.create( iSup.prototype ), iSub.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
);
};
$.makeArray = function () {
return Array.from( arguments[0] );
};
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;
}
$.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).slice(8, -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) {
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 (iName) {
iName = iName.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 JSON.parse(iJSON, function (iKey, iValue) {
if (iKey && (typeof iValue == 'string')) try {
return 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 = new BOM.URLSearchParams();
if ($.likeArray( iObject ))
for (var i = 0; iObject[i]; i++)
iParameter.append(iObject[i].name, iObject[i].value);
else
$.each(iObject, function (iName) {
var iValue = (this == BOM) ? '' : this;
iValue = $.isPlainObject( iValue ) ?
JSON.stringify( iValue ) : iValue;
if ($.likeArray( iValue ))
$.map(
iValue, $.proxy(iParameter.append, iParameter, iName)
);
else
iParameter.append(iName, iValue);
});
return iParameter + '';
},
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 = Object.prototype.toString.call( iVar ).slice(8, -1);
var iName = iVar.constructor.name;
iName = (typeof iName == 'function') ?
iName.call( iVar.constructor ) : iName;
if ((iType == 'Object') && iName) iType = iName;
} 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 (iOrigin) {
return function iProxy() {
return (arguments.length >= iOrigin.length) ?
iOrigin.apply(this, arguments) :
$.proxy.apply($, $.merge([iProxy, this], arguments));
};
},
isSelector: function () {
try {
document.querySelector( arguments[0] );
} catch (iError) {
return false;
}
return true;
},
formatJSON: function () {
return JSON.stringify(arguments[0], null, 4)
.replace(/(\s+"[^"]+":) ([^\s]+)/g, '$1 $2');
},
cssPX: RegExp([
'width', 'height', 'padding', 'border-radius', 'margin',
'top', 'right', 'bottom', 'left'
].join('|'))
});
})(self, self.document, self.iQuery || iQuery);
(function (BOM, DOM, $) {
$.extend({
paramJSON: function (search) {
var _Args_ = { };
$.each(
Array.from(
(new BOM.URLSearchParams(
(search || BOM.location.search).split('?')[1]
)).entries()
),
function () {
this[1] = decodeURIComponent( this[1] );
if (
(! $.isNumeric(this[1])) ||
Number.isSafeInteger( +this[1] )
) try {
this[1] = JSON.parse( this[1] );
} catch (iError) { }
if (this[0] in _Args_)
_Args_[this[0]] = [ ].concat(_Args_[this[0]], this[1]);
else
_Args_[this[0]] = this[1];
}
);
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('')
);
}
});
/* ---------- URL Parameter Signature v0.1 ---------- */
function JSON_Sign(iData) {
return '{' + $.map(Object.keys( iData ).sort(), function (iKey) {
return '"' + iKey + '":' + JSON.stringify( iData[iKey] );
}).join() + '}';
}
$.paramSign = function (iData) {
iData = iData.valueOf();
if (typeof iData === 'string') iData = this.paramJSON( iData );
var _Data_ = new BOM.URLSearchParams();
$.each(iData, function (name, value) {
switch ( true ) {
case (this === BOM):
value = '';
break;
case (typeof value === 'object'):
value = JSON_Sign( this );
break;
case $.likeArray( this ):
value = '[' + $.map(this, JSON_Sign).join() + ']';
break;
case (this instanceof Function):
return;
}
_Data_.append(name, value);
});
_Data_.sort();
return _Data_ + '';
};
})(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;
$.merge(this, Element_Set);
if (Element_Set.length == 1)
this.context = (Element_Set[0] || '').ownerDocument;
}
/* ----- 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
},
Check_Type = $.makeSet('radio', 'checkbox');
$.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);
},
checked: function (iDOM) {
return (
(iDOM.tagName.toLowerCase() == 'input') &&
(iDOM.type in Check_Type) && (iDOM.checked === true)
);
},
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 ---------- */
/* ----- :indeterminate ----- */
var Check_Type = $.makeSet('radio', 'checkbox');
$.expr[':'].indeterminate = function (iDOM) {
switch ( iDOM.tagName.toLowerCase() ) {
case 'input':
if (! (iDOM.type in Check_Type)) break;
case 'progress':
return (iDOM.indeterminate === true);
}
};
/* ----- :list, :data ----- */
var pList = $.makeSet('UL', 'OL', 'DL', 'TBODY', '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_Ready = (new Promise(function (iResolve) {
$.start('DOM_Ready');
$( BOM ).one('DOMContentLoaded load', iResolve);
$.every(0.5, function () {
if ((DOM.readyState == 'complete') && (DOM.body || '').lastChild)
return Boolean( iResolve( arguments[0] ) );
});
})).then(function () {
$.data(DOM, 'Load_During', $.end('DOM_Ready'));
console.info('[DOM Ready Event]');
console.log( arguments[0] );
});
$.fn.ready = function () {
if ($.Type( this[0] ) != 'Document')
throw 'The Ready Method is only used for Document Object !';
DOM_Ready.then( $.proxy(arguments[0], this[0], $) );
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)?:\\/\\/[^:]+)"
));
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;
}
});
/* ---------- URL Search Parameter ---------- */
function URLSearchParams() {
this.length = 0;
var _This_ = this;
arguments[0].replace(/([^&=]+)=([^&]+)/g, function (_, key, value) {
_This_.append(key, value);
});
}
$.extend(URLSearchParams.prototype, {
push: Array.prototype.push,
splice: Array.prototype.splice,
append: function (key, value) {
this.push([key, value + '']);
},
get: function (key) {
for (var i = 0; this[i]; i++)
if (this[i][0] === key) return this[i][1];
},
getAll: function (key) {
return $.map(this, function (_This_) {
if (_This_[0] === key) return _This_[1];
});
},
delete: function (key) {
for (var i = 0; this[i]; i++)
if (this[i][0] === key) this.splice(i, 1);
},
set: function (key, value) {
if (this.get( key ) != null) this.delete( key );
this.append(key, value);
},
toString: function () {
return encodeURIComponent($.map(this, function (_This_) {
return _This_[0] + '=' + _This_[1];
}).join('&'));
},
entries: function () {
return $.makeIterator( this );
}
});
BOM.URLSearchParams = BOM.URLSearchParams || URLSearchParams;
BOM.URLSearchParams.prototype.sort =
BOM.URLSearchParams.prototype.sort || function () {
Array.prototype.sort.call(this, function (A, B) {
return A[0].localeCompare( B[0] );
});
};
/* ---------- 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() {
this.length = 0;
$.merge(
this, (arguments[0].getAttribute('class') || '').trim().split(/\s+/)
);
}
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() {
this.length = 0;
$.merge(this, arguments[0]);
}
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, $) {
$.fn.toggleAnimate = function (iClass, iData) {
var CSS_Rule = BOM.getMatchedCSSRules(
this.toggleClass( iClass ).children()[0]
) || '',
$_This = this;
for (var i = 0; CSS_Rule[i]; i++)
if (CSS_Rule[i].cssText.indexOf('transition') > 0)
return new Promise(function () {
$_This.one(
'transitionend webkitTransitionEnd',
(iData != null) ?
$.proxy(arguments[0], null, iData) : arguments[0]
);
});
return Promise.resolve( iData );
};
})(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'
},
Fail_State = {
readyState: 4,
status: 500,
statusText: 'Internal Server Error'
};
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 () {
var _DOM_ = this.contentWindow.document;
$.extend(iDHR, Success_State, {
responseHeader: {
'Set-Cookie': _DOM_.cookie,
'Content-Type':
_DOM_.contentType + '; charset=' + _DOM_.charset
},
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) {
var _This_ = DOM.currentScript;
iData = $.extend({
responseHeader: {
'Content-Type': _This_.type + '; charset=' + _This_.charset
},
responseType: 'json',
response: iData,
responseText: JSON.stringify( iData )
}, Success_State);
var iDHR = JSONP_Map[ _This_.src ];
for (var i = 0; iDHR[i]; i++) if ( iDHR[i].$_Transport ) {
$.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
}).on('error', $.proxy(this.onerror, $.extend(this, Fail_State, {
responseType: 'text',
response: '',
responseText: ''
}))).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;
},
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.remove();
this.$_Transport = null;
this.readyState = 0;
},
setRequestHeader: function () {
console.warn("JSONP/iframe doesn't support Changing HTTP Headers...");
},
getResponseHeader: function () {
return this.responseHeader[ arguments[0] ] || null;
}
});
/* ---------- Cacheable JSONP ---------- */
function DHR_Transport(iOption) {
var iXHR;
if (iOption.dataType != 'jsonp') return;
iOption.cache = ('cache' in arguments[1]) ? arguments[1].cache : true;
if ( iOption.cache ) iOption.url = iOption.url.replace(/&?_=\d+/, '');
if (! $.fn.iquery) {
iOption.url = iOption.url.replace(
RegExp('&?' + iOption.jsonp + '=\\w+'), ''
).trim('?');
iOption.dataTypes.shift();
}
return {
send: function (iHeader, iComplete) {
iOption.url += (iOption.url.split('?')[1] ? '&' : '?') +
iOption.jsonp + '=?';
iXHR = new BOM.DOMHttpRequest();
iXHR.open(iOption.type, iOption.url);
iXHR.onload = iXHR.onerror = 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);
/* ---------- AJAX for IE 10- ---------- */
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.timeout = iOption.timeout || 0;
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.ontimeout = $.proxy(
iComplete, null, 504, 'Gateway Timeout'
);
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);
(function (BOM, DOM, $) {
/* ---------- Bit Operation for Big Number v0.1 ---------- */
function Bit_Calculate(iType, iLeft, iRight) {
iLeft = parseInt(iLeft, 2);
iRight = parseInt(iRight, 2);
switch (iType) {
case '&': return iLeft & iRight;
case '|': return iLeft | iRight;
case '^': return iLeft ^ iRight;
case '~': return ~iLeft;
}
}
$.bitOperate = function (iType, iLeft, iRight) {
iLeft = (typeof iLeft == 'string') ? iLeft : iLeft.toString(2);
iRight = (typeof iRight == 'string') ? iRight : iRight.toString(2);
var iLength = Math.max(iLeft.length, iRight.length);
if (iLength < 32)
return Bit_Calculate(iType, iLeft, iRight).toString(2);
iLeft = $.leftPad(iLeft, iLength, 0);
iRight = $.leftPad(iRight, iLength, 0);
var iResult = '';
for (var i = 0; i < iLength; i += 31)
iResult += $.leftPad(
Bit_Calculate(
iType, iLeft.slice(i, i + 31), iRight.slice(i, i + 31)
).toString(2),
Math.min(31, iLength - i),
0
);
return iResult;
};
/* ---------- Local Storage Wrapper v0.1 ---------- */
var LS_Key = [ ];
$.storage = function (iName, iData) {
if (! (iData != null)) return JSON.parse(BOM.localStorage[ iName ]);
var iLast = 0, iLength = Math.min(LS_Key.length, BOM.localStorage.length);
do try {
BOM.localStorage[ iName ] = JSON.stringify( iData );
if (LS_Key.indexOf( iName ) == -1) LS_Key.push( iName );
break;
} catch (iError) {
if (LS_Key[ iLast ]) {
delete BOM.localStorage[ LS_Key[iLast] ];
LS_Key.splice(iLast, 1);
} else
iLast++ ;
} while (iLast < iLength);
return iData;
};
/* ---------- Base64 to Blob v0.1 ---------- */
// Thanks "axes" --- http://www.cnblogs.com/axes/p/4603984.html
$.toBlob = function (iType, iString) {
if (arguments.length == 1) {
iString = iType.match(/^data:([^;]+);base64,(.+)/);
iType = iString[1];
iString = iString[2];
}
iString = BOM.atob( iString );
var iBuffer = new ArrayBuffer( iString.length );
var uBuffer = new Uint8Array( iBuffer );
for (var i = 0; iString[i]; i++)
uBuffer[i] = iString.charCodeAt(i);
var BlobBuilder = BOM.WebKitBlobBuilder || BOM.MozBlobBuilder;
if (! BlobBuilder)
return new BOM.Blob([iBuffer], {type: iType});
var iBuilder = new BlobBuilder();
iBuilder.append( iBuffer );
return iBuilder.getBlob( iType );
};
/* ---------- CRC-32 v0.1 ---------- */
// Thanks "Bakasen" for http://blog.csdn.net/bakasen/article/details/6043797
var CRC_32_Table = (function () {
var iTable = new Array(256);
for (var i = 0, iCell; i < 256; i++) {
iCell = i;
for (var j = 0; j < 8; j++)
if (iCell & 1)
iCell = ((iCell >> 1) & 0x7FFFFFFF) ^ 0xEDB88320;
else
iCell = (iCell >> 1) & 0x7FFFFFFF;
iTable[i] = iCell;
}
return iTable;
})();
function CRC_32(iRAW) {
iRAW = '' + iRAW;
var iValue = 0xFFFFFFFF;
for (var i = 0; iRAW[i]; i++)
iValue = ((iValue >> 8) & 0x00FFFFFF) ^ CRC_32_Table[
(iValue & 0xFF) ^ iRAW.charCodeAt(i)
];
return iValue ^ 0xFFFFFFFF;
}
/* ---------- Hash Algorithm (Crypto API Wrapper) v0.1 ---------- */
// Thanks "emu" --- http://blog.csdn.net/emu/article/details/39618297
if ( BOM.msCrypto ) {
BOM.crypto = BOM.msCrypto;
$.each(BOM.crypto.subtle, function (key, _This_) {
if (! (_This_ instanceof Function)) return;
BOM.crypto.subtle[ key ] = function () {
var iObserver = _This_.apply(this, arguments);
return new Promise(function (iResolve) {
iObserver.oncomplete = function () {
iResolve( arguments[0].target.result );
};
iObserver.onabort = iObserver.onerror = arguments[1];
});
};
});
}
BOM.crypto.subtle = BOM.crypto.subtle || BOM.crypto.webkitSubtle;
function BufferToString(iBuffer){
var iDataView = new DataView(iBuffer), iResult = '';
for (var i = 0, iTemp; i < iBuffer.byteLength; i += 4) {
iTemp = iDataView.getUint32(i).toString(16);
iResult += ((iTemp.length == 8) ? '' : 0) + iTemp;
}
return iResult;
}
$.dataHash = function (iAlgorithm, iData) {
if (arguments.length < 2) {
iData = iAlgorithm; iAlgorithm = 'CRC-32';
}
return (iAlgorithm === 'CRC-32') ?
Promise.resolve( CRC_32( iData ) ) :
BOM.crypto.subtle.digest(
{name: iAlgorithm},
new Uint8Array(
Array.prototype.map.call(String( iData ), function () {
return arguments[0].charCodeAt(0);
})
)
).then( BufferToString );
};
})(self, self.document, self.iQuery || iQuery);
});
//
// >>> EasyImport.js <<<
//
//
// [Version] v1.2 (2016-06-14) Stable
//
// [Usage] A Asynchronous & Responsive Loader
// for Resource File in Web Browser.
//
//
// (C)2013-2016 SCU FYclub-RDD
//
(function (BOM, DOM, $) {
/* ----------- Standard Mode Meta Patches ----------- */
var $_Meta = [ ], $_Head = $('head');
if ($.browser.mobile) {
if ($.browser.modern)
$_Meta.push(
$('<meta />', {
name: "viewport",
content: [
'width' + '=' + (
BOM.navigator.userAgent.match(
/MicroMessenger|UCBrowser|UCWeb/i
) ?
320 : 'device-width'
),
'initial-scale=1.0',
'minimum-scale=1.0',
'maximum-scale=1.0',
'user-scalable=no',
'target-densitydpi=medium-dpi'
].join(',')
})[0]
);
else
$_Meta = $_Meta.concat([
$('<meta />', {
name: 'MobileOptimized',
content: 320
})[0],
$('<meta />', {
name: 'HandheldFriendly',
content: 'true'
})[0]
]);
}
if ($.browser.msie)
$_Meta.push(
$('<meta />', {
'http-equiv': 'X-UA-Compatible',
content: 'IE=Edge, Chrome=1'
})[0]
);
$_Meta = $($_Meta);
if (! $('head meta').slice(-1).after($_Meta).length)
$_Head.find('link, title, script').eq(0).before($_Meta);
/* ---------- Loading Queue ---------- */
var Root_Path = $.filePath( DOM.currentScript.src ) + '/';
function Queue_Filter(iList) {
for (var i = 0, _Group_; i < iList.length; i++) {
_Group_ = iList[i];
if (typeof _Group_ == 'string') {
iList[i] = { };
iList[i][_Group_] = true;
}
if ($.isPlainObject( iList[i] )) {
_Group_ = [ ];
for (var iScript in iList[i])
if ( iList[i][iScript] ) _Group_.push(iScript);
iList[i] = _Group_;
}
for (var j = 0; j < _Group_.length; j++)
if (! _Group_[j].match(/^(\w+:)?\/\//))
_Group_[j] = Root_Path + _Group_[j];
}
return iList;
}
/* ---------- DOM Cache ---------- */
var $_Script = $('<script />', {
type: 'text/javascript',
charset: 'UTF-8',
'class': 'EasyImport'
}),
$_DOM = $(DOM);
/* ---------- DOM Load-Engine ---------- */
function DOM_Load(iOrder, iFinal) {
if (! iOrder[0]) {
iFinal();
return;
}
var This_Call = arguments;
if ((! iOrder[1]) && (this !== DOM)) {
$_DOM.ready(function () {
This_Call.callee.apply(this, This_Call);
});
return;
}
var This_Group = 0;
function _Next_() {
if ( iOrder[0][++This_Group] ) return;
if (typeof this != 'function')
$(this).data('Load_During', $.end( $.fileName(this.src) ));
iOrder.shift();
This_Call.callee.apply(this, This_Call);
}
for (var i = 0, iScript; (iOrder[0] && (i < iOrder[0].length)); i++) {
iScript = iOrder[0][i];
$_Head.trigger({
type: 'loading',
detail: 0,
data: 'Web Loading ...'
});
if (typeof iScript == 'function') {
iScript();
_Next_.call(iScript);
continue;
}
$_Script.clone().one('load', _Next_)
.attr('src', iScript).appendTo($_Head);
$.start( $.fileName(iScript) );
}
}
/* ----------- Open API ----------- */
var Load_Times = 0;
function Load_End() {
$(DOM.body).trigger({
type: 'loading',
detail: 1
});
if ( Load_Times++ ) return;
var iTimer = $.browser.modern && (! $.browser.ios) && BOM.performance.timing;
var Async_Time = (! iTimer) ? $.end('DOM_Ready') : (
(iTimer.domContentLoadedEventEnd - iTimer.navigationStart) / 1000
),
Sync_Time = $_DOM.data('Load_During');
$('head > script.EasyImport').each(function () {
Sync_Time += $(this).data('Load_During') || 0;
});
console.info([
'[ EasyImport.js ] Time Statistics',
' Async Sum: ' + Async_Time.toFixed(3) + ' s',
' Sync Sum: ' + Sync_Time.toFixed(3) + ' s',
' Saving: ' + (
((Sync_Time - Async_Time) / Sync_Time) * 100
).toFixed(2) + ' %'
].join("\n\n"));
}
BOM.ImportJS = function () {
var Func_Args = $.makeArray(arguments),
JS_List, CallBack;
Root_Path = (typeof Func_Args[0] == 'string') ?
Func_Args.shift() : Root_Path;
if (Func_Args[0] instanceof Array)
JS_List = Func_Args.shift();
else
throw "Format of Importing List isn't currect !";
CallBack = (typeof Func_Args[0] == 'function') ?
Func_Args.shift() : null;
var JS_Item = Queue_Filter(JS_List);
if (CallBack) JS_Item.push( [CallBack] );
if (! JS_Item[0].length) return;
DOM_Load(JS_Item, Load_End);
};
/* ----------- Practical Extension ----------- */
/* ----- Lazy Loading v0.2 ----- */
function Scroll_Queue() {
this.$_ViewPort = $(arguments[0] || BOM);
this.vpHeight = this.$_ViewPort.height();
this.count = 0;
this.finish = [ ];
}
Scroll_Queue.prototype.watch = function () {
var _This_ = this, $_DOM = $(this.$_ViewPort[0].document);
this.$_ViewPort.scroll(function () {
var iLazy = _This_[ $_DOM.scrollTop() ];
if (! iLazy) return;
for (var i = 0; i < iLazy.length; i++)
if (
($.inArray(iLazy[i], _This_.finish) == -1) &&
(false !== _This_.onScroll( iLazy[i] ))
) {
_This_.finish.push( iLazy[i] );
if (--_This_.count == 0)
_This_.$_ViewPort.unbind('scroll', arguments.callee);
}
});
};
Scroll_Queue.prototype.register = function (Item) {
if (! Item) return;
Item = $.likeArray(Item) ? Item : [Item];
if ((! this.count) && Item.length) this.watch();
for (var i = 0, Off_Top, iNO; i < Item.length; i++) {
Off_Top = $(Item[i]).offset().top;
iNO = Math.round(
(Off_Top < this.vpHeight) ? 0 : (Off_Top - this.vpHeight)
);
for (; iNO < Off_Top; iNO++)
if (! this[iNO])
this[iNO] = [ Item[i] ];
else
this[iNO].push( Item[i] );
}
this.count += Item.length;
};
$_DOM.ready(function () {
var iQueue = new Scroll_Queue(), Lazy_Tag = $.makeSet('IMG', 'IFRAME');
iQueue.onScroll = function (iLazy) {
if ( iLazy.dataset.src )
iLazy.src = iLazy.dataset.src;
else
iLazy.style.backgroundImage = iLazy.dataset.background;
};
if ( $.browser.modern )
this.addEventListener('DOMNodeInserted', function () {
var iTarget = arguments[0].target;
if (iTarget.nodeType != 1) return;
if (iTarget.tagName in Lazy_Tag) {
if (! iTarget.dataset.src) return;
} else if (! iTarget.dataset.background)
return;
iQueue.register( iTarget );
});
iQueue.register(
$('img[data-src], iframe[data-src], *[data-background]', this.body)
);
});
/* ----- Remote Error Log v0.2 ----- */
// Thanks "raphealguo" --- http://rapheal.sinaapp.com/2014/11/06/javascript-error-monitor/
var Console_URL = $('head link[rel="console"]').attr('href');
BOM.onerror = function (iMessage, iURL, iLine, iColumn, iError){
if (! Console_URL) return;
$.wait(0, function () {
var iData = {
message: iMessage,
url: iURL,
line: iLine,
column:
iColumn || (BOM.event && BOM.event.errorCharacter) || 0
};
if (iError) iData.stack = String(iError.stack || iError.stacktrace);
$[iData.stack ? 'post' : 'get'](Console_URL, iData);
});
return true;
};
})(self, self.document, self.iQuery);
JavaScript
1
https://gitee.com/Tech_Query/EasyImport.js.git
git@gitee.com:Tech_Query/EasyImport.js.git
Tech_Query
EasyImport.js
EasyImport.js
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891