sui-all.js 134 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572
  1. (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  2. /* ==========================================================
  3. * bootstrap-affix.js v2.3.2
  4. * http://getbootstrap.com/2.3.2/javascript.html#affix
  5. * ==========================================================
  6. * Copyright 2013 Twitter, Inc.
  7. *
  8. * Licensed under the Apache License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. * ========================================================== */
  20. !function ($) {
  21. "use strict";
  22. /* AFFIX CLASS DEFINITION
  23. * ====================== */
  24. var Affix = function (element, options) {
  25. this.options = $.extend({}, $.fn.affix.defaults, options)
  26. this.$window = $(window)
  27. .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
  28. .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
  29. this.$element = $(element)
  30. this.checkPosition()
  31. }
  32. Affix.prototype.checkPosition = function () {
  33. if (!this.$element.is(':visible')) return
  34. var scrollHeight = $(document).height()
  35. , scrollTop = this.$window.scrollTop()
  36. , position = this.$element.offset()
  37. , offset = this.options.offset
  38. , offsetBottom = offset.bottom
  39. , offsetTop = offset.top
  40. , reset = 'affix affix-top affix-bottom'
  41. , affix
  42. if (typeof offset != 'object') offsetBottom = offsetTop = offset
  43. if (typeof offsetTop == 'function') offsetTop = offset.top()
  44. if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
  45. affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
  46. false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
  47. 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
  48. 'top' : false
  49. if (this.affixed === affix) return
  50. this.affixed = affix
  51. this.unpin = affix == 'bottom' ? position.top - scrollTop : null
  52. this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
  53. }
  54. /* AFFIX PLUGIN DEFINITION
  55. * ======================= */
  56. var old = $.fn.affix
  57. $.fn.affix = function (option) {
  58. return this.each(function () {
  59. var $this = $(this)
  60. , data = $this.data('affix')
  61. , options = typeof option == 'object' && option
  62. if (!data) $this.data('affix', (data = new Affix(this, options)))
  63. if (typeof option == 'string') data[option]()
  64. })
  65. }
  66. $.fn.affix.Constructor = Affix
  67. $.fn.affix.defaults = {
  68. offset: 0
  69. }
  70. /* AFFIX NO CONFLICT
  71. * ================= */
  72. $.fn.affix.noConflict = function () {
  73. $.fn.affix = old
  74. return this
  75. }
  76. /* AFFIX DATA-API
  77. * ============== */
  78. $(window).on('load', function () {
  79. $('[data-spy="affix"]').each(function () {
  80. var $spy = $(this)
  81. , data = $spy.data()
  82. data.offset = data.offset || {}
  83. data.offsetBottom && (data.offset.bottom = data.offsetBottom)
  84. data.offsetTop && (data.offset.top = data.offsetTop)
  85. $spy.affix(data)
  86. })
  87. })
  88. }(window.jQuery);
  89. },{}],2:[function(require,module,exports){
  90. /* ==========================================================
  91. * bootstrap-alert.js v2.3.2
  92. * http://getbootstrap.com/2.3.2/javascript.html#alerts
  93. * ==========================================================
  94. * Copyright 2013 Twitter, Inc.
  95. *
  96. * Licensed under the Apache License, Version 2.0 (the "License");
  97. * you may not use this file except in compliance with the License.
  98. * You may obtain a copy of the License at
  99. *
  100. * http://www.apache.org/licenses/LICENSE-2.0
  101. *
  102. * Unless required by applicable law or agreed to in writing, software
  103. * distributed under the License is distributed on an "AS IS" BASIS,
  104. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  105. * See the License for the specific language governing permissions and
  106. * limitations under the License.
  107. * ========================================================== */
  108. !function ($) {
  109. "use strict";
  110. /* ALERT CLASS DEFINITION
  111. * ====================== */
  112. var dismiss = '[data-dismiss="alert"]'
  113. , Alert = function (el) {
  114. $(el).on('click', dismiss, this.close)
  115. }
  116. Alert.prototype.close = function (e) {
  117. var $this = $(this)
  118. , selector = $this.attr('data-target')
  119. , $parent
  120. if (!selector) {
  121. selector = $this.attr('href')
  122. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  123. }
  124. $parent = $(selector)
  125. e && e.preventDefault()
  126. $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
  127. $parent.trigger(e = $.Event('close'))
  128. if (e.isDefaultPrevented()) return
  129. $parent.removeClass('in')
  130. function removeElement() {
  131. $parent
  132. .trigger('closed')
  133. .remove()
  134. }
  135. $.support.transition && $parent.hasClass('fade') ?
  136. $parent.on($.support.transition.end, removeElement) :
  137. removeElement()
  138. }
  139. /* ALERT PLUGIN DEFINITION
  140. * ======================= */
  141. var old = $.fn.alert
  142. $.fn.alert = function (option) {
  143. return this.each(function () {
  144. var $this = $(this)
  145. , data = $this.data('alert')
  146. if (!data) $this.data('alert', (data = new Alert(this)))
  147. if (typeof option == 'string') data[option].call($this)
  148. })
  149. }
  150. $.fn.alert.Constructor = Alert
  151. /* ALERT NO CONFLICT
  152. * ================= */
  153. $.fn.alert.noConflict = function () {
  154. $.fn.alert = old
  155. return this
  156. }
  157. /* ALERT DATA-API
  158. * ============== */
  159. $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
  160. }(window.jQuery);
  161. },{}],3:[function(require,module,exports){
  162. /* ============================================================
  163. * bootstrap-button.js v2.3.2
  164. * http://getbootstrap.com/2.3.2/javascript.html#buttons
  165. * ============================================================
  166. * Copyright 2013 Twitter, Inc.
  167. *
  168. * Licensed under the Apache License, Version 2.0 (the "License");
  169. * you may not use this file except in compliance with the License.
  170. * You may obtain a copy of the License at
  171. *
  172. * http://www.apache.org/licenses/LICENSE-2.0
  173. *
  174. * Unless required by applicable law or agreed to in writing, software
  175. * distributed under the License is distributed on an "AS IS" BASIS,
  176. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  177. * See the License for the specific language governing permissions and
  178. * limitations under the License.
  179. * ============================================================ */
  180. !function ($) {
  181. "use strict";
  182. /* BUTTON PUBLIC CLASS DEFINITION
  183. * ============================== */
  184. var Button = function (element, options) {
  185. this.$element = $(element)
  186. this.options = $.extend({}, $.fn.button.defaults, options)
  187. }
  188. Button.prototype.setState = function (state) {
  189. var d = 'disabled'
  190. , $el = this.$element
  191. , data = $el.data()
  192. , val = $el.is('input') ? 'val' : 'html'
  193. state = state + 'Text'
  194. data.resetText || $el.data('resetText', $el[val]())
  195. $el[val](data[state] || this.options[state])
  196. // push to event loop to allow forms to submit
  197. setTimeout(function () {
  198. state == 'loadingText' ?
  199. $el.addClass(d).attr(d, d) :
  200. $el.removeClass(d).removeAttr(d)
  201. }, 0)
  202. }
  203. Button.prototype.toggle = function () {
  204. var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
  205. $parent && $parent
  206. .find('.active')
  207. .removeClass('active')
  208. this.$element.toggleClass('active')
  209. }
  210. /* BUTTON PLUGIN DEFINITION
  211. * ======================== */
  212. var old = $.fn.button
  213. $.fn.button = function (option) {
  214. return this.each(function () {
  215. var $this = $(this)
  216. , data = $this.data('button')
  217. , options = typeof option == 'object' && option
  218. if (!data) $this.data('button', (data = new Button(this, options)))
  219. if (option == 'toggle') data.toggle()
  220. else if (option) data.setState(option)
  221. })
  222. }
  223. $.fn.button.defaults = {
  224. loadingText: 'loading...'
  225. }
  226. $.fn.button.Constructor = Button
  227. /* BUTTON NO CONFLICT
  228. * ================== */
  229. $.fn.button.noConflict = function () {
  230. $.fn.button = old
  231. return this
  232. }
  233. /* BUTTON DATA-API
  234. * =============== */
  235. $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
  236. var $btn = $(e.target)
  237. if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
  238. $btn.button('toggle')
  239. })
  240. }(window.jQuery);
  241. },{}],4:[function(require,module,exports){
  242. /* ==========================================================
  243. * bootstrap-carousel.js v2.3.2
  244. * http://getbootstrap.com/2.3.2/javascript.html#carousel
  245. * ==========================================================
  246. * Copyright 2013 Twitter, Inc.
  247. *
  248. * Licensed under the Apache License, Version 2.0 (the "License");
  249. * you may not use this file except in compliance with the License.
  250. * You may obtain a copy of the License at
  251. *
  252. * http://www.apache.org/licenses/LICENSE-2.0
  253. *
  254. * Unless required by applicable law or agreed to in writing, software
  255. * distributed under the License is distributed on an "AS IS" BASIS,
  256. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  257. * See the License for the specific language governing permissions and
  258. * limitations under the License.
  259. * ========================================================== */
  260. !function ($) {
  261. "use strict";
  262. /* CAROUSEL CLASS DEFINITION
  263. * ========================= */
  264. var Carousel = function (element, options) {
  265. this.$element = $(element)
  266. this.$indicators = this.$element.find('.carousel-indicators')
  267. this.options = options
  268. this.options.pause == 'hover' && this.$element
  269. .on('mouseenter', $.proxy(this.pause, this))
  270. .on('mouseleave', $.proxy(this.cycle, this))
  271. }
  272. Carousel.prototype = {
  273. cycle: function (e) {
  274. if (!e) this.paused = false
  275. if (this.interval) clearInterval(this.interval);
  276. this.options.interval
  277. && !this.paused
  278. && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
  279. return this
  280. }
  281. , getActiveIndex: function () {
  282. this.$active = this.$element.find('.item.active')
  283. this.$items = this.$active.parent().children()
  284. return this.$items.index(this.$active)
  285. }
  286. , to: function (pos) {
  287. var activeIndex = this.getActiveIndex()
  288. , that = this
  289. if (pos > (this.$items.length - 1) || pos < 0) return
  290. if (this.sliding) {
  291. return this.$element.one('slid', function () {
  292. that.to(pos)
  293. })
  294. }
  295. if (activeIndex == pos) {
  296. return this.pause().cycle()
  297. }
  298. return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
  299. }
  300. , pause: function (e) {
  301. if (!e) this.paused = true
  302. if (this.$element.find('.next, .prev').length && $.support.transition.end) {
  303. this.$element.trigger($.support.transition.end)
  304. this.cycle(true)
  305. }
  306. clearInterval(this.interval)
  307. this.interval = null
  308. return this
  309. }
  310. , next: function () {
  311. if (this.sliding) return
  312. return this.slide('next')
  313. }
  314. , prev: function () {
  315. if (this.sliding) return
  316. return this.slide('prev')
  317. }
  318. , slide: function (type, next) {
  319. var $active = this.$element.find('.item.active')
  320. , $next = next || $active[type]()
  321. , isCycling = this.interval
  322. , direction = type == 'next' ? 'left' : 'right'
  323. , fallback = type == 'next' ? 'first' : 'last'
  324. , that = this
  325. , e
  326. this.sliding = true
  327. isCycling && this.pause()
  328. $next = $next.length ? $next : this.$element.find('.item')[fallback]()
  329. e = $.Event('slide', {
  330. relatedTarget: $next[0]
  331. , direction: direction
  332. })
  333. if ($next.hasClass('active')) return
  334. if (this.$indicators.length) {
  335. this.$indicators.find('.active').removeClass('active')
  336. this.$element.one('slid', function () {
  337. var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
  338. $nextIndicator && $nextIndicator.addClass('active')
  339. })
  340. }
  341. if ($.support.transition && this.$element.hasClass('slide')) {
  342. this.$element.trigger(e)
  343. if (e.isDefaultPrevented()) return
  344. $next.addClass(type)
  345. $next[0].offsetWidth // force reflow
  346. $active.addClass(direction)
  347. $next.addClass(direction)
  348. this.$element.one($.support.transition.end, function () {
  349. $next.removeClass([type, direction].join(' ')).addClass('active')
  350. $active.removeClass(['active', direction].join(' '))
  351. that.sliding = false
  352. setTimeout(function () { that.$element.trigger('slid') }, 0)
  353. })
  354. } else {
  355. this.$element.trigger(e)
  356. if (e.isDefaultPrevented()) return
  357. $active.removeClass('active')
  358. $next.addClass('active')
  359. this.sliding = false
  360. this.$element.trigger('slid')
  361. }
  362. isCycling && this.cycle()
  363. return this
  364. }
  365. }
  366. /* CAROUSEL PLUGIN DEFINITION
  367. * ========================== */
  368. var old = $.fn.carousel
  369. $.fn.carousel = function (option) {
  370. return this.each(function () {
  371. var $this = $(this)
  372. , data = $this.data('carousel')
  373. , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
  374. , action = typeof option == 'string' ? option : options.slide
  375. if (!data) $this.data('carousel', (data = new Carousel(this, options)))
  376. if (typeof option == 'number') data.to(option)
  377. else if (action) data[action]()
  378. else if (options.interval) data.pause().cycle()
  379. })
  380. }
  381. $.fn.carousel.defaults = {
  382. interval: 5000
  383. , pause: 'hover'
  384. }
  385. $.fn.carousel.Constructor = Carousel
  386. /* CAROUSEL NO CONFLICT
  387. * ==================== */
  388. $.fn.carousel.noConflict = function () {
  389. $.fn.carousel = old
  390. return this
  391. }
  392. /* CAROUSEL DATA-API
  393. * ================= */
  394. $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
  395. var $this = $(this), href
  396. , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
  397. , options = $.extend({}, $target.data(), $this.data())
  398. , slideIndex
  399. $target.carousel(options)
  400. if (slideIndex = $this.attr('data-slide-to')) {
  401. $target.data('carousel').pause().to(slideIndex).cycle()
  402. }
  403. e.preventDefault()
  404. })
  405. }(window.jQuery);
  406. },{}],5:[function(require,module,exports){
  407. /* =============================================================
  408. * bootstrap-collapse.js v2.3.2
  409. * http://getbootstrap.com/2.3.2/javascript.html#collapse
  410. * =============================================================
  411. * Copyright 2013 Twitter, Inc.
  412. *
  413. * Licensed under the Apache License, Version 2.0 (the "License");
  414. * you may not use this file except in compliance with the License.
  415. * You may obtain a copy of the License at
  416. *
  417. * http://www.apache.org/licenses/LICENSE-2.0
  418. *
  419. * Unless required by applicable law or agreed to in writing, software
  420. * distributed under the License is distributed on an "AS IS" BASIS,
  421. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  422. * See the License for the specific language governing permissions and
  423. * limitations under the License.
  424. * ============================================================ */
  425. !function ($) {
  426. "use strict";
  427. /* COLLAPSE PUBLIC CLASS DEFINITION
  428. * ================================ */
  429. var Collapse = function (element, options) {
  430. this.$element = $(element)
  431. this.options = $.extend({}, $.fn.collapse.defaults, options)
  432. if (this.options.parent) {
  433. this.$parent = $(this.options.parent)
  434. }
  435. this.options.toggle && this.toggle()
  436. }
  437. Collapse.prototype = {
  438. constructor: Collapse
  439. , dimension: function () {
  440. var hasWidth = this.$element.hasClass('width')
  441. return hasWidth ? 'width' : 'height'
  442. }
  443. , show: function () {
  444. var dimension
  445. , scroll
  446. , actives
  447. , hasData
  448. if (this.transitioning || this.$element.hasClass('in')) return
  449. dimension = this.dimension()
  450. scroll = $.camelCase(['scroll', dimension].join('-'))
  451. actives = this.$parent && this.$parent.find('> .accordion-group > .in')
  452. if (actives && actives.length) {
  453. hasData = actives.data('collapse')
  454. if (hasData && hasData.transitioning) return
  455. actives.collapse('hide')
  456. hasData || actives.data('collapse', null)
  457. }
  458. this.$element[dimension](0)
  459. this.transition('addClass', $.Event('show'), 'shown')
  460. $.support.transition && this.$element[dimension](this.$element[0][scroll])
  461. }
  462. , hide: function () {
  463. var dimension
  464. if (this.transitioning || !this.$element.hasClass('in')) return
  465. dimension = this.dimension()
  466. this.reset(this.$element[dimension]())
  467. this.transition('removeClass', $.Event('hide'), 'hidden')
  468. this.$element[dimension](0)
  469. }
  470. , reset: function (size) {
  471. var dimension = this.dimension()
  472. this.$element
  473. .removeClass('collapse')
  474. [dimension](size || 'auto')
  475. [0].offsetWidth
  476. this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
  477. return this
  478. }
  479. , transition: function (method, startEvent, completeEvent) {
  480. var that = this
  481. , complete = function () {
  482. if (startEvent.type == 'show') that.reset()
  483. that.transitioning = 0
  484. that.$element.trigger(completeEvent)
  485. }
  486. this.$element.trigger(startEvent)
  487. if (startEvent.isDefaultPrevented()) return
  488. this.transitioning = 1
  489. this.$element[method]('in')
  490. $.support.transition && this.$element.hasClass('collapse') ?
  491. this.$element.one($.support.transition.end, complete) :
  492. complete()
  493. }
  494. , toggle: function () {
  495. this[this.$element.hasClass('in') ? 'hide' : 'show']()
  496. }
  497. }
  498. /* COLLAPSE PLUGIN DEFINITION
  499. * ========================== */
  500. var old = $.fn.collapse
  501. $.fn.collapse = function (option) {
  502. return this.each(function () {
  503. var $this = $(this)
  504. , data = $this.data('collapse')
  505. , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
  506. if (!data) $this.data('collapse', (data = new Collapse(this, options)))
  507. if (typeof option == 'string') data[option]()
  508. })
  509. }
  510. $.fn.collapse.defaults = {
  511. toggle: true
  512. }
  513. $.fn.collapse.Constructor = Collapse
  514. /* COLLAPSE NO CONFLICT
  515. * ==================== */
  516. $.fn.collapse.noConflict = function () {
  517. $.fn.collapse = old
  518. return this
  519. }
  520. /* COLLAPSE DATA-API
  521. * ================= */
  522. $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
  523. var $this = $(this), href
  524. , target = $this.attr('data-target')
  525. || e.preventDefault()
  526. || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
  527. , option = $(target).data('collapse') ? 'toggle' : $this.data()
  528. $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
  529. $(target).collapse(option)
  530. })
  531. }(window.jQuery);
  532. },{}],6:[function(require,module,exports){
  533. /*jshint sub:true*/
  534. /*
  535. * js come from :bootstrap-datepicker.js
  536. * Started by Stefan Petre; improvements by Andrew Rowls + contributors
  537. * you con get the source from github: https://github.com/eternicode/bootstrap-datepicker
  538. */
  539. (function($, undefined){
  540. var $window = $(window);
  541. function UTCDate(){
  542. return new Date(Date.UTC.apply(Date, arguments));
  543. }
  544. function UTCToday(){
  545. var today = new Date();
  546. return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());
  547. }
  548. function alias(method){
  549. return function(){
  550. return this[method].apply(this, arguments);
  551. };
  552. }
  553. var DateArray = (function(){
  554. var extras = {
  555. get: function(i){
  556. return this.slice(i)[0];
  557. },
  558. contains: function(d){
  559. // Array.indexOf is not cross-browser;
  560. // $.inArray doesn't work with Dates
  561. var val = d && d.valueOf();
  562. for (var i=0, l=this.length; i < l; i++)
  563. if (this[i].valueOf() === val)
  564. return i;
  565. return -1;
  566. },
  567. remove: function(i){
  568. this.splice(i,1);
  569. },
  570. replace: function(new_array){
  571. if (!new_array)
  572. return;
  573. if (!$.isArray(new_array))
  574. new_array = [new_array];
  575. this.clear();
  576. this.push.apply(this, new_array);
  577. },
  578. clear: function(){
  579. this.length = 0;
  580. },
  581. copy: function(){
  582. var a = new DateArray();
  583. a.replace(this);
  584. return a;
  585. }
  586. };
  587. return function(){
  588. var a = [];
  589. a.push.apply(a, arguments);
  590. $.extend(a, extras);
  591. return a;
  592. };
  593. })();
  594. // Picker object
  595. var Datepicker = function(element, options){
  596. this.dates = new DateArray();
  597. this.viewDate = UTCToday();
  598. this.focusDate = null;
  599. this._process_options(options);
  600. this.element = $(element);
  601. this.isInline = false;
  602. this.isInput = this.element.is('input');
  603. this.component = this.element.is('.date') ? this.element.find('.add-on, .input-group-addon, .sui-btn') : false;
  604. this.hasInput = this.component && this.element.find('input').length;
  605. if (this.component && this.component.length === 0)
  606. this.component = false;
  607. this.picker = $(DPGlobal.template);
  608. this._buildEvents();
  609. this._attachEvents();
  610. if (this.isInline){
  611. this.picker.addClass('datepicker-inline').appendTo(this.element);
  612. }
  613. else {
  614. this.picker.addClass('datepicker-dropdown dropdown-menu');
  615. }
  616. if (this.o.rtl){
  617. this.picker.addClass('datepicker-rtl');
  618. }
  619. this.viewMode = this.o.startView;
  620. if (this.o.calendarWeeks)
  621. this.picker.find('tfoot th.today')
  622. .attr('colspan', function(i, val){
  623. return parseInt(val) + 1;
  624. });
  625. this._allow_update = false;
  626. this.setStartDate(this._o.startDate);
  627. this.setEndDate(this._o.endDate);
  628. this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);
  629. this.fillDow();
  630. this.fillMonths();
  631. this._allow_update = true;
  632. this.update();
  633. this.showMode();
  634. if (this.isInline){
  635. this.show();
  636. }
  637. };
  638. Datepicker.prototype = {
  639. constructor: Datepicker,
  640. _process_options: function(opts){
  641. // Store raw options for reference
  642. this._o = $.extend({}, this._o, opts);
  643. // Processed options
  644. var o = this.o = $.extend({}, this._o);
  645. // Check if "de-DE" style date is available, if not language should
  646. // fallback to 2 letter code eg "de"
  647. var lang = o.language;
  648. if (!dates[lang]){
  649. lang = lang.split('-')[0];
  650. if (!dates[lang])
  651. lang = defaults.language;
  652. }
  653. o.language = lang;
  654. switch (o.startView){
  655. case 2:
  656. case 'decade':
  657. o.startView = 2;
  658. break;
  659. case 1:
  660. case 'year':
  661. o.startView = 1;
  662. break;
  663. default:
  664. o.startView = 0;
  665. }
  666. switch (o.minViewMode){
  667. case 1:
  668. case 'months':
  669. o.minViewMode = 1;
  670. break;
  671. case 2:
  672. case 'years':
  673. o.minViewMode = 2;
  674. break;
  675. default:
  676. o.minViewMode = 0;
  677. }
  678. o.startView = Math.max(o.startView, o.minViewMode);
  679. // true, false, or Number > 0
  680. if (o.multidate !== true){
  681. o.multidate = Number(o.multidate) || false;
  682. if (o.multidate !== false)
  683. o.multidate = Math.max(0, o.multidate);
  684. else
  685. o.multidate = 1;
  686. }
  687. o.multidateSeparator = String(o.multidateSeparator);
  688. o.weekStart %= 7;
  689. o.weekEnd = ((o.weekStart + 6) % 7);
  690. var format = DPGlobal.parseFormat(o.format);
  691. if (o.startDate !== -Infinity){
  692. if (!!o.startDate){
  693. if (o.startDate instanceof Date)
  694. o.startDate = this._local_to_utc(this._zero_time(o.startDate));
  695. else
  696. o.startDate = DPGlobal.parseDate(o.startDate, format, o.language);
  697. }
  698. else {
  699. o.startDate = -Infinity;
  700. }
  701. }
  702. if (o.endDate !== Infinity){
  703. if (!!o.endDate){
  704. if (o.endDate instanceof Date)
  705. o.endDate = this._local_to_utc(this._zero_time(o.endDate));
  706. else
  707. o.endDate = DPGlobal.parseDate(o.endDate, format, o.language);
  708. }
  709. else {
  710. o.endDate = Infinity;
  711. }
  712. }
  713. o.daysOfWeekDisabled = o.daysOfWeekDisabled||[];
  714. if (!$.isArray(o.daysOfWeekDisabled))
  715. o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/);
  716. o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function(d){
  717. return parseInt(d, 10);
  718. });
  719. var plc = String(o.orientation).toLowerCase().split(/\s+/g),
  720. _plc = o.orientation.toLowerCase();
  721. plc = $.grep(plc, function(word){
  722. return (/^auto|left|right|top|bottom$/).test(word);
  723. });
  724. o.orientation = {x: 'auto', y: 'auto'};
  725. if (!_plc || _plc === 'auto')
  726. ; // no action
  727. else if (plc.length === 1){
  728. switch (plc[0]){
  729. case 'top':
  730. case 'bottom':
  731. o.orientation.y = plc[0];
  732. break;
  733. case 'left':
  734. case 'right':
  735. o.orientation.x = plc[0];
  736. break;
  737. }
  738. }
  739. else {
  740. _plc = $.grep(plc, function(word){
  741. return (/^left|right$/).test(word);
  742. });
  743. o.orientation.x = _plc[0] || 'auto';
  744. _plc = $.grep(plc, function(word){
  745. return (/^top|bottom$/).test(word);
  746. });
  747. o.orientation.y = _plc[0] || 'auto';
  748. }
  749. },
  750. _events: [],
  751. _secondaryEvents: [],
  752. _applyEvents: function(evs){
  753. for (var i=0, el, ch, ev; i < evs.length; i++){
  754. el = evs[i][0];
  755. if (evs[i].length === 2){
  756. ch = undefined;
  757. ev = evs[i][1];
  758. }
  759. else if (evs[i].length === 3){
  760. ch = evs[i][1];
  761. ev = evs[i][2];
  762. }
  763. el.on(ev, ch);
  764. }
  765. },
  766. _unapplyEvents: function(evs){
  767. for (var i=0, el, ev, ch; i < evs.length; i++){
  768. el = evs[i][0];
  769. if (evs[i].length === 2){
  770. ch = undefined;
  771. ev = evs[i][1];
  772. }
  773. else if (evs[i].length === 3){
  774. ch = evs[i][1];
  775. ev = evs[i][2];
  776. }
  777. el.off(ev, ch);
  778. }
  779. },
  780. _buildEvents: function(){
  781. if (this.isInput){ // single input
  782. this._events = [
  783. [this.element, {
  784. focus: $.proxy(this.show, this),
  785. keyup: $.proxy(function(e){
  786. if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)
  787. this.update();
  788. }, this),
  789. keydown: $.proxy(this.keydown, this)
  790. }]
  791. ];
  792. }
  793. else if (this.component && this.hasInput){ // component: input + button
  794. this._events = [
  795. // For components that are not readonly, allow keyboard nav
  796. [this.element.find('input'), {
  797. focus: $.proxy(this.show, this),
  798. keyup: $.proxy(function(e){
  799. if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)
  800. this.update();
  801. }, this),
  802. keydown: $.proxy(this.keydown, this)
  803. }],
  804. [this.component, {
  805. click: $.proxy(this.show, this)
  806. }]
  807. ];
  808. }
  809. else if (this.element.is('div')){ // inline datepicker
  810. this.isInline = true;
  811. }
  812. else {
  813. this._events = [
  814. [this.element, {
  815. click: $.proxy(this.show, this)
  816. }]
  817. ];
  818. }
  819. this._events.push(
  820. // Component: listen for blur on element descendants
  821. [this.element, '*', {
  822. blur: $.proxy(function(e){
  823. this._focused_from = e.target;
  824. }, this)
  825. }],
  826. // Input: listen for blur on element
  827. [this.element, {
  828. blur: $.proxy(function(e){
  829. this._focused_from = e.target;
  830. }, this)
  831. }]
  832. );
  833. this._secondaryEvents = [
  834. [this.picker, {
  835. click: $.proxy(this.click, this)
  836. }],
  837. [$(window), {
  838. resize: $.proxy(this.place, this)
  839. }],
  840. [$(document), {
  841. 'mousedown touchstart': $.proxy(function(e){
  842. // Clicked outside the datepicker, hide it
  843. if (!(
  844. this.element.is(e.target) ||
  845. this.element.find(e.target).length ||
  846. this.picker.is(e.target) ||
  847. this.picker.find(e.target).length
  848. )){
  849. this.hide();
  850. }
  851. }, this)
  852. }]
  853. ];
  854. },
  855. _attachEvents: function(){
  856. this._detachEvents();
  857. this._applyEvents(this._events);
  858. },
  859. _detachEvents: function(){
  860. this._unapplyEvents(this._events);
  861. },
  862. _attachSecondaryEvents: function(){
  863. this._detachSecondaryEvents();
  864. this._applyEvents(this._secondaryEvents);
  865. },
  866. _detachSecondaryEvents: function(){
  867. this._unapplyEvents(this._secondaryEvents);
  868. },
  869. _trigger: function(event, altdate){
  870. var date = altdate || this.dates.get(-1),
  871. local_date = this._utc_to_local(date);
  872. this.element.trigger({
  873. type: event,
  874. date: local_date,
  875. dates: $.map(this.dates, this._utc_to_local),
  876. format: $.proxy(function(ix, format){
  877. if (arguments.length === 0){
  878. ix = this.dates.length - 1;
  879. format = this.o.format;
  880. }
  881. else if (typeof ix === 'string'){
  882. format = ix;
  883. ix = this.dates.length - 1;
  884. }
  885. format = format || this.o.format;
  886. var date = this.dates.get(ix);
  887. return DPGlobal.formatDate(date, format, this.o.language);
  888. }, this)
  889. });
  890. },
  891. show: function(){
  892. if (!this.isInline)
  893. this.picker.appendTo('body');
  894. this.picker.show();
  895. this.place();
  896. this._attachSecondaryEvents();
  897. this._trigger('show');
  898. },
  899. hide: function(){
  900. if (this.isInline)
  901. return;
  902. if (!this.picker.is(':visible'))
  903. return;
  904. this.focusDate = null;
  905. this.picker.hide().detach();
  906. this._detachSecondaryEvents();
  907. this.viewMode = this.o.startView;
  908. this.showMode();
  909. if (
  910. this.o.forceParse &&
  911. (
  912. this.isInput && this.element.val() ||
  913. this.hasInput && this.element.find('input').val()
  914. )
  915. )
  916. this.setValue();
  917. this._trigger('hide');
  918. },
  919. remove: function(){
  920. this.hide();
  921. this._detachEvents();
  922. this._detachSecondaryEvents();
  923. this.picker.remove();
  924. delete this.element.data().datepicker;
  925. if (!this.isInput){
  926. delete this.element.data().date;
  927. }
  928. },
  929. _utc_to_local: function(utc){
  930. return utc && new Date(utc.getTime() + (utc.getTimezoneOffset()*60000));
  931. },
  932. _local_to_utc: function(local){
  933. return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));
  934. },
  935. _zero_time: function(local){
  936. return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());
  937. },
  938. _zero_utc_time: function(utc){
  939. return utc && new Date(Date.UTC(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate()));
  940. },
  941. getDates: function(){
  942. return $.map(this.dates, this._utc_to_local);
  943. },
  944. getUTCDates: function(){
  945. return $.map(this.dates, function(d){
  946. return new Date(d);
  947. });
  948. },
  949. getDate: function(){
  950. return this._utc_to_local(this.getUTCDate());
  951. },
  952. getUTCDate: function(){
  953. return new Date(this.dates.get(-1));
  954. },
  955. setDates: function(){
  956. var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
  957. this.update.apply(this, args);
  958. this._trigger('changeDate');
  959. this.setValue();
  960. },
  961. setUTCDates: function(){
  962. var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
  963. this.update.apply(this, $.map(args, this._utc_to_local));
  964. this._trigger('changeDate');
  965. this.setValue();
  966. },
  967. setDate: alias('setDates'),
  968. setUTCDate: alias('setUTCDates'),
  969. setValue: function(){
  970. var formatted = this.getFormattedDate();
  971. if (!this.isInput){
  972. if (this.component){
  973. this.element.find('input').val(formatted).change();
  974. }
  975. }
  976. else {
  977. this.element.val(formatted).change();
  978. }
  979. },
  980. getFormattedDate: function(format){
  981. if (format === undefined)
  982. format = this.o.format;
  983. var lang = this.o.language;
  984. return $.map(this.dates, function(d){
  985. return DPGlobal.formatDate(d, format, lang);
  986. }).join(this.o.multidateSeparator);
  987. },
  988. setStartDate: function(startDate){
  989. this._process_options({startDate: startDate});
  990. this.update();
  991. this.updateNavArrows();
  992. },
  993. setEndDate: function(endDate){
  994. this._process_options({endDate: endDate});
  995. this.update();
  996. this.updateNavArrows();
  997. },
  998. setDaysOfWeekDisabled: function(daysOfWeekDisabled){
  999. this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
  1000. this.update();
  1001. this.updateNavArrows();
  1002. },
  1003. place: function(){
  1004. if (this.isInline)
  1005. return;
  1006. var calendarWidth = this.picker.outerWidth(),
  1007. calendarHeight = this.picker.outerHeight(),
  1008. visualPadding = 10,
  1009. windowWidth = $window.width(),
  1010. windowHeight = $window.height(),
  1011. scrollTop = $window.scrollTop();
  1012. var zIndex = parseInt(this.element.parents().filter(function(){
  1013. return $(this).css('z-index') !== 'auto';
  1014. }).first().css('z-index'))+10;
  1015. var offset = this.component ? this.component.parent().offset() : this.element.offset();
  1016. var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);
  1017. var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);
  1018. var left = offset.left,
  1019. top = offset.top;
  1020. this.picker.removeClass(
  1021. 'datepicker-orient-top datepicker-orient-bottom '+
  1022. 'datepicker-orient-right datepicker-orient-left'
  1023. );
  1024. if (this.o.orientation.x !== 'auto'){
  1025. this.picker.addClass('datepicker-orient-' + this.o.orientation.x);
  1026. if (this.o.orientation.x === 'right')
  1027. left -= calendarWidth - width;
  1028. }
  1029. // auto x orientation is best-placement: if it crosses a window
  1030. // edge, fudge it sideways
  1031. else {
  1032. // Default to left
  1033. this.picker.addClass('datepicker-orient-left');
  1034. if (offset.left < 0)
  1035. left -= offset.left - visualPadding;
  1036. else if (offset.left + calendarWidth > windowWidth)
  1037. left = windowWidth - calendarWidth - visualPadding;
  1038. }
  1039. // auto y orientation is best-situation: top or bottom, no fudging,
  1040. // decision based on which shows more of the calendar
  1041. var yorient = this.o.orientation.y,
  1042. top_overflow, bottom_overflow;
  1043. if (yorient === 'auto'){
  1044. top_overflow = -scrollTop + offset.top - calendarHeight;
  1045. bottom_overflow = scrollTop + windowHeight - (offset.top + height + calendarHeight);
  1046. if (Math.max(top_overflow, bottom_overflow) === bottom_overflow)
  1047. yorient = 'top';
  1048. else
  1049. yorient = 'bottom';
  1050. }
  1051. this.picker.addClass('datepicker-orient-' + yorient);
  1052. if (yorient === 'top')
  1053. top += height + 6;
  1054. else
  1055. top -= calendarHeight + parseInt(this.picker.css('padding-top')) + 6;
  1056. this.picker.css({
  1057. top: top,
  1058. left: left,
  1059. zIndex: zIndex
  1060. });
  1061. },
  1062. _allow_update: true,
  1063. update: function(){
  1064. if (!this._allow_update)
  1065. return;
  1066. var oldDates = this.dates.copy(),
  1067. dates = [],
  1068. fromArgs = false;
  1069. if (arguments.length){
  1070. $.each(arguments, $.proxy(function(i, date){
  1071. if (date instanceof Date)
  1072. date = this._local_to_utc(date);
  1073. dates.push(date);
  1074. }, this));
  1075. fromArgs = true;
  1076. }
  1077. else {
  1078. dates = this.isInput
  1079. ? this.element.val()
  1080. : this.element.data('date') || this.element.find('input').val();
  1081. if (dates && this.o.multidate)
  1082. dates = dates.split(this.o.multidateSeparator);
  1083. else
  1084. dates = [dates];
  1085. delete this.element.data().date;
  1086. }
  1087. dates = $.map(dates, $.proxy(function(date){
  1088. return DPGlobal.parseDate(date, this.o.format, this.o.language);
  1089. }, this));
  1090. dates = $.grep(dates, $.proxy(function(date){
  1091. return (
  1092. date < this.o.startDate ||
  1093. date > this.o.endDate ||
  1094. !date
  1095. );
  1096. }, this), true);
  1097. this.dates.replace(dates);
  1098. if (this.dates.length)
  1099. this.viewDate = new Date(this.dates.get(-1));
  1100. else if (this.viewDate < this.o.startDate)
  1101. this.viewDate = new Date(this.o.startDate);
  1102. else if (this.viewDate > this.o.endDate)
  1103. this.viewDate = new Date(this.o.endDate);
  1104. if (fromArgs){
  1105. // setting date by clicking
  1106. this.setValue();
  1107. }
  1108. else if (dates.length){
  1109. // setting date by typing
  1110. if (String(oldDates) !== String(this.dates))
  1111. this._trigger('changeDate');
  1112. }
  1113. if (!this.dates.length && oldDates.length)
  1114. this._trigger('clearDate');
  1115. this.fill();
  1116. },
  1117. fillDow: function(){
  1118. var dowCnt = this.o.weekStart,
  1119. html = '<tr class="week-content">';
  1120. if (this.o.calendarWeeks){
  1121. var cell = '<th class="cw">&nbsp;</th>';
  1122. html += cell;
  1123. this.picker.find('.datepicker-days thead tr:first-child').prepend(cell);
  1124. }
  1125. while (dowCnt < this.o.weekStart + 7){
  1126. html += '<th class="dow">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>';
  1127. }
  1128. html += '</tr>';
  1129. this.picker.find('.datepicker-days thead').append(html);
  1130. },
  1131. fillMonths: function(){
  1132. var html = '',
  1133. i = 0;
  1134. while (i < 12){
  1135. html += '<span class="month">'+dates[this.o.language].monthsShort[i++]+'</span>';
  1136. }
  1137. this.picker.find('.datepicker-months td').html(html);
  1138. },
  1139. setRange: function(range){
  1140. if (!range || !range.length)
  1141. delete this.range;
  1142. else
  1143. this.range = $.map(range, function(d){
  1144. return d.valueOf();
  1145. });
  1146. this.fill();
  1147. },
  1148. getClassNames: function(date){
  1149. var cls = [],
  1150. year = this.viewDate.getUTCFullYear(),
  1151. month = this.viewDate.getUTCMonth(),
  1152. today = new Date();
  1153. if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){
  1154. cls.push('old');
  1155. }
  1156. else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){
  1157. cls.push('new');
  1158. }
  1159. if (this.focusDate && date.valueOf() === this.focusDate.valueOf())
  1160. cls.push('focused');
  1161. // Compare internal UTC date with local today, not UTC today
  1162. if (this.o.todayHighlight &&
  1163. date.getUTCFullYear() === today.getFullYear() &&
  1164. date.getUTCMonth() === today.getMonth() &&
  1165. date.getUTCDate() === today.getDate()){
  1166. cls.push('today');
  1167. }
  1168. if (this.dates.contains(date) !== -1)
  1169. cls.push('active');
  1170. if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate ||
  1171. $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1){
  1172. cls.push('disabled');
  1173. }
  1174. if (this.range){
  1175. if (date > this.range[0] && date < this.range[this.range.length-1]){
  1176. cls.push('range');
  1177. }
  1178. if ($.inArray(date.valueOf(), this.range) !== -1){
  1179. cls.push('selected');
  1180. }
  1181. }
  1182. return cls;
  1183. },
  1184. fill: function(){
  1185. var d = new Date(this.viewDate),
  1186. year = d.getUTCFullYear(),
  1187. month = d.getUTCMonth(),
  1188. startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
  1189. startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
  1190. endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
  1191. endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
  1192. todaytxt = dates[this.o.language].today || dates['en'].today || '',
  1193. cleartxt = dates[this.o.language].clear || dates['en'].clear || '',
  1194. tooltip;
  1195. this.picker.find('.datepicker-days thead th.datepicker-switch')
  1196. .text(year+'年 '+dates[this.o.language].months[month]);
  1197. this.picker.find('tfoot th.today')
  1198. .text(todaytxt)
  1199. .toggle(this.o.todayBtn !== false);
  1200. this.picker.find('tfoot th.clear')
  1201. .text(cleartxt)
  1202. .toggle(this.o.clearBtn !== false);
  1203. this.updateNavArrows();
  1204. this.fillMonths();
  1205. var prevMonth = UTCDate(year, month-1, 28),
  1206. day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());
  1207. prevMonth.setUTCDate(day);
  1208. prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);
  1209. var nextMonth = new Date(prevMonth);
  1210. nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
  1211. nextMonth = nextMonth.valueOf();
  1212. var html = [];
  1213. var clsName;
  1214. while (prevMonth.valueOf() < nextMonth){
  1215. if (prevMonth.getUTCDay() === this.o.weekStart){
  1216. html.push('<tr>');
  1217. if (this.o.calendarWeeks){
  1218. // ISO 8601: First week contains first thursday.
  1219. // ISO also states week starts on Monday, but we can be more abstract here.
  1220. var
  1221. // Start of current week: based on weekstart/current date
  1222. ws = new Date(+prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5),
  1223. // Thursday of this week
  1224. th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
  1225. // First Thursday of year, year from thursday
  1226. yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay())%7*864e5),
  1227. // Calendar week: ms between thursdays, div ms per day, div 7 days
  1228. calWeek = (th - yth) / 864e5 / 7 + 1;
  1229. html.push('<td class="cw">'+ calWeek +'</td>');
  1230. }
  1231. }
  1232. clsName = this.getClassNames(prevMonth);
  1233. clsName.push('day');
  1234. if (this.o.beforeShowDay !== $.noop){
  1235. var before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
  1236. if (before === undefined)
  1237. before = {};
  1238. else if (typeof(before) === 'boolean')
  1239. before = {enabled: before};
  1240. else if (typeof(before) === 'string')
  1241. before = {classes: before};
  1242. if (before.enabled === false)
  1243. clsName.push('disabled');
  1244. if (before.classes)
  1245. clsName = clsName.concat(before.classes.split(/\s+/));
  1246. if (before.tooltip)
  1247. tooltip = before.tooltip;
  1248. }
  1249. clsName = $.unique(clsName);
  1250. var currentDate;
  1251. var today = new Date();
  1252. if (this.o.todayHighlight &&
  1253. prevMonth.getUTCFullYear() === today.getFullYear() &&
  1254. prevMonth.getUTCMonth() === today.getMonth() &&
  1255. prevMonth.getUTCDate() === today.getDate()) {
  1256. currentDate = '今日';
  1257. }else{
  1258. currentDate = prevMonth.getUTCDate();
  1259. }
  1260. html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + 'data-day="'+prevMonth.getUTCDate()+'"'+'>'+ currentDate + '</td>');
  1261. if (prevMonth.getUTCDay() === this.o.weekEnd){
  1262. html.push('</tr>');
  1263. }
  1264. prevMonth.setUTCDate(prevMonth.getUTCDate()+1);
  1265. }
  1266. this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
  1267. var months = this.picker.find('.datepicker-months')
  1268. .find('th:eq(1)')
  1269. .text(year)
  1270. .end()
  1271. .find('span').removeClass('active');
  1272. $.each(this.dates, function(i, d){
  1273. if (d.getUTCFullYear() === year)
  1274. months.eq(d.getUTCMonth()).addClass('active');
  1275. });
  1276. if (year < startYear || year > endYear){
  1277. months.addClass('disabled');
  1278. }
  1279. if (year === startYear){
  1280. months.slice(0, startMonth).addClass('disabled');
  1281. }
  1282. if (year === endYear){
  1283. months.slice(endMonth+1).addClass('disabled');
  1284. }
  1285. html = '';
  1286. year = parseInt(year/10, 10) * 10;
  1287. var yearCont = this.picker.find('.datepicker-years')
  1288. .find('th:eq(1)')
  1289. .text(year + '-' + (year + 9))
  1290. .end()
  1291. .find('td');
  1292. year -= 1;
  1293. var years = $.map(this.dates, function(d){
  1294. return d.getUTCFullYear();
  1295. }),
  1296. classes;
  1297. for (var i = -1; i < 11; i++){
  1298. classes = ['year'];
  1299. if (i === -1)
  1300. classes.push('old');
  1301. else if (i === 10)
  1302. classes.push('new');
  1303. if ($.inArray(year, years) !== -1)
  1304. classes.push('active');
  1305. if (year < startYear || year > endYear)
  1306. classes.push('disabled');
  1307. html += '<span class="' + classes.join(' ') + '">'+year+'</span>';
  1308. year += 1;
  1309. }
  1310. yearCont.html(html);
  1311. },
  1312. updateNavArrows: function(){
  1313. if (!this._allow_update)
  1314. return;
  1315. var d = new Date(this.viewDate),
  1316. year = d.getUTCFullYear(),
  1317. month = d.getUTCMonth();
  1318. switch (this.viewMode){
  1319. case 0:
  1320. if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()){
  1321. this.picker.find('.prev').css({visibility: 'hidden'});
  1322. }
  1323. else {
  1324. this.picker.find('.prev').css({visibility: 'visible'});
  1325. }
  1326. if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()){
  1327. this.picker.find('.next').css({visibility: 'hidden'});
  1328. }
  1329. else {
  1330. this.picker.find('.next').css({visibility: 'visible'});
  1331. }
  1332. break;
  1333. case 1:
  1334. case 2:
  1335. if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear()){
  1336. this.picker.find('.prev').css({visibility: 'hidden'});
  1337. }
  1338. else {
  1339. this.picker.find('.prev').css({visibility: 'visible'});
  1340. }
  1341. if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear()){
  1342. this.picker.find('.next').css({visibility: 'hidden'});
  1343. }
  1344. else {
  1345. this.picker.find('.next').css({visibility: 'visible'});
  1346. }
  1347. break;
  1348. }
  1349. },
  1350. click: function(e){
  1351. e.preventDefault();
  1352. var target = $(e.target).closest('span, td, th'),
  1353. year, month, day;
  1354. if (target.length === 1){
  1355. switch (target[0].nodeName.toLowerCase()){
  1356. case 'th':
  1357. switch (target[0].className){
  1358. case 'datepicker-switch':
  1359. this.showMode(1);
  1360. break;
  1361. case 'prev':
  1362. case 'next':
  1363. var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1);
  1364. switch (this.viewMode){
  1365. case 0:
  1366. this.viewDate = this.moveMonth(this.viewDate, dir);
  1367. this._trigger('changeMonth', this.viewDate);
  1368. break;
  1369. case 1:
  1370. case 2:
  1371. this.viewDate = this.moveYear(this.viewDate, dir);
  1372. if (this.viewMode === 1)
  1373. this._trigger('changeYear', this.viewDate);
  1374. break;
  1375. }
  1376. this.fill();
  1377. break;
  1378. case 'today':
  1379. var date = new Date();
  1380. date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
  1381. this.showMode(-2);
  1382. var which = this.o.todayBtn === 'linked' ? null : 'view';
  1383. this._setDate(date, which);
  1384. break;
  1385. case 'clear':
  1386. var element;
  1387. if (this.isInput)
  1388. element = this.element;
  1389. else if (this.component)
  1390. element = this.element.find('input');
  1391. if (element)
  1392. element.val("").change();
  1393. this.update();
  1394. this._trigger('changeDate');
  1395. if (this.o.autoclose)
  1396. this.hide();
  1397. break;
  1398. }
  1399. break;
  1400. case 'span':
  1401. if (!target.is('.disabled')){
  1402. this.viewDate.setUTCDate(1);
  1403. if (target.is('.month')){
  1404. day = 1;
  1405. month = target.parent().find('span').index(target);
  1406. year = this.viewDate.getUTCFullYear();
  1407. this.viewDate.setUTCMonth(month);
  1408. this._trigger('changeMonth', this.viewDate);
  1409. if (this.o.minViewMode === 1){
  1410. this._setDate(UTCDate(year, month, day));
  1411. }
  1412. }
  1413. else {
  1414. day = 1;
  1415. month = 0;
  1416. year = parseInt(target.text(), 10)||0;
  1417. this.viewDate.setUTCFullYear(year);
  1418. this._trigger('changeYear', this.viewDate);
  1419. if (this.o.minViewMode === 2){
  1420. this._setDate(UTCDate(year, month, day));
  1421. }
  1422. }
  1423. this.showMode(-1);
  1424. this.fill();
  1425. }
  1426. break;
  1427. case 'td':
  1428. if (target.is('.day') && !target.is('.disabled')){
  1429. day = target.data('day');
  1430. day = parseInt(day, 10)||1;
  1431. year = this.viewDate.getUTCFullYear();
  1432. month = this.viewDate.getUTCMonth();
  1433. if (target.is('.old')){
  1434. if (month === 0){
  1435. month = 11;
  1436. year -= 1;
  1437. }
  1438. else {
  1439. month -= 1;
  1440. }
  1441. }
  1442. else if (target.is('.new')){
  1443. if (month === 11){
  1444. month = 0;
  1445. year += 1;
  1446. }
  1447. else {
  1448. month += 1;
  1449. }
  1450. }
  1451. this._setDate(UTCDate(year, month, day));
  1452. }
  1453. break;
  1454. }
  1455. }
  1456. if (this.picker.is(':visible') && this._focused_from){
  1457. $(this._focused_from).focus();
  1458. }
  1459. delete this._focused_from;
  1460. },
  1461. _toggle_multidate: function(date){
  1462. var ix = this.dates.contains(date);
  1463. if (!date){
  1464. this.dates.clear();
  1465. }
  1466. else if (ix !== -1){
  1467. this.dates.remove(ix);
  1468. }
  1469. else {
  1470. this.dates.push(date);
  1471. }
  1472. if (typeof this.o.multidate === 'number')
  1473. while (this.dates.length > this.o.multidate)
  1474. this.dates.remove(0);
  1475. },
  1476. _setDate: function(date, which){
  1477. if (!which || which === 'date')
  1478. this._toggle_multidate(date && new Date(date));
  1479. if (!which || which === 'view')
  1480. this.viewDate = date && new Date(date);
  1481. this.fill();
  1482. this.setValue();
  1483. this._trigger('changeDate');
  1484. var element;
  1485. if (this.isInput){
  1486. element = this.element;
  1487. }
  1488. else if (this.component){
  1489. element = this.element.find('input');
  1490. }
  1491. if (element){
  1492. element.change();
  1493. }
  1494. if (this.o.autoclose && (!which || which === 'date')){
  1495. this.hide();
  1496. }
  1497. },
  1498. moveMonth: function(date, dir){
  1499. if (!date)
  1500. return undefined;
  1501. if (!dir)
  1502. return date;
  1503. var new_date = new Date(date.valueOf()),
  1504. day = new_date.getUTCDate(),
  1505. month = new_date.getUTCMonth(),
  1506. mag = Math.abs(dir),
  1507. new_month, test;
  1508. dir = dir > 0 ? 1 : -1;
  1509. if (mag === 1){
  1510. test = dir === -1
  1511. // If going back one month, make sure month is not current month
  1512. // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
  1513. ? function(){
  1514. return new_date.getUTCMonth() === month;
  1515. }
  1516. // If going forward one month, make sure month is as expected
  1517. // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
  1518. : function(){
  1519. return new_date.getUTCMonth() !== new_month;
  1520. };
  1521. new_month = month + dir;
  1522. new_date.setUTCMonth(new_month);
  1523. // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
  1524. if (new_month < 0 || new_month > 11)
  1525. new_month = (new_month + 12) % 12;
  1526. }
  1527. else {
  1528. // For magnitudes >1, move one month at a time...
  1529. for (var i=0; i < mag; i++)
  1530. // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
  1531. new_date = this.moveMonth(new_date, dir);
  1532. // ...then reset the day, keeping it in the new month
  1533. new_month = new_date.getUTCMonth();
  1534. new_date.setUTCDate(day);
  1535. test = function(){
  1536. return new_month !== new_date.getUTCMonth();
  1537. };
  1538. }
  1539. // Common date-resetting loop -- if date is beyond end of month, make it
  1540. // end of month
  1541. while (test()){
  1542. new_date.setUTCDate(--day);
  1543. new_date.setUTCMonth(new_month);
  1544. }
  1545. return new_date;
  1546. },
  1547. moveYear: function(date, dir){
  1548. return this.moveMonth(date, dir*12);
  1549. },
  1550. dateWithinRange: function(date){
  1551. return date >= this.o.startDate && date <= this.o.endDate;
  1552. },
  1553. keydown: function(e){
  1554. if (this.picker.is(':not(:visible)')){
  1555. if (e.keyCode === 27) // allow escape to hide and re-show picker
  1556. this.show();
  1557. return;
  1558. }
  1559. var dateChanged = false,
  1560. dir, newDate, newViewDate,
  1561. focusDate = this.focusDate || this.viewDate;
  1562. switch (e.keyCode){
  1563. case 27: // escape
  1564. if (this.focusDate){
  1565. this.focusDate = null;
  1566. this.viewDate = this.dates.get(-1) || this.viewDate;
  1567. this.fill();
  1568. }
  1569. else
  1570. this.hide();
  1571. e.preventDefault();
  1572. break;
  1573. case 37: // left
  1574. case 39: // right
  1575. if (!this.o.keyboardNavigation)
  1576. break;
  1577. dir = e.keyCode === 37 ? -1 : 1;
  1578. if (e.ctrlKey){
  1579. newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
  1580. newViewDate = this.moveYear(focusDate, dir);
  1581. this._trigger('changeYear', this.viewDate);
  1582. }
  1583. else if (e.shiftKey){
  1584. newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
  1585. newViewDate = this.moveMonth(focusDate, dir);
  1586. this._trigger('changeMonth', this.viewDate);
  1587. }
  1588. else {
  1589. newDate = new Date(this.dates.get(-1) || UTCToday());
  1590. newDate.setUTCDate(newDate.getUTCDate() + dir);
  1591. newViewDate = new Date(focusDate);
  1592. newViewDate.setUTCDate(focusDate.getUTCDate() + dir);
  1593. }
  1594. if (this.dateWithinRange(newDate)){
  1595. this.focusDate = this.viewDate = newViewDate;
  1596. this.setValue();
  1597. this.fill();
  1598. e.preventDefault();
  1599. }
  1600. break;
  1601. case 38: // up
  1602. case 40: // down
  1603. if (!this.o.keyboardNavigation)
  1604. break;
  1605. dir = e.keyCode === 38 ? -1 : 1;
  1606. if (e.ctrlKey){
  1607. newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
  1608. newViewDate = this.moveYear(focusDate, dir);
  1609. this._trigger('changeYear', this.viewDate);
  1610. }
  1611. else if (e.shiftKey){
  1612. newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
  1613. newViewDate = this.moveMonth(focusDate, dir);
  1614. this._trigger('changeMonth', this.viewDate);
  1615. }
  1616. else {
  1617. newDate = new Date(this.dates.get(-1) || UTCToday());
  1618. newDate.setUTCDate(newDate.getUTCDate() + dir * 7);
  1619. newViewDate = new Date(focusDate);
  1620. newViewDate.setUTCDate(focusDate.getUTCDate() + dir * 7);
  1621. }
  1622. if (this.dateWithinRange(newDate)){
  1623. this.focusDate = this.viewDate = newViewDate;
  1624. this.setValue();
  1625. this.fill();
  1626. e.preventDefault();
  1627. }
  1628. break;
  1629. case 32: // spacebar
  1630. // Spacebar is used in manually typing dates in some formats.
  1631. // As such, its behavior should not be hijacked.
  1632. break;
  1633. case 13: // enter
  1634. focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;
  1635. this._toggle_multidate(focusDate);
  1636. dateChanged = true;
  1637. this.focusDate = null;
  1638. this.viewDate = this.dates.get(-1) || this.viewDate;
  1639. this.setValue();
  1640. this.fill();
  1641. if (this.picker.is(':visible')){
  1642. e.preventDefault();
  1643. if (this.o.autoclose)
  1644. this.hide();
  1645. }
  1646. break;
  1647. case 9: // tab
  1648. this.focusDate = null;
  1649. this.viewDate = this.dates.get(-1) || this.viewDate;
  1650. this.fill();
  1651. this.hide();
  1652. break;
  1653. }
  1654. if (dateChanged){
  1655. if (this.dates.length)
  1656. this._trigger('changeDate');
  1657. else
  1658. this._trigger('clearDate');
  1659. var element;
  1660. if (this.isInput){
  1661. element = this.element;
  1662. }
  1663. else if (this.component){
  1664. element = this.element.find('input');
  1665. }
  1666. if (element){
  1667. element.change();
  1668. }
  1669. }
  1670. },
  1671. showMode: function(dir){
  1672. if (dir){
  1673. this.viewMode = Math.max(this.o.minViewMode, Math.min(2, this.viewMode + dir));
  1674. }
  1675. this.picker
  1676. .find('>div')
  1677. .hide()
  1678. .filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName)
  1679. .css('display', 'block');
  1680. this.updateNavArrows();
  1681. }
  1682. };
  1683. var DateRangePicker = function(element, options){
  1684. this.element = $(element);
  1685. this.inputs = $.map(options.inputs, function(i){
  1686. return i.jquery ? i[0] : i;
  1687. });
  1688. delete options.inputs;
  1689. $(this.inputs)
  1690. .datepicker(options)
  1691. .bind('changeDate', $.proxy(this.dateUpdated, this));
  1692. this.pickers = $.map(this.inputs, function(i){
  1693. return $(i).data('datepicker');
  1694. });
  1695. this.updateDates();
  1696. };
  1697. DateRangePicker.prototype = {
  1698. updateDates: function(){
  1699. this.dates = $.map(this.pickers, function(i){
  1700. return i.getUTCDate();
  1701. });
  1702. this.updateRanges();
  1703. },
  1704. updateRanges: function(){
  1705. var range = $.map(this.dates, function(d){
  1706. return d.valueOf();
  1707. });
  1708. $.each(this.pickers, function(i, p){
  1709. p.setRange(range);
  1710. });
  1711. },
  1712. dateUpdated: function(e){
  1713. // `this.updating` is a workaround for preventing infinite recursion
  1714. // between `changeDate` triggering and `setUTCDate` calling. Until
  1715. // there is a better mechanism.
  1716. if (this.updating)
  1717. return;
  1718. this.updating = true;
  1719. var dp = $(e.target).data('datepicker'),
  1720. new_date = dp.getUTCDate(),
  1721. i = $.inArray(e.target, this.inputs),
  1722. l = this.inputs.length;
  1723. if (i === -1)
  1724. return;
  1725. $.each(this.pickers, function(i, p){
  1726. if (!p.getUTCDate())
  1727. p.setUTCDate(new_date);
  1728. });
  1729. if (new_date < this.dates[i]){
  1730. // Date being moved earlier/left
  1731. while (i >= 0 && new_date < this.dates[i]){
  1732. this.pickers[i--].setUTCDate(new_date);
  1733. }
  1734. }
  1735. else if (new_date > this.dates[i]){
  1736. // Date being moved later/right
  1737. while (i < l && new_date > this.dates[i]){
  1738. this.pickers[i++].setUTCDate(new_date);
  1739. }
  1740. }
  1741. this.updateDates();
  1742. delete this.updating;
  1743. },
  1744. remove: function(){
  1745. $.map(this.pickers, function(p){ p.remove(); });
  1746. delete this.element.data().datepicker;
  1747. }
  1748. };
  1749. function opts_from_el(el, prefix){
  1750. // Derive options from element data-attrs
  1751. var data = $(el).data(),
  1752. out = {}, inkey,
  1753. replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');
  1754. prefix = new RegExp('^' + prefix.toLowerCase());
  1755. function re_lower(_,a){
  1756. return a.toLowerCase();
  1757. }
  1758. for (var key in data)
  1759. if (prefix.test(key)){
  1760. inkey = key.replace(replace, re_lower);
  1761. out[inkey] = data[key];
  1762. }
  1763. return out;
  1764. }
  1765. function opts_from_locale(lang){
  1766. // Derive options from locale plugins
  1767. var out = {};
  1768. // Check if "de-DE" style date is available, if not language should
  1769. // fallback to 2 letter code eg "de"
  1770. if (!dates[lang]){
  1771. lang = lang.split('-')[0];
  1772. if (!dates[lang])
  1773. return;
  1774. }
  1775. var d = dates[lang];
  1776. $.each(locale_opts, function(i,k){
  1777. if (k in d)
  1778. out[k] = d[k];
  1779. });
  1780. return out;
  1781. }
  1782. var old = $.fn.datepicker;
  1783. $.fn.datepicker = function(option){
  1784. var args = Array.apply(null, arguments);
  1785. args.shift();
  1786. var internal_return;
  1787. this.each(function(){
  1788. var $this = $(this),
  1789. data = $this.data('datepicker'),
  1790. options = typeof option === 'object' && option;
  1791. if (!data){
  1792. var elopts = opts_from_el(this, 'date'),
  1793. // Preliminary otions
  1794. xopts = $.extend({}, defaults, elopts, options),
  1795. locopts = opts_from_locale(xopts.language),
  1796. // Options priority: js args, data-attrs, locales, defaults
  1797. opts = $.extend({}, defaults, locopts, elopts, options);
  1798. if ($this.is('.input-daterange') || opts.inputs){
  1799. var ropts = {
  1800. inputs: opts.inputs || $this.find('input').toArray()
  1801. };
  1802. $this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts))));
  1803. }
  1804. else {
  1805. $this.data('datepicker', (data = new Datepicker(this, opts)));
  1806. }
  1807. }
  1808. if (typeof option === 'string' && typeof data[option] === 'function'){
  1809. internal_return = data[option].apply(data, args);
  1810. if (internal_return !== undefined)
  1811. return false;
  1812. }
  1813. });
  1814. if (internal_return !== undefined)
  1815. return internal_return;
  1816. else
  1817. return this;
  1818. };
  1819. var defaults = $.fn.datepicker.defaults = {
  1820. autoclose: true,
  1821. beforeShowDay: $.noop,
  1822. calendarWeeks: false,
  1823. clearBtn: false,
  1824. daysOfWeekDisabled: [],
  1825. endDate: Infinity,
  1826. forceParse: true,
  1827. format: 'yyyy-mm-dd',
  1828. keyboardNavigation: true,
  1829. language: 'zh-CN',
  1830. minViewMode: 0,
  1831. multidate: false,
  1832. multidateSeparator: ',',
  1833. orientation: "auto",
  1834. rtl: false,
  1835. startDate: -Infinity,
  1836. startView: 0,
  1837. todayBtn: false,
  1838. todayHighlight: true,
  1839. weekStart: 0
  1840. };
  1841. var locale_opts = $.fn.datepicker.locale_opts = [
  1842. 'format',
  1843. 'rtl',
  1844. 'weekStart'
  1845. ];
  1846. $.fn.datepicker.Constructor = Datepicker;
  1847. var dates = $.fn.datepicker.dates = {
  1848. "en": {
  1849. days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
  1850. daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
  1851. daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
  1852. months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  1853. monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  1854. today: "Today",
  1855. clear: "Clear"
  1856. },
  1857. "zh-CN": {
  1858. days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
  1859. daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
  1860. daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
  1861. months: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
  1862. monthsShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
  1863. today: "今日",
  1864. weekStart: 0
  1865. }
  1866. };
  1867. var DPGlobal = {
  1868. modes: [
  1869. {
  1870. clsName: 'days',
  1871. navFnc: 'Month',
  1872. navStep: 1
  1873. },
  1874. {
  1875. clsName: 'months',
  1876. navFnc: 'FullYear',
  1877. navStep: 1
  1878. },
  1879. {
  1880. clsName: 'years',
  1881. navFnc: 'FullYear',
  1882. navStep: 10
  1883. }],
  1884. isLeapYear: function(year){
  1885. return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
  1886. },
  1887. getDaysInMonth: function(year, month){
  1888. return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
  1889. },
  1890. validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
  1891. nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
  1892. parseFormat: function(format){
  1893. // IE treats \0 as a string end in inputs (truncating the value),
  1894. // so it's a bad format delimiter, anyway
  1895. var separators = format.replace(this.validParts, '\0').split('\0'),
  1896. parts = format.match(this.validParts);
  1897. if (!separators || !separators.length || !parts || parts.length === 0){
  1898. throw new Error("Invalid date format.");
  1899. }
  1900. return {separators: separators, parts: parts};
  1901. },
  1902. parseDate: function(date, format, language){
  1903. if (!date)
  1904. return undefined;
  1905. if (date instanceof Date)
  1906. return date;
  1907. if (typeof format === 'string')
  1908. format = DPGlobal.parseFormat(format);
  1909. var part_re = /([\-+]\d+)([dmwy])/,
  1910. parts = date.match(/([\-+]\d+)([dmwy])/g),
  1911. part, dir, i;
  1912. if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){
  1913. date = new Date();
  1914. for (i=0; i < parts.length; i++){
  1915. part = part_re.exec(parts[i]);
  1916. dir = parseInt(part[1]);
  1917. switch (part[2]){
  1918. case 'd':
  1919. date.setUTCDate(date.getUTCDate() + dir);
  1920. break;
  1921. case 'm':
  1922. date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir);
  1923. break;
  1924. case 'w':
  1925. date.setUTCDate(date.getUTCDate() + dir * 7);
  1926. break;
  1927. case 'y':
  1928. date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir);
  1929. break;
  1930. }
  1931. }
  1932. return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0);
  1933. }
  1934. parts = date && date.match(this.nonpunctuation) || [];
  1935. date = new Date();
  1936. var parsed = {},
  1937. setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
  1938. setters_map = {
  1939. yyyy: function(d,v){
  1940. return d.setUTCFullYear(v);
  1941. },
  1942. yy: function(d,v){
  1943. return d.setUTCFullYear(2000+v);
  1944. },
  1945. m: function(d,v){
  1946. if (isNaN(d))
  1947. return d;
  1948. v -= 1;
  1949. while (v < 0) v += 12;
  1950. v %= 12;
  1951. d.setUTCMonth(v);
  1952. while (d.getUTCMonth() !== v)
  1953. d.setUTCDate(d.getUTCDate()-1);
  1954. return d;
  1955. },
  1956. d: function(d,v){
  1957. return d.setUTCDate(v);
  1958. }
  1959. },
  1960. val, filtered;
  1961. setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
  1962. setters_map['dd'] = setters_map['d'];
  1963. date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
  1964. var fparts = format.parts.slice();
  1965. // Remove noop parts
  1966. if (parts.length !== fparts.length){
  1967. fparts = $(fparts).filter(function(i,p){
  1968. return $.inArray(p, setters_order) !== -1;
  1969. }).toArray();
  1970. }
  1971. // Process remainder
  1972. function match_part(){
  1973. var m = this.slice(0, parts[i].length),
  1974. p = parts[i].slice(0, m.length);
  1975. return m === p;
  1976. }
  1977. if (parts.length === fparts.length){
  1978. var cnt;
  1979. for (i=0, cnt = fparts.length; i < cnt; i++){
  1980. val = parseInt(parts[i], 10);
  1981. part = fparts[i];
  1982. if (isNaN(val)){
  1983. switch (part){
  1984. case 'MM':
  1985. filtered = $(dates[language].months).filter(match_part);
  1986. val = $.inArray(filtered[0], dates[language].months) + 1;
  1987. break;
  1988. case 'M':
  1989. filtered = $(dates[language].monthsShort).filter(match_part);
  1990. val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
  1991. break;
  1992. }
  1993. }
  1994. parsed[part] = val;
  1995. }
  1996. var _date, s;
  1997. for (i=0; i < setters_order.length; i++){
  1998. s = setters_order[i];
  1999. if (s in parsed && !isNaN(parsed[s])){
  2000. _date = new Date(date);
  2001. setters_map[s](_date, parsed[s]);
  2002. if (!isNaN(_date))
  2003. date = _date;
  2004. }
  2005. }
  2006. }
  2007. return date;
  2008. },
  2009. formatDate: function(date, format, language){
  2010. if (!date)
  2011. return '';
  2012. if (typeof format === 'string')
  2013. format = DPGlobal.parseFormat(format);
  2014. var val = {
  2015. d: date.getUTCDate(),
  2016. D: dates[language].daysShort[date.getUTCDay()],
  2017. DD: dates[language].days[date.getUTCDay()],
  2018. m: date.getUTCMonth() + 1,
  2019. M: dates[language].monthsShort[date.getUTCMonth()],
  2020. MM: dates[language].months[date.getUTCMonth()],
  2021. yy: date.getUTCFullYear().toString().substring(2),
  2022. yyyy: date.getUTCFullYear()
  2023. };
  2024. val.dd = (val.d < 10 ? '0' : '') + val.d;
  2025. val.mm = (val.m < 10 ? '0' : '') + val.m;
  2026. date = [];
  2027. var seps = $.extend([], format.separators);
  2028. for (var i=0, cnt = format.parts.length; i <= cnt; i++){
  2029. if (seps.length)
  2030. date.push(seps.shift());
  2031. date.push(val[format.parts[i]]);
  2032. }
  2033. return date.join('');
  2034. },
  2035. headTemplate: '<thead>'+
  2036. '<tr class="date-header">'+
  2037. '<th class="prev"><b></b></th>'+
  2038. '<th colspan="5" class="datepicker-switch"></th>'+
  2039. '<th class="next"><b></b></th>'+
  2040. '</tr>'+
  2041. '</thead>',
  2042. contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
  2043. footTemplate: '<tfoot>'+
  2044. '<tr>'+
  2045. '<th colspan="7" class="today"></th>'+
  2046. '</tr>'+
  2047. '<tr>'+
  2048. '<th colspan="7" class="clear"></th>'+
  2049. '</tr>'+
  2050. '</tfoot>'
  2051. };
  2052. DPGlobal.template = '<div class="datepicker">'+
  2053. '<div class="datepicker-days">'+
  2054. '<table class=" table-condensed">'+
  2055. DPGlobal.headTemplate+
  2056. '<tbody></tbody>'+
  2057. DPGlobal.footTemplate+
  2058. '</table>'+
  2059. '</div>'+
  2060. '<div class="datepicker-months">'+
  2061. '<table class="table-condensed">'+
  2062. DPGlobal.headTemplate+
  2063. DPGlobal.contTemplate+
  2064. DPGlobal.footTemplate+
  2065. '</table>'+
  2066. '</div>'+
  2067. '<div class="datepicker-years">'+
  2068. '<table class="table-condensed">'+
  2069. DPGlobal.headTemplate+
  2070. DPGlobal.contTemplate+
  2071. DPGlobal.footTemplate+
  2072. '</table>'+
  2073. '</div>'+
  2074. '</div>';
  2075. $.fn.datepicker.DPGlobal = DPGlobal;
  2076. /* DATEPICKER NO CONFLICT
  2077. * =================== */
  2078. $.fn.datepicker.noConflict = function(){
  2079. $.fn.datepicker = old;
  2080. return this;
  2081. };
  2082. /* DATEPICKER DATA-API
  2083. * ================== */
  2084. $(document).on(
  2085. 'focus.datepicker.data-api click.datepicker.data-api',
  2086. '[data-toggle="datepicker"]',
  2087. function(e){
  2088. var $this = $(this);
  2089. if ($this.data('datepicker'))
  2090. return;
  2091. e.preventDefault();
  2092. // component click requires us to explicitly show it
  2093. $this.datepicker('show');
  2094. }
  2095. );
  2096. $(function(){
  2097. $('[data-toggle="datepicker-inline"]').datepicker();
  2098. });
  2099. }(window.jQuery));
  2100. },{}],7:[function(require,module,exports){
  2101. /* ============================================================
  2102. * bootstrap-dropdown.js v2.3.2
  2103. * http://getbootstrap.com/2.3.2/javascript.html#dropdowns
  2104. * ============================================================
  2105. * Copyright 2013 Twitter, Inc.
  2106. *
  2107. * Licensed under the Apache License, Version 2.0 (the "License");
  2108. * you may not use this file except in compliance with the License.
  2109. * You may obtain a copy of the License at
  2110. *
  2111. * http://www.apache.org/licenses/LICENSE-2.0
  2112. *
  2113. * Unless required by applicable law or agreed to in writing, software
  2114. * distributed under the License is distributed on an "AS IS" BASIS,
  2115. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2116. * See the License for the specific language governing permissions and
  2117. * limitations under the License.
  2118. * ============================================================ */
  2119. !function ($) {
  2120. "use strict";
  2121. /* DROPDOWN CLASS DEFINITION
  2122. * ========================= */
  2123. var toggle = '[data-toggle=dropdown]'
  2124. , Dropdown = function (element) {
  2125. var $el = $(element).on('click.dropdown.data-api', this.toggle)
  2126. if (!$el.data("toggle")) {
  2127. $el.attr("data-toggle", 'dropdown')
  2128. }
  2129. $('html').on('click.dropdown.data-api', function () {
  2130. getContainer($el).removeClass('open')
  2131. })
  2132. }
  2133. , getContainer = function($el) {
  2134. var $parent = $el.parent()
  2135. if ($parent.hasClass("dropdown-inner")) return $parent.parent()
  2136. return $parent;
  2137. }
  2138. Dropdown.prototype = {
  2139. constructor: Dropdown
  2140. , toggle: function (e) {
  2141. var $this = $(this)
  2142. , $parent
  2143. , isActive
  2144. if ($this.is('.disabled, :disabled')) return
  2145. $parent = getParent($this)
  2146. isActive = $parent.hasClass('open')
  2147. clearMenus()
  2148. if (!isActive) {
  2149. if ('ontouchstart' in document.documentElement) {
  2150. // if mobile we we use a backdrop because click events don't delegate
  2151. $('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
  2152. }
  2153. $parent.toggleClass('open')
  2154. }
  2155. $this.focus()
  2156. return false
  2157. }
  2158. , keydown: function (e) {
  2159. var $this
  2160. , $items
  2161. , $active
  2162. , $parent
  2163. , isActive
  2164. , index
  2165. if (!/(38|40|27)/.test(e.keyCode)) return
  2166. $this = $(this)
  2167. e.preventDefault()
  2168. e.stopPropagation()
  2169. if ($this.is('.disabled, :disabled')) return
  2170. $parent = getParent($this)
  2171. isActive = $parent.hasClass('open')
  2172. if (!isActive || (isActive && e.keyCode == 27)) {
  2173. if (e.which == 27) $parent.find(toggle).focus()
  2174. return $this.click()
  2175. }
  2176. $items = $('[role=menu] li:not(.divider):visible a', $parent)
  2177. if (!$items.length) return
  2178. index = $items.index($items.filter(':focus'))
  2179. if (e.keyCode == 38 && index > 0) index-- // up
  2180. if (e.keyCode == 40 && index < $items.length - 1) index++ // down
  2181. if (!~index) index = 0
  2182. $items
  2183. .eq(index)
  2184. .focus()
  2185. }
  2186. }
  2187. function clearMenus() {
  2188. $('.dropdown-backdrop').remove()
  2189. $(toggle).each(function () {
  2190. getParent($(this)).removeClass('open')
  2191. })
  2192. }
  2193. function getParent($this) {
  2194. var selector = $this.attr('data-target')
  2195. , $parent
  2196. if (!selector) {
  2197. selector = $this.attr('href')
  2198. selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  2199. }
  2200. $parent = selector && $(selector)
  2201. if (!$parent || !$parent.length) $parent = getContainer($this)
  2202. return $parent
  2203. }
  2204. /* DROPDOWN PLUGIN DEFINITION
  2205. * ========================== */
  2206. var old = $.fn.dropdown
  2207. $.fn.dropdown = function (option) {
  2208. return this.each(function () {
  2209. var $this = $(this)
  2210. , data = $this.data('dropdown')
  2211. if (!data) $this.data('dropdown', (data = new Dropdown(this)))
  2212. if (typeof option == 'string') data[option].call($this)
  2213. })
  2214. }
  2215. $.fn.dropdown.Constructor = Dropdown
  2216. /* DROPDOWN NO CONFLICT
  2217. * ==================== */
  2218. $.fn.dropdown.noConflict = function () {
  2219. $.fn.dropdown = old
  2220. return this
  2221. }
  2222. /* APPLY TO STANDARD DROPDOWN ELEMENTS
  2223. * =================================== */
  2224. $(document)
  2225. .on('click.dropdown.data-api', clearMenus)
  2226. .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
  2227. .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
  2228. .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
  2229. }(window.jQuery);
  2230. },{}],8:[function(require,module,exports){
  2231. /* =========================================================
  2232. * bootstrap-modal.js v2.3.2
  2233. * http://getbootstrap.com/2.3.2/javascript.html#modals
  2234. * =========================================================
  2235. * @file bootstrap-modal.js
  2236. * @brief 弹层dpl,扩展自bootstrap2.3.2
  2237. * @author banbian, zangtao.zt@alibaba-inc.com
  2238. * @date 2014-01-14
  2239. */
  2240. !function ($) {
  2241. "use strict";
  2242. /* MODAL CLASS DEFINITION
  2243. * ====================== */
  2244. var Modal = function (element, options) {
  2245. this.options = options
  2246. //若element为null,则表示为js触发的alert、confirm弹层
  2247. if (element === null) {
  2248. var TPL = ''
  2249. //data-hidetype表明这类简单dialog调用hide方法时会从文档树里删除节点
  2250. + '<div class="sui-modal hide fade" tabindex="-1" role="dialog" id={%id%} data-hidetype="remove">'
  2251. + '<div class="modal-dialog">'
  2252. + '<div class="modal-content">'
  2253. + '<div class="modal-header">'
  2254. + '<button type="button" class="sui-close" data-dismiss="modal" aria-hidden="true">&times;</button>'
  2255. + '<h4 class="modal-title">{%title%}</h4>'
  2256. + '</div>'
  2257. + '<div class="modal-body ' + (options.hasfoot ? '' : 'no-foot') + '">{%body%}</div>'
  2258. + (options.hasfoot ? '<div class="modal-footer">'
  2259. //增加data-ok="modal"参数
  2260. + '<button type="button" class="sui-btn btn-primary btn-large" data-ok="modal">{%ok_btn%}</button>'
  2261. + (options.cancelBtn ? '<button type="button" class="sui-btn btn-default btn-large" data-dismiss="modal">{%cancel_btn%}</button>' : '')
  2262. + '</div>' : '')
  2263. + '</div>'
  2264. + '</div>'
  2265. + '</div>';
  2266. element = $(TPL.replace('{%title%}', options.title)
  2267. .replace('{%body%}', options.body)
  2268. .replace('{%id%}', options.id)
  2269. .replace('{%ok_btn%}', options.okBtn)
  2270. .replace('{%cancel_btn%}', options.cancelBtn))
  2271. $('body').append(element)
  2272. }
  2273. this.$element = $(element)
  2274. this.init()
  2275. }
  2276. //对外接口只有toggle, show, hide
  2277. Modal.prototype = {
  2278. constructor: Modal
  2279. ,init: function () {
  2280. var ele = this.$element
  2281. , w = this.options.width
  2282. , self = this
  2283. , standardW = {
  2284. small: 440 //默认宽度
  2285. ,normal: 590
  2286. ,large: 790
  2287. }
  2288. ele.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
  2289. .delegate(':not(.disabled)[data-ok="modal"]', 'click.ok.modal', $.proxy(this.okHide, this))
  2290. if(w) {
  2291. standardW[w] && (w = standardW[w])
  2292. ele.width(w).css('margin-left', -parseInt(w) / 2)
  2293. }
  2294. this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
  2295. //, function(res, status, xhr){
  2296. //异步加载数据的情况,对话框展示时用于决定定位的信息不是最终有效信息,需要回调时校正。
  2297. //self.resize();
  2298. }
  2299. , toggle: function () {
  2300. return this[!this.isShown ? 'show' : 'hide']()
  2301. }
  2302. , show: function () {
  2303. var that = this
  2304. , e = $.Event('show')
  2305. , ele = this.$element
  2306. ele.trigger(e)
  2307. if (this.isShown || e.isDefaultPrevented()) return
  2308. this.isShown = true
  2309. this.escape()
  2310. this.backdrop(function () {
  2311. var transition = $.support.transition && ele.hasClass('fade')
  2312. if (!ele.parent().length) {
  2313. ele.appendTo(document.body) //don't move modals dom position
  2314. }
  2315. //处理dialog在页面中的定位
  2316. that.resize()
  2317. ele.show()
  2318. if (transition) {
  2319. ele[0].offsetWidth // force reflow
  2320. }
  2321. ele
  2322. .addClass('in')
  2323. .attr('aria-hidden', false)
  2324. that.enforceFocus()
  2325. transition ?
  2326. ele.one($.support.transition.end, function () {
  2327. callbackAfterTransition(that)
  2328. }) :
  2329. callbackAfterTransition(that)
  2330. function callbackAfterTransition(that) {
  2331. that.$element.focus().trigger('shown')
  2332. if (that.options.timeout > 0) {
  2333. that.timeid = setTimeout(function(){
  2334. that.hide();
  2335. }, that.options.timeout)
  2336. }
  2337. }
  2338. })
  2339. return ele
  2340. }
  2341. , hide: function (e) {
  2342. e && e.preventDefault()
  2343. var that = this
  2344. e = $.Event('hide')
  2345. this.$element.trigger(e)
  2346. if (!this.isShown || e.isDefaultPrevented()) return
  2347. this.isShown = false
  2348. this.escape()
  2349. $(document).off('focusin.modal')
  2350. that.timeid && clearTimeout(that.timeid)
  2351. this.$element
  2352. .removeClass('in')
  2353. .attr('aria-hidden', true)
  2354. $.support.transition && this.$element.hasClass('fade') ?
  2355. this.hideWithTransition() :
  2356. this.hideModal()
  2357. return that.$element
  2358. }
  2359. , okHide: function(e){
  2360. var that = this
  2361. // 如果e为undefined而不是事件对象,则说明不是点击确定按钮触发的执行,而是手工调用,
  2362. // 那么直接执行hideWithOk
  2363. if (!e) {
  2364. hideWithOk()
  2365. return
  2366. }
  2367. var fn = this.options.okHide
  2368. , ifNeedHide = true
  2369. if (!fn) {
  2370. var eventArr = $._data(this.$element[0], 'events').okHide
  2371. if (eventArr && eventArr.length) {
  2372. fn = eventArr[eventArr.length - 1].handler;
  2373. }
  2374. }
  2375. typeof fn == 'function' && (ifNeedHide = fn.call(this))
  2376. //显式返回false,则不关闭对话框
  2377. if (ifNeedHide !== false){
  2378. hideWithOk()
  2379. }
  2380. function hideWithOk (){
  2381. that.hideReason = 'ok'
  2382. that.hide(e)
  2383. }
  2384. return that.$element
  2385. }
  2386. //对话框内部遮罩层
  2387. , shadeIn: function () {
  2388. var $ele = this.$element
  2389. if ($ele.find('.shade').length) return
  2390. var $shadeEle = $('<div class="shade in" style="background:' + this.options.bgColor + '"></div>')
  2391. $shadeEle.appendTo($ele)
  2392. this.hasShaded = true
  2393. return this.$element
  2394. }
  2395. , shadeOut: function () {
  2396. this.$element.find('.shade').remove()
  2397. this.hasShaded = false
  2398. return this.$element
  2399. }
  2400. , shadeToggle: function () {
  2401. return this[!this.hasShaded ? 'shadeIn' : 'shadeOut']()
  2402. }
  2403. // dialog展示后,如果高度动态发生变化,比如塞入异步数据后撑高容器,则调用$dialog.modal('resize'),使dialog重新定位居中
  2404. , resize: function() {
  2405. var ele = this.$element
  2406. ,eleH = ele.height()
  2407. ,winH = $(window).height()
  2408. ,mt = 0
  2409. if (eleH >= winH)
  2410. mt = -winH/2
  2411. else
  2412. mt = (winH - eleH) / (1 + 1.618) - winH / 2
  2413. ele.css('margin-top', parseInt(mt))
  2414. return ele
  2415. }
  2416. , enforceFocus: function () {
  2417. var that = this
  2418. //防止多实例时循环触发
  2419. $(document).off('focusin.modal') .on('focusin.modal', function (e) {
  2420. if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
  2421. that.$element.focus()
  2422. }
  2423. })
  2424. }
  2425. , escape: function () {
  2426. var that = this
  2427. if (this.isShown && this.options.keyboard) {
  2428. this.$element.on('keyup.dismiss.modal', function ( e ) {
  2429. e.which == 27 && that.hide()
  2430. })
  2431. } else if (!this.isShown) {
  2432. this.$element.off('keyup.dismiss.modal')
  2433. }
  2434. }
  2435. , hideWithTransition: function () {
  2436. var that = this
  2437. , timeout = setTimeout(function () {
  2438. that.$element.off($.support.transition.end)
  2439. that.hideModal()
  2440. }, 300)
  2441. this.$element.one($.support.transition.end, function () {
  2442. clearTimeout(timeout)
  2443. that.hideModal()
  2444. })
  2445. }
  2446. , hideModal: function () {
  2447. var that = this
  2448. ,ele = this.$element
  2449. ele.hide()
  2450. this.backdrop(function () {
  2451. that.removeBackdrop()
  2452. if (that.hideReason == 'ok') {
  2453. ele.trigger('okHidden')
  2454. that.hideReason = null
  2455. }
  2456. ele.trigger('hidden')
  2457. //销毁静态方法生成的dialog元素 , 默认只有静态方法是remove类型
  2458. ele.data('hidetype') == 'remove' && ele.remove()
  2459. })
  2460. }
  2461. , removeBackdrop: function () {
  2462. this.$backdrop && this.$backdrop.remove()
  2463. this.$backdrop = null
  2464. }
  2465. , backdrop: function (callback) {
  2466. var that = this
  2467. , animate = this.$element.hasClass('fade') ? 'fade' : ''
  2468. , opt = this.options
  2469. if (this.isShown) {
  2470. var doAnimate = $.support.transition && animate
  2471. //如果显示背景遮罩层
  2472. if (opt.backdrop !== false) {
  2473. this.$backdrop = $('<div class="sui-modal-backdrop ' + animate + '" style="background:' + opt.bgColor + '"/>')
  2474. .appendTo(document.body)
  2475. //遮罩层背景黑色半透明
  2476. this.$backdrop.click(
  2477. opt.backdrop == 'static' ?
  2478. $.proxy(this.$element[0].focus, this.$element[0])
  2479. : $.proxy(this.hide, this)
  2480. )
  2481. if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
  2482. this.$backdrop.addClass('in ')
  2483. if (!callback) return
  2484. doAnimate ?
  2485. this.$backdrop.one($.support.transition.end, callback) :
  2486. callback()
  2487. } else {
  2488. callback && callback()
  2489. }
  2490. } else {
  2491. if (this.$backdrop) {
  2492. this.$backdrop.removeClass('in')
  2493. $.support.transition && this.$element.hasClass('fade')?
  2494. this.$backdrop.one($.support.transition.end, callback) :
  2495. callback()
  2496. } else {
  2497. callback && callback();
  2498. }
  2499. }
  2500. }
  2501. }
  2502. /* MODAL PLUGIN DEFINITION
  2503. * ======================= */
  2504. var old = $.fn.modal
  2505. $.fn.modal = function (option) {
  2506. //this指向dialog元素Dom,
  2507. //each让诸如 $('#qqq, #eee').modal(options) 的用法可行。
  2508. return this.each(function () {
  2509. var $this = $(this)
  2510. , data = $this.data('modal')
  2511. , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
  2512. //这里判断的目的是:第一次show时实例化dialog,之后的show则用缓存在data-modal里的对象。
  2513. if (!data) $this.data('modal', (data = new Modal(this, options)))
  2514. //如果是$('#xx').modal('toggle'),务必保证传入的字符串是Modal类原型链里已存在的方法。否则会报错has no method。
  2515. if (typeof option == 'string') data[option]()
  2516. else data.show()
  2517. })
  2518. }
  2519. $.fn.modal.defaults = {
  2520. backdrop: true
  2521. , bgColor: '#000'
  2522. , keyboard: true
  2523. , hasfoot: true
  2524. }
  2525. $.fn.modal.Constructor = Modal
  2526. /* MODAL NO CONFLICT
  2527. * ================= */
  2528. $.fn.modal.noConflict = function () {
  2529. $.fn.modal = old
  2530. return this
  2531. }
  2532. /* MODAL DATA-API
  2533. * ============== */
  2534. $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
  2535. var $this = $(this)
  2536. , href = $this.attr('href')
  2537. //$target这里指dialog本体Dom(若存在)
  2538. //通过data-target="#foo"或href="#foo"指向
  2539. , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
  2540. , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $this.data())
  2541. e.preventDefault()
  2542. $target
  2543. .modal(option)
  2544. .one('hide', function () {
  2545. $this.focus()
  2546. })
  2547. })
  2548. /* jquery弹层静态方法,用于很少重复,不需记住状态的弹层,可方便的直接调用,最简单形式就是$.alert('我是alert')
  2549. * 若弹层内容是复杂的Dom结构, 建议将弹层html结构写到模版里,用$(xx).modal(options) 调用
  2550. *
  2551. * example
  2552. * $.alert({
  2553. * title: '自定义标题'
  2554. * body: 'html' //必填
  2555. * okBtn : '好的'
  2556. * cancelBtn : '雅达'
  2557. * bgColor : '#123456' 背景遮罩层颜色
  2558. * width: {number|string(px)|'small'|'normal'|'large'}推荐优先使用后三个描述性字符串,统一样式
  2559. * timeout: {number} 1000 单位毫秒ms ,dialog打开后多久自动关闭
  2560. * hasfoot: {Boolean} 是否显示脚部 默认true
  2561. * show: fn --------------function(e){}
  2562. * shown: fn
  2563. * hide: fn
  2564. * hidden: fn
  2565. * okHide: function(e){alert('点击确认后、dialog消失前的逻辑,
  2566. * 函数返回true(默认)则dialog关闭,反之不关闭;若不传入则默认是直接返回true的函数
  2567. * 注意不要人肉返回undefined!!')}
  2568. * okHidden: function(e){alert('点击确认后、dialog消失后的逻辑')}
  2569. * })
  2570. *
  2571. */
  2572. $.extend({
  2573. _modal: function(dialogCfg, customCfg){
  2574. var modalId = +new Date()
  2575. ,finalCfg = $.extend({}, $.fn.modal.defaults
  2576. , dialogCfg
  2577. , {id: modalId, okBtn: '确定'}
  2578. , (typeof customCfg == 'string' ? {body: customCfg} : customCfg))
  2579. var dialog = new Modal(null, finalCfg)
  2580. , $ele = dialog.$element
  2581. _bind(modalId, finalCfg)
  2582. $ele.data('modal', dialog).modal('show')
  2583. function _bind(id, eList){
  2584. var eType = ['show', 'shown', 'hide', 'hidden', 'okHidden']
  2585. $.each(eType, function(k, v){
  2586. if (typeof eList[v] == 'function'){
  2587. $(document).on(v, '#'+id, $.proxy(eList[v], $('#' + id)[0]))
  2588. }
  2589. })
  2590. }
  2591. //静态方法对话框返回对话框元素的jQuery对象
  2592. return $ele
  2593. }
  2594. //为最常见的alert,confirm建立$.modal的快捷方式,
  2595. ,alert: function(customCfg){
  2596. var dialogCfg = {
  2597. type: 'alert'
  2598. ,title: '注意'
  2599. }
  2600. return $._modal(dialogCfg, customCfg)
  2601. }
  2602. ,confirm: function(customCfg){
  2603. var dialogCfg = {
  2604. type: 'confirm'
  2605. ,title: '提示'
  2606. ,cancelBtn: '取消'
  2607. }
  2608. return $._modal(dialogCfg, customCfg)
  2609. }
  2610. })
  2611. }(window.jQuery);
  2612. },{}],9:[function(require,module,exports){
  2613. (function ($) {
  2614. function Pagination(opts) {
  2615. this.itemsCount = opts.itemsCount;
  2616. this.pageSize = opts.pageSize;
  2617. this.displayPage = opts.displayPage < 5 ? 5 : opts.displayPage;
  2618. this.pages = Math.ceil(opts.itemsCount / opts.pageSize);
  2619. $.isNumeric(opts.pages) && (this.pages = opts.pages);
  2620. this.currentPage = opts.currentPage;
  2621. this.styleClass = opts.styleClass;
  2622. this.onSelect = opts.onSelect;
  2623. this.showCtrl = opts.showCtrl;
  2624. this.remote = opts.remote;
  2625. }
  2626. /* jshint ignore:start */
  2627. Pagination.prototype = {
  2628. //generate the outer wrapper with the config of custom style
  2629. _draw: function () {
  2630. var tpl = '<div class="sui-pagination';
  2631. for (var i = 0; i < this.styleClass.length; i++) {
  2632. tpl += ' ' + this.styleClass[i];
  2633. }
  2634. tpl += '"></div>'
  2635. this.hookNode.html(tpl);
  2636. this._drawInner();
  2637. },
  2638. //generate the true pagination
  2639. _drawInner: function () {
  2640. var outer = this.hookNode.children('.sui-pagination');
  2641. var tpl = '<ul>' + '<li class="prev' + (this.currentPage - 1 <= 0 ? ' disabled' : ' ') + '"><a href="#" data="' + (this.currentPage - 1) + '">«上一页</a></li>';
  2642. if (this.pages <= this.displayPage || this.pages == this.displayPage + 1) {
  2643. for (var i = 1; i < this.pages + 1; i++) {
  2644. i == this.currentPage ? (tpl += '<li class="active"><a href="#" data="' + i + '">' + i + '</a></li>') : (tpl += '<li><a href="#" data="' + i + '">' + i + '</a></li>');
  2645. }
  2646. } else {
  2647. if (this.currentPage < this.displayPage - 1) {
  2648. for (var i = 1; i < this.displayPage; i++) {
  2649. i == this.currentPage ? (tpl += '<li class="active"><a href="#" data="' + i + '">' + i + '</a></li>') : (tpl += '<li><a href="#" data="' + i + '">' + i + '</a></li>');
  2650. }
  2651. tpl += '<li class="dotted"><span>...</span></li>';
  2652. tpl += '<li><a href="#" data="' + this.pages + '">' + this.pages + '</a></li>';
  2653. } else if (this.currentPage > this.pages - this.displayPage + 2 && this.currentPage <= this.pages) {
  2654. tpl += '<li><a href="#" data="1">1</a></li>';
  2655. tpl += '<li class="dotted"><span>...</span></li>';
  2656. for (var i = this.pages - this.displayPage + 2; i <= this.pages; i++) {
  2657. i == this.currentPage ? (tpl += '<li class="active"><a href="#" data="' + i + '">' + i + '</a></li>') : (tpl += '<li><a href="#" data="' + i + '">' + i + '</a></li>');
  2658. }
  2659. } else {
  2660. tpl += '<li><a href="#" data="1">1</a></li>';
  2661. tpl += '<li class="dotted"><span>...</span></li>';
  2662. var frontPage,
  2663. backPage,
  2664. middle = (this.displayPage - 3) / 2;
  2665. if ( (this.displayPage - 3) % 2 == 0 ) {
  2666. frontPage = backPage = middle;
  2667. } else {
  2668. frontPage = Math.floor(middle);
  2669. backPage = Math.ceil(middle);
  2670. }
  2671. for (var i = this.currentPage - frontPage; i <= this.currentPage + backPage; i++) {
  2672. i == this.currentPage ? (tpl += '<li class="active"><a href="#" data="' + i + '">' + i + '</a></li>') : (tpl += '<li><a href="#" data="' + i + '">' + i + '</a></li>');
  2673. }
  2674. tpl += '<li class="dotted"><span>...</span></li>';
  2675. tpl += '<li><a href="#" data="' + this.pages + '">' + this.pages + '</a></li>';
  2676. }
  2677. }
  2678. tpl += '<li class="next' + (this.currentPage + 1 > this.pages ? ' disabled' : ' ') + '"><a href="#" data="' + (this.currentPage + 1) + '">下一页»</a></li>' + '</ul>';
  2679. this.showCtrl && (tpl += this._drawCtrl());
  2680. outer.html(tpl);
  2681. },
  2682. //值传递
  2683. _drawCtrl: function () {
  2684. var tpl = '<div>&nbsp;' + '<span>共' + this.pages + '页</span>&nbsp;' + '<span>' + '&nbsp;到&nbsp;' + '<input type="text" class="page-num"/><button class="page-confirm">确定</button>' + '&nbsp;页' + '</span>' + '</div>';
  2685. return tpl;
  2686. },
  2687. _ctrl: function () {
  2688. var self = this,
  2689. pag = self.hookNode.children('.sui-pagination');
  2690. function doPagination() {
  2691. var tmpNum = parseInt(pag.find('.page-num').val());
  2692. if ($.isNumeric(tmpNum) && tmpNum <= self.pages && tmpNum > 0) {
  2693. if (!self.remote) {
  2694. self.currentPage = tmpNum;
  2695. self._drawInner();
  2696. }
  2697. if ($.isFunction(self.onSelect)) {
  2698. self.onSelect.call($(this), tmpNum);
  2699. }
  2700. }
  2701. }
  2702. pag.on('click', '.page-confirm', function (e) {
  2703. doPagination.call(this)
  2704. })
  2705. pag.on('keypress', '.page-num', function (e) {
  2706. e.which == 13 && doPagination.call(this)
  2707. })
  2708. },
  2709. _select: function () {
  2710. var self = this;
  2711. self.hookNode.children('.sui-pagination').on('click', 'a', function (e) {
  2712. e.preventDefault();
  2713. var tmpNum = parseInt($(this).attr('data'));
  2714. if (!$(this).parent().hasClass('disabled') && !$(this).parent().hasClass('active')) {
  2715. if (!self.remote) {
  2716. self.currentPage = tmpNum;
  2717. self._drawInner();
  2718. }
  2719. if ($.isFunction(self.onSelect)) {
  2720. self.onSelect.call($(this), tmpNum);
  2721. }
  2722. }
  2723. })
  2724. },
  2725. init: function (opts, hookNode) {
  2726. this.hookNode = hookNode;
  2727. this._draw();
  2728. this._select();
  2729. this.showCtrl && this._ctrl();
  2730. return this;
  2731. },
  2732. updateItemsCount: function (itemsCount, pageToGo) {
  2733. $.isNumeric(itemsCount) && (this.pages = Math.ceil(itemsCount / this.pageSize));
  2734. //如果最后一页没有数据了,返回到剩余最大页数
  2735. this.currentPage = this.currentPage > this.pages ? this.pages : this.currentPage;
  2736. $.isNumeric(pageToGo) && (this.currentPage = pageToGo);
  2737. this._drawInner();
  2738. },
  2739. updatePages: function (pages, pageToGo) {
  2740. $.isNumeric(pages) && (this.pages = pages);
  2741. this.currentPage = this.currentPage > this.pages ? this.pages : this.currentPage;
  2742. $.isNumeric(pageToGo) && (this.currentPage = pageToGo);
  2743. this._drawInner();
  2744. },
  2745. goToPage: function (page) {
  2746. if ($.isNumeric(page) && page <= this.pages && page > 0) {
  2747. this.currentPage = page;
  2748. this._drawInner()
  2749. }
  2750. }
  2751. }
  2752. /* jshint ignore:end */
  2753. var old = $.fn.pagination;
  2754. $.fn.pagination = function (options) {
  2755. var opts = $.extend({}, $.fn.pagination.defaults, typeof options == 'object' && options);
  2756. if (typeof options == 'string') {
  2757. args = $.makeArray(arguments);
  2758. args.shift();
  2759. }
  2760. var $this = $(this),
  2761. pag = $this.data('sui-pagination');
  2762. if (!pag) $this.data('sui-pagination', (pag = new Pagination(opts).init(opts, $(this))))
  2763. else if (typeof options == 'string') {
  2764. pag[options].apply(pag, args)
  2765. }
  2766. return pag;
  2767. };
  2768. $.fn.pagination.Constructor = Pagination;
  2769. $.fn.pagination.noConflict = function () {
  2770. $.fn.pagination = old;
  2771. return this
  2772. }
  2773. $.fn.pagination.defaults = {
  2774. pageSize: 10,
  2775. displayPage: 5,
  2776. currentPage: 1,
  2777. itemsCount: 100,
  2778. styleClass: [],
  2779. pages: null,
  2780. showCtrl: false,
  2781. onSelect: null,
  2782. remote: false
  2783. }
  2784. })(window.jQuery)
  2785. },{}],10:[function(require,module,exports){
  2786. /* ===========================================================
  2787. * bootstrap-popover.js v2.3.2
  2788. * http://getbootstrap.com/2.3.2/javascript.html#popovers
  2789. * ===========================================================
  2790. * Copyright 2013 Twitter, Inc.
  2791. *
  2792. * Licensed under the Apache License, Version 2.0 (the "License");
  2793. * you may not use this file except in compliance with the License.
  2794. * You may obtain a copy of the License at
  2795. *
  2796. * http://www.apache.org/licenses/LICENSE-2.0
  2797. *
  2798. * Unless required by applicable law or agreed to in writing, software
  2799. * distributed under the License is distributed on an "AS IS" BASIS,
  2800. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2801. * See the License for the specific language governing permissions and
  2802. * limitations under the License.
  2803. * =========================================================== */
  2804. !function ($) {
  2805. "use strict";
  2806. /* POPOVER PUBLIC CLASS DEFINITION
  2807. * =============================== */
  2808. var Popover = function (element, options) {
  2809. this.init('popover', element, options)
  2810. }
  2811. /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
  2812. ========================================== */
  2813. Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
  2814. constructor: Popover
  2815. , setContent: function () {
  2816. var $tip = this.tip()
  2817. , title = this.getTitle()
  2818. , content = this.getContent()
  2819. $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
  2820. $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
  2821. $tip.removeClass('fade top bottom left right in')
  2822. }
  2823. , hasContent: function () {
  2824. return this.getTitle() || this.getContent()
  2825. }
  2826. , getContent: function () {
  2827. var content
  2828. , $e = this.$element
  2829. , o = this.options
  2830. content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
  2831. || $e.attr('data-content')
  2832. return content
  2833. }
  2834. , tip: function () {
  2835. if (!this.$tip) {
  2836. this.$tip = $(this.options.template)
  2837. }
  2838. return this.$tip
  2839. }
  2840. , destroy: function () {
  2841. this.hide().$element.off('.' + this.type).removeData(this.type)
  2842. }
  2843. })
  2844. /* POPOVER PLUGIN DEFINITION
  2845. * ======================= */
  2846. var old = $.fn.popover
  2847. $.fn.popover = function (option) {
  2848. return this.each(function () {
  2849. var $this = $(this)
  2850. , data = $this.data('popover')
  2851. , options = typeof option == 'object' && option
  2852. if (!data) $this.data('popover', (data = new Popover(this, options)))
  2853. if (typeof option == 'string') data[option]()
  2854. })
  2855. }
  2856. $.fn.popover.Constructor = Popover
  2857. $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
  2858. placement: 'right'
  2859. , trigger: 'click'
  2860. , content: ''
  2861. , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
  2862. })
  2863. /* POPOVER NO CONFLICT
  2864. * =================== */
  2865. $.fn.popover.noConflict = function () {
  2866. $.fn.popover = old
  2867. return this
  2868. }
  2869. }(window.jQuery);
  2870. },{}],11:[function(require,module,exports){
  2871. /* =============================================================
  2872. * bootstrap-scrollspy.js v2.3.2
  2873. * http://getbootstrap.com/2.3.2/javascript.html#scrollspy
  2874. * =============================================================
  2875. * Copyright 2013 Twitter, Inc.
  2876. *
  2877. * Licensed under the Apache License, Version 2.0 (the "License");
  2878. * you may not use this file except in compliance with the License.
  2879. * You may obtain a copy of the License at
  2880. *
  2881. * http://www.apache.org/licenses/LICENSE-2.0
  2882. *
  2883. * Unless required by applicable law or agreed to in writing, software
  2884. * distributed under the License is distributed on an "AS IS" BASIS,
  2885. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2886. * See the License for the specific language governing permissions and
  2887. * limitations under the License.
  2888. * ============================================================== */
  2889. !function ($) {
  2890. "use strict";
  2891. /* SCROLLSPY CLASS DEFINITION
  2892. * ========================== */
  2893. function ScrollSpy(element, options) {
  2894. var process = $.proxy(this.process, this)
  2895. , $element = $(element).is('body') ? $(window) : $(element)
  2896. , href
  2897. this.options = $.extend({}, $.fn.scrollspy.defaults, options)
  2898. this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
  2899. this.selector = (this.options.target
  2900. || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
  2901. || '') + ' .nav li > a'
  2902. this.$body = $('body')
  2903. this.refresh()
  2904. this.process()
  2905. }
  2906. ScrollSpy.prototype = {
  2907. constructor: ScrollSpy
  2908. , refresh: function () {
  2909. var self = this
  2910. , $targets
  2911. this.offsets = $([])
  2912. this.targets = $([])
  2913. $targets = this.$body
  2914. .find(this.selector)
  2915. .map(function () {
  2916. var $el = $(this)
  2917. , href = $el.data('target') || $el.attr('href')
  2918. , $href = /^#\w/.test(href) && $(href)
  2919. return ( $href
  2920. && $href.length
  2921. && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
  2922. })
  2923. .sort(function (a, b) { return a[0] - b[0] })
  2924. .each(function () {
  2925. self.offsets.push(this[0])
  2926. self.targets.push(this[1])
  2927. })
  2928. }
  2929. , process: function () {
  2930. var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
  2931. , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
  2932. , maxScroll = scrollHeight - this.$scrollElement.height()
  2933. , offsets = this.offsets
  2934. , targets = this.targets
  2935. , activeTarget = this.activeTarget
  2936. , i
  2937. if (scrollTop >= maxScroll) {
  2938. return activeTarget != (i = targets.last()[0])
  2939. && this.activate ( i )
  2940. }
  2941. for (i = offsets.length; i--;) {
  2942. activeTarget != targets[i]
  2943. && scrollTop >= offsets[i]
  2944. && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
  2945. && this.activate( targets[i] )
  2946. }
  2947. }
  2948. , activate: function (target) {
  2949. var active
  2950. , selector
  2951. this.activeTarget = target
  2952. $(this.selector)
  2953. .parent('.active')
  2954. .removeClass('active')
  2955. selector = this.selector
  2956. + '[data-target="' + target + '"],'
  2957. + this.selector + '[href="' + target + '"]'
  2958. active = $(selector)
  2959. .parent('li')
  2960. .addClass('active')
  2961. if (active.parent('.dropdown-menu').length) {
  2962. active = active.closest('li.dropdown').addClass('active')
  2963. }
  2964. active.trigger('activate')
  2965. }
  2966. }
  2967. /* SCROLLSPY PLUGIN DEFINITION
  2968. * =========================== */
  2969. var old = $.fn.scrollspy
  2970. $.fn.scrollspy = function (option) {
  2971. return this.each(function () {
  2972. var $this = $(this)
  2973. , data = $this.data('scrollspy')
  2974. , options = typeof option == 'object' && option
  2975. if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
  2976. if (typeof option == 'string') data[option]()
  2977. })
  2978. }
  2979. $.fn.scrollspy.Constructor = ScrollSpy
  2980. $.fn.scrollspy.defaults = {
  2981. offset: 10
  2982. }
  2983. /* SCROLLSPY NO CONFLICT
  2984. * ===================== */
  2985. $.fn.scrollspy.noConflict = function () {
  2986. $.fn.scrollspy = old
  2987. return this
  2988. }
  2989. /* SCROLLSPY DATA-API
  2990. * ================== */
  2991. $(window).on('load', function () {
  2992. $('[data-spy="scroll"]').each(function () {
  2993. var $spy = $(this)
  2994. $spy.scrollspy($spy.data())
  2995. })
  2996. })
  2997. }(window.jQuery);
  2998. },{}],12:[function(require,module,exports){
  2999. //全部打包
  3000. require("./sui")
  3001. require("./sui-extends")
  3002. },{"./sui":14,"./sui-extends":13}],13:[function(require,module,exports){
  3003. //拓展组件
  3004. },{}],14:[function(require,module,exports){
  3005. //核心组件
  3006. require('./transition')
  3007. require('./alert')
  3008. require('./button')
  3009. require('./carousel')
  3010. require('./collapse')
  3011. require('./dropdown')
  3012. require('./modal')
  3013. require('./tooltip')
  3014. require('./popover')
  3015. require('./scrollspy')
  3016. require('./tab')
  3017. require('./affix')
  3018. require('./pagination')
  3019. require('./validate')
  3020. require('./validate-rules')
  3021. require('./tree')
  3022. require('./datepicker')
  3023. },{"./affix":1,"./alert":2,"./button":3,"./carousel":4,"./collapse":5,"./datepicker":6,"./dropdown":7,"./modal":8,"./pagination":9,"./popover":10,"./scrollspy":11,"./tab":15,"./tooltip":16,"./transition":17,"./tree":18,"./validate":20,"./validate-rules":19}],15:[function(require,module,exports){
  3024. /* ========================================================
  3025. * bootstrap-tab.js v2.3.2
  3026. * http://getbootstrap.com/2.3.2/javascript.html#tabs
  3027. * ========================================================
  3028. * Copyright 2013 Twitter, Inc.
  3029. *
  3030. * Licensed under the Apache License, Version 2.0 (the "License");
  3031. * you may not use this file except in compliance with the License.
  3032. * You may obtain a copy of the License at
  3033. *
  3034. * http://www.apache.org/licenses/LICENSE-2.0
  3035. *
  3036. * Unless required by applicable law or agreed to in writing, software
  3037. * distributed under the License is distributed on an "AS IS" BASIS,
  3038. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3039. * See the License for the specific language governing permissions and
  3040. * limitations under the License.
  3041. * ======================================================== */
  3042. !function ($) {
  3043. "use strict";
  3044. /* TAB CLASS DEFINITION
  3045. * ==================== */
  3046. var Tab = function (element) {
  3047. this.element = $(element)
  3048. }
  3049. Tab.prototype = {
  3050. constructor: Tab
  3051. , show: function () {
  3052. var $this = this.element
  3053. , $ul = $this.closest('ul:not(.dropdown-menu)')
  3054. , selector = $this.attr('data-target')
  3055. , previous
  3056. , $target
  3057. , e
  3058. if (!selector) {
  3059. selector = $this.attr('href')
  3060. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  3061. }
  3062. if ( $this.parent('li').hasClass('active') ) return
  3063. previous = $ul.find('.active:last a')[0]
  3064. e = $.Event('show', {
  3065. relatedTarget: previous
  3066. })
  3067. $this.trigger(e)
  3068. if (e.isDefaultPrevented()) return
  3069. $target = $(selector)
  3070. this.activate($this.parent('li'), $ul)
  3071. this.activate($target, $target.parent(), function () {
  3072. $this.trigger({
  3073. type: 'shown'
  3074. , relatedTarget: previous
  3075. })
  3076. })
  3077. }
  3078. , activate: function ( element, container, callback) {
  3079. var $active = container.find('> .active')
  3080. , transition = callback
  3081. && $.support.transition
  3082. && $active.hasClass('fade')
  3083. function next() {
  3084. $active
  3085. .removeClass('active')
  3086. .find('> .dropdown-menu > .active')
  3087. .removeClass('active')
  3088. element.addClass('active')
  3089. if (transition) {
  3090. element[0].offsetWidth // reflow for transition
  3091. element.addClass('in')
  3092. } else {
  3093. element.removeClass('fade')
  3094. }
  3095. if ( element.parent('.dropdown-menu') ) {
  3096. element.closest('li.dropdown').addClass('active')
  3097. }
  3098. callback && callback()
  3099. }
  3100. transition ?
  3101. $active.one($.support.transition.end, next) :
  3102. next()
  3103. $active.removeClass('in')
  3104. }
  3105. }
  3106. /* TAB PLUGIN DEFINITION
  3107. * ===================== */
  3108. var old = $.fn.tab
  3109. $.fn.tab = function ( option ) {
  3110. return this.each(function () {
  3111. var $this = $(this)
  3112. , data = $this.data('tab')
  3113. if (!data) $this.data('tab', (data = new Tab(this)))
  3114. if (typeof option == 'string') data[option]()
  3115. })
  3116. }
  3117. $.fn.tab.Constructor = Tab
  3118. /* TAB NO CONFLICT
  3119. * =============== */
  3120. $.fn.tab.noConflict = function () {
  3121. $.fn.tab = old
  3122. return this
  3123. }
  3124. /* TAB DATA-API
  3125. * ============ */
  3126. $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
  3127. e.preventDefault()
  3128. $(this).tab('show')
  3129. })
  3130. }(window.jQuery);
  3131. },{}],16:[function(require,module,exports){
  3132. /* ===========================================================
  3133. * bootstrap-tooltip.js v2.3.2
  3134. * http://getbootstrap.com/2.3.2/javascript.html#tooltips
  3135. * Inspired by the original jQuery.tipsy by Jason Frame
  3136. * ===========================================================
  3137. * Copyright 2013 Twitter, Inc.
  3138. *
  3139. * Licensed under the Apache License, Version 2.0 (the "License");
  3140. * you may not use this file except in compliance with the License.
  3141. * You may obtain a copy of the License at
  3142. *
  3143. * http://www.apache.org/licenses/LICENSE-2.0
  3144. *
  3145. * Unless required by applicable law or agreed to in writing, software
  3146. * distributed under the License is distributed on an "AS IS" BASIS,
  3147. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3148. * See the License for the specific language governing permissions and
  3149. * limitations under the License.
  3150. * ========================================================== */
  3151. !function ($) {
  3152. "use strict";
  3153. /* TOOLTIP PUBLIC CLASS DEFINITION
  3154. * =============================== */
  3155. //element为触发元素,如标识文字链
  3156. var Tooltip = function (element, options) {
  3157. this.init('tooltip', element, options)
  3158. }
  3159. Tooltip.prototype = {
  3160. constructor: Tooltip
  3161. , init: function (type, element, options) {
  3162. var eventIn
  3163. , eventOut
  3164. , triggers
  3165. , trigger
  3166. , i
  3167. this.type = type
  3168. this.$element = $(element)
  3169. this.options = this.getOptions(options)
  3170. this.enabled = true
  3171. triggers = this.options.trigger.split(' ')
  3172. for (i = triggers.length; i--;) {
  3173. trigger = triggers[i]
  3174. if (trigger == 'click') {
  3175. this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
  3176. } else if (trigger != 'manual') {
  3177. eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
  3178. eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
  3179. this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
  3180. this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
  3181. }
  3182. }
  3183. //为confirm类型tooltip增加取消按钮设置默认逻辑
  3184. if (this.options.type == 'confirm') {
  3185. this.$element.parent().on('click', '[data-dismiss=tooltip]', function(e){
  3186. $(this).parents('.sui-tooltip').prev().trigger('click')
  3187. })
  3188. this.$element.parent().on('click', '[data-ok=tooltip]', $.proxy(this.options.okHide, this))
  3189. }
  3190. this.options.selector ?
  3191. (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
  3192. this.fixTitle()
  3193. }
  3194. , getOptions: function (options) {
  3195. options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
  3196. var foot = options.type == 'confirm' ? '<div class="tooltip-footer"><button class="sui-btn btn-primary" data-ok="tooltip">确定</button><button class="sui-btn btn-default" data-dismiss="tooltip">取消</button></div>' : ''
  3197. //根据tooltip的type类型构造tip模版
  3198. options.template = '<div class="sui-tooltip ' + options.type + ' break-line" style="overflow:visible"><div class="tooltip-arrow"><div class="tooltip-arrow cover"></div></div><div class="tooltip-inner"></div>' + foot + '</div>'
  3199. options.type == 'confirm' && (options.html = true)
  3200. if (options.delay && typeof options.delay == 'number') {
  3201. options.delay = {
  3202. show: options.delay
  3203. , hide: options.delay
  3204. }
  3205. }
  3206. return options
  3207. }
  3208. , enter: function (e) {
  3209. var defaults = $.fn[this.type].defaults
  3210. , options = {}
  3211. , self
  3212. this._options && $.each(this._options, function (key, value) {
  3213. if (defaults[key] != value) options[key] = value
  3214. }, this)
  3215. self = $(e.currentTarget)[this.type](options).data(this.type)
  3216. self.hoverState = 'in'
  3217. if (!self.options.delay || !self.options.delay.show) return self.show()
  3218. clearTimeout(this.timeout)
  3219. this.timeout = setTimeout(function() {
  3220. if (self.hoverState == 'in') self.show()
  3221. }, self.options.delay.show)
  3222. }
  3223. , leave: function (e) {
  3224. var self = $(e.currentTarget)[this.type](this._options).data(this.type)
  3225. if (this.timeout) clearTimeout(this.timeout)
  3226. if (!self.options.delay || !self.options.delay.hide) return self.hide()
  3227. this.timeout = setTimeout(function() {
  3228. //isHover 为0或undefined,undefined:没有移到tip上过
  3229. if (!self.isTipHover) {
  3230. self.hoverState = 'out'
  3231. }
  3232. if (self.hoverState == 'out') self.hide()
  3233. }, self.options.delay.hide)
  3234. }
  3235. , show: function () {
  3236. var $tip
  3237. , pos
  3238. , actualWidth
  3239. , actualHeight
  3240. , placement
  3241. , tp
  3242. , e = $.Event('show')
  3243. , opt = this.options
  3244. , widthLimit = opt.widthlimit
  3245. , self = this
  3246. if (this.hasContent() && this.enabled) {
  3247. this.$element.trigger(e)
  3248. if (e.isDefaultPrevented()) return
  3249. $tip = this.tip()
  3250. this.setContent()
  3251. if (opt.animation) {
  3252. $tip.addClass('fade')
  3253. }
  3254. placement = typeof opt.placement == 'function' ?
  3255. opt.placement.call(this, $tip[0], this.$element[0]) :
  3256. opt.placement
  3257. $tip
  3258. .detach()
  3259. .css({ top: 0, left: 0, display: 'block' })
  3260. opt.container ? $tip.appendTo(opt.container) : $tip.insertAfter(this.$element)
  3261. if (opt.trigger !== 'click') {
  3262. $tip.hover(function(){
  3263. self.isTipHover = 1;
  3264. }, function(){
  3265. self.isTipHover = 0;
  3266. self.hide()
  3267. })
  3268. }
  3269. //宽度限制逻辑
  3270. if (widthLimit !== true) {
  3271. var val
  3272. widthLimit === false && (val = 'none')
  3273. typeof opt.widthlimit == 'string' && (val = widthLimit)
  3274. $tip.css('max-width', val)
  3275. }
  3276. pos = this.getPosition()
  3277. actualWidth = $tip[0].offsetWidth
  3278. actualHeight = $tip[0].offsetHeight
  3279. //+ - 7修正,和css对应,勿单独修改
  3280. var d = opt.type == 'attention' ? 5 : 7
  3281. switch (placement) {
  3282. case 'bottom':
  3283. tp = {top: pos.top + pos.height + d, left: pos.left + pos.width / 2 - actualWidth / 2}
  3284. break
  3285. case 'top':
  3286. tp = {top: pos.top - actualHeight - d, left: pos.left + pos.width / 2 - actualWidth / 2}
  3287. break
  3288. case 'left':
  3289. tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - d}
  3290. break
  3291. case 'right':
  3292. tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + d}
  3293. break
  3294. }
  3295. this.applyPlacement(tp, placement)
  3296. this.$element.trigger('shown')
  3297. }
  3298. }
  3299. , applyPlacement: function(offset, placement){
  3300. var $tip = this.tip()
  3301. , width = $tip[0].offsetWidth
  3302. , height = $tip[0].offsetHeight
  3303. , actualWidth
  3304. , actualHeight
  3305. , delta
  3306. , replace
  3307. $tip
  3308. .offset(offset)
  3309. .addClass(placement)
  3310. .addClass('in')
  3311. actualWidth = $tip[0].offsetWidth
  3312. actualHeight = $tip[0].offsetHeight
  3313. if (placement == 'top' && actualHeight != height) {
  3314. offset.top = offset.top + height - actualHeight
  3315. replace = true
  3316. }
  3317. if (placement == 'bottom' || placement == 'top') {
  3318. delta = 0
  3319. if (offset.left < 0){
  3320. delta = offset.left * -2
  3321. offset.left = 0
  3322. $tip.offset(offset)
  3323. actualWidth = $tip[0].offsetWidth
  3324. actualHeight = $tip[0].offsetHeight
  3325. }
  3326. this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
  3327. } else {
  3328. this.replaceArrow(actualHeight - height, actualHeight, 'top')
  3329. }
  3330. if (replace) $tip.offset(offset)
  3331. }
  3332. , replaceArrow: function(delta, dimension, position){
  3333. this
  3334. .arrow()
  3335. .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
  3336. }
  3337. , setContent: function () {
  3338. var $tip = this.tip()
  3339. , title = this.getTitle()
  3340. $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
  3341. $tip.removeClass('fade in top bottom left right')
  3342. }
  3343. , hide: function () {
  3344. var $tip = this.tip()
  3345. , e = $.Event('hide')
  3346. this.$element.trigger(e)
  3347. if (e.isDefaultPrevented()) return
  3348. $tip.removeClass('in')
  3349. function removeWithAnimation() {
  3350. var timeout = setTimeout(function () {
  3351. $tip.off($.support.transition.end).detach()
  3352. }, 500)
  3353. $tip.one($.support.transition.end, function () {
  3354. clearTimeout(timeout)
  3355. $tip.detach()
  3356. })
  3357. }
  3358. $.support.transition && this.$tip.hasClass('fade') ?
  3359. removeWithAnimation() :
  3360. $tip.detach()
  3361. this.$element.trigger('hidden')
  3362. return this
  3363. }
  3364. , fixTitle: function () {
  3365. var $e = this.$element
  3366. if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
  3367. $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
  3368. }
  3369. }
  3370. , hasContent: function () {
  3371. return this.getTitle()
  3372. }
  3373. , getPosition: function () {
  3374. var el = this.$element[0]
  3375. return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
  3376. width: el.offsetWidth
  3377. , height: el.offsetHeight
  3378. }, this.$element.offset())
  3379. }
  3380. , getTitle: function () {
  3381. var title
  3382. , $e = this.$element
  3383. , o = this.options
  3384. title = $e.attr('data-original-title')
  3385. || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
  3386. return title
  3387. }
  3388. , tip: function () {
  3389. return this.$tip = this.$tip || $(this.options.template)
  3390. }
  3391. , arrow: function(){
  3392. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  3393. }
  3394. , validate: function () {
  3395. if (!this.$element[0].parentNode) {
  3396. this.hide()
  3397. this.$element = null
  3398. this.options = null
  3399. }
  3400. }
  3401. , enable: function () {
  3402. this.enabled = true
  3403. }
  3404. , disable: function () {
  3405. this.enabled = false
  3406. }
  3407. , toggleEnabled: function () {
  3408. this.enabled = !this.enabled
  3409. }
  3410. , toggle: function (e) {
  3411. var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
  3412. self.tip().hasClass('in') ? self.hide() : self.show()
  3413. }
  3414. , destroy: function () {
  3415. this.hide().$element.off('.' + this.type).removeData(this.type)
  3416. }
  3417. }
  3418. /* TOOLTIP PLUGIN DEFINITION
  3419. * ========================= */
  3420. var old = $.fn.tooltip
  3421. $.fn.tooltip = function ( option ) {
  3422. return this.each(function () {
  3423. var $this = $(this)
  3424. , data = $this.data('tooltip')
  3425. , options = typeof option == 'object' && option
  3426. if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
  3427. if (typeof option == 'string') data[option]()
  3428. })
  3429. }
  3430. $.fn.tooltip.Constructor = Tooltip
  3431. $.fn.tooltip.defaults = {
  3432. animation: true
  3433. , type: 'normal' //tip 类型 {string} 'normal'|'attention'|'confirm' ,区别见demo
  3434. , placement: 'top'
  3435. , selector: false //通常要配合调用方法使用,如果tooltip元素很多,用此途径进行事件委托减少事件监听数量: $('body').tooltip({selector: '.tips'})
  3436. , trigger: 'hover focus' //触发方式,多选:click hover focus,如果希望手动触发,则传入'manual'
  3437. , title: 'it is default title' //默认tooltip的内容,如果给html元素添加了title属性则使用该html属性替代此属性
  3438. , delay: {show:0, hide: 200} //如果只传number,则show、hide时都会使用这个延时,若想差异化则传入形如{show:400, hide: 600} 的对象 注:delay参数对manual触发方式的tooltip无效
  3439. , html: true //决定是html()还是text()
  3440. , container: false //将tooltip与输入框组一同使用时,为了避免不必要的影响,需要设置container.他用来将tooltip的dom节点插入到container指定的元素内的最后,可理解为 container.append(tooltipDom)。
  3441. , widthlimit: true // {Boolean|string} tooltip元素最大宽度限制,false不限宽,true限宽300px,也可传入"500px",人工限制宽度
  3442. }
  3443. /* TOOLTIP NO CONFLICT
  3444. * =================== */
  3445. $.fn.tooltip.noConflict = function () {
  3446. $.fn.tooltip = old
  3447. return this
  3448. }
  3449. //document ready init
  3450. $(function(){
  3451. $('[data-toggle="tooltip"]').tooltip()
  3452. //点击外部可消失tooltip
  3453. $(document).on('mousedown', function(e){
  3454. var tgt = $(e.target)
  3455. , tip = $('.sui-tooltip')
  3456. , switchTgt = tip.prev()
  3457. , tipContainer = tgt.parents('.sui-tooltip')
  3458. if (tip.length && !tipContainer.length && tgt[0] != switchTgt[0]) {
  3459. switchTgt.trigger('click.tooltip')
  3460. }
  3461. })
  3462. })
  3463. }(window.jQuery);
  3464. },{}],17:[function(require,module,exports){
  3465. /* ===================================================
  3466. * bootstrap-transition.js v2.3.2
  3467. * http://getbootstrap.com/2.3.2/javascript.html#transitions
  3468. * ===================================================
  3469. * Copyright 2013 Twitter, Inc.
  3470. *
  3471. * Licensed under the Apache License, Version 2.0 (the "License");
  3472. * you may not use this file except in compliance with the License.
  3473. * You may obtain a copy of the License at
  3474. *
  3475. * http://www.apache.org/licenses/LICENSE-2.0
  3476. *
  3477. * Unless required by applicable law or agreed to in writing, software
  3478. * distributed under the License is distributed on an "AS IS" BASIS,
  3479. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3480. * See the License for the specific language governing permissions and
  3481. * limitations under the License.
  3482. * ========================================================== */
  3483. !function ($) {
  3484. "use strict";
  3485. /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
  3486. * ======================================================= */
  3487. $(function () {
  3488. $.support.transition = (function () {
  3489. var transitionEnd = (function () {
  3490. var el = document.createElement('bootstrap')
  3491. , transEndEventNames = {
  3492. 'WebkitTransition' : 'webkitTransitionEnd'
  3493. , 'MozTransition' : 'transitionend'
  3494. , 'OTransition' : 'oTransitionEnd otransitionend'
  3495. , 'transition' : 'transitionend'
  3496. }
  3497. , name
  3498. for (name in transEndEventNames){
  3499. if (el.style[name] !== undefined) {
  3500. return transEndEventNames[name]
  3501. }
  3502. }
  3503. }())
  3504. return transitionEnd && {
  3505. end: transitionEnd
  3506. }
  3507. })()
  3508. })
  3509. }(window.jQuery);
  3510. },{}],18:[function(require,module,exports){
  3511. /**
  3512. * Created by huazhi.chz on 14-4-27.
  3513. * tree 2.0.0
  3514. * 由原来的一次性读取数据改为事件性获取数据
  3515. */
  3516. !(function($) {"use strict";
  3517. var Tree = function(element, options) {
  3518. this.$element = $(element);
  3519. this.options = options;
  3520. this.redis = new Redis();
  3521. };
  3522. // 数据缓存处理
  3523. var Redis = function() {
  3524. this.data = {};
  3525. }
  3526. Redis.prototype = {
  3527. constructor : Redis,
  3528. query : function(key) {
  3529. return this.data[key];
  3530. },
  3531. insert : function(key, value) {
  3532. this.data[key] = value;
  3533. },
  3534. clear : function() {
  3535. this.data = {};
  3536. }
  3537. }
  3538. // private methods
  3539. var methods = {
  3540. init : function() {
  3541. this.destory();
  3542. methods.bindChange.call(this);
  3543. methods.bindUpdate.call(this);
  3544. this.$element.trigger('tree:update'); // 触发第一次更新
  3545. },
  3546. getData : function(id, index) {
  3547. var that = this, data = that.redis.query(id); // 先获取缓存数据
  3548. if (!that.options.src) return;
  3549. // 先取缓存数据
  3550. if (data) {
  3551. methods.createDom.apply(that, [data, index])
  3552. } else { // 如果没有就重新获取
  3553. $.ajax(that.options.src, {
  3554. data : that.options.key + '=' + id,
  3555. cache : true,
  3556. dataType : that.options.jsonp ? 'jsonp' : 'json'
  3557. }).success(function(json) {
  3558. if (json.code == 200 && json.data && json.data.length) {
  3559. data = json.data;
  3560. that.redis.insert(id, data); // 将值存放缓存中
  3561. methods.createDom.apply(that, [data, index]);
  3562. }
  3563. })
  3564. }
  3565. },
  3566. createDom : function(list, index) {
  3567. var dom = ['<select>'],
  3568. placeholder = this.options.placeholder,
  3569. val = this.options.val[index];
  3570. placeholder && dom.push('<option value="">' + placeholder + '</option>');
  3571. $.each(list, function(i, n) {
  3572. dom.push('<option data-isleaf="' + n.isleaf + '" value="' + n.id + '" ' + (n.id == val ? 'selected' : '') + '>' + n.value + '</option>')
  3573. });
  3574. dom.push('</select>');
  3575. //return dom.join('');
  3576. dom = $(dom.join('')).appendTo(this.$element).trigger('change');
  3577. },
  3578. bindChange : function() {
  3579. var that = this;
  3580. this.$element.on('change.sui.tree', 'select', function(e) {
  3581. var $this = $(this), v = $this.val();
  3582. $this.nextAll().remove();
  3583. methods.saveValue.call(that);
  3584. if (!v) return; // 选择了placeholder
  3585. if (!$this.find('option:selected').data('isleaf')) methods.getData.apply(that, [v, $this.index() + 1]);
  3586. else that.options.val = []; // 清空初始化的时候设置的值
  3587. })
  3588. },
  3589. bindUpdate : function() {
  3590. var that = this;
  3591. this.$element.on('tree:update', function(e) {
  3592. var $this = $(this);
  3593. $this.empty();
  3594. methods.getData.apply(that, [0, 0]); // 每次重新获取数据的id都为0
  3595. })
  3596. },
  3597. saveValue : function() {
  3598. var _val = [], _opt = [];
  3599. this.$element.find('select').each(function() {
  3600. _val.push(this.value);
  3601. _opt.push($(this).find('option:selected').text());
  3602. });
  3603. this.datas = {option : _opt, value : _val};
  3604. }
  3605. };
  3606. Tree.prototype = {
  3607. constructor : Tree,
  3608. getValue : $.noop, // how ?
  3609. setValue : function(ary) {
  3610. this.options.val = ary;
  3611. this.$element.trigger('tree:update');
  3612. },
  3613. destory : function() {
  3614. this.$element.off('change.sui.tree').empty();
  3615. }
  3616. };
  3617. var old = $.fn.tree;
  3618. $.fn.extend({
  3619. tree : function() {
  3620. var args = Array.prototype.slice.call(arguments),
  3621. arg0 = args.shift();
  3622. return this.each(function() {
  3623. var $this = $(this),
  3624. data = $this.data('tree'),
  3625. options = $.extend({}, $.fn.tree.defaults, $this.data(), typeof arg0 === 'object' && arg0);
  3626. if (!data) $this.data('tree', (data = new Tree(this, options))); // 在每个元素上只保存一个实例
  3627. if (typeof arg0 === 'string' && typeof data[arg0] === 'function') data[arg0].apply(data, args);
  3628. else methods.init.call(data);
  3629. });
  3630. }
  3631. });
  3632. $.fn.tree.Constructor = Tree;
  3633. $.fn.tree.defaults = {
  3634. src : '', // 数据源,json或jsonp
  3635. treeType : 'select', // TODO tree的类型,select或list
  3636. placeholder : '请选择',
  3637. val : [], // update时取的值
  3638. key : 'id' // 默认的参数名
  3639. };
  3640. // NO CONFLICT
  3641. $.fn.tree.noConflict = function () {
  3642. $.fn.tree = old;
  3643. return this;
  3644. };
  3645. // auto handle
  3646. $(function() {
  3647. $('[data-toggle="tree"]').tree();
  3648. });
  3649. })(jQuery);
  3650. },{}],19:[function(require,module,exports){
  3651. // add rules
  3652. !function($) {
  3653. Validate = $.validate;
  3654. trim = function(v) {
  3655. if (!v) return v;
  3656. return v.replace(/^\s+/g, '').replace(/\s+$/g, '')
  3657. };
  3658. var required = function(value, element, param) {
  3659. var $input = $(element)
  3660. return !!trim(value);
  3661. };
  3662. var requiredMsg = function ($input, param) {
  3663. var getWord = function($input) {
  3664. var tagName = $input[0].tagName.toUpperCase();
  3665. var type = $input[0].type.toUpperCase();
  3666. if ( type == 'CHECKBOX' || type == 'RADIO' || tagName == 'SELECT') {
  3667. return '选择'
  3668. }
  3669. return '填写'
  3670. }
  3671. return "请" + getWord($input)
  3672. }
  3673. Validate.setRule("required", required, requiredMsg);
  3674. var prefill = function(value, element, param) {
  3675. var $input = $(element)
  3676. if (param && typeof param === typeof 'a') {
  3677. var $form = $input.parents("form")
  3678. var $required = $form.find("[name='"+param+"']")
  3679. return !!$required.val()
  3680. }
  3681. return true
  3682. }
  3683. Validate.setRule("prefill", prefill, function($input, param) {
  3684. var getWord = function($input) {
  3685. var tagName = $input[0].tagName.toUpperCase();
  3686. var type = $input[0].type.toUpperCase();
  3687. if ( type == 'CHECKBOX' || type == 'RADIO' || tagName == 'SELECT') {
  3688. return '选择'
  3689. }
  3690. return '填写'
  3691. }
  3692. if (param && typeof param === typeof 'a') {
  3693. var $form = $input.parents("form")
  3694. var $required = $form.find("[name='"+param+"']")
  3695. if (!$required.val()) {
  3696. return "请先" + getWord($required) + ($required.attr("title") || $required.attr("name"))
  3697. }
  3698. }
  3699. return '错误'
  3700. });
  3701. var match = function(value, element, param) {
  3702. value = trim(value);
  3703. return value == $(element).parents('form').find("[name='"+param+"']").val()
  3704. };
  3705. Validate.setRule("match", match, '必须与$0相同');
  3706. var number = function(value, element, param) {
  3707. value = trim(value);
  3708. return (/^\d+(.\d*)?$/).test(value)
  3709. };
  3710. Validate.setRule("number", number, '请输入数字');
  3711. var digits = function(value, element, param) {
  3712. value = trim(value);
  3713. return (/^\d+$/).test(value)
  3714. };
  3715. Validate.setRule("digits", digits, '请输入整数');
  3716. var mobile = function(value, element, param) {
  3717. return (/^0?1[3|4|5|7|8][0-9]\d{8,9}$/).test(trim(value));
  3718. };
  3719. Validate.setRule("mobile", mobile, '请填写正确的手机号码');
  3720. var tel = function(value, element, param) {
  3721. return (/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,11})+$/).test(trim(value));
  3722. };
  3723. Validate.setRule("tel", tel, '请填写正确的电话号码');
  3724. var email = function(value, element, param) {
  3725. return (/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(trim(value)); //"
  3726. };
  3727. Validate.setRule("email", email, '请填写正确的email地址');
  3728. var zip = function(value, element, param) {
  3729. return (/^[1-9][0-9]{5}$/).test(trim(value));
  3730. };
  3731. Validate.setRule("zip", zip, '请填写正确的邮编');
  3732. var date = function(value, element, param) {
  3733. return (/^[1|2]\d{3}-[0-2][0-9]-[0-3][0-9]$/).test(trim(value));
  3734. };
  3735. Validate.setRule("date", date, '请填写正确的日期');
  3736. var url = function(value, element, param) {
  3737. var urlPattern;
  3738. value = trim(value);
  3739. urlPattern = /(http|ftp|https):\/\/([\w-]+\.)?[\w-]+\.(com|net|cn|org|me|io|info)/;
  3740. if (!/^http/.test(value)) {
  3741. value = 'http://' + value;
  3742. }
  3743. return urlPattern.test(value);
  3744. };
  3745. Validate.setRule("url", url, '请填写正确的网址');
  3746. var minlength = function(value, element, param) {
  3747. return trim(value).length >= param;
  3748. };
  3749. Validate.setRule("minlength", minlength, '长度不能少于$0');
  3750. var maxlength = function(value, element, param) {
  3751. return trim(value).length <= param;
  3752. };
  3753. Validate.setRule("maxlength", maxlength, '长度不能超过$0');
  3754. }(window.jQuery)
  3755. },{}],20:[function(require,module,exports){
  3756. /*
  3757. * validate 核心函数,只提供框架,不提供校验规则
  3758. */
  3759. !function($) {
  3760. 'use strict';
  3761. var Validate = function(form, options) {
  3762. var self = this;
  3763. this.options = $.extend($.fn.validate.defaults, options)
  3764. this.$form = $(form).attr("novalidate", 'novalidate');
  3765. this.$form.submit(function() {
  3766. return onsubmit.call(self);
  3767. });
  3768. this.$form.find('input, select, textarea').each(function() {
  3769. var $this = $(this);
  3770. if ($this.attr("disabled")) return;
  3771. $this.on('blur keyup change update', function(e) {
  3772. var $target;
  3773. $target = $(e.target);
  3774. update.call(self, $target);
  3775. return true;
  3776. });
  3777. });
  3778. this.errors = {};
  3779. };
  3780. Validate.rules = {};
  3781. Validate.setRule = function(name, method, msg) {
  3782. var oldRule = Validate.rules[name];
  3783. if (oldRule && !method) {
  3784. method = oldRule.method
  3785. }
  3786. Validate.rules[name] = {
  3787. method: method,
  3788. msg: msg
  3789. };
  3790. };
  3791. Validate.setMsg = function(name, msg) {
  3792. Validate.setRule(name, undefined, msg)
  3793. }
  3794. var onsubmit = function() {
  3795. var hasError, self;
  3796. self = this;
  3797. hasError = false;
  3798. this.$form.find("input, select, textarea").each(function() {
  3799. var $input, error;
  3800. $input = $(this);
  3801. error = update.call(self, this);
  3802. if (error && !hasError) {
  3803. $input.focus();
  3804. }
  3805. if (error) {
  3806. return hasError = true;
  3807. }
  3808. });
  3809. return !hasError;
  3810. };
  3811. var update = function(input) {
  3812. var $input = $(input);
  3813. var rules = {};
  3814. var dataRules = ($input.data("rules") || "").split('|');
  3815. for (var i = 0; i < dataRules.length; i++) {
  3816. if (!dataRules[i]) continue;
  3817. var tokens = dataRules[i].split('=');
  3818. tokens[1] = tokens[1] || undefined;
  3819. rules[tokens[0]] = tokens[1];
  3820. }
  3821. var configRules = (this.options.rules && this.options.rules[$input.attr("name")]) || {};
  3822. rules = $.extend(rules, configRules)
  3823. var error = false;
  3824. var msg = null;
  3825. for (var name in rules) {
  3826. var value = rules[name];
  3827. var currentRule = Validate.rules[name];
  3828. if (!currentRule) { //未定义的rule
  3829. throw new Error("未定义的校验规则:" + name);
  3830. }
  3831. var inputVal = val($input);
  3832. if ((!inputVal) && name !== 'required') { //特殊处理,如果当前输入框没有值,并且当前不是required,则不报错
  3833. error = false;
  3834. hideError.call(this, $input);
  3835. continue
  3836. }
  3837. var result = true
  3838. // 如果规则值是一个函数,则直接用此函数的返回值
  3839. if ($.isFunction(value)) {
  3840. result = value.call(this, $input)
  3841. } else {
  3842. result = currentRule.method.call(this, inputVal, $input, value)
  3843. }
  3844. if (result) {
  3845. error = false;
  3846. hideError.call(this, $input, name);
  3847. } else {
  3848. error = true;
  3849. msg = currentRule.msg;
  3850. if ($.isFunction(msg)) msg = msg($input, value)
  3851. showError.call(this, $input, name, msg.replace('$0', value));
  3852. break;
  3853. }
  3854. }
  3855. return error;
  3856. };
  3857. var showError = function($input, errorName, errorMsg) {
  3858. var inputName = $input.attr("name")
  3859. var $errors = this.errors[inputName] || (this.errors[inputName] = {});
  3860. var $currentError = $errors[errorName]
  3861. if (!$currentError) {
  3862. $currentError = ($errors[errorName] = $(this.options.errorTpl.replace("$errorMsg", errorMsg)));
  3863. this.options.placeError.call(this, $input, $currentError);
  3864. }
  3865. for (var k in $errors) {
  3866. if (k !== errorName) $errors[k].hide()
  3867. }
  3868. this.options.highlight.call(this, $input, $currentError, this.options.inputErrorClass)
  3869. $input.trigger("highlight");
  3870. };
  3871. var hideError = function($input, errorName) {
  3872. var $errors = this.errors[$input.attr('name')];
  3873. if (!$errors) return;
  3874. var $error = $errors[errorName];
  3875. if (!$error) return;
  3876. this.options.unhighlight.call(this, $input, $error, this.options.inputErrorClass)
  3877. $input.trigger("unhighlight");
  3878. };
  3879. //根据不同的input类型来取值
  3880. var val = function(input) {
  3881. var $input = $(input);
  3882. if (!$input[0]) return undefined;
  3883. var tagName = $input[0].tagName.toUpperCase();
  3884. var type = ($input.attr("type") || 'text').toUpperCase()
  3885. var name = $input.attr("name")
  3886. var $form = $input.parents("form")
  3887. switch(tagName) {
  3888. case 'INPUT':
  3889. switch(type) {
  3890. case 'CHECKBOX':
  3891. case 'RADIO':
  3892. return $form.find("[name='"+name+"']:checked").val()
  3893. default:
  3894. return $input.val()
  3895. }
  3896. break;
  3897. case 'TEXTAREA':
  3898. return $input.html()
  3899. break;
  3900. default:
  3901. return $input.val()
  3902. }
  3903. }
  3904. var old = $.fn.validate;
  3905. $.fn.extend({
  3906. validate: function (options) {
  3907. return this.each(function() {
  3908. var $this = $(this),
  3909. data = $this.data("validate")
  3910. if (!data) $this.data('validate', (data = new Validate(this, options)))
  3911. if (typeof option == 'string') data[option]()
  3912. })
  3913. }
  3914. })
  3915. $.fn.validate.Constructor = Validate
  3916. $.fn.validate.defaults = {
  3917. errorTpl: '<div class="sui-msg msg-error">\n <div class="msg-con">\n <span>$errorMsg</span>\n <s class="msg-icon"></s>\n </div>\n</div>',
  3918. inputErrorClass: 'input-error',
  3919. placeError: function($input, $error) {
  3920. $input = $($input);
  3921. var $wrap = $input.parents(".controls-wrap");
  3922. if (!$wrap[0]) {
  3923. $wrap = $input.parents(".controls");
  3924. }
  3925. $error.appendTo($wrap);
  3926. },
  3927. highlight: function($input, $error, inputErrorClass) {
  3928. $input.addClass(inputErrorClass)
  3929. $error.show()
  3930. },
  3931. unhighlight: function($input, $error, inputErrorClass) {
  3932. $input.removeClass(inputErrorClass)
  3933. $error.hide()
  3934. },
  3935. rules: undefined
  3936. };
  3937. $.fn.validate.noConflict = function () {
  3938. $.fn.validate = old
  3939. return this
  3940. }
  3941. $.validate = Validate;
  3942. //自动加载
  3943. $(function() {
  3944. $(".sui-validate").validate()
  3945. })
  3946. }(window.jQuery);
  3947. },{}]},{},[12])