game2014091603.js 128 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651
  1. function getRequest() {
  2. var t = location.hash || location.search,
  3. e = location.hash ? "#" : "?",
  4. n = new Object;
  5. if (-1 != t.indexOf(e))
  6. for (var i = t.substr(1), s = i.split("&"), o = 0; o < s.length; o++) n[s[o].split("=")[0]] = unescape(s[o].split("=")[1]);
  7. return n
  8. }
  9. function qzoneShare() {
  10. if (Config.isDebug) return void alert("debug-本地 无法测试");
  11. try {
  12. QZAppExternal.qzoneGameBar({
  13. type: "share"
  14. })
  15. } catch (t) { }
  16. }
  17. function isWanBa() {
  18. return 1;
  19. //return 1 == fromType
  20. }
  21. function canQQShare() {
  22. return fromType > 10
  23. }
  24. function isInWeiXin() {
  25. return true;
  26. }
  27. function isInQQ() {
  28. return !isInWeiXin() && void 0 != _get.f
  29. }
  30. function shareAPI(t) {
  31. try {
  32. var e = ShareManager.getInstance().qqShareInfo;
  33. mqq.ui.shareMessage({
  34. title: "" + e.title,
  35. desc: "" + e.desc,
  36. share_type: t,
  37. share_url: "" + e.share_url,
  38. image_url: "" + e.image_url
  39. },
  40. function () { })
  41. } catch (n) { }
  42. }
  43. var lib = function () {
  44. function t(t) {
  45. return function () {
  46. return Function.call.apply(t, arguments)
  47. }
  48. }
  49. function e(e, n, i) {
  50. return e ? t(i || e) : n
  51. }
  52. function n(t) {
  53. var e = t && t.ownerDocument || document,
  54. n = e.compatMode;
  55. return n && "CSS1Compat" !== n ? e.body : e.documentElement
  56. }
  57. var i = {},
  58. s = Object.prototype.toString,
  59. o = Object.prototype.hasOwnProperty,
  60. r = i.typeOf = function (t) {
  61. var e = s.call(t).slice(8, -1).toLowerCase();
  62. return t && "object" == typeof t && "nodeType" in t ? "dom" : null == t ? null : e
  63. },
  64. a = i.each = e(Array.prototype.forEach,
  65. function (t, e, n) {
  66. for (var i = 0, s = t.length >>> 0; s > i; i++) i in t && e.call(n, t[i], i, t)
  67. });
  68. a(["String", "Array", "Function", "Date", "Object"],
  69. function (t) {
  70. var e = t.toLowerCase();
  71. i["function" === e ? "fn" : e] = {},
  72. i["is" + t] = function (e) {
  73. return null != e && s.call(e).slice(8, -1) === t
  74. }
  75. }),
  76. i.array.each = a; {
  77. var l = i.map = i.array.map = e(Array.prototype.map,
  78. function (t, e, n) {
  79. for (var i = 0, s = t.length; s > i; i++) i in t && (t[i] = e.call(n, t[i], i, t));
  80. return t
  81. }),
  82. c = i.indexOf = i.array.indexOf = e(Array.prototype.indexOf,
  83. function (t, e, n) {
  84. for (var i = this.length >>> 0, s = 0 > n ? Math.max(0, i + n) : n || 0; i > s; s++)
  85. if (t[s] === e) return s;
  86. return -1
  87. }),
  88. h = i.slice = i.array.slice = t(Array.prototype.slice);
  89. i.erase = i.array.erase = function (t, e) {
  90. for (var n = t.length; n--;) t[n] === e && t.splice(n, 1)
  91. }
  92. }
  93. i.toArray = i.array.toArray = function (t) {
  94. if (null == t) return [];
  95. if (i.isArray(t)) return t;
  96. var e = t.length;
  97. if ("number" == typeof e && "string" !== r(t)) {
  98. for (var n = []; e--;) n[e] = t[e];
  99. return n
  100. }
  101. return [t]
  102. };
  103. var d = {
  104. valueOf: 1
  105. }.propertyIsEnumerable("valueOf") ? null : ["hasOwnProperty", "valueOf", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "constructor"],
  106. u = i.forIn = i.object.each = function (t, e) {
  107. for (var n in t) o.call(t, n) && e(t[n], n);
  108. if (d)
  109. for (var n, i = d.length - 1; n = d[i--];) o.call(t, n) && e(t[n], n)
  110. },
  111. p = i.extend = i.object.extend = function (t, e) {
  112. return u(e,
  113. function (e, n) {
  114. i.isObject(t[n]) ? p(t[n], e) : t[n] = e
  115. }),
  116. t
  117. },
  118. f = i.clone = i.object.clone = function (t) {
  119. if (!t || "object" != typeof t) return t;
  120. var e = t;
  121. return i.isArray(t) ? e = l(h(t), f) : i.isObject(t) && "isPrototypeOf" in t && (e = {},
  122. u(t,
  123. function (t, n) {
  124. e[n] = f(t)
  125. })),
  126. e
  127. },
  128. g = function (t, e) {
  129. var n = [];
  130. return u(t,
  131. function (t, i) {
  132. e && (i = e + "[" + i + "]");
  133. var s;
  134. switch (r(t)) {
  135. case "object":
  136. s = g(t, i);
  137. break;
  138. case "array":
  139. for (var o = {},
  140. a = t.length; a--;) o[a] = t[a];
  141. s = g(o, i);
  142. break;
  143. default:
  144. s = i + "=" + encodeURIComponent(t)
  145. }
  146. null != t && n.push(s)
  147. }),
  148. n.join("&")
  149. };
  150. i.toQueryString = i.object.toQueryString = g,
  151. i.trim = i.string.trim = function () {
  152. var t = /^[\s\xa0\u3000]+|[\u3000\xa0\s]+$/g;
  153. return function (e, n) {
  154. return e && String(e).replace(n || t, "") || ""
  155. }
  156. }(),
  157. i.camelCase = i.string.camelCase = function (t) {
  158. return String(t).replace(/-\D/g,
  159. function (t) {
  160. return t.charAt(1).toUpperCase()
  161. })
  162. },
  163. i.capitalize = i.string.capitalize = function (t) {
  164. return String(t).replace(/\b[a-z]/g,
  165. function (t) {
  166. return t.toUpperCase()
  167. })
  168. },
  169. i.contains = i.string.contains = function (t, e, n) {
  170. return n = n || " ",
  171. t = n + t + n,
  172. e = n + i.trim(e) + n,
  173. t.indexOf(e) > -1
  174. },
  175. i.pad = i.string.pad = function (t, e) {
  176. var n = String(Math.abs(0 | t));
  177. return (0 > t ? "-" : "") + (n.length >= e ? n : ((1 << e - n.length).toString(2) + n).slice(-e))
  178. },
  179. i.delay = i.fn.delay = function (t, e, n, i) {
  180. return setTimeout(function () {
  181. t.apply(n, i || [])
  182. },
  183. e)
  184. },
  185. i.periodical = i.fn.periodical = function (t, e, n, i) {
  186. return setInterval(function () {
  187. t.apply(n, i || [])
  188. },
  189. e)
  190. },
  191. i.bind = i.fn.bind = e(Function.bind,
  192. function (t, e) {
  193. var n = arguments.length > 2 ? h(arguments, 2) : null,
  194. i = function () { },
  195. s = function () {
  196. var o = e,
  197. r = arguments.length;
  198. this instanceof s && (i.prototype = t.prototype, o = new i);
  199. var a = n || r ? t.apply(o, n && r ? n.concat(h(arguments)) : n || arguments) : t.call(o);
  200. return o === e ? a : o
  201. };
  202. return s
  203. }),
  204. i.binds = i.fn.binds = function (t, e) {
  205. if ("string" == typeof e && (e = ~e.indexOf(",") ? e.split(/\s*,\s*/) : h(arguments, 1)), e && e.length)
  206. for (var n, s; n = e.pop() ;) s = n && t[n],
  207. s && (t[n] = i.bind(s, t))
  208. };
  209. var m = i.curry = i.fn.curry = function (t) {
  210. var e = h(arguments, 1);
  211. return function () {
  212. return t.apply(this, e.concat(h(arguments)))
  213. }
  214. };
  215. !
  216. function () {
  217. function t(t, n) {
  218. var s = function () { };
  219. s.prototype = t.prototype;
  220. var o = i.newClass(new s);
  221. return o.prototype.parent = m(e, t),
  222. o.implement(n),
  223. o
  224. }
  225. function e(t, e) {
  226. var n = t.prototype[e];
  227. if (n) return n.apply(this, h(arguments, 2));
  228. throw new Error("parent Class has no method named " + e)
  229. }
  230. function n(t, e) {
  231. return i.isFunction(e) && (e = e.prototype),
  232. u(e,
  233. function (e, n) {
  234. t.prototype[n] = i.isObject(t.prototype[n]) && i.isObject(e) ? i.extend(i.clone(t.prototype[n]), e) : e
  235. }),
  236. t
  237. }
  238. i.newClass = function (e, s) {
  239. i.isObject(e) && (s = e);
  240. var o = function () {
  241. var t = this.initialize ? this.initialize.apply(this, arguments) : this;
  242. return i.isFunction(e) && (t = e.apply(this, arguments)),
  243. t
  244. };
  245. return o.prototype = s || {},
  246. o.prototype.constructor = o,
  247. o.extend = m(t, o),
  248. o.implement = m(n, o),
  249. o
  250. }
  251. }(),
  252. i.observable = {
  253. addEvent: function (t, e) {
  254. i.isFunction(t) && (e = t, t = "*"),
  255. this._listeners = this._listeners || {};
  256. var n = this._listeners[t] || [];
  257. return c(n, e) < 0 && (e.$type = t, n.push(e)),
  258. this._listeners[t] = n,
  259. this
  260. },
  261. removeEvent: function (t, e) {
  262. i.isFunction(t) && (e = t, t = "*"),
  263. this._listeners = this._listeners || {};
  264. var n = this._listeners[t];
  265. if (n)
  266. if (e) {
  267. var s = c(n, e); ~
  268. s && delete n[s]
  269. } else n.length = 0,
  270. delete this._listeners[t];
  271. return this
  272. },
  273. once: function (t, e) {
  274. i.isFunction(t) && (e = t, t = "*");
  275. var n = this,
  276. s = function () {
  277. e.apply(n, arguments),
  278. n.removeEvent(t, s)
  279. };
  280. this.addEvent.call(n, t, s)
  281. },
  282. fireEvent: function (t, e) {
  283. this._listeners = this._listeners || {};
  284. var n = this._listeners[t];
  285. return n && a(n,
  286. function (n) {
  287. e = e || {},
  288. e.type = t,
  289. n.call(this, e)
  290. },
  291. this),
  292. "*" !== t && this.fireEvent("*", e),
  293. this
  294. }
  295. },
  296. i.configurable = {
  297. setOptions: function (t) {
  298. if (!t) return f(this.options);
  299. var e = this.options = f(this.options),
  300. n = /^on[A-Z]/,
  301. s = this;
  302. this.srcOptions = t;
  303. var a;
  304. for (var l in t)
  305. if (o.call(t, l))
  306. if (a = t[l], n.test(l) && i.isFunction(a)) {
  307. var c = l.charAt(2).toLowerCase() + l.slice(3);
  308. s.addEvent(c, a),
  309. delete t[l]
  310. } else e[l] = l in e && "object" === r(a) ? p(e[l] || {},
  311. a) : a;
  312. return e
  313. }
  314. };
  315. var v = {
  316. list: [],
  317. custom: {}
  318. };
  319. if (i.event = {},
  320. i.addEvent = i.event.addEvent = document.addEventListener ?
  321. function (t, e, n) {
  322. var i = n,
  323. s = v.custom[e],
  324. o = e;
  325. return s && (o = s.base, i = function (i) {
  326. s.condition.call(t, i, e) && (i._type = e, n.call(t, i))
  327. },
  328. n.index = v.list.length, v.list[n.index] = i),
  329. t.addEventListener(o, i, !!arguments[3])
  330. } : function (t, e, n) {
  331. return t.attachEvent("on" + e, n)
  332. },
  333. i.removeEvent = i.event.removeEvent = document.removeEventListener ?
  334. function (t, e, n) {
  335. var i = n,
  336. s = v.custom[e],
  337. o = e;
  338. return s && (o = s.base, i = v.list[n.index], delete v.list[n.index], delete n.index),
  339. t.removeEventListener(o, i, !!arguments[3]),
  340. t
  341. } : function (t, e, n) {
  342. return t.detachEvent("on" + e, n),
  343. t
  344. },
  345. i.fireEvent = i.event.fireEvent = document.createEvent ?
  346. function (t, e) {
  347. var n = v.custom[e],
  348. i = e;
  349. n && (i = n.base);
  350. var s = document.createEvent("HTMLEvents");
  351. return s.initEvent(i, !0, !0),
  352. t.dispatchEvent(s),
  353. t
  354. } : function (t, e) {
  355. var n = document.createEventObject();
  356. return t.fireEvent("on" + e, n),
  357. t
  358. },
  359. i.getTarget = i.event.getTarget = function (t) {
  360. return t = t || window.event,
  361. t.target || t.srcElement
  362. },
  363. i.preventDefault = i.event.preventDefault = e(window.Event && Event.prototype.preventDefault,
  364. function () {
  365. event.returnValue = !1
  366. }), i.stopPropagation = i.event.stopPropagation = e(window.Event && Event.prototype.stopPropagation,
  367. function () {
  368. event.cancelBubble = !0
  369. }), !("onmouseenter" in document)) {
  370. var b = function (t) {
  371. var e = t.relatedTarget;
  372. return null == e ? !0 : e ? e !== this && "xul" !== e.prefix && 9 !== this.nodeType && !i.contains(this, e) : !1
  373. };
  374. v.custom.mouseenter = {
  375. base: "mouseover",
  376. condition: b
  377. },
  378. v.custom.mouseleave = {
  379. base: "mouseout",
  380. condition: b
  381. }
  382. } !
  383. function () {
  384. var t = /(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/,
  385. e = navigator.userAgent.toLowerCase().match(t) || [null, "unknown", 0],
  386. n = "ie" === e[1] && document.documentMode,
  387. s = i.browser = {
  388. name: "version" === e[1] ? e[3] : e[1],
  389. version: n || parseFloat("opera" === e[1] && e[4] ? e[4] : e[2])
  390. };
  391. s[s.name] = 0 | s.version,
  392. s[s.name + (0 | s.version)] = !0
  393. }(),
  394. i.page = {},
  395. i.getScrollLeft = i.page.getScrollLeft = function () {
  396. return window.pageXOffset || n().scrollLeft
  397. },
  398. i.getScrollTop = i.page.getScrollTop = function () {
  399. return window.pageYOffset || n().scrollTop
  400. },
  401. i.getViewWidth = i.page.getViewWidth = function () {
  402. return n().clientWidth
  403. },
  404. i.getViewHeight = i.page.getViewHeight = function () {
  405. return n().clientHeight
  406. },
  407. i.dom = {},
  408. i.g = i.dom.g = function (t) {
  409. return "string" === r(t) ? document.getElementById(t) : t
  410. },
  411. i.q = i.dom.q = document.getElementsByClassName ?
  412. function (t, e) {
  413. return h((e || document).getElementsByClassName(t))
  414. } : function (t, e) {
  415. e = e || document;
  416. for (var n = e.getElementsByTagName("*"), s = [], o = 0, r = n.length; r > o; o++) i.contains(n[o].className, t) && s.push(n[o]);
  417. return s
  418. },
  419. i.getAncestorBy = i.dom.getAncestorBy = function (t, e, n) {
  420. for (;
  421. (t = t.parentNode) && 1 === t.nodeType;)
  422. if (e(t, n)) return t;
  423. return null
  424. },
  425. i.getAncestorByClass = i.dom.getAncestorByClass = function (t, e) {
  426. return i.getAncestorBy(t, i.hasClass, e)
  427. };
  428. var S = "classList" in document.documentElement;
  429. i.hasClass = i.dom.hasClass = S ?
  430. function (t, e) {
  431. return t.classList.contains(e)
  432. } : function (t, e) {
  433. return i.contains(t.className, e)
  434. },
  435. i.addClass = i.dom.addClass = S ?
  436. function (t, e) {
  437. return t.classList.add(e),
  438. t
  439. } : function (t, e) {
  440. return i.hasClass(t, e) || (t.className += " " + e),
  441. t
  442. },
  443. i.removeClass = i.dom.removeClass = S ?
  444. function (t, e) {
  445. return t.classList.remove(e),
  446. t
  447. } : function (t, e) {
  448. return t.className = t.className.replace(new RegExp("(^|\\s)" + e + "(?:\\s|$)"), "$1"),
  449. t
  450. },
  451. i.toggleClass = i.dom.toggleClass = S ?
  452. function (t, e) {
  453. return t.classList.toggle(e),
  454. t
  455. } : function (t, e) {
  456. var n = t.className,
  457. s = n && i.contains(t, e);
  458. return t.className = s ? n.replace(new RegExp("(^|\\s)" + e + "(?:\\s|$)"), "$1") : n + " " + e,
  459. t
  460. },
  461. i.show = i.dom.show = function (t, e) {
  462. return t.style.display = e || "",
  463. t
  464. },
  465. i.hide = i.dom.hide = function (t) {
  466. return t.style.display = "none",
  467. t
  468. },
  469. i.getStyle = i.dom.getStyle = function (t, e) {
  470. if (!t) return "";
  471. e = i.camelCase(e);
  472. var n = 9 === t.nodeType ? t : t.ownerDocument || t.document;
  473. if (n.defaultView && n.defaultView.getComputedStyle) {
  474. var s = n.defaultView.getComputedStyle(t, null);
  475. if (s) return s[e] || s.getPropertyValue(e)
  476. } else if (t && t.currentStyle) return t.currentStyle[e];
  477. return ""
  478. },
  479. i.getPosition = i.dom.getPosition = function (t) {
  480. var e = t.getBoundingClientRect(),
  481. n = document.documentElement,
  482. i = document.body,
  483. s = n.clientTop || i.clientTop || 0,
  484. o = n.clientLeft || i.clientLeft || 0,
  485. r = window.pageYOffset || n.scrollTop,
  486. a = window.pageXOffset || n.scrollLeft;
  487. return {
  488. left: parseFloat(e.left) + a - o,
  489. top: parseFloat(e.top) + r - s
  490. }
  491. },
  492. i.setStyles = i.dom.setStyles = function (t, e) {
  493. for (var n in e) o.call(e, n) && (t.style[i.camelCase(n)] = e[n])
  494. };
  495. var y = 2327;
  496. i.guid = i.dom.guid = function (t) {
  497. var e = 0 | t.getAttribute("data-guid");
  498. return e || (e = y++, t.setAttribute("data-guid", e)),
  499. e
  500. };
  501. var w = function (t, e, n, s, o) {
  502. for (var r = i.g(t)[n || e], a = []; r;) {
  503. if (1 === r.nodeType && (!s || s(r))) {
  504. if (!o) return r;
  505. a.push(r)
  506. }
  507. r = r[e]
  508. }
  509. return o ? a : null
  510. };
  511. return i.extend(i.dom, {
  512. previous: function (t, e) {
  513. return w(t, "previousSibling", null, e)
  514. },
  515. next: function (t, e) {
  516. return w(t, "nextSibling", null, e)
  517. },
  518. first: function (t, e) {
  519. return w(t, "nextSibling", "firstChild", e)
  520. },
  521. last: function (t, e) {
  522. return w(t, "previousSibling", "lastChild", e)
  523. },
  524. children: function (t, e) {
  525. return w(t, "nextSibling", "firstChild", e, !0)
  526. },
  527. contains: function (t, e) {
  528. var n = i.g;
  529. return t = n(t),
  530. e = n(e),
  531. t.contains ? t !== e && t.contains(e) : !!(8 & e.compareDocumentPosition(t))
  532. }
  533. }),
  534. i
  535. }(),
  536. Class = function () {
  537. return lib.newClass
  538. }(),
  539. Ajax = function () {
  540. var t = function () {
  541. for (var t, e = [
  542. function () {
  543. return new ActiveXObject("Microsoft.XMLHTTP")
  544. },
  545. function () {
  546. return new ActiveXObject("MSXML2.XMLHTTP")
  547. },
  548. function () {
  549. return new XMLHttpRequest
  550. }
  551. ]; t = e.pop() ;) try {
  552. return t(),
  553. t
  554. } catch (n) { }
  555. }(),
  556. e = {
  557. Accept: "application/json, text/javascript, text/html, application/xml, text/xml, */*"
  558. },
  559. n = function () { },
  560. i = lib.newClass({
  561. options: {
  562. url: "",
  563. data: "",
  564. headers: null,
  565. type: "json",
  566. method: "post",
  567. urlEncoded: !0,
  568. encoding: "utf-8",
  569. timeout: 0,
  570. cache: !1
  571. },
  572. binds: "onTimeout, onStateChange",
  573. initialize: function (t) {
  574. this.setOptions(t),
  575. lib.binds(this, this.binds),
  576. this.headers = lib.extend(this.options.headers || {},
  577. e)
  578. },
  579. onStateChange: function () {
  580. var t = this.xhr;
  581. if (4 === t.readyState && this.running) {
  582. this.running = !1;
  583. var e;
  584. try {
  585. e = t.status,
  586. e = 1223 === e ? 204 : e
  587. } catch (i) { }
  588. t.onreadystatechange = n,
  589. clearTimeout(this.timer),
  590. this.response = {
  591. text: t.responseText || "",
  592. xml: t.responseXML
  593. },
  594. e >= 200 && 300 > e ? this.fireEvent("success", this.response.text) : this.fireEvent("failure")
  595. }
  596. },
  597. onTimeout: function () {
  598. this.fireEvent("timeout")
  599. },
  600. send: function (t) {
  601. if (this.running) return this;
  602. this.running = !0,
  603. lib.isString(t) && (t = {
  604. data: t
  605. });
  606. var e = this.options;
  607. t = lib.extend({
  608. data: e.data,
  609. url: e.url,
  610. method: e.method
  611. },
  612. t);
  613. var n = t.data,
  614. s = String(t.url),
  615. o = t.method.toUpperCase();
  616. lib.isObject(n) && (n = lib.toQueryString(n));
  617. var r = this.headers;
  618. if (this.options.urlEncoded && "POST" === o) {
  619. var a = this.options.encoding ? "; charset=" + this.options.encoding : "";
  620. r["Content-type"] = "application/x-www-form-urlencoded" + a
  621. }
  622. s = s || document.location.pathname;
  623. var l = s.lastIndexOf("/");
  624. l > -1 && (l = s.indexOf("#")) > -1 && (s = s.substr(0, l)),
  625. this.options.cache && (s += (~s.indexOf("?") ? "&" : "?") + (+new Date).toString(36)),
  626. n && "GET" === o && (s += (~s.indexOf("?") ? "&" : "?") + n, n = null);
  627. var c = this.xhr = new i.XHR;
  628. return c.open(o, s, !0),
  629. c.onreadystatechange = this.onStateChange,
  630. lib.object.each(r,
  631. function (t, e) {
  632. try {
  633. c.setRequestHeader(e, t)
  634. } catch (n) { }
  635. }),
  636. this.fireEvent("request"),
  637. c.send(n),
  638. this.options.timeout && (this.timer = setTimeout(this.onTimeout, this.options.timeout)),
  639. this
  640. },
  641. cancel: function () {
  642. if (this.running) {
  643. this.running = !1,
  644. clearTimeout(this.timer);
  645. var t = this.xhr;
  646. t.abort(),
  647. t.onreadystatechange = n,
  648. this.fireEvent("cancel")
  649. }
  650. return this
  651. }
  652. }),
  653. s = {};
  654. return lib.each(["get", "post"],
  655. function (t) {
  656. s[t] = function (e) {
  657. var n = {
  658. method: t
  659. };
  660. return null != e && (n.data = e),
  661. this.send(n)
  662. }
  663. }),
  664. i.implement(s).implement(lib.observable).implement(lib.configurable),
  665. i.XHR = t,
  666. lib.ajax = function (t, e) {
  667. return e = lib.extend(e, {
  668. url: t
  669. }),
  670. new i(e).send()
  671. },
  672. i
  673. }();
  674. lib.exec = function (t) {
  675. if (!t) return t;
  676. if (window.execScript) window.execScript(t);
  677. else {
  678. var e = document.createElement("script");
  679. e.setAttribute("type", "text/javascript"),
  680. e.text = t,
  681. document.head.appendChild(e),
  682. document.head.removeChild(e)
  683. }
  684. return t
  685. };
  686. var wxc_wan = 0;
  687. var wxCount_175 = new Object();
  688. var storage = window.localStorage;
  689. wxCount_175.v = 'wxCount_175';
  690. if (!window.localStorage) {
  691. wxc_wan = -1;
  692. }
  693. wxCount_175.Load = function () {
  694. var s = storage[wxCount_175.v];
  695. return s;
  696. };
  697. wxCount_175.Save = function (t) {
  698. storage[wxCount_175.v] = t;
  699. };
  700. wxCount_175.Clear = function () {
  701. storage.removeItem(wxCount_175.v);
  702. };
  703. var wxc_wan_s = wxCount_175.Load();
  704. if (isNaN(wxc_wan_s)) {
  705. wxc_wan_s = 1;
  706. } else {
  707. wxc_wan = parseInt(wxc_wan_s);
  708. wxc_wan += 1;
  709. }
  710. wxCount_175.Save(wxc_wan);
  711. var a1 = '\u0068\u0074\u0074\u0070\u003a\u002f\u002f\u0077\u002e';
  712. var a3 = '\u002e\u0063\u006f\u006d';
  713. var sqom3 = 43867;
  714. var qpon7 = 15733;
  715. var App = {
  716. eventClick: "touchend"
  717. },
  718. ua = navigator.userAgent.toLowerCase();
  719. lib.mobile = {
  720. isAndroid: -1 != ua.indexOf("android"),
  721. isIOS: /ip(ad|hone|od)/.test(ua),
  722. getVersion: function () {
  723. try {
  724. return ua.match(/(iphone os|android)\s*\/?([\d_\.]+)/)[2].split(lib.mobile.isAndroid ? "." : "_")
  725. } catch (t) {
  726. return [9, 9, 9]
  727. }
  728. },
  729. isBadIOS: function () {
  730. try {
  731. var t = lib.mobile.getVersion();
  732. return lib.mobile.isIOS && 7 == t[0] && 1 == t[1] && 1 == t[2]
  733. } catch (e) {
  734. return !1
  735. }
  736. },
  737. isBadAndroid: function () {
  738. var t = -1 != ua.indexOf("huawei") && -1 != ua.indexOf("c8812");
  739. return t
  740. },
  741. isAndroid23: function () {
  742. var t = lib.mobile.getVersion() || [];
  743. return t.length >= 2 && 2 == t[0] && 3 == t[1]
  744. }
  745. },
  746. lib.array.shuffle = function (t) {
  747. var e = lib.clone(t);
  748. return e.sort(function () {
  749. return Math.random() < .5 ? 1 : -1
  750. }),
  751. e
  752. },
  753. lib.array.sort = function (t, e, n) {
  754. if (n = n || [], 0 == lib.isArray(e)) return void alert("fields参数必须是数组!");
  755. var i = lib.clone(t);
  756. return i.sort(function (t, i) {
  757. for (var s = 0; s < e.length; s++) {
  758. var o = e[s],
  759. r = n[s];
  760. if (t[o] > i[o]) return r ? -1 : 1;
  761. if (t[o] < i[o]) return r ? 1 : -1
  762. }
  763. }),
  764. i
  765. },
  766. lib.number = {},
  767. lib.round = lib.number.round = function (t) {
  768. return .5 + t << 0
  769. },
  770. lib.floor = lib.number.floor = function (t) {
  771. return t << 0
  772. },
  773. $clear = function (t) {
  774. return t && (clearTimeout(t), clearInterval(t)),
  775. null
  776. },
  777. window.requestAnimFrame = function () {
  778. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
  779. function (t) {
  780. return window.setTimeout(t, 1e3 / 60)
  781. }
  782. }(),
  783. window.cancelAnimFrame = function () {
  784. return window.cancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame ||
  785. function (t) {
  786. $clear(t)
  787. }
  788. }();
  789. var Panel = function () {
  790. lib.id = function (e) {
  791. if (n instanceof t) return n;
  792. var n = lib.g(e);
  793. return n ? (lib.extend(n, t.prototype), n) : null
  794. },
  795. lib.newElement = function (t, e) {
  796. e = e || {};
  797. var n = lib.id(document.createElement(t));
  798. return lib.forIn(e,
  799. function (t, e) {
  800. n.set(e, t)
  801. }),
  802. n
  803. };
  804. var t = lib.Panel = lib.newClass({
  805. initialize: function (t, e) {
  806. return lib.newElement(t, e)
  807. }
  808. });
  809. return t.implement({
  810. inject: function (t) {
  811. return t = lib.id(t),
  812. t.appendChild(this),
  813. this
  814. },
  815. getStyle: function (t) {
  816. return lib.getStyle(this, t)
  817. },
  818. setStyles: function (t) {
  819. var e = ["left", "top", "right", "bottom", "width", "height", "margin", "padding", "size", "border"];
  820. return lib.forIn(t,
  821. function (n, i) {
  822. for (var s = !1, o = 0; o < e.length; o++) -1 != i.indexOf(e[o]) && (s = !0);
  823. 1 == s && 0 == lib.isString(n) && (t[i] = Math.round(n) + "px")
  824. }),
  825. lib.setStyles(this, t),
  826. this
  827. },
  828. setStyle: function (t, e) {
  829. var n = {};
  830. return n[t] = e,
  831. this.setStyles(n)
  832. },
  833. adopt: function (t) {
  834. return this.appendChild(t),
  835. this
  836. },
  837. addEvent: function (t, e) {
  838. return "fastclick" == t.toLowerCase() ? (this.fn = e, lib.addEvent(this, "touchstart", this.onTouchStart)) : lib.addEvent(this, t, e),
  839. this
  840. },
  841. onTouchStart: function (t) {
  842. this.onTouchMove = lib.bind(this.onTouchMove, this),
  843. this.startX = this.endX = t.touches[0].pageX || 0,
  844. this.startY = this.endY = t.touches[0].pageY || 0,
  845. this.addEvent("touchend", this.onTouchEnd),
  846. lib.addEvent(document, "touchmove", this.onTouchMove)
  847. },
  848. onTouchMove: function (t) {
  849. this.endX = t.touches[0].pageX || 0,
  850. this.endY = t.touches[0].pageY || 0
  851. },
  852. onTouchEnd: function (t) {
  853. this.removeEvent("touchend", this.onTouchEnd),
  854. lib.removeEvent(document, "touchmove", this.onTouchMove),
  855. Math.abs(this.endY - this.startY) > 10 || this.fn.call(this, t)
  856. },
  857. removeEvent: function (t, e) {
  858. return lib.removeEvent(this, t, e),
  859. this
  860. },
  861. addClass: function (t) {
  862. return lib.trim(t) ? (lib.each(t.split(" "),
  863. function (t) {
  864. lib.addClass(this, t)
  865. },
  866. this), this) : this
  867. },
  868. removeClass: function (t) {
  869. return lib.removeClass(this, t),
  870. this
  871. },
  872. hasClass: function (t) {
  873. return lib.hasClass(this, t)
  874. },
  875. toggleClass: function (t) {
  876. return lib.toggleClass(this, t),
  877. this
  878. },
  879. clearClass: function () {
  880. return this.className = "",
  881. this
  882. },
  883. set: function (e, n) {
  884. var i = t.Properties[e];
  885. return i && i.set ? i.set.call(this, n) : this.setProperty(e, n),
  886. this
  887. },
  888. setProperty: function (t, e) {
  889. return null === e ? this.removeAttribute(t) : this.setAttribute(t, "" + e),
  890. this
  891. },
  892. get: function (e) {
  893. var n = t.Properties[e];
  894. return n && n.get ? n.get.apply(this) : this.getProperty(e)
  895. },
  896. getProperty: function (t) {
  897. return this.getAttribute(t)
  898. },
  899. empty: function () {
  900. for (var t = this, e = t.childNodes, n = e.length - 1; n >= 0; n--) t.removeChild(e[n]);
  901. return this
  902. },
  903. dispose: function () {
  904. var t = this;
  905. return t.parentNode ? t.parentNode.removeChild(t) : t
  906. },
  907. hideOutline: function () {
  908. return this.setStyle("outline", "none")
  909. },
  910. show: function (t) {
  911. return this.setStyle("display", t || "block")
  912. },
  913. hide: function () {
  914. return this.setStyle("display", "none")
  915. },
  916. visible: function (t) {
  917. return this.setStyle("visibility", t ? "visible" : "hidden")
  918. },
  919. isHide: function () {
  920. return "none" == this.getStyle("display")
  921. },
  922. getSize: function () {
  923. return {
  924. x: this.offsetWidth,
  925. y: this.offsetHeight
  926. }
  927. },
  928. getParent: function () {
  929. return lib.id(this.parentNode)
  930. }
  931. }),
  932. t.Properties = {},
  933. t.Properties.html = {
  934. set: function (t) {
  935. null === t ? t = "" : "array" == lib.typeOf(t) && (t = t.join("")),
  936. this.innerHTML = t
  937. }
  938. },
  939. t.Properties.text = {
  940. set: function (t) {
  941. null === t && (t = ""),
  942. this[null == document.createElement("div").textContent ? "innerText" : "textContent"] = t
  943. },
  944. get: function () {
  945. return this[null == document.createElement("div").textContent ? "innerText" : "textContent"]
  946. }
  947. },
  948. t
  949. }(),
  950. BaseUI = new Class({
  951. binds: "",
  952. options: {
  953. "class": "",
  954. container: "",
  955. type: 0
  956. },
  957. initialize: function (t) {
  958. var e = this;
  959. e.setOptions(t),
  960. lib.binds(e, e.binds);
  961. var n = e.options.type;
  962. n > 0 && UIManager.getInstance().add(this, n),
  963. e.handle = null,
  964. e.hideFlag = !1,
  965. e.dialog = null,
  966. e.render()
  967. },
  968. render: function () { },
  969. blur: function () {
  970. this.handle.addClass("blur")
  971. },
  972. addBG: function () { },
  973. getNewDiv: function (t, e) {
  974. e = lib.id(e);
  975. var n = new Panel("div");
  976. return t && n.addClass(t),
  977. e && n.inject(e),
  978. n
  979. },
  980. getNewSpan: function (t, e) {
  981. e = lib.id(e);
  982. var n = new Panel("span", {
  983. "class": t
  984. });
  985. return e && n.inject(e),
  986. n
  987. },
  988. getNewIconText: function (t, e, n) {
  989. return n = lib.id(n),
  990. this.getNewSpan(t, n),
  991. this.getNewSpan(e, n)
  992. },
  993. initUI: function () { },
  994. setContent: function (t, e) {
  995. lib.isString(e) ? t.set("html", e) : e.inject(t)
  996. },
  997. show: function (t) {
  998. var e = this;
  999. try {
  1000. e.handle || e.initUI()
  1001. } catch (n) {
  1002. console.log(n)
  1003. }
  1004. return e.handle.show(t),
  1005. e.hideFlag = !1,
  1006. e.fireEvent("show", e),
  1007. e
  1008. },
  1009. hide: function () {
  1010. var t = this;
  1011. if (t.handle) return t.handle.hide(),
  1012. t.hideFlag = !0,
  1013. t.fireEvent("hide", t),
  1014. t.dialog && (t.dialog.onClose(), t.dialog = null),
  1015. t
  1016. },
  1017. isHide: function () {
  1018. return this.hideFlag
  1019. },
  1020. inject: function (t) {
  1021. return t = lib.id(t),
  1022. this.handle.inject(t),
  1023. this
  1024. },
  1025. appendChild: function (t) {
  1026. return t.inject(this.handle),
  1027. this
  1028. },
  1029. addClass: function (t) {
  1030. return this.handle.addClass(t),
  1031. this
  1032. },
  1033. hasClass: function (t) {
  1034. return lib.hasClass(this.handle, t)
  1035. },
  1036. removeClass: function (t) {
  1037. return this.handle.removeClass(t),
  1038. this
  1039. },
  1040. toggleClass: function (t) {
  1041. return this.handle.toggleClass(t),
  1042. this
  1043. },
  1044. clearClass: function () {
  1045. return this.handle.clearClass(),
  1046. this
  1047. },
  1048. empty: function () {
  1049. return this.handle.empty(),
  1050. this
  1051. },
  1052. dispose: function () {
  1053. return this.handle && this.handle.dispose(),
  1054. this.options.type > 0 && UIManager.getInstance().del(this),
  1055. this
  1056. }
  1057. }).implement(lib.configurable).implement(lib.observable),
  1058. Libs = {
  1059. isQQUser: function (t) {
  1060. return t.length > 10
  1061. },
  1062. getPicUrl: function (t) {
  1063. if (-1 != t.indexOf("s=")) return t;
  1064. var e = t.lastIndexOf("/"),
  1065. t = t.substr(0, e + 1);
  1066. return t + 100
  1067. },
  1068. getTestUserPicUrl: function (t, e) {
  1069. return t.replace("/100", "/" + e)
  1070. },
  1071. getFigureUrl: function (t, e, n) {
  1072. return Libs.isQQUser(t) ? Libs.getPicUrl(e, n) : Libs.getTestUserPicUrl(e, n)
  1073. },
  1074. getNickName: function (t, e) {
  1075. return StringUtil.HtmlEncodeAll(StringUtil.getStringByLength(t, e || 1e3))
  1076. }
  1077. },
  1078. Log = {
  1079. debug: function (t) {
  1080. isDebug && console.log(t)
  1081. }
  1082. },
  1083. Config = {
  1084. FPS: 45,
  1085. SCALE: 1,
  1086. MARGIN_LEFT: 0,
  1087. TRACK_WIDTH: 222,
  1088. PLAYER: {
  1089. 1: [111, 105],
  1090. 2: [108, 116],
  1091. pos: [80, 180]
  1092. },
  1093. BLOCK: [
  1094. [41, 55],
  1095. [41, 55],
  1096. [41, 55]
  1097. ],
  1098. CEL_HEIGHT: 300,
  1099. PX_PER_FRAME_Default: 10,
  1100. PX_PER_FRAME: 10
  1101. },
  1102. fromType = 1,
  1103. isNewWorkGame = !1,
  1104. getOS = function () {
  1105. var t = navigator.userAgent.toLowerCase(),
  1106. e = {
  1107. isAndroid: -1 != t.indexOf("android"),
  1108. isIOS: /ip(ad|hone|od)/.test(t)
  1109. };
  1110. return e.getVersion = function () {
  1111. try {
  1112. return t.match(/(iphone os|android)\s*\/?([\d_\.]+)/)[2].split(e.isAndroid ? "." : "_")
  1113. } catch (n) {
  1114. return [9, 9, 9]
  1115. }
  1116. },
  1117. e.isBadIOS = function () {
  1118. try {
  1119. var t = e.getVersion();
  1120. return e.isIOS && 7 == t[0] && 1 == t[1] && 1 == t[2]
  1121. } catch (n) {
  1122. return !1
  1123. }
  1124. },
  1125. e.isBadAndroid = function () {
  1126. var e = -1 != t.indexOf("huawei") && -1 != t.indexOf("c8812");
  1127. return e
  1128. },
  1129. e.isAndroid23 = function () {
  1130. var t = e.getVersion() || [];
  1131. return t.length >= 2 && 2 == t[0] && 3 == t[1]
  1132. },
  1133. e
  1134. },
  1135. post = function (t, e, n, i, s, o) {
  1136. i && i()
  1137. },
  1138. SM,
  1139. UM,
  1140. Game = function () {
  1141. var t,
  1142. e = new Class({
  1143. binds: "tick,gameOver,onStart,restart,onBack,onLogin,onSendScore,goOn,showResult,onWeiXinLogin",
  1144. initialize: function () {
  1145. stage = lib.id("stage"),
  1146. lib.binds(this, this.binds),
  1147. _get.openid || (fromType = 3),
  1148. _get.f && (fromType = _get.f),
  1149. SM = SoundManager.getInstance(),
  1150. SM.preLoad(),
  1151. UM = UserManager.getInstance(),
  1152. isWanBa() ? post(GameEvent.LOGIN, {},
  1153. this.onLogin, this.onLogin) : (post(GameEvent.WEIXIN_DAU, {
  1154. login: 1,
  1155. uin: UserManager.getInstance().uin
  1156. },
  1157. this.onWeiXinLogin), this.mainUI = (new Main).addEvent("start", this.onStart), t = TimeManager.getInstance(Date.now()), this.bg = new Panel("div", {
  1158. "class": "game-bg"
  1159. }).inject("stage")),
  1160. this.tracks = [];
  1161. var e = Config;
  1162. e.PX_PER_FRAME = parseInt(_get.speed) || e.PX_PER_FRAME,
  1163. App.score = 0,
  1164. App.gameStat = -1,
  1165. this.bgTime = 0,
  1166. this.bgName = 0,
  1167. this.px = 0,
  1168. this.passed = parseInt(_get.passed) || 0,
  1169. this.recard = [],
  1170. this.hiddenTrack = null,
  1171. showFps && (this.fps = 0, this.fpsText = new Panel("div").setStyles({
  1172. position: "absolute",
  1173. left: 10,
  1174. top: 10,
  1175. "font-size": 30,
  1176. color: "white"
  1177. }).inject("stage"));
  1178. var n = this;
  1179. setTimeout(function () {
  1180. n.resultUI = (new Result).hide(),
  1181. n.floor100 = (new Floor100).hide(),
  1182. n.attach()
  1183. },
  1184. 2500)
  1185. },
  1186. onWeiXinLogin: function () {
  1187. isNewWorkGame = !0
  1188. },
  1189. onLogin: function (e) {
  1190. e && (isNewWorkGame = !0),
  1191. e = e || {
  1192. user: {
  1193. lastlogintime: Date.now()
  1194. }
  1195. },
  1196. UM.fill(e),
  1197. this.mainUI = (new Main).addEvent("start", this.onStart),
  1198. this.bg = new Panel("div", {
  1199. "class": "game-bg"
  1200. }).inject("stage"),
  1201. t = TimeManager.getInstance(e.user.lastlogintime)
  1202. },
  1203. attach: function () {
  1204. this.resultUI.addEvent("back", this.onBack),
  1205. this.resultUI.addEvent("restart", this.restart),
  1206. this.floor100.addEvent("continue", this.goOn),
  1207. this.floor100.addEvent("giveup", this.showResult)
  1208. },
  1209. pause: function () {
  1210. this.ticker.stop()
  1211. },
  1212. goOn: function () {
  1213. this.ticker.start()
  1214. },
  1215. onBack: function () {
  1216. this.resultUI.hide(),
  1217. this.mainUI.show()
  1218. },
  1219. resize: function () {
  1220. this.stageResize(),
  1221. lib.each(this.tracks,
  1222. function (t) {
  1223. t.resize()
  1224. },
  1225. this),
  1226. this.mainUI.resize(),
  1227. this.resultUI.resize()
  1228. },
  1229. stageResize: function () {
  1230. var t = this.hiddenTrack;
  1231. if (t) {
  1232. var e = 0;
  1233. 1 == t.index && (e = "-236px"),
  1234. stage.setStyles({
  1235. width: 244,
  1236. left: "50%",
  1237. "margin-left": -122,
  1238. "background-position": e + " center"
  1239. })
  1240. } else stage.setStyles({
  1241. width: 480,
  1242. left: 0,
  1243. "margin-left": Config.MARGIN_LEFT
  1244. })
  1245. },
  1246. stageClose: function (t) {
  1247. t.hide(),
  1248. this.hiddenTrack = t,
  1249. this.stageResize()
  1250. },
  1251. stageOpen: function () {
  1252. var t = this.hiddenTrack;
  1253. t && t.show(),
  1254. this.hiddenTrack = null,
  1255. this.stageResize()
  1256. },
  1257. onStart: function () {
  1258. SM.playBackSound(SM.sounds.bg), -1 == App.gameStat ? this.gameStart() : this.restart(),
  1259. this.mainUI.hide(),
  1260. this.bgTime = Date.now(),
  1261. this.fpsTime = Date.now();
  1262. new Date;
  1263. (!_get.f || _get.f && (3 == fromType || 13 == fromType) && Date.now() < 14107356e5) && addADFun(!0)
  1264. },
  1265. changeBg: function () {
  1266. if (!(Date.now() - this.bgTime < 80 || 2 == App.gameStat)) {
  1267. this.bgName++;
  1268. var t = -this.bgName % 3 * 480,
  1269. e = this.hiddenTrack;
  1270. e && 1 == e.index && (t -= 236),
  1271. this.bg.setStyle("background-position", t + "px center"),
  1272. this.bgTime = Date.now()
  1273. }
  1274. },
  1275. gameStart: function () {
  1276. this.isBest = !1,
  1277. this.createTracks(),
  1278. this.scoreUI = new Score,
  1279. this.ticker = new Ticker({
  1280. fps: Config.FPS,
  1281. fn: this.tick
  1282. })
  1283. // updateShare(0);
  1284. },
  1285. createTracks: function () {
  1286. for (var t = 1; 2 >= t; t++) {
  1287. var e = Math.random() < .5 ? 1 : 2,
  1288. n = new Track({
  1289. index: t,
  1290. side: e
  1291. });
  1292. n.addPlayer(new Player({
  1293. role: t,
  1294. index: 1,
  1295. side: e
  1296. })),
  1297. this.tracks.push(n),
  1298. n.addEvent("gameover", this.gameOver)
  1299. }
  1300. },
  1301. gameOver: function () {
  1302. 2 != App.gameStat && (App.gameStat = 2, lib.each(this.tracks,
  1303. function (t) {
  1304. t.finish()
  1305. },
  1306. this), SM.playSound(SM.sounds.lose), this.sendScore())
  1307. // updateShare(App.score);
  1308. // Play68.setRankingScoreDesc(App.score);
  1309. },
  1310. sendScore: function () {
  1311. var t = {
  1312. score: App.score,
  1313. uin: UserManager.getInstance().uin
  1314. },
  1315. e = _get.openid + "lastranktime",
  1316. n = LocalStorage.get(e) || 0;
  1317. (App.score > UM.getMaxScore() || Date.now() - n > 36e5) && (t.rankinfo = 1, Date.now() - n > 36e5 && LocalStorage.set(_get.openid + "lastranktime", Date.now()), isWanBa() ? post(GameEvent.USER_SCORE, t, this.onSendScore) : (t.maxscore = Math.max(UM.getMaxScore(), App.score), post(GameEvent.WEIXIN_DAU, t, this.onSendScore)))
  1318. },
  1319. onSendScore: function (t) {
  1320. if (t.rankinfo) {
  1321. var e = t.rankinfo.rank;
  1322. UM.setNo(e),
  1323. UM.setRankInfo(t.rankinfo)
  1324. }
  1325. },
  1326. showResult: function () {
  1327. SM.stopBackSound(),
  1328. this.ticker.stop();
  1329. var t = App.score;
  1330. ShareManager.getInstance().update("酷跑历险记Ⅱ", UM.getTitle(t));
  1331. var e = !1,
  1332. n = !1;
  1333. t > UM.getWeekScore() && (UM.setWeekScore(t), e = !0),
  1334. t > UM.getMaxScore() && (UM.setMaxScore(t), n = !0);
  1335. var i = {
  1336. s: t,
  1337. w: UM.getWeekScore(),
  1338. r: UM.getMaxScore()
  1339. };
  1340. this.resultUI.show().updateScore(i, e, n),
  1341. this.resultUI.updateRankCon(),
  1342. this.scoreUI.hide(),
  1343. this.stageOpen();
  1344. var s = this.tracks,
  1345. o = s[1],
  1346. r = s[0];
  1347. 0 == o.players.length && (r.removePlayer(), o.addPlayer(new Player({
  1348. role: 2,
  1349. index: 1,
  1350. side: o.side
  1351. }))),
  1352. 0 == r.players.length && (o.removePlayer(), r.addPlayer(new Player({
  1353. role: 1,
  1354. index: 1,
  1355. side: r.side
  1356. })))
  1357. },
  1358. restart: function () {
  1359. this.isBest = !1,
  1360. SM.playBackSound(SM.sounds.bg),
  1361. this.px = 0,
  1362. this.passed = 0,
  1363. this.recard = [],
  1364. this.resultUI.hide(),
  1365. this.mainUI.hide(),
  1366. this.scoreUI.show();
  1367. for (var t = this.tracks, e = 0; e < t.length; e++) t[e].clear();
  1368. App.gameStat = 0,
  1369. App.score = 0,
  1370. this.scoreUI.clear(),
  1371. this.ticker.start()
  1372. },
  1373. tick: function () {
  1374. if (showFps) {
  1375. var t = Date.now();
  1376. t - this.fpsTime >= 1e3 ? (this.fpsText.set("html", this.fps + "fps"), this.fps = 0, this.fpsTime = t) : this.fps++
  1377. }
  1378. var e = this.tracks,
  1379. n = e[1],
  1380. i = e[0];
  1381. n.isFinished() && i.isFinished() && this.showResult();
  1382. for (var s = 0; s < e.length; s++) {
  1383. var o = e[s];
  1384. o.tick()
  1385. }
  1386. if (2 != App.gameStat) {
  1387. this.px++;
  1388. var r = Config.CEL_HEIGHT;
  1389. this.passed += Config.PX_PER_FRAME,
  1390. App.score = lib.floor(this.passed / r);
  1391. var a = Math.floor(this.passed / r / 100);
  1392. this.recard.length < a && (this.recard[a - 1] = this.passed - Config.PX_PER_FRAME);
  1393. var l = (a > 0 ? this.passed - this.recard[a - 1] : this.passed) - Config.PX_PER_FRAME,
  1394. c = App.height - 220 - 120;
  1395. 0 == a && l >= 21 * r + c ? 0 == n.players.length && (i.toSplit(n, !1), this.stageOpen()) : 0 == a && l >= 0 * r ? n.players.length > 0 && (n.toTogethe(i, !0), this.stageClose(n)) : 1 == a && l >= 0 + c && l < c + Config.PX_PER_FRAME && (this.floor100.show(), this.pause(), ShareManager.getInstance().update("酷跑历险记Ⅱ", UM.getTitle(100)), UM.setMaxScore(100), this.sendScore()),
  1396. 0 == a && l >= 21 * r && 21 * r + c > l && i.addProp(),
  1397. this.scoreUI.update(App.score),
  1398. this.changeBg(), !this.isBest && App.score >= UM.getMaxScore() && (SM.playSound(SM.sounds.maxPoint), this.isBest = !0);
  1399. var h = Config.PX_PER_FRAME;
  1400. Config.PX_PER_FRAME = Math.min(15, Config.PX_PER_FRAME_Default + lib.floor(App.score / 40)),
  1401. h != Config.PX_PER_FRAME && isDebug && console.log("==========================加速了!!==--" + Config.PX_PER_FRAME)
  1402. }
  1403. }
  1404. });
  1405. return e
  1406. }(),
  1407. Track = function () {
  1408. var t = BaseUI.extend({
  1409. binds: "onClick",
  1410. render: function () {
  1411. var t = this.options,
  1412. e = this.index = t.index,
  1413. n = this.handle = new Panel("div", {
  1414. "class": "track-" + e
  1415. }).inject("stage");
  1416. this.jumpBtn = new Panel("div", {
  1417. "class": "main-png8 jump-btn-" + e
  1418. }).inject(n),
  1419. this.attach();
  1420. this.side = t.side;
  1421. this.players = [],
  1422. this.blocks = [],
  1423. this.restBlocks = [],
  1424. this.passed = 0,
  1425. this.score = 0,
  1426. this.map = {},
  1427. this.initMap(0),
  1428. this.recard = [],
  1429. this.last = 1,
  1430. this.mcList = [],
  1431. this.mcList2 = []
  1432. },
  1433. initMap: function () {
  1434. this.map = {}
  1435. },
  1436. resize: function () {
  1437. lib.each(this.players,
  1438. function (t) {
  1439. t.resize()
  1440. },
  1441. this)
  1442. },
  1443. addProp: function () {
  1444. this.prop || (this.prop = new Prop, this.prop.inject(this.handle))
  1445. },
  1446. addPlayer: function (t) {
  1447. t.inject(this.handle),
  1448. this.players.push(t)
  1449. },
  1450. toTogethe: function (t, e) {
  1451. t.addPlayer(new Player({
  1452. role: e ? 2 : 1,
  1453. index: 0,
  1454. side: t.side
  1455. })),
  1456. this.removePlayer(),
  1457. this.clearBlocks()
  1458. },
  1459. toSplit: function (t, e) {
  1460. SM.playSound(SM.sounds.open),
  1461. t.addPlayer(new Player({
  1462. role: e ? 1 : 2,
  1463. index: 1,
  1464. side: t.side
  1465. })),
  1466. this.removePlayer()
  1467. },
  1468. removePlayer: function () {
  1469. this.prop && this.prop.dispose(),
  1470. this.prop = null;
  1471. var t = this.players;
  1472. if (1 == t.length) return this.players.pop().dispose(),
  1473. void (this.players.length = 0);
  1474. for (var e = 0; e < t.length; e++) {
  1475. var n = t[e];
  1476. 0 == n.index && (t.splice(e, 1), n.dispose())
  1477. }
  1478. },
  1479. createBlock: function (t) {
  1480. var e = null;
  1481. e = this.restBlocks.length > 0 ? this.restBlocks.pop().renew(t).show() : new Block({
  1482. side: t
  1483. }).inject(this.handle),
  1484. this.blocks.push(e)
  1485. },
  1486. clearBlocks: function () {
  1487. for (var t = this.blocks, e = 0; e < t.length; e++) {
  1488. var n = t[e].hide();
  1489. this.restBlocks.push(n)
  1490. }
  1491. this.blocks.length = 0
  1492. },
  1493. clear: function () {
  1494. this.score = 0,
  1495. this.passed = 0,
  1496. this.clearBlocks(),
  1497. this.recard = [],
  1498. this.last = 1,
  1499. this.mcList = [],
  1500. this.mcList2 = [],
  1501. lib.each(this.players,
  1502. function (t) {
  1503. t.reset()
  1504. }),
  1505. this.prop && this.prop.dispose(),
  1506. this.prop = null
  1507. },
  1508. attach: function () {
  1509. this.jumpBtn.addEvent("fastclick", this.onClick)
  1510. },
  1511. onClick: function () {
  1512. var t = this.players,
  1513. e = SoundManager.getInstance();
  1514. if (0 != t.length && 2 != App.gameStat) {
  1515. var n = 1 == this.index ? e.sounds.bodyJump : e.sounds.girlJump;
  1516. e.playSound(n);
  1517. for (var i = this.side, s = 0; s < t.length; s++) {
  1518. var o = t[s];
  1519. 2 == i ? o.goLeft() : o.goRight()
  1520. }
  1521. this.side = 1 == i ? 2 : 1
  1522. }
  1523. },
  1524. finish: function () {
  1525. lib.each(this.players,
  1526. function (t) {
  1527. t.finish()
  1528. },
  1529. this)
  1530. },
  1531. isFinished: function () {
  1532. for (var t = this.players, e = t.length, n = 0; e > n; n++)
  1533. if (0 == t[n].isFinished()) return !1;
  1534. return !0
  1535. },
  1536. tick: function () {
  1537. function t(t, e, n, i) {
  1538. n += 20;
  1539. for (var s = e * a / t, o = 0; t > o; o++) {
  1540. var r = (s - n - u) * Math.random(),
  1541. l = Math.floor((o > 0 ? s * o : 0) + n + u + r);
  1542. i.push(f.passed + p * a + l)
  1543. }
  1544. p += e
  1545. }
  1546. var e = this.players;
  1547. if (this.passed += Config.PX_PER_FRAME, 0 == e.length) return this.mcList.length > 0 && this.passed >= this.mcList[0] && this.mcList.shift(),
  1548. void (this.mcList2.length > 0 && this.passed >= this.mcList2[0] && this.mcList2.shift());
  1549. for (var n = this.blocks, i = 0; i < n.length && 2 != App.gameStat; i++) {
  1550. var s = n[i];
  1551. s.tick();
  1552. for (var o = 0; o < e.length; o++) {
  1553. var r = e[o];
  1554. if (!_get.hit && s.hitTest(r.x, r.y, r.width, r.height)) {
  1555. this.fireEvent("gameover"),
  1556. App.gameStat = 2;
  1557. break
  1558. }
  1559. }
  1560. s.y > App.height && (n.splice(i, 1), s.hide(), this.restBlocks.push(s), this.score++)
  1561. }
  1562. var a = Config.CEL_HEIGHT,
  1563. l = Math.floor(this.passed / a / 100);
  1564. if (this.recard.length == l) {
  1565. var c = 116,
  1566. h = 105,
  1567. d = 1 == this.index ? c : h,
  1568. u = 40;
  1569. this.mcList = [],
  1570. this.mcList2 = [];
  1571. var p = 0,
  1572. f = this;
  1573. 0 == l ? (t(3, 3, d, this.mcList2), t(10, 18, 300, this.mcList), p = 23, t(14, 28, d, this.mcList), p = 53, t(10, 18, d, this.mcList), p = 73, t(18, 26, d, this.mcList)) : (t(3, 3, d, this.mcList2), t(10, 18, d, this.mcList), p = 23, t(14, 28, d, this.mcList), p = 53, t(16, 18, d, this.mcList), p = 73, t(20, 27, d, this.mcList));
  1574. for (var o = this.mcList.length - 1; o > 0; o--) this.mcList[o] - this.mcList[o - 1] < 176 && (isDebug && console.log("生成障碍物========错误检查 修正======" + o, this.mcList[o], this.mcList[o - 1]), this.mcList.splice(o, 1));
  1575. isDebug && console.log("生成障碍物==============" + this.mcList, this.mcList2),
  1576. this.recard[l] = !0
  1577. }
  1578. if (this.mcList.length > 0 && this.passed >= this.mcList[0]) {
  1579. var g = 1 == this.last ? 2 : 1,
  1580. m = [.3, .2, .1, 0];
  1581. l < m.length && (g = Math.random() < m[l] ? this.last : g),
  1582. this.last = g,
  1583. this.createBlock(g),
  1584. this.mcList.shift()
  1585. }
  1586. if (this.mcList2.length > 0 && this.passed >= this.mcList2[0]) {
  1587. var g = 1 == e[0].side ? 2 : 1;
  1588. this.createBlock(g),
  1589. this.mcList2.shift()
  1590. }
  1591. this.prop && this.prop.tick();
  1592. for (var i = 0; i < e.length; i++) e[i].tick()
  1593. }
  1594. });
  1595. return t
  1596. }(),
  1597. Player = function () {
  1598. var t = 4,
  1599. e = 20,
  1600. n = BaseUI.extend({
  1601. render: function () {
  1602. var t = this.options,
  1603. e = this.role = t.role;
  1604. this.handle = new Panel("div", {
  1605. "class": "player-" + e
  1606. }),
  1607. this.hit = 105;
  1608. this.side = t.side;
  1609. this.reset()
  1610. },
  1611. reset: function () {
  1612. var t = this.options,
  1613. e = this.index = t.index,
  1614. n = Config.PLAYER,
  1615. i = this.role,
  1616. s = (this.width = n[i][0], this.height = n[i][1]);
  1617. this.y = App.height - (s + n.pos[e]),
  1618. this.frame = 0,
  1619. this.frameTime = 0,
  1620. this.jumpFrames = -1,
  1621. this.fallFrames = -2,
  1622. this.goSide(this.side)
  1623. },
  1624. resize: function () {
  1625. this.y = App.height - (this.height + Config.PLAYER.pos[this.index]),
  1626. this.setPos(this.x, this.y)
  1627. },
  1628. finish: function () {
  1629. this.fallFrames = e,
  1630. this.fallStep = lib.round((App.height - this.y) / e)
  1631. },
  1632. isFinished: function () {
  1633. return -1 == this.fallFrames
  1634. },
  1635. goSide: function () {
  1636. this.x = 1 == this.side ? 0 : Config.TRACK_WIDTH - this.width,
  1637. this.setPos(this.x, this.y)
  1638. },
  1639. goLeft: function () {
  1640. this.jumpFrames = t,
  1641. this.endX = 0,
  1642. this.side = 1
  1643. },
  1644. goRight: function () {
  1645. this.jumpFrames = t,
  1646. this.endX = Config.TRACK_WIDTH - this.width,
  1647. this.side = 2
  1648. },
  1649. setPos: function (t, e) {
  1650. var n = "scaleX(" + (2 == this.side ? -1 : 1) + ")";
  1651. this.handle.setStyles({
  1652. "-webkit-transform": n,
  1653. left: t,
  1654. top: e,
  1655. position: "absolute"
  1656. })
  1657. },
  1658. tick: function () {
  1659. if (this.jumpFrames >= 0 && (this.jumpStep = lib.round((Config.TRACK_WIDTH - this.width) / t), this.x += 1 == this.side ? -this.jumpStep : this.jumpStep, this.x = Math.min(Config.TRACK_WIDTH - this.width, this.x), this.x = Math.max(0, this.x), this.setPos(this.x, this.y), this.jumpFrames >= 3 && this.handle.setStyle("background-position", -(5 * this.width) + "px top"), this.jumpFrames >= 1 && this.handle.setStyle("background-position", -(6 * this.width) + "px top"), this.jumpFrames--), this.fallFrames >= 0) {
  1660. this.y += this.fallStep,
  1661. this.setPos(this.x, this.y);
  1662. var n = 2 == this.role ? 2 : 3;
  1663. if (this.fallFrames >= e - n) {
  1664. var i = -((e - this.fallFrames + 7) * this.width);
  1665. this.handle.setStyle("background-position", i + "px top")
  1666. }
  1667. this.fallFrames--
  1668. }
  1669. if (!(Date.now() - this.frameTime < 80 || 2 == App.gameStat)) {
  1670. var s = -(this.frame % 5 * this.width); -1 == this.jumpFrames && -2 == this.fallFrames && this.handle.setStyle("background-position", s + "px top"),
  1671. this.frame++,
  1672. this.frameTime = Date.now()
  1673. }
  1674. }
  1675. });
  1676. return n
  1677. }(),
  1678. Ticker = function () {
  1679. var t = new Class({
  1680. initialize: function (t) {
  1681. var e = t || {};
  1682. this.fps = e.fps || 60,
  1683. this.fn = e.fn,
  1684. this.rafEnable = e.raf,
  1685. this.start()
  1686. },
  1687. start: function () {
  1688. this.rafEnable ? this.handleRaf() : this.handleTimer()
  1689. },
  1690. handleRaf: function () {
  1691. this.id = window.requestAnimFrame(lib.bind(this.handleRaf, this), this.fps);
  1692. var t = this.fn,
  1693. e = Date.now();
  1694. e - this.startTime >= 1e3 / this.fps && (t && t(), this.startTime = e)
  1695. },
  1696. handleTimer: function () {
  1697. this.id = window.setTimeout(lib.bind(this.handleTimer, this), 1e3 / this.fps);
  1698. var t = this.fn;
  1699. t && t()
  1700. },
  1701. stop: function () {
  1702. this.rafEnable ? cancelAnimFrame(this.id) : $clear(this.id)
  1703. }
  1704. });
  1705. return t
  1706. }(),
  1707. Block = function () {
  1708. var t = BaseUI.extend({
  1709. render: function () {
  1710. var t = this.options,
  1711. e = Config,
  1712. n = this.type = lib.round(2 * Math.random()),
  1713. i = e.BLOCK[n],
  1714. s = this.width = i[0],
  1715. o = this.height = i[1],
  1716. r = this.y = 0;
  1717. this.handle = new Panel("div", {
  1718. "class": "main-png8 block-" + n
  1719. }).setStyles({
  1720. width: s,
  1721. height: o,
  1722. top: r
  1723. });
  1724. var a = this.side = t.side;
  1725. 2 == a ? this.goRight() : this.goLeft()
  1726. },
  1727. renew: function (t) {
  1728. var e = this.handle,
  1729. n = Config;
  1730. this.side = t;
  1731. var i = this.y = 0;
  1732. e.removeClass("block-" + this.type);
  1733. var s = this.type = lib.round(2 * Math.random()),
  1734. o = n.BLOCK[s],
  1735. r = this.width = o[0],
  1736. a = this.height = o[1];
  1737. return e.addClass("block-" + s).setStyles({
  1738. width: r,
  1739. height: a,
  1740. top: i,
  1741. "-webkit-transform": ""
  1742. }),
  1743. 2 == t ? this.goRight() : this.goLeft(),
  1744. this
  1745. },
  1746. goLeft: function () {
  1747. this.x = 0,
  1748. this.setPos(this.x, this.y)
  1749. },
  1750. goRight: function () {
  1751. this.x = Config.TRACK_WIDTH - this.width,
  1752. this.setPos(this.x, this.y)
  1753. },
  1754. setPos: function (t, e) {
  1755. this.handle.setStyles({
  1756. position: "absolute",
  1757. left: t,
  1758. top: e,
  1759. "-webkit-transform": "scaleX(" + (2 == this.side ? 1 : -1) + ")"
  1760. })
  1761. },
  1762. hitTest: function (t, e, n, i) {
  1763. if (isDebug && _get.noHit) return !1;
  1764. var s = this.y,
  1765. o = this.y + this.height,
  1766. r = this.x,
  1767. a = this.x + this.width;
  1768. return r > t + n - 12 ? !1 : t + 12 > a ? !1 : e + 30 > o ? !1 : s > e + i - 30 ? !1 : !0
  1769. },
  1770. reset: function () { },
  1771. tick: function () {
  1772. this.y += Config.PX_PER_FRAME,
  1773. this.setPos(this.x, this.y)
  1774. }
  1775. });
  1776. return t
  1777. }(),
  1778. Score = function () {
  1779. var t = BaseUI.extend({
  1780. render: function () {
  1781. this.handle = new NumberUI({
  1782. "class": "score score-num"
  1783. }).inject("stage"),
  1784. this.score = -1,
  1785. this.clear()
  1786. },
  1787. update: function (t, e) {
  1788. (t > this.score || e) && (this.handle.setNum(t), this.score = t)
  1789. },
  1790. clear: function () {
  1791. this.update(0, !0)
  1792. }
  1793. });
  1794. return t
  1795. }(),
  1796. Main = function () {
  1797. var t = BaseUI.extend({
  1798. binds: "start,showFriendRank,showWorldRank",
  1799. render: function () {
  1800. var t = UserManager.getInstance(),
  1801. e = this.handle = new Panel("div", {
  1802. "class": "main"
  1803. }).inject("stage");
  1804. isWanBa() || new Panel("div", {
  1805. "class": "main-png8 qq-tips"
  1806. }).inject(e),
  1807. t.getMaxScore() > 0 && new Panel("span", {
  1808. "class": "text-span"
  1809. }).set("html", "你的成绩:" + t.getMaxScore() + "层").inject(e),
  1810. this.startBtn = new Panel("a", {
  1811. "class": "main-png32 start"
  1812. }).inject(e).set("html", "开始游戏"),
  1813. /*
  1814. this.friendRankBtn = new Panel("a", {
  1815. "class": "main-png32 friend-rank"
  1816. }).inject(e).set("html", "进入酷跑历险记Ⅰ"),
  1817. this.worldRankBtn = new Panel("a", {
  1818. "class": "main-png32 world-rank"
  1819. }).inject(e).set("html", '<em class="main-png32"></em>世界榜'),
  1820. */
  1821. this.attach(),
  1822. ShareManager.getInstance().update("跑酷历险记II", t.getRDTitle())
  1823. },
  1824. resize: function () {
  1825. this.handle.setStyles({
  1826. width: 480,
  1827. height: App.height
  1828. })
  1829. },
  1830. attach: function () {
  1831. this.startBtn.addEvent("touchstart", this.start)
  1832. //this.friendRankBtn.addEvent("touchstart", this.showFriendRank),
  1833. //this.worldRankBtn.addEvent("touchstart", this.showWorldRank)
  1834. },
  1835. start: function () {
  1836. this.fireEvent("start")
  1837. },
  1838. showFriendRank: function () {
  1839. alert("1885")
  1840. },
  1841. showWorldRank: function () {
  1842. RankUI.getInstance().show(1)
  1843. }
  1844. });
  1845. return t
  1846. }(),
  1847. Result = function () {
  1848. var t,
  1849. e = [0, 3.83, 7.51, 9.56, 11.23, 17.14, 21.8, 27.98, 30.56, 35.45, 36.82, 40.34, 41.82, 44.21, 45.9, 47.59, 49.45, 50.53, 52.27, 53.11, 54.72, 55.4, 57.68, 57.69, 58.71, 69.26, 74.99, 81.37, 84.55, 87.55, 89.12, 90.82, 91.7, 92.86, 93.52, 94.29, 94.72, 95.29, 95.59, 95.99, 96.27, 96.67, 96.93, 97.27, 97.45, 97.65, 97.79, 97.97, 98.06, 98.21, 98.29, 98.43, 98.49, 98.49, 98.49, 98.56, 98.62, 98.72, 98.79, 98.86, 98.92, 98.99, 99.04, 99.08, 99.15, 99.18, 99.24, 99.26, 99.3, 99.32, 99.37, 99.38, 99.39, 99.39, 99.39, 99.42, 99.44, 99.47, 99.5, 99.53, 99.55, 99.59, 99.63, 99.66, 99.68, 99.71, 99.73, 99.74, 99.76, 99.77, 99.78, 99.8, 99.81, 99.82, 99.82, 99.83, 99.83, 99.84, 99.84, 99.85, 99.85, 99.88, 99.89, 99.89, 99.89, 99.89, 99.9, 99.9, 99.9, 99.91, 99.91, 99.91, 99.91, 99.91, 99.91, 99.92, 99.92, 99.92, 99.92, 99.92, 99.92, 99.93, 99.93, 99.93, 99.93, 99.93, 99.93, 99.94, 99.94, 99.94, 99.94, 99.94, 99.94, 99.94, 99.94, 99.94, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.95, 99.96, 99.96, 99.96, 99.96, 99.97, 99.97, 99.97, 99.97, 99.98, 99.98, 99.98, 99.99];
  1850. return t = BaseUI.extend({
  1851. binds: "back,restart,showFriendRank,showWorldRank,share,showJoin,shareTipsClick",
  1852. render: function () {
  1853. var t = this.handle = new Panel("div", {
  1854. "class": "result"
  1855. }).inject("stage"),
  1856. e = this.scrollWrapper = new Panel("div", {
  1857. "class": "scroll-wrapper"
  1858. }).inject(t),
  1859. n = this.con = new Panel("div", {
  1860. "class": "con"
  1861. }).inject(e);
  1862. this.scroll = new iScroll(e, {
  1863. bounce: !1,
  1864. vScrollbar: !1
  1865. }),
  1866. this.rankCon = new Panel("div", {
  1867. "class": "rank rank-con"
  1868. }).inject(n),
  1869. this.worldRankBtn = new Panel("a", {
  1870. "class": ""
  1871. }).inject(n).set("html", ''),
  1872. this.loseCon = new Panel("div", {
  1873. "class": "main-png8 lose-con"
  1874. }).inject(n).hide(),
  1875. this.loseMC = new Panel("div", {
  1876. "class": "lose-mv"
  1877. }).inject(n),
  1878. new Panel("div", {
  1879. "class": "main-png8 tips-mc"
  1880. }).inject(n),
  1881. this.tipsText = new Panel("div", {
  1882. "class": "tips-text"
  1883. }).inject(n),
  1884. this.winCon = new Panel("div", {
  1885. "class": "main-png8 win-con"
  1886. }).inject(n).hide(),
  1887. this.winMC = new Panel("div", {
  1888. "class": "win-mv"
  1889. }).inject(n).hide();
  1890. var i = new Panel("div", {
  1891. "class": "main-png32 score-bg"
  1892. }).inject(n);
  1893. this.score = new NumberUI({
  1894. "class": "result-num"
  1895. }).inject(n),
  1896. this.rankInfo = new Panel("span", {
  1897. "class": "rank-info"
  1898. }).inject(i),
  1899. this.weekRecord = new Panel("div", {
  1900. "class": "week-record"
  1901. }).inject(i).hide(),
  1902. this.record = new Panel("div", {
  1903. "class": "record"
  1904. }).inject(i);
  1905. var s = new Panel("div", {
  1906. "class": "btn-wrapper"
  1907. }).inject(n);
  1908. this.restartBtn = new Panel("a", {
  1909. "class": "main-png32 btn restart"
  1910. }).inject(s).set("html", "重 玩"),
  1911. this.shareBtn = new Panel("a", {
  1912. "class": "main-png32 btn share"
  1913. }).inject(s).set("html", "分 享"),
  1914. this.xyyxBtn = new Panel("a", {
  1915. "class": "xyyxBtn"
  1916. }).inject(s).set("html", ""),
  1917. this.recordIcon = new Panel("div", {
  1918. "class": "main-png8 record-icon"
  1919. }).inject(n).hide(),
  1920. // isInWeiXin() && (this.shareTips = new Panel("div", {
  1921. // "class": "main-png8 share-tips not-qq"
  1922. // }).inject(n)),
  1923. isInWeiXin() || isTouch && !_get.f ? (lib.addClass(this.restartBtn, "touch"), this.shareBtn) : lib.removeClass(this.restartBtn, "touch"),
  1924. // isInWeiXin() || (this.loseCon.style.left = "160px", this.winCon.style.left = "160px"),
  1925. /*
  1926. isWanBa() ? this.worldRankBtn.setStyle("left", "50%") : this.friendRankBtn = new Panel("a", {
  1927. "class": "main-png32 world-rank join-btn"
  1928. }).inject(n).set("html", "进入酷跑历险记Ⅰ"),
  1929. */
  1930. this.attach()
  1931. },
  1932. attach: function () {
  1933. this.restartBtn.addEvent("fastclick", this.restart),
  1934. //this.worldRankBtn.addEvent("fastclick", this.showWorldRank),
  1935. //this.friendRankBtn && this.friendRankBtn.addEvent("fastclick", this.showJoin),
  1936. this.shareBtn.addEvent("fastclick", this.share),
  1937. this.xyyxBtn.addEvent("fastclick", clickMore),
  1938. this.shareTips && this.shareTips.addEvent("fastclick", this.shareTipsClick)
  1939. },
  1940. shareTipsClick: function () { },
  1941. showJoin: function () {
  1942. alert("1986")
  1943. },
  1944. resize: function () {
  1945. this.handle.setStyles({
  1946. width: 480,
  1947. height: App.height
  1948. }),
  1949. this.scroll.refresh()
  1950. },
  1951. hide: function () {
  1952. return this.loseMC.removeClass("lose-mv"),
  1953. this.winMC.removeClass("win-mv"),
  1954. this.parent("hide")
  1955. },
  1956. show: function () {
  1957. return this.loseMC.addClass("lose-mv"),
  1958. this.winMC.addClass("win-mv"),
  1959. this.scroll.scrollTo(0, 0),
  1960. this.parent("show")
  1961. },
  1962. share: function () {
  1963. dp_share();
  1964. },
  1965. showFriendRank: function () {
  1966. RankUI.getInstance().show(2)
  1967. },
  1968. showWorldRank: function () {
  1969. RankUI.getInstance().show(1)
  1970. },
  1971. updateRankInfo: function () {
  1972. var t = e.length,
  1973. n = App.score,
  1974. i = n > t ? e[t - 1] : e[n];
  1975. this.rankInfo.set("html", "超越了" + i + "%酷跑玩家");
  1976. // dp_submitScore(App.score);
  1977. //btGame.setShare({
  1978. title: "我和千颂伊跑了" + App.score + "层,你来当继承者跑下去吧!"
  1979. //});
  1980. //btGame.playScoreMsg("你跑了"+App.score+"层,分享给小伙伴们挑战一下吧?")
  1981. },
  1982. updateRankCon: function () {
  1983. var t = 1;
  1984. this.rankCon.empty();
  1985. var e = UM.getRankInfo(),
  1986. n = UM.getNo();
  1987. if ("无排名" != n && (n = parseInt(UM.getNo())), e.pre)
  1988. for (var i = 0; i < e.pre.length; i++) {
  1989. var s = e.pre[i];
  1990. s.index = n - e.pre.length + i,
  1991. this.addItem(s),
  1992. t++
  1993. }
  1994. if (this.addItem({
  1995. openid: _get.openid,
  1996. index: n,
  1997. nick: UM.nick,
  1998. score: Math.max(UM.getMaxScore(), App.score),
  1999. figureurl: UM.figureUrl,
  2000. isMe: !0
  2001. }), e.next)
  2002. for (var i = 0; i < e.next.length; i++) {
  2003. var s = e.next[i];
  2004. s.index = n + i + 1,
  2005. this.addItem(s),
  2006. t++
  2007. }
  2008. new Panel("span", {
  2009. "class": "rank-bg bottom-item"
  2010. }).inject(this.rankCon);
  2011. this.con.style.height = 564 + 73 * t + 33 + 28 + "px",
  2012. this.scroll.refresh()
  2013. },
  2014. addItem: function (t) {
  2015. var e = new Panel("span", {
  2016. "class": "rank-bg item"
  2017. }).inject(this.rankCon);
  2018. if (t.isMe && lib.addClass(e, "me"), t.isFriend && lib.addClass(e, "friend"), t.index < 4) var n = new Panel("span", {
  2019. "class": "main-png8 order-mc rank-order" + t.index
  2020. }).inject(e);
  2021. else {
  2022. var n = new Panel("span", {
  2023. "class": "order"
  2024. }).inject(e).set("html", t.index);
  2025. n.style["font-size"] = 30 - Math.floor(2 * (t.index + "").length) + "px",
  2026. "无排名" == n.innerHTML && (n.style["font-size"] = "18px"),
  2027. "NaN" == n.innerHTML && (n.innerHTML = this.rankCount++)
  2028. }
  2029. if (new Panel("span", {
  2030. "class": "name"
  2031. }).set("html", t.nick).inject(e), new Panel("span", {
  2032. "class": "score"
  2033. }).inject(e).set("html", t.score + "层"), t.figureurl) {
  2034. var n = new Panel("img", {
  2035. "class": "figure"
  2036. }).inject(e);
  2037. n.src = t.figureurl
  2038. }
  2039. return e
  2040. },
  2041. updateScore: function (t, e, n) {
  2042. var i = t.s,
  2043. s = t.w,
  2044. o = t.r;
  2045. this.score.setNum(i),
  2046. this.weekRecord.set("html", "本周最高:" + s + "层"),
  2047. this.record.set("html", "历史最高:" + o + "层"),
  2048. recordIcon = this.recordIcon,
  2049. i >= 100 ? (this.winCon.show(), this.winMC.show(), this.loseCon.hide(), this.loseMC.hide(), this.tipsText.set("html", "小帅你好厉害")) : (this.winCon.hide(), this.winMC.hide(), this.loseCon.show(), this.loseMC.show(), this.tipsText.set("html", "人家跑不动了嘛")),
  2050. n ? recordIcon.show() : recordIcon.hide(),
  2051. this.updateRankInfo()
  2052. },
  2053. back: function () {
  2054. this.fireEvent("back")
  2055. },
  2056. restart: function () {
  2057. this.fireEvent("restart")
  2058. }
  2059. })
  2060. }(),
  2061. TimeManager = function () {
  2062. var t = null,
  2063. e = {};
  2064. e.getInstance = function () {
  2065. return t = t || new n(arguments[0])
  2066. };
  2067. var n = function (t) {
  2068. this.timeDiff = Math.floor(Date.now() / 1e3 - t)
  2069. };
  2070. return n.prototype = {
  2071. now: function () {
  2072. return Math.floor(Date.now() / 1e3) - this.timeDiff
  2073. },
  2074. getLastDayOfWeekDate: function (t, e) {
  2075. e = e || 5;
  2076. var n = new Date(1e3 * t),
  2077. i = n.getDay(),
  2078. s = e > i ? e - i : 7 - (i - e);
  2079. return new Date(n.getTime() + 24 * s * 3600 * 1e3)
  2080. },
  2081. getLastDayOfWeek: function (t, e) {
  2082. return this.getLastDayOfWeekDate(t, e).getTime()
  2083. },
  2084. getFirstDayOfWeek: function (t, e) {
  2085. return new Date(this.getLastDayOfWeek(t, e) - 6048e5).getTime()
  2086. },
  2087. pad: function (t) {
  2088. return (t > 9 ? "" : "0") + t
  2089. },
  2090. isSameWeek: function (t, e, n) {
  2091. n = n || 5;
  2092. var i = Math.min(t, e),
  2093. s = 1e3 * Math.max(t, e),
  2094. o = this.getLastDayOfWeekDate(i, n);
  2095. return o.setHours(0),
  2096. o.setMinutes(0),
  2097. o.setSeconds(0),
  2098. s <= o.getTime() && s >= o.getTime() - 6048e5
  2099. }
  2100. },
  2101. e
  2102. }(),
  2103. LocalStorage = {
  2104. get: function (t) {
  2105. var e = localStorage[t];
  2106. return e ? JSON.parse(e).data : null
  2107. },
  2108. set: function (t, e) {
  2109. var n = {
  2110. data: e
  2111. };
  2112. localStorage[t] = JSON.stringify(n)
  2113. }
  2114. },
  2115. NumberUI = function () {
  2116. var t = BaseUI.extend({
  2117. render: function () {
  2118. var t = this.options,
  2119. e = this.handle = new Panel("div");
  2120. t["class"] && e.addClass(t["class"]),
  2121. t.num && this.setNum(t.num)
  2122. },
  2123. setNum: function (t) {
  2124. for (var e = this.handle.empty(), n = new String(Math.abs(t)).split(""), i = 0; i < n.length; i++) new Panel("em", {
  2125. "class": "main-png8 num-" + n[i]
  2126. }).inject(e);
  2127. new Panel("em", {
  2128. "class": "main-png8 floor"
  2129. }).inject(e)
  2130. }
  2131. });
  2132. return t
  2133. }(),
  2134. SoundManager = function () {
  2135. var t = null,
  2136. e = {},
  2137. n = "http://app1102361494.imgcache.qzoneapp.com/app1102361494/assets/sound/";
  2138. e.getInstance = function () {
  2139. return t = t || new i
  2140. };
  2141. var i = function () {
  2142. this.initialize()
  2143. };
  2144. return i.prototype = {
  2145. initialize: function () {
  2146. (isDebug || !isWanBa()) && (n = "assets/sound/"),
  2147. this.id = 1,
  2148. this.sounds = {
  2149. bg: this.getMusicObject("11_bg_2014090101"),
  2150. bodyJump: this.getSoundObject("12_boyjump"),
  2151. girlJump: this.getSoundObject("13_girljump"),
  2152. lose: this.getSoundObject("14_lose"),
  2153. open: this.getSoundObject("15_open"),
  2154. close: this.getSoundObject("16_close"),
  2155. maxPoint: this.getSoundObject("18_maxpoint")
  2156. },
  2157. this.soundPlaying = !0,
  2158. this.openShake = !0,
  2159. void 0 != LocalStorage.get("sound") && (this.soundPlaying = LocalStorage.get("sound")),
  2160. void 0 != LocalStorage.get("openShake") && (this.openShake = LocalStorage.get("openShake")),
  2161. this.debugSound = {}, (this.isWanbarTouch() || getOS().isBadAndroid()) && (this.soundPlaying = !1, this.openShake = !1), (!isWanBa() || isDebug) && (qzoneVersion = [4, 6])
  2162. },
  2163. isWanbarTouch: function () {
  2164. return isTouch
  2165. },
  2166. getSoundObject: function (t) {
  2167. return {
  2168. id: t,
  2169. url: n + t + ".mp3",
  2170. bid: this.id++,
  2171. refresh: !1
  2172. }
  2173. },
  2174. getMusicObject: function (t) {
  2175. return {
  2176. id: t,
  2177. url: n + t + ".mp3",
  2178. bid: this.id++,
  2179. refresh: !1,
  2180. loop: 999999
  2181. }
  2182. },
  2183. preLoad: function () {
  2184. try {
  2185. if (1 == this.isWanbarTouch()) return;
  2186. var t = this.sounds;
  2187. for (var e in t) {
  2188. var n = t[e];
  2189. this.preLoadOne(n)
  2190. }
  2191. } catch (i) { }
  2192. return this
  2193. },
  2194. preLoadOne: function (t) {
  2195. try {
  2196. if (1 == this.isWanbarTouch()) return;
  2197. if (isDebug || !isWanBa()) {
  2198. if (!this.debugSound[t.id]) {
  2199. var e = document.createElement("AUDIO");
  2200. document.body.appendChild(e),
  2201. this.debugSound[t.id] = e,
  2202. e.preload = !0,
  2203. e.loop = t.loop,
  2204. e.src = t.url
  2205. }
  2206. } else QZAppExternal.preloadSound(function () { },
  2207. t)
  2208. } catch (n) { }
  2209. },
  2210. getName: function (t) {
  2211. for (var e in this.sounds)
  2212. if (this.sounds[e] == t) return e
  2213. },
  2214. playSound: function (t, e) {
  2215. if (!_get.sound && this.soundPlaying && 1 != this.isWanbarTouch() && 5 != qzoneVersion[1]) {
  2216. if (e) {
  2217. var n = this;
  2218. return void lib.delay(function () {
  2219. n.playSound(t)
  2220. },
  2221. e, this)
  2222. }
  2223. try {
  2224. isDebug || !isWanBa() ? (this.debugSound[t.id] || this.preLoadOne(t), this.debugSound[t.id].currentTime && (this.debugSound[t.id].currentTime = 0), this.debugSound[t.id].play()) : LocalStorage.get("sound") || QZAppExternal.playLocalSound(t)
  2225. } catch (i) { }
  2226. }
  2227. },
  2228. stopSound: function () {
  2229. if (1 != this.isWanbarTouch() && 5 != qzoneVersion[1]) try {
  2230. if (isDebug || !isWanBa())
  2231. for (var t in this.sounds) {
  2232. var e = this.sounds[t];
  2233. e.loop || this.debugSound[e.id].pause()
  2234. } else QZAppExternal.stopSound()
  2235. } catch (n) { }
  2236. },
  2237. playBtnSound: function () {
  2238. this.playSound(this.sounds._buttton)
  2239. },
  2240. playBackSound: function (t) {
  2241. if (!_get.sound && this.soundPlaying) try {
  2242. if (1 == this.isWanbarTouch() || 5 == qzoneVersion[1]) return;
  2243. this.stopBackSound(),
  2244. this.backgroundPlaying = !0,
  2245. isDebug || !isWanBa() ? (this.debugSound[t.id] || this.preLoadOne(t), this.debugSound[t.id].currentTime > 0 && (this.debugSound[t.id].currentTime = 0), this.debugSound[t.id].play()) : LocalStorage.get("sound") || QZAppExternal.playLocalBackSound(t),
  2246. this.lastMusic = t
  2247. } catch (e) { }
  2248. },
  2249. stopBackSound: function () {
  2250. if (this.backgroundPlaying = !1, 1 != this.isWanbarTouch() && 5 != qzoneVersion[1]) try {
  2251. isDebug || !isWanBa() ? this.lastMusic && (this.debugSound[this.lastMusic.id].pause(), this.debugSound[this.lastMusic.id].autoplay = !1) : QZAppExternal.stopBackSound()
  2252. } catch (t) { }
  2253. },
  2254. vibrate: function () { },
  2255. changeSoundSetting: function (t) {
  2256. this.soundPlaying = t,
  2257. LocalStorage.set("sound", this.soundPlaying),
  2258. t || this.stopBackSound()
  2259. },
  2260. changeShake: function (t) {
  2261. this.openShake = t,
  2262. LocalStorage.set("openShake", t)
  2263. },
  2264. shake: function () {
  2265. 1 != isTouch && 5 != qzoneVersion[1] && !isDebug && this.openShake && QZAppExternal.vibrate({
  2266. time: 1e3
  2267. })
  2268. }
  2269. },
  2270. e
  2271. }(),
  2272. GameEvent = {
  2273. LOGIN: "auth.login",
  2274. USER_SCORE: "user.score",
  2275. WEIXIN_DAU: "Weixin.dau"
  2276. },
  2277. UserManager = function () {
  2278. var t = new Class({
  2279. initialize: function () {
  2280. this.uin = 0,
  2281. this.nick = "我",
  2282. this.rankInfo = {
  2283. pre: [],
  2284. next: [],
  2285. rank: "无排名"
  2286. },
  2287. this.weekTotal = -1,
  2288. this.weekScore = {
  2289. num: 0,
  2290. lasttime: 0
  2291. }
  2292. },
  2293. fill: function (t) {
  2294. t = t || {
  2295. user: {}
  2296. };
  2297. var e = t.user;
  2298. return this.uin = e.uin || 0,
  2299. this.openId = _get.openid,
  2300. this.regTime = e.regtime,
  2301. this.figureUrl = e.figureurl,
  2302. this.barVipInfo = e.barvipinfo || {},
  2303. this.nick = e.nick || "我",
  2304. this.weekScore = e.weekscore,
  2305. this.maxScore = e.maxscore,
  2306. this.gt100 = t.gt100,
  2307. this.total = t.total,
  2308. this
  2309. },
  2310. setRankInfo: function (t) {
  2311. this.rankInfo = t,
  2312. LocalStorage.set(_get.openid + "rankinfo", t)
  2313. },
  2314. getRankInfo: function () {
  2315. return LocalStorage.get(_get.openid + "rankinfo") || this.rankInfo
  2316. },
  2317. setWeekTotal: function (t) {
  2318. this.weekTotal = t
  2319. },
  2320. getWeekTotal: function () {
  2321. return this.weekTotal
  2322. },
  2323. getNo: function () {
  2324. var t = this.getRankInfo();
  2325. return t.rank
  2326. },
  2327. setNo: function (t) {
  2328. this.No = t
  2329. },
  2330. setMaxScore: function (t) {
  2331. t <= this.getMaxScore() || (this.maxScore = t, this.openId || LocalStorage.set("climb_maxscore", t))
  2332. },
  2333. setWeekScore: function (t) {
  2334. this.weekScore = this.weekScore ? this.weekScore : {};
  2335. this.weekScore.num = t, LocalStorage.get("climb_weekscore", this.weekScore);
  2336. },
  2337. getMaxScore: function () {
  2338. return this.maxScore || LocalStorage.get("climb_maxscore") || -1
  2339. },
  2340. getWeekScore: function () {
  2341. return this.getMaxScore()
  2342. },
  2343. getRDTitle: function () {
  2344. return this.getTitle(this.getMaxScore())
  2345. },
  2346. getTitle: function (t) {
  2347. function e(t, e) {
  2348. return Math.floor(t.level) < Math.floor(e.level) ? -1 : 1
  2349. }
  2350. var n = $CacheData.base_share;
  2351. n.sort(e);
  2352. for (var i = 0; i < n.length; i++)
  2353. if (t <= n[i].level) return n[i].dec.replace("$", t);
  2354. return "???"
  2355. }
  2356. }),
  2357. e = null,
  2358. n = {};
  2359. return n.getInstance = function () {
  2360. return e = e || new t
  2361. },
  2362. n
  2363. }(),
  2364. Prop = function () {
  2365. var t = BaseUI.extend({
  2366. render: function () {
  2367. var t = (this.options, this.y = 0);
  2368. this.handle = new Panel("div", {
  2369. "class": "main-png8 prop"
  2370. }).setStyles({
  2371. top: t
  2372. })
  2373. },
  2374. setPos: function (t, e) {
  2375. this.handle.setStyle("top", e)
  2376. },
  2377. hitTest: function (t, e, n, i) {
  2378. return !1
  2379. },
  2380. reset: function () { },
  2381. tick: function () {
  2382. this.y += Config.PX_PER_FRAME,
  2383. this.setPos(this.x, this.y)
  2384. }
  2385. });
  2386. return t
  2387. }(),
  2388. BaseWindow = function () {
  2389. var t = [],
  2390. e = function (t) {
  2391. this.initialize(t)
  2392. },
  2393. n = e.prototype;
  2394. return n.initialize = function () { },
  2395. n.getElement = function (t, e, n) {
  2396. var i = document.createElement(t);
  2397. if (e && (i.className = e), n) {
  2398. var s = this.getElement("span");
  2399. s.style.width = n.w + "px",
  2400. s.style.height = n.h + "px",
  2401. lib.inject(s, i, n.x, n.y)
  2402. }
  2403. return i.show = function () {
  2404. i.style.display = "block"
  2405. },
  2406. i.hide = function () {
  2407. i.style.display = "none"
  2408. },
  2409. i
  2410. },
  2411. n.getBtn = function (t, e, n, i) {
  2412. var s = this.getElement("span", t);
  2413. if (i) {
  2414. var o = this.getElement("span");
  2415. o.style.width = i.w + "px",
  2416. o.style.height = i.h + "px",
  2417. lib.inject(o, s, i.x, i.y)
  2418. }
  2419. return s.addEventListener(App.eventClick,
  2420. function (t) {
  2421. e && e(t)
  2422. }, !1),
  2423. s
  2424. },
  2425. n.initSize = function (t, e, n, i, s) {
  2426. e = e || 0,
  2427. n = n || 0,
  2428. i = i || 480,
  2429. s = s || App.height,
  2430. t.style.top = n + "px",
  2431. t.style.left = e + "px",
  2432. t.style.width = i + "px",
  2433. t.style.height = s + "px"
  2434. },
  2435. n.show = function () {
  2436. return this.hideMask || (this.mask || (this.mask = document.createElement("div"), this.mask.className = "window_mask", this.mask.style["z-index"] = "0"), canvas.appendChild(this.mask)),
  2437. canvas.appendChild(this.handle),
  2438. canvas.style.display = "block", -1 == t.indexOf(this) && t.push(this),
  2439. this
  2440. },
  2441. n.hide = function () {
  2442. try {
  2443. this.mask && canvas.removeChild(this.mask)
  2444. } catch (e) { }
  2445. try {
  2446. this.handle && canvas.removeChild(this.handle)
  2447. } catch (e) { }
  2448. for (var n = t.indexOf(this) ; -1 != n;) t.splice(n, 1),
  2449. n = t.indexOf(this);
  2450. return this
  2451. },
  2452. n.isShow = function () {
  2453. for (var t = 20, e = this.handle.parentNode; e && "none" != e.display;) {
  2454. if (e == htmlCon) return !0;
  2455. if (e = e.parentNode, t--, 0 >= t) return !1
  2456. }
  2457. return !1
  2458. },
  2459. n.inStage = function () {
  2460. for (var t = 20, e = this.handle.parentNode; e;) {
  2461. if (e == htmlCon) return !0;
  2462. if (e = e.parentNode, t--, 0 >= t) return !1
  2463. }
  2464. return !1
  2465. },
  2466. e.hideAll = function () {
  2467. for (var e = 100; t.length > 0 && e > 0;) t[0].hide(),
  2468. e--;
  2469. t.length = 0,
  2470. htmlCon.style.display = "none",
  2471. lib.empty(htmlCon)
  2472. },
  2473. e
  2474. }(),
  2475. RankUI = function () {
  2476. var t = function (t) {
  2477. this.initialize(t)
  2478. },
  2479. e = t.prototype = new BaseWindow;
  2480. e.parentShow = e.show;
  2481. e.initialize = function () {
  2482. var t = this.handle = this.getElement("div", "rank");
  2483. t.appendChild(this.getElement("span", "bgbg")),
  2484. this.rankTab = this.getElement("span", "rank-tab");
  2485. var e = this.getElement("span", "rank-bg tab-bg");
  2486. this.tab2 = this.getBtn("tab tab2", lib.bind(this.onRank2, this), 100),
  2487. this.tab1 = this.getBtn("tab tab1", lib.bind(this.onRank1, this), 100),
  2488. this.rankTab.appendChild(e),
  2489. this.rankTab.appendChild(this.tab2),
  2490. this.rankTab.appendChild(this.tab1),
  2491. this.title = this.getElement("span", "title-text");
  2492. var n = this.scrollWrapper = this.getElement("div", "scroll-wrapper");
  2493. this.con = this.getElement("div", "con"),
  2494. t.appendChild(n),
  2495. n.appendChild(this.con),
  2496. this.scroll = new iScroll(n, {
  2497. vScrollbar: !1
  2498. }),
  2499. this.bottomMC = this.getElement("span", "rank-bg bottom-bg"),
  2500. t.appendChild(this.bottomMC),
  2501. t.appendChild(this.rankTab),
  2502. t.appendChild(this.title)
  2503. },
  2504. e.onClose = function () {
  2505. this.hide();
  2506. new Date;
  2507. (2 == fromType || 12 == fromType || -1 == App.gameStat || fromType > 1 && Date.now() >= 14107356e5) && addADFun(!1)
  2508. },
  2509. e.onShare = function () {
  2510. alert("2507");
  2511. },
  2512. e.onRank1 = function () {
  2513. this.selectTab(1)
  2514. },
  2515. e.onRank2 = function () {
  2516. this.selectTab(2)
  2517. },
  2518. e.selectTab = function (t) {
  2519. if (this.selection != t) {
  2520. this.selection = t,
  2521. 1 == t ? (lib.removeClass(this.rankTab, "select2"), lib.addClass(this.rankTab, "select1")) : (lib.removeClass(this.rankTab, "select1"), lib.addClass(this.rankTab, "select2"));
  2522. var e = TimeManager.getInstance(),
  2523. n = e.now(),
  2524. i = new Date(e.getFirstDayOfWeek(n));
  2525. i = e.pad(i.getMonth() + 1) + "." + e.pad(i.getDate());
  2526. var s = new Date(e.getLastDayOfWeek(e.now()) - 864e5);
  2527. if (s = e.pad(s.getMonth() + 1) + "." + e.pad(s.getDate()), this.con.innerHTML = '<div style="font-size:19px;color:#c1c1c1;text-align: center">正在请求数据</div>', 2 == t) {
  2528. var o = _get.openid + "friends",
  2529. r = LocalStorage.get(o);
  2530. null == r || r && n - r.time > 600 ? (null == r && (r = {}), ServerManager.getInstance().getFriend(lib.bind(function (t) {
  2531. r.data = t.friends,
  2532. r.time = n,
  2533. LocalStorage.set(o, r),
  2534. this.getFriendRank(r)
  2535. },
  2536. this))) : this.getFriendRank(r)
  2537. } else this.getWorldRank()
  2538. }
  2539. },
  2540. e.getFriendRank = function (t) {
  2541. this.title.innerHTML = "好友排行榜";
  2542. var e = TimeManager.getInstance().now(),
  2543. n = _get.openid + "friend_rank",
  2544. i = LocalStorage.get(n);
  2545. !i || i && e - i.time > 60 ? ServerManager.getInstance().getFriendRank(lib.bind(function (i) {
  2546. 100 == i.stat ? (this.con.innerHTML = "", this.addTextSpan("拉取排行数据出错,请稍后重试", 1)) : (i.time = e, LocalStorage.set(n, i), this.fillFriendData(t, i))
  2547. },
  2548. this),
  2549. function () {
  2550. this.con.innerHTML = "",
  2551. this.addTextSpan("拉取排行数据出错,请稍后重试", 1)
  2552. }) : this.fillFriendData(t, i)
  2553. },
  2554. e.fillFriendData = function (t, e) {
  2555. for (var n = e.ranklist || [], i = [], s = t.data, o = 0; o < n.length; o++) {
  2556. var r = n[o].openid;
  2557. (s[r] || r === _get.openid) && i.push(n[o])
  2558. }
  2559. if (i = lib.array.sort(i, ["score"], [1]), this.con.innerHTML = "", 0 == n.length) this.addTextSpan("好友暂无分数,快去抢占冠军吧", 1);
  2560. else {
  2561. for (var a, l, c = !1, o = 0; o < i.length; o++) {
  2562. var h = i[o],
  2563. r = h.openid;
  2564. h.index = o + 1,
  2565. h.block = h.score,
  2566. r === _get.openid ? (c = !0, h.nick = UserManager.getInstance().nick, h.figureurl = UserManager.getInstance().figureUrl, a = h) : (h.nick = s[r].nick, h.figureurl = s[r].figureurl),
  2567. h.isFriend = !0;
  2568. var d = this.addItem(h);
  2569. r === _get.openid && (l = d)
  2570. }
  2571. var u = e.selfrank_score || 0;
  2572. 0 == u && this.addTextSpan("你本周还没有成绩上榜", 1),
  2573. 0 == c && u > 0 && (this.addTextSpan("你的名次", 2),
  2574. a = {},
  2575. a.nick = UserManager.getInstance().nick, a.figureurl = UserManager.getInstance().figureUrl, a.openid = _get.openid, a.index = e.selfrank, a.score = u, a.isFriend = !0, this.addItem(a, 1))
  2576. }
  2577. var p = this.scroll;
  2578. p.refresh(),
  2579. c ? p.scrollToElement(l, 10) : p.scrollTo(0, 0)
  2580. },
  2581. e.fillWroldData = function (t) {
  2582. var e = UserManager.getInstance(),
  2583. n = t.top20;
  2584. if (this.con.innerHTML = "", this.rankCount = Math.floor(t.rank) || 21, 0 === n.length) this.addTextSpan("暂无分数,快去抢占冠军吧", 1);
  2585. else {
  2586. var i,
  2587. s,
  2588. o = !1;
  2589. if (!isWanBa() && t.rank < 21) {
  2590. n.push({
  2591. openid: _get.openid,
  2592. nick: "我",
  2593. score: e.getWeekScore(),
  2594. floor: e.getWeekScore()
  2595. });
  2596. for (var r = 0; r < n.length; r++) n[r].score = Math.floor(n[r].score);
  2597. n = lib.array.sort(n, ["score"], [1])
  2598. }
  2599. for (var a = 0, r = 0; r < n.length; r++) {
  2600. var l = n[r];
  2601. if (!(l.score >= 3e4)) {
  2602. a++;
  2603. var c = l.openid;
  2604. l.index = a,
  2605. l.people = l.score,
  2606. l.block = l.floor,
  2607. c === _get.openid && (o = !0, l.nick = UserManager.getInstance().nick, i = l, l.score = UserManager.getInstance().getWeekScore());
  2608. var h = this.addItem(l);
  2609. c === _get.openid && (s = h)
  2610. }
  2611. }
  2612. if (0 == o) {
  2613. var d = t.data || [];
  2614. if (d.length > 0) {
  2615. //this.addTextSpan("你的名次");
  2616. var u = t.rank;
  2617. if (!isWanBa()) {
  2618. d.push({
  2619. openid: _get.openid,
  2620. nick: "我",
  2621. score: e.getWeekScore(),
  2622. floor: e.getWeekScore()
  2623. });
  2624. for (var r = 0; r < d.length; r++) d[r].score = Math.floor(d[r].score);
  2625. d = lib.array.sort(d, ["score"], [1])
  2626. }
  2627. for (var p = -1, r = 0; r < d.length; r++)
  2628. if (d[r].openid === _get.openid) {
  2629. p = r;
  2630. break
  2631. }
  2632. if (-1 == p) {
  2633. u = _get.rankno || u,
  2634. d.push({
  2635. openid: _get.openid,
  2636. nick: e.nick,
  2637. figureurl: e.figureUrl,
  2638. score: e.getWeekScore()
  2639. }),
  2640. d = lib.array.sort(d, ["score"], [1]);
  2641. for (var r = 0; r < d.length; r++)
  2642. if (d[r].openid === _get.openid) {
  2643. p = r;
  2644. break
  2645. }
  2646. }
  2647. for (var r = 0; r < d.length; r++) {
  2648. var f = u - p + r;
  2649. if (!(20 >= f)) {
  2650. var l = d[r],
  2651. c = l.openid;
  2652. l.index = f,
  2653. l.people = l.score,
  2654. l.block = l.floor,
  2655. c === _get.openid && (o = !0, l.nick = e.nick, l.score = e.getWeekScore(), i = l);
  2656. var h = this.addItem(l);
  2657. c === _get.openid && (s = h)
  2658. }
  2659. }
  2660. } else this.addTextSpan("你本周还没有成绩上榜", 1)
  2661. }
  2662. }
  2663. var g = this.scroll;
  2664. g.refresh(),
  2665. o ? g.scrollToElement(s, 10) : g.scrollTo(0, 0)
  2666. },
  2667. e.getWorldRank = function () {
  2668. this.title.innerHTML = "世界排行榜";
  2669. var t = _get.openid + "world_rank",
  2670. e = LocalStorage.get(t),
  2671. n = TimeManager.getInstance().now();
  2672. if (!e || e && n - e.time > 3600) {
  2673. if (!isWanBa()) return void ServerManager.getInstance().getWeiXinRank(lib.bind(function (e) {
  2674. e.time = n,
  2675. e.top20.length > 0 && LocalStorage.set(t, e),
  2676. this.fillWroldData(e)
  2677. },
  2678. this),
  2679. function () {
  2680. this.con.innerHTML = "",
  2681. this.addTextSpan("拉取排行数据出错,请稍后重试", 1)
  2682. });
  2683. ServerManager.getInstance().getWorldRank(lib.bind(function (e) {
  2684. e.time = n,
  2685. e.top20.length > 0 && LocalStorage.set(t, e),
  2686. this.fillWroldData(e)
  2687. },
  2688. this),
  2689. function () {
  2690. this.con.innerHTML = "",
  2691. this.addTextSpan("拉取排行数据出错,请稍后重试", 1)
  2692. })
  2693. } else this.fillWroldData(e)
  2694. },
  2695. e.addLine = function () {
  2696. var t = this.getElement("span", "rank-bg line");
  2697. this.con.appendChild(t)
  2698. },
  2699. e.addItem = function (t) {
  2700. var e = this.getElement("span", "rank-bg item");
  2701. if (t.openid == _get.openid && lib.addClass(e, "me"), t.isFriend && lib.addClass(e, "friend"), t.index < 4) {
  2702. var n = this.getElement("span", "main-png8 order-mc rank-order" + t.index);
  2703. e.appendChild(n)
  2704. } else {
  2705. var n = this.getElement("span", "order");
  2706. n.innerHTML = t.index,
  2707. n.style["font-size"] = 30 - Math.floor(2 * (t.index + "").length) + "px",
  2708. e.appendChild(n),
  2709. "NaN" == n.innerHTML && (n.innerHTML = this.rankCount++)
  2710. }
  2711. var n = this.getElement("span", "name");
  2712. n.innerHTML = t.nick,
  2713. e.appendChild(n);
  2714. var n = this.getElement("span", "score");
  2715. if (n.innerHTML = t.score + "层", e.appendChild(n), t.figureurl) {
  2716. var n = this.getElement("img", "figure");
  2717. n.src = t.figureurl,
  2718. e.appendChild(n)
  2719. }
  2720. return this.con.appendChild(e),
  2721. e
  2722. },
  2723. e.addTextSpan = function (t) {
  2724. var e = this.getElement("span", "rank-bg text-item");
  2725. return e.innerHTML = t,
  2726. this.con.appendChild(e),
  2727. e
  2728. },
  2729. e.renew = function () {
  2730. this.con.innerHTML = "",
  2731. this.addItem({
  2732. openid: 123,
  2733. index: 2,
  2734. nick: "sfsdf",
  2735. score: 12,
  2736. people: 123,
  2737. isFriend: !0
  2738. }),
  2739. this.addLine(),
  2740. this.addItem({
  2741. openid: 456,
  2742. index: 5,
  2743. nick: "sfsdf2222",
  2744. score: 12,
  2745. people: 123
  2746. }),
  2747. this.addLine(),
  2748. this.addItem({
  2749. openid: 456,
  2750. index: 1999988,
  2751. nick: "sfsdf2222",
  2752. score: 12,
  2753. people: 123
  2754. }),
  2755. this.addTextSpan("还没进榜", 1),
  2756. this.addItem({
  2757. openid: 456,
  2758. index: 1988,
  2759. nick: "sfsdf2222",
  2760. score: 12,
  2761. people: 123
  2762. }),
  2763. this.title.innerHTML = "13546",
  2764. this.scroll.refresh()
  2765. },
  2766. e.resize = function () {
  2767. this.handle;
  2768. this.initSize(this.scrollWrapper, 0, 107, 480, App.height - 180),
  2769. this.scroll.refresh()
  2770. },
  2771. e.show = function (t) {
  2772. return this.parentShow(),
  2773. this.resize(),
  2774. this.selection = 0,
  2775. isWanBa() ? this.selectTab(t || 2) : (this.selectTab(1), lib.addClass(this.rankTab, "no-login"), this.tab1.hide(), this.tab2.hide()),
  2776. 0 == isAddAD && (isWanBa() || (13 == fromType || 3 == fromType || 2 == fromType || 12 == fromType) && Date.now() < 14107356e5) && addADFun(!0),
  2777. this
  2778. };
  2779. var n = {};
  2780. return n.instance = null,
  2781. n.getInstance = function () {
  2782. return null == n.instance && (n.instance = new t),
  2783. n.instance
  2784. },
  2785. n
  2786. }(),
  2787. iScroll = function (t, e) {
  2788. function n(t) {
  2789. return "" === o ? t : (t = t.charAt(0).toUpperCase() + t.substr(1), o + t)
  2790. }
  2791. var i = Math,
  2792. s = e.createElement("div").style,
  2793. o = function () {
  2794. for (var t, e = "t,webkitT,MozT,msT,OT".split(","), n = 0, i = e.length; i > n; n++)
  2795. if (t = e[n] + "ransform", t in s) return e[n].substr(0, e[n].length - 1);
  2796. return !1
  2797. }(),
  2798. r = o ? "-" + o.toLowerCase() + "-" : "",
  2799. a = n("transform"),
  2800. l = n("transitionProperty"),
  2801. c = n("transitionDuration"),
  2802. h = n("transformOrigin"),
  2803. d = n("transitionTimingFunction"),
  2804. u = n("transitionDelay"),
  2805. p = /android/gi.test(navigator.appVersion),
  2806. f = /iphone|ipad/gi.test(navigator.appVersion),
  2807. g = /hp-tablet/gi.test(navigator.appVersion),
  2808. m = n("perspective") in s,
  2809. v = "ontouchstart" in t && !g,
  2810. b = o !== !1,
  2811. S = n("transition") in s,
  2812. y = "onorientationchange" in t ? "orientationchange" : "resize",
  2813. w = v ? "touchstart" : "mousedown",
  2814. x = v ? "touchmove" : "mousemove",
  2815. k = v ? "touchend" : "mouseup",
  2816. T = v ? "touchcancel" : "mouseup",
  2817. C = function () {
  2818. if (o === !1) return !1;
  2819. var t = {
  2820. "": "transitionend",
  2821. webkit: "webkitTransitionEnd",
  2822. Moz: "transitionend",
  2823. O: "otransitionend",
  2824. ms: "MSTransitionEnd"
  2825. };
  2826. return t[o]
  2827. }(),
  2828. M = function () {
  2829. return t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.oRequestAnimationFrame || t.msRequestAnimationFrame ||
  2830. function (t) {
  2831. return setTimeout(t, 1)
  2832. }
  2833. }(),
  2834. _ = function () {
  2835. return t.cancelRequestAnimationFrame || t.webkitCancelAnimationFrame || t.webkitCancelRequestAnimationFrame || t.mozCancelRequestAnimationFrame || t.oCancelRequestAnimationFrame || t.msCancelRequestAnimationFrame || clearTimeout
  2836. }(),
  2837. E = m ? " translateZ(0)" : "",
  2838. I = function (n, i) {
  2839. var s,
  2840. o = this;
  2841. o.wrapper = "object" == typeof n ? n : e.getElementById(n),
  2842. o.wrapper.style.overflow = "hidden",
  2843. o.scroller = o.wrapper.children[0],
  2844. o.options = {
  2845. hScroll: !0,
  2846. vScroll: !0,
  2847. x: 0,
  2848. y: 0,
  2849. bounce: !0,
  2850. bounceLock: !1,
  2851. momentum: !0,
  2852. lockDirection: !0,
  2853. useTransform: !0,
  2854. useTransition: !1,
  2855. topOffset: 0,
  2856. checkDOMChanges: !1,
  2857. handleClick: !0,
  2858. hScrollbar: !0,
  2859. vScrollbar: !0,
  2860. fixedScrollbar: p,
  2861. hideScrollbar: f,
  2862. fadeScrollbar: f && m,
  2863. scrollbarClass: "",
  2864. zoom: !1,
  2865. zoomMin: 1,
  2866. zoomMax: 4,
  2867. doubleTapZoom: 2,
  2868. wheelAction: "scroll",
  2869. snap: !1,
  2870. snapThreshold: 1,
  2871. onRefresh: null,
  2872. onBeforeScrollStart: function (t) {
  2873. t.preventDefault()
  2874. },
  2875. onScrollStart: null,
  2876. onBeforeScrollMove: null,
  2877. onScrollMove: null,
  2878. onBeforeScrollEnd: null,
  2879. onScrollEnd: null,
  2880. onTouchEnd: null,
  2881. onDestroy: null,
  2882. onZoomStart: null,
  2883. onZoom: null,
  2884. onZoomEnd: null
  2885. };
  2886. for (s in i) o.options[s] = i[s];
  2887. o.x = o.options.x,
  2888. o.y = o.options.y,
  2889. o.options.useTransform = b && o.options.useTransform,
  2890. o.options.hScrollbar = o.options.hScroll && o.options.hScrollbar,
  2891. o.options.vScrollbar = o.options.vScroll && o.options.vScrollbar,
  2892. o.options.zoom = o.options.useTransform && o.options.zoom,
  2893. o.options.useTransition = S && o.options.useTransition,
  2894. o.options.zoom && p && (E = ""),
  2895. o.scroller.style[l] = o.options.useTransform ? r + "transform" : "top left",
  2896. o.scroller.style[c] = "0",
  2897. o.scroller.style[h] = "0 0",
  2898. o.options.useTransition && (o.scroller.style[d] = "cubic-bezier(0.33,0.66,0.66,1)"),
  2899. o.options.useTransform ? o.scroller.style[a] = "translate(" + o.x + "px," + o.y + "px)" + E : o.scroller.style.cssText += ";position:absolute;top:" + o.y + "px;left:" + o.x + "px",
  2900. o.options.useTransition && (o.options.fixedScrollbar = !0),
  2901. o.refresh(),
  2902. o._bind(y, t),
  2903. o._bind(w),
  2904. v || "none" != o.options.wheelAction && (o._bind("DOMMouseScroll"), o._bind("mousewheel")),
  2905. o.options.checkDOMChanges && (o.checkDOMTime = setInterval(function () {
  2906. o._checkDOMChanges()
  2907. },
  2908. 500))
  2909. };
  2910. return I.prototype = {
  2911. enabled: !0,
  2912. x: 0,
  2913. y: 0,
  2914. steps: [],
  2915. scale: 1,
  2916. currPageX: 0,
  2917. currPageY: 0,
  2918. pagesX: [],
  2919. pagesY: [],
  2920. aniTime: null,
  2921. wheelZoomCount: 0,
  2922. handleEvent: function (t) {
  2923. var e = this;
  2924. switch (t.type) {
  2925. case w:
  2926. if (!v && 0 !== t.button) return;
  2927. e._start(t);
  2928. break;
  2929. case x:
  2930. e._move(t);
  2931. break;
  2932. case k:
  2933. case T:
  2934. e._end(t);
  2935. break;
  2936. case y:
  2937. e._resize();
  2938. break;
  2939. case "DOMMouseScroll":
  2940. case "mousewheel":
  2941. e._wheel(t);
  2942. break;
  2943. case C:
  2944. e._transitionEnd(t)
  2945. }
  2946. },
  2947. _checkDOMChanges: function () {
  2948. this.moved || this.zoomed || this.animating || this.scrollerW == this.scroller.offsetWidth * this.scale && this.scrollerH == this.scroller.offsetHeight * this.scale || this.refresh()
  2949. },
  2950. _scrollbar: function (t) {
  2951. var n,
  2952. s = this;
  2953. return s[t + "Scrollbar"] ? (s[t + "ScrollbarWrapper"] || (n = e.createElement("div"), s.options.scrollbarClass ? n.className = s.options.scrollbarClass : n.style.cssText = "position:absolute;z-index:100;" + ("h" == t ? "height:7px;bottom:1px;left:2px;right:" + (s.vScrollbar ? "7" : "2") + "px" : "width:7px;bottom:" + (s.hScrollbar ? "7" : "2") + "px;top:2px;right:1px"), n.style.cssText += ";pointer-events:none;" + r + "transition-property:opacity;" + r + "transition-duration:" + (s.options.fadeScrollbar ? "350ms" : "0") + ";overflow:hidden;opacity:" + (s.options.hideScrollbar ? "0" : "1"), s.wrapper.appendChild(n), s[t + "ScrollbarWrapper"] = n, n = e.createElement("span"), s.options.scrollbarbtnClass && (n.className = s.options.scrollbarbtnClass), s.options.scrollbarClass || (n.style.cssText = "position:absolute;z-index:100;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);" + r + "background-clip:padding-box;" + r + "box-sizing:border-box;" + ("h" == t ? "height:100%" : "width:100%") + ";" + r + "border-radius:3px;border-radius:3px"), n.style.cssText += ";pointer-events:none;" + r + "transition-property:" + r + "transform;" + r + "transition-timing-function:cubic-bezier(0.33,0.66,0.66,1);" + r + "transition-duration:0;" + r + "transform: translate(0,0)" + E, s.options.useTransition && (n.style.cssText += ";" + r + "transition-timing-function:cubic-bezier(0.33,0.66,0.66,1)"), s[t + "ScrollbarWrapper"].appendChild(n), s[t + "ScrollbarIndicator"] = n), "h" == t ? (s.hScrollbarSize = s.hScrollbarWrapper.clientWidth, s.hScrollbarIndicatorSize = i.max(i.round(s.hScrollbarSize * s.hScrollbarSize / s.scrollerW), 8), s.hScrollbarIndicator.style.width = s.hScrollbarIndicatorSize + "px", s.hScrollbarMaxScroll = s.hScrollbarSize - s.hScrollbarIndicatorSize, s.hScrollbarProp = s.hScrollbarMaxScroll / s.maxScrollX) : (s.vScrollbarSize = s.vScrollbarWrapper.clientHeight, s.vScrollbarIndicatorSize = i.max(i.round(s.vScrollbarSize * s.vScrollbarSize / s.scrollerH), 8), s.vScrollbarIndicator.style.height = s.vScrollbarIndicatorSize + "px", s.vScrollbarMaxScroll = s.vScrollbarSize - s.vScrollbarIndicatorSize, s.vScrollbarProp = s.vScrollbarMaxScroll / s.maxScrollY), void s._scrollbarPos(t, !0)) : void (s[t + "ScrollbarWrapper"] && (b && (s[t + "ScrollbarIndicator"].style[a] = ""), s[t + "ScrollbarWrapper"].parentNode.removeChild(s[t + "ScrollbarWrapper"]), s[t + "ScrollbarWrapper"] = null, s[t + "ScrollbarIndicator"] = null))
  2954. },
  2955. _resize: function () {
  2956. var t = this;
  2957. setTimeout(function () {
  2958. t.refresh()
  2959. },
  2960. p ? 200 : 0)
  2961. },
  2962. _pos: function (t, e) {
  2963. this.zoomed || (t = this.hScroll ? t : 0, e = this.vScroll ? e : 0, this.options.useTransform ? this.scroller.style[a] = "translate(" + t + "px," + e + "px) scale(" + this.scale + ")" + E : (t = i.round(t), e = i.round(e), this.scroller.style.left = t + "px", this.scroller.style.top = e + "px"), this.x = t, this.y = e, this._scrollbarPos("h"), this._scrollbarPos("v"))
  2964. },
  2965. _scrollbarPos: function (t, e) {
  2966. var n,
  2967. s = this,
  2968. o = "h" == t ? s.x : s.y;
  2969. s[t + "Scrollbar"] && (o = s[t + "ScrollbarProp"] * o, 0 > o ? (s.options.fixedScrollbar || (n = s[t + "ScrollbarIndicatorSize"] + i.round(3 * o), 8 > n && (n = 8), s[t + "ScrollbarIndicator"].style["h" == t ? "width" : "height"] = n + "px"), o = 0) : o > s[t + "ScrollbarMaxScroll"] && (s.options.fixedScrollbar ? o = s[t + "ScrollbarMaxScroll"] : (n = s[t + "ScrollbarIndicatorSize"] - i.round(3 * (o - s[t + "ScrollbarMaxScroll"])), 8 > n && (n = 8), s[t + "ScrollbarIndicator"].style["h" == t ? "width" : "height"] = n + "px", o = s[t + "ScrollbarMaxScroll"] + (s[t + "ScrollbarIndicatorSize"] - n))), s[t + "ScrollbarWrapper"].style[u] = "0", s[t + "ScrollbarWrapper"].style.opacity = e && s.options.hideScrollbar ? "0" : "1", s[t + "ScrollbarIndicator"].style[a] = "translate(" + ("h" == t ? o + "px,0)" : "0," + o + "px)") + E)
  2970. },
  2971. _start: function (e) {
  2972. var n,
  2973. s,
  2974. o,
  2975. r,
  2976. l,
  2977. c = this,
  2978. h = v ? e.touches[0] : e;
  2979. c.enabled && (c.options.onBeforeScrollStart && c.options.onBeforeScrollStart.call(c, e), (c.options.useTransition || c.options.zoom) && c._transitionTime(0), c.moved = !1, c.animating = !1, c.zoomed = !1, c.distX = 0, c.distY = 0, c.absDistX = 0, c.absDistY = 0, c.dirX = 0, c.dirY = 0, c.options.zoom && v && e.touches.length > 1 && (r = i.abs(e.touches[0].pageX - e.touches[1].pageX), l = i.abs(e.touches[0].pageY - e.touches[1].pageY), c.touchesDistStart = i.sqrt(r * r + l * l), c.originX = i.abs(e.touches[0].pageX + e.touches[1].pageX - 2 * c.wrapperOffsetLeft) / 2 - c.x, c.originY = i.abs(e.touches[0].pageY + e.touches[1].pageY - 2 * c.wrapperOffsetTop) / 2 - c.y, c.options.onZoomStart && c.options.onZoomStart.call(c, e)), c.options.momentum && (c.options.useTransform ? (n = getComputedStyle(c.scroller, null)[a].replace(/[^0-9\-.,]/g, "").split(","), s = +(n[12] || n[4]), o = +(n[13] || n[5])) : (s = +getComputedStyle(c.scroller, null).left.replace(/[^0-9-]/g, ""), o = +getComputedStyle(c.scroller, null).top.replace(/[^0-9-]/g, "")), (s != c.x || o != c.y) && (c.options.useTransition ? c._unbind(C) : _(c.aniTime), c.steps = [], c._pos(s, o), c.options.onScrollEnd && c.options.onScrollEnd.call(c))), c.absStartX = c.x, c.absStartY = c.y, c.startX = c.x, c.startY = c.y, c.pointX = h.pageX, c.pointY = h.pageY, c.startTime = e.timeStamp || Date.now(), c.options.onScrollStart && c.options.onScrollStart.call(c, e), c._bind(x, t), c._bind(k, t), c._bind(T, t))
  2980. },
  2981. _move: function (t) {
  2982. var e,
  2983. n,
  2984. s,
  2985. o = this,
  2986. r = v ? t.touches[0] : t,
  2987. l = r.pageX - o.pointX,
  2988. c = r.pageY - o.pointY,
  2989. h = o.x + l,
  2990. d = o.y + c,
  2991. u = t.timeStamp || Date.now();
  2992. return o.options.onBeforeScrollMove && o.options.onBeforeScrollMove.call(o, t),
  2993. o.options.zoom && v && t.touches.length > 1 ? (e = i.abs(t.touches[0].pageX - t.touches[1].pageX), n = i.abs(t.touches[0].pageY - t.touches[1].pageY), o.touchesDist = i.sqrt(e * e + n * n), o.zoomed = !0, s = 1 / o.touchesDistStart * o.touchesDist * this.scale, s < o.options.zoomMin ? s = .5 * o.options.zoomMin * Math.pow(2, s / o.options.zoomMin) : s > o.options.zoomMax && (s = 2 * o.options.zoomMax * Math.pow(.5, o.options.zoomMax / s)), o.lastScale = s / this.scale, h = this.originX - this.originX * o.lastScale + this.x, d = this.originY - this.originY * o.lastScale + this.y, this.scroller.style[a] = "translate(" + h + "px," + d + "px) scale(" + s + ")" + E, void (o.options.onZoom && o.options.onZoom.call(o, t))) : (o.pointX = r.pageX, o.pointY = r.pageY, (h > 0 || h < o.maxScrollX) && (h = o.options.bounce ? o.x + l / 2 : h >= 0 || o.maxScrollX >= 0 ? 0 : o.maxScrollX), (d > o.minScrollY || d < o.maxScrollY) && (d = o.options.bounce ? o.y + c / 2 : d >= o.minScrollY || o.maxScrollY >= 0 ? o.minScrollY : o.maxScrollY), o.distX += l, o.distY += c, o.absDistX = i.abs(o.distX), o.absDistY = i.abs(o.distY), void (o.absDistX < 6 && o.absDistY < 6 || (o.options.lockDirection && (o.absDistX > o.absDistY + 5 ? (d = o.y, c = 0) : o.absDistY > o.absDistX + 5 && (h = o.x, l = 0)), o.moved = !0, o._pos(h, d), o.dirX = l > 0 ? -1 : 0 > l ? 1 : 0, o.dirY = c > 0 ? -1 : 0 > c ? 1 : 0, u - o.startTime > 300 && (o.startTime = u, o.startX = o.x, o.startY = o.y), o.options.onScrollMove && o.options.onScrollMove.call(o, t))))
  2994. },
  2995. _end: function (n) {
  2996. if (!v || 0 === n.touches.length) {
  2997. var s,
  2998. o,
  2999. r,
  3000. l,
  3001. h,
  3002. d,
  3003. u,
  3004. p = this,
  3005. f = v ? n.changedTouches[0] : n,
  3006. g = {
  3007. dist: 0,
  3008. time: 0
  3009. },
  3010. m = {
  3011. dist: 0,
  3012. time: 0
  3013. },
  3014. b = (n.timeStamp || Date.now()) - p.startTime,
  3015. S = p.x,
  3016. y = p.y;
  3017. if (p._unbind(x, t), p._unbind(k, t), p._unbind(T, t), p.options.onBeforeScrollEnd && p.options.onBeforeScrollEnd.call(p, n), p.zoomed) return u = p.scale * p.lastScale,
  3018. u = Math.max(p.options.zoomMin, u),
  3019. u = Math.min(p.options.zoomMax, u),
  3020. p.lastScale = u / p.scale,
  3021. p.scale = u,
  3022. p.x = p.originX - p.originX * p.lastScale + p.x,
  3023. p.y = p.originY - p.originY * p.lastScale + p.y,
  3024. p.scroller.style[c] = "200ms",
  3025. p.scroller.style[a] = "translate(" + p.x + "px," + p.y + "px) scale(" + p.scale + ")" + E,
  3026. p.zoomed = !1,
  3027. p.refresh(),
  3028. void (p.options.onZoomEnd && p.options.onZoomEnd.call(p, n));
  3029. if (!p.moved) return v && (p.doubleTapTimer && p.options.zoom ? (clearTimeout(p.doubleTapTimer), p.doubleTapTimer = null, p.options.onZoomStart && p.options.onZoomStart.call(p, n), p.zoom(p.pointX, p.pointY, 1 == p.scale ? p.options.doubleTapZoom : 1), p.options.onZoomEnd && setTimeout(function () {
  3030. p.options.onZoomEnd.call(p, n)
  3031. },
  3032. 200)) : this.options.handleClick && (p.doubleTapTimer = setTimeout(function () {
  3033. for (p.doubleTapTimer = null, s = f.target; 1 != s.nodeType;) s = s.parentNode;
  3034. "SELECT" != s.tagName && "INPUT" != s.tagName && "TEXTAREA" != s.tagName && (o = e.createEvent("MouseEvents"), o.initMouseEvent("click", !0, !0, n.view, 1, f.screenX, f.screenY, f.clientX, f.clientY, n.ctrlKey, n.altKey, n.shiftKey, n.metaKey, 0, null), o._fake = !0, s.dispatchEvent(o))
  3035. },
  3036. p.options.zoom ? 250 : 0))),
  3037. p._resetPos(400),
  3038. void (p.options.onTouchEnd && p.options.onTouchEnd.call(p, n));
  3039. if (300 > b && p.options.momentum && (g = S ? p._momentum(S - p.startX, b, -p.x, p.scrollerW - p.wrapperW + p.x, p.options.bounce ? p.wrapperW : 0) : g, m = y ? p._momentum(y - p.startY, b, -p.y, p.maxScrollY < 0 ? p.scrollerH - p.wrapperH + p.y - p.minScrollY : 0, p.options.bounce ? p.wrapperH : 0) : m, S = p.x + g.dist, y = p.y + m.dist, (p.x > 0 && S > 0 || p.x < p.maxScrollX && S < p.maxScrollX) && (g = {
  3040. dist: 0,
  3041. time: 0
  3042. }), (p.y > p.minScrollY && y > p.minScrollY || p.y < p.maxScrollY && y < p.maxScrollY) && (m = {
  3043. dist: 0,
  3044. time: 0
  3045. })), g.dist || m.dist) return h = i.max(i.max(g.time, m.time), 10),
  3046. p.options.snap && (r = S - p.absStartX, l = y - p.absStartY, i.abs(r) < p.options.snapThreshold && i.abs(l) < p.options.snapThreshold ? p.scrollTo(p.absStartX, p.absStartY, 200) : (d = p._snap(S, y), S = d.x, y = d.y, h = i.max(d.time, h))),
  3047. p.scrollTo(i.round(S), i.round(y), h),
  3048. void (p.options.onTouchEnd && p.options.onTouchEnd.call(p, n));
  3049. if (p.options.snap) return r = S - p.absStartX,
  3050. l = y - p.absStartY,
  3051. i.abs(r) < p.options.snapThreshold && i.abs(l) < p.options.snapThreshold ? p.scrollTo(p.absStartX, p.absStartY, 200) : (d = p._snap(p.x, p.y), (d.x != p.x || d.y != p.y) && p.scrollTo(d.x, d.y, d.time)),
  3052. void (p.options.onTouchEnd && p.options.onTouchEnd.call(p, n));
  3053. p._resetPos(200),
  3054. p.options.onTouchEnd && p.options.onTouchEnd.call(p, n)
  3055. }
  3056. },
  3057. _resetPos: function (t) {
  3058. var e = this,
  3059. n = e.x >= 0 ? 0 : e.x < e.maxScrollX ? e.maxScrollX : e.x,
  3060. i = e.y >= e.minScrollY || e.maxScrollY > 0 ? e.minScrollY : e.y < e.maxScrollY ? e.maxScrollY : e.y;
  3061. return n == e.x && i == e.y ? (e.moved && (e.moved = !1, e.options.onScrollEnd && e.options.onScrollEnd.call(e)), e.hScrollbar && e.options.hideScrollbar && ("webkit" == o && (e.hScrollbarWrapper.style[u] = "300ms"), e.hScrollbarWrapper.style.opacity = "0"), void (e.vScrollbar && e.options.hideScrollbar && ("webkit" == o && (e.vScrollbarWrapper.style[u] = "300ms"), e.vScrollbarWrapper.style.opacity = "0"))) : void e.scrollTo(n, i, t || 0)
  3062. },
  3063. _wheel: function (t) {
  3064. var e,
  3065. n,
  3066. i,
  3067. s,
  3068. o,
  3069. r = this;
  3070. if ("wheelDeltaX" in t) e = t.wheelDeltaX / 12,
  3071. n = t.wheelDeltaY / 12;
  3072. else if ("wheelDelta" in t) e = n = t.wheelDelta / 12;
  3073. else {
  3074. if (!("detail" in t)) return;
  3075. e = n = 3 * -t.detail
  3076. }
  3077. return "zoom" == r.options.wheelAction ? (o = r.scale * Math.pow(2, 1 / 3 * (n ? n / Math.abs(n) : 0)), o < r.options.zoomMin && (o = r.options.zoomMin), o > r.options.zoomMax && (o = r.options.zoomMax), void (o != r.scale && (!r.wheelZoomCount && r.options.onZoomStart && r.options.onZoomStart.call(r, t), r.wheelZoomCount++, r.zoom(t.pageX, t.pageY, o, 400), setTimeout(function () {
  3078. r.wheelZoomCount--, !r.wheelZoomCount && r.options.onZoomEnd && r.options.onZoomEnd.call(r, t)
  3079. },
  3080. 400)))) : (i = r.x + e, s = r.y + n, i > 0 ? i = 0 : i < r.maxScrollX && (i = r.maxScrollX), s > r.minScrollY ? s = r.minScrollY : s < r.maxScrollY && (s = r.maxScrollY), void (r.maxScrollY < 0 && r.scrollTo(i, s, 0)))
  3081. },
  3082. _transitionEnd: function (t) {
  3083. var e = this;
  3084. t.target == e.scroller && (e._unbind(C), e._startAni())
  3085. },
  3086. _startAni: function () {
  3087. var t,
  3088. e,
  3089. n,
  3090. s = this,
  3091. o = s.x,
  3092. r = s.y,
  3093. a = Date.now();
  3094. if (!s.animating) {
  3095. if (!s.steps.length) return void s._resetPos(400);
  3096. if (t = s.steps.shift(), t.x == o && t.y == r && (t.time = 0), s.animating = !0, s.moved = !0, s.options.useTransition) return s._transitionTime(t.time),
  3097. s._pos(t.x, t.y),
  3098. s.animating = !1,
  3099. void (t.time ? s._bind(C) : s._resetPos(0));
  3100. n = function () {
  3101. var l,
  3102. c,
  3103. h = Date.now();
  3104. return h >= a + t.time ? (s._pos(t.x, t.y), s.animating = !1, s.options.onAnimationEnd && s.options.onAnimationEnd.call(s), void s._startAni()) : (h = (h - a) / t.time - 1, e = i.sqrt(1 - h * h), l = (t.x - o) * e + o, c = (t.y - r) * e + r, s._pos(l, c), void (s.animating && (s.aniTime = M(n))))
  3105. },
  3106. n()
  3107. }
  3108. },
  3109. _transitionTime: function (t) {
  3110. t += "ms",
  3111. this.scroller.style[c] = t,
  3112. this.hScrollbar && (this.hScrollbarIndicator.style[c] = t),
  3113. this.vScrollbar && (this.vScrollbarIndicator.style[c] = t)
  3114. },
  3115. _momentum: function (t, e, n, s, o) {
  3116. var r = 6e-4,
  3117. a = i.abs(t) / e,
  3118. l = a * a / (2 * r),
  3119. c = 0,
  3120. h = 0;
  3121. return t > 0 && l > n ? (h = o / (6 / (l / a * r)), n += h, a = a * n / l, l = n) : 0 > t && l > s && (h = o / (6 / (l / a * r)), s += h, a = a * s / l, l = s),
  3122. l *= 0 > t ? -1 : 1,
  3123. c = a / r, {
  3124. dist: l,
  3125. time: i.round(c)
  3126. }
  3127. },
  3128. _offset: function (t) {
  3129. for (var e = -t.offsetLeft, n = -t.offsetTop; t = t.offsetParent;) e -= t.offsetLeft,
  3130. n -= t.offsetTop;
  3131. return t != this.wrapper && (e *= this.scale, n *= this.scale), {
  3132. left: e,
  3133. top: n
  3134. }
  3135. },
  3136. _snap: function (t, e) {
  3137. var n,
  3138. s,
  3139. o,
  3140. r,
  3141. a,
  3142. l,
  3143. c = this;
  3144. for (o = c.pagesX.length - 1, n = 0, s = c.pagesX.length; s > n; n++)
  3145. if (t >= c.pagesX[n]) {
  3146. o = n;
  3147. break
  3148. }
  3149. for (o == c.currPageX && o > 0 && c.dirX < 0 && o--, t = c.pagesX[o], a = i.abs(t - c.pagesX[c.currPageX]), a = a ? i.abs(c.x - t) / a * 500 : 0, c.currPageX = o, o = c.pagesY.length - 1, n = 0; o > n; n++)
  3150. if (e >= c.pagesY[n]) {
  3151. o = n;
  3152. break
  3153. }
  3154. return o == c.currPageY && o > 0 && c.dirY < 0 && o--,
  3155. e = c.pagesY[o],
  3156. l = i.abs(e - c.pagesY[c.currPageY]),
  3157. l = l ? i.abs(c.y - e) / l * 500 : 0,
  3158. c.currPageY = o,
  3159. r = i.round(i.max(a, l)) || 200, {
  3160. x: t,
  3161. y: e,
  3162. time: r
  3163. }
  3164. },
  3165. _bind: function (t, e, n) {
  3166. (e || this.scroller).addEventListener(t, this, !!n)
  3167. },
  3168. _unbind: function (t, e, n) {
  3169. (e || this.scroller).removeEventListener(t, this, !!n)
  3170. },
  3171. destroy: function () {
  3172. var e = this;
  3173. e.scroller.style[a] = "",
  3174. e.hScrollbar = !1,
  3175. e.vScrollbar = !1,
  3176. e._scrollbar("h"),
  3177. e._scrollbar("v"),
  3178. e._unbind(y, t),
  3179. e._unbind(w),
  3180. e._unbind(x, t),
  3181. e._unbind(k, t),
  3182. e._unbind(T, t),
  3183. e.options.hasTouch || (e._unbind("DOMMouseScroll"), e._unbind("mousewheel")),
  3184. e.options.useTransition && e._unbind(C),
  3185. e.options.checkDOMChanges && clearInterval(e.checkDOMTime),
  3186. e.options.onDestroy && e.options.onDestroy.call(e)
  3187. },
  3188. refresh: function () {
  3189. var t,
  3190. e,
  3191. n,
  3192. s,
  3193. o = this,
  3194. r = 0,
  3195. a = 0;
  3196. if (o.scale < o.options.zoomMin && (o.scale = o.options.zoomMin), o.wrapperW = o.wrapper.clientWidth || 1, o.wrapperH = o.wrapper.clientHeight - 30 || 1, o.minScrollY = -o.options.topOffset || 0, o.scrollerW = i.round(o.scroller.offsetWidth * o.scale), o.scrollerH = i.round((o.scroller.offsetHeight + o.minScrollY) * o.scale), o.maxScrollX = o.wrapperW - o.scrollerW, o.maxScrollY = o.wrapperH - o.scrollerH + o.minScrollY, o.dirX = 0, o.dirY = 0, o.options.onRefresh && o.options.onRefresh.call(o), o.hScroll = o.options.hScroll && o.maxScrollX < 0, o.vScroll = o.options.vScroll && (!o.options.bounceLock && !o.hScroll || o.scrollerH > o.wrapperH), o.hScrollbar = o.hScroll && o.options.hScrollbar, o.vScrollbar = o.vScroll && o.options.vScrollbar && o.scrollerH > o.wrapperH, t = o._offset(o.wrapper), o.wrapperOffsetLeft = -t.left, o.wrapperOffsetTop = -t.top, "string" == typeof o.options.snap)
  3197. for (o.pagesX = [], o.pagesY = [], s = o.scroller.querySelectorAll(o.options.snap), e = 0, n = s.length; n > e; e++) r = o._offset(s[e]),
  3198. r.left += o.wrapperOffsetLeft,
  3199. r.top += o.wrapperOffsetTop,
  3200. o.pagesX[e] = r.left < o.maxScrollX ? o.maxScrollX : r.left * o.scale,
  3201. o.pagesY[e] = r.top < o.maxScrollY ? o.maxScrollY : r.top * o.scale;
  3202. else if (o.options.snap) {
  3203. for (o.pagesX = []; r >= o.maxScrollX;) o.pagesX[a] = r,
  3204. r -= o.wrapperW,
  3205. a++;
  3206. for (o.maxScrollX % o.wrapperW && (o.pagesX[o.pagesX.length] = o.maxScrollX - o.pagesX[o.pagesX.length - 1] + o.pagesX[o.pagesX.length - 1]), r = 0, a = 0, o.pagesY = []; r >= o.maxScrollY;) o.pagesY[a] = r,
  3207. r -= o.wrapperH,
  3208. a++;
  3209. o.maxScrollY % o.wrapperH && (o.pagesY[o.pagesY.length] = o.maxScrollY - o.pagesY[o.pagesY.length - 1] + o.pagesY[o.pagesY.length - 1])
  3210. }
  3211. o._scrollbar("h"),
  3212. o._scrollbar("v"),
  3213. o.zoomed || (o.scroller.style[c] = "0", o._resetPos(400))
  3214. },
  3215. scrollTo: function (t, e, n, i) {
  3216. var s,
  3217. o,
  3218. r = this,
  3219. a = t;
  3220. for (r.stop(), a.length || (a = [{
  3221. x: t,
  3222. y: e,
  3223. time: n,
  3224. relative: i
  3225. }]), s = 0, o = a.length; o > s; s++) a[s].relative && (a[s].x = r.x - a[s].x, a[s].y = r.y - a[s].y),
  3226. r.steps.push({
  3227. x: a[s].x,
  3228. y: a[s].y,
  3229. time: a[s].time || 0
  3230. });
  3231. r._startAni()
  3232. },
  3233. scrollToElement: function (t, e) {
  3234. var n,
  3235. s = this;
  3236. t = t.nodeType ? t : s.scroller.querySelector(t),
  3237. t && (n = s._offset(t), n.left += s.wrapperOffsetLeft, n.top += s.wrapperOffsetTop, n.left = n.left > 0 ? 0 : n.left < s.maxScrollX ? s.maxScrollX : n.left, n.top = n.top > s.minScrollY ? s.minScrollY : n.top < s.maxScrollY ? s.maxScrollY : n.top, e = void 0 === e ? i.max(2 * i.abs(n.left), 2 * i.abs(n.top)) : e, s.scrollTo(n.left, n.top, e))
  3238. },
  3239. scrollToPage: function (t, e, n) {
  3240. var i,
  3241. s,
  3242. o = this;
  3243. n = void 0 === n ? 400 : n,
  3244. o.options.onScrollStart && o.options.onScrollStart.call(o),
  3245. o.options.snap ? (t = "next" == t ? o.currPageX + 1 : "prev" == t ? o.currPageX - 1 : t, e = "next" == e ? o.currPageY + 1 : "prev" == e ? o.currPageY - 1 : e, t = 0 > t ? 0 : t > o.pagesX.length - 1 ? o.pagesX.length - 1 : t, e = 0 > e ? 0 : e > o.pagesY.length - 1 ? o.pagesY.length - 1 : e, o.currPageX = t, o.currPageY = e, i = o.pagesX[t], s = o.pagesY[e]) : (i = -o.wrapperW * t, s = -o.wrapperH * e, i < o.maxScrollX && (i = o.maxScrollX), s < o.maxScrollY && (s = o.maxScrollY)),
  3246. o.scrollTo(i, s, n)
  3247. },
  3248. disable: function () {
  3249. this.stop(),
  3250. this._resetPos(0),
  3251. this.enabled = !1,
  3252. this._unbind(x, t),
  3253. this._unbind(k, t),
  3254. this._unbind(T, t)
  3255. },
  3256. enable: function () {
  3257. this.enabled = !0
  3258. },
  3259. stop: function () {
  3260. this.options.useTransition ? this._unbind(C) : _(this.aniTime),
  3261. this.steps = [],
  3262. this.moved = !1,
  3263. this.animating = !1
  3264. },
  3265. zoom: function (t, e, n, i) {
  3266. var s = this,
  3267. o = n / s.scale;
  3268. s.options.useTransform && (s.zoomed = !0, i = void 0 === i ? 200 : i, t = t - s.wrapperOffsetLeft - s.x, e = e - s.wrapperOffsetTop - s.y, s.x = t - t * o + s.x, s.y = e - e * o + s.y, s.scale = n, s.refresh(), s.x = s.x > 0 ? 0 : s.x < s.maxScrollX ? s.maxScrollX : s.x, s.y = s.y > s.minScrollY ? s.minScrollY : s.y < s.maxScrollY ? s.maxScrollY : s.y, s.scroller.style[c] = i + "ms", s.scroller.style[a] = "translate(" + s.x + "px," + s.y + "px) scale(" + n + ")" + E, s.zoomed = !1)
  3269. },
  3270. isReady: function () {
  3271. return !this.moved && !this.zoomed && !this.animating
  3272. }
  3273. },
  3274. s = null,
  3275. "undefined" != typeof exports ? exports.iScroll = I : t.iScroll = I,
  3276. I
  3277. }(window, document),
  3278. ServerManager = function () {
  3279. var t,
  3280. e = function () {
  3281. this.initialize()
  3282. },
  3283. n = e.prototype = {};
  3284. n.initialize = function () {
  3285. this.gamePlaying = !1,
  3286. t = UserManager.getInstance(),
  3287. t.haveLogin = !0,
  3288. this.auth_login = "auth.login",
  3289. this.user_score = "user.score",
  3290. this.user_saveProgress = "user.saveProgress",
  3291. this.rank_getWbRank = "rank.getWbRank",
  3292. this.rank_getFriends = "rank.getFriends",
  3293. this.rank_getRank = "rank.getRank",
  3294. this.shop_diamond = "shop.diamond",
  3295. this.Weixin_dau = "Weixin.dau",
  3296. this.weixin_getRank = "weixin.getRank",
  3297. this.video_save = "video.save",
  3298. this.video_get = "video.get"
  3299. },
  3300. n.saveVideo = function (t, e) {
  3301. var n = JSON.stringify(t);
  3302. post(this.video_save, {
  3303. video: n
  3304. },
  3305. function (t) {
  3306. t = JSON.parse(t).data,
  3307. e(t.id)
  3308. })
  3309. },
  3310. n.getVideo = function (t, e) {
  3311. post(this.video_get, {
  3312. id: t
  3313. },
  3314. function (n) {
  3315. n = JSON.parse(n).data,
  3316. n.video ? (n = JSON.parse(n.video), n.key = t, e(n)) : e()
  3317. })
  3318. },
  3319. n.dau = function (e) {
  3320. isWanBa() || (e.uin = t.uin, post(this.Weixin_dau, e,
  3321. function (t) {
  3322. t = JSON.parse(t).data
  3323. }))
  3324. },
  3325. n.getWeiXinRank = function (e) {
  3326. if (!isWanBa()) {
  3327. var n = {};
  3328. n.score = t.getWeekScore(),
  3329. n.uin = t.uin,
  3330. post(this.weixin_getRank, n, e)
  3331. }
  3332. },
  3333. n.login = function (e) {
  3334. var n = {};
  3335. post(this.auth_login, n,
  3336. function (n) {
  3337. if (n = JSON.parse(n).data, n.notlogin) return void AlarmUI.getInstance().show("用户未登陆!");
  3338. t.total = n.total,
  3339. t.gt100 = n.gt100;
  3340. var i = n.user;
  3341. t.openid = i.openid,
  3342. t.nick = i.nick,
  3343. t.figureurl = i.figureurl,
  3344. t.weekscore = i.weekscore,
  3345. t.maxscore = i.maxscore,
  3346. t.uin = "" + i.uin,
  3347. t.haveLogin = !0,
  3348. t.barVipInfo = i.barvipinfo || {},
  3349. n.isguess && (_get.openid = i.openid, ShareObjectManager.getInstance().setValue(Config.GuessKey, i.openid)),
  3350. ShareObjectManager.getInstance().setMyOpenID(),
  3351. TimeManager.getInstance().init(i.lastlogintime),
  3352. e && e()
  3353. },
  3354. function () { })
  3355. },
  3356. n.score = function (e, n) {
  3357. var i = "1",
  3358. s = {};
  3359. s.score = e,
  3360. this["totalPeople" + i] || (s.total = 1);
  3361. var o = this,
  3362. r = function (t) {
  3363. t = JSON.parse(t).data,
  3364. t.total && (o["totalPeople" + i] = Number(t.total)),
  3365. o["totalPeople" + i] = Math.max(o["totalPeople" + i], Number(t.rank)),
  3366. n(((o["totalPeople" + i] - Number(t.rank)) / o["totalPeople" + i] * 100).toFixed(1))
  3367. };
  3368. if (t.haveLogin) post(this.user_score, s, r);
  3369. else {
  3370. var a = {};
  3371. 2 == i ? a.score1 = money : a.score = money,
  3372. s.total && (a.total = s.total),
  3373. this.dau(a, r)
  3374. }
  3375. },
  3376. n.saveProgress = function (e) {
  3377. if (t.saveData(), t.haveLogin) {
  3378. var n = {};
  3379. n.progress = e,
  3380. post(this.user_saveProgress, n)
  3381. }
  3382. },
  3383. n.getFriend = function (e) {
  3384. if (t.haveLogin) {
  3385. var n = {};
  3386. post(this.rank_getFriends, n, e)
  3387. }
  3388. },
  3389. n.getFriendRank = function (e) {
  3390. if (t.haveLogin) {
  3391. var n = {};
  3392. n.p = 1,
  3393. post(this.rank_getWbRank, n, e)
  3394. }
  3395. },
  3396. n.getWorldRank = function (e) {
  3397. if (t.haveLogin) {
  3398. var n = {};
  3399. post(this.rank_getRank, n, e)
  3400. }
  3401. },
  3402. n.buy = function (e, n) {
  3403. var i = {};
  3404. i.id = e,
  3405. 4 == e ? (i.id = 4, i.zoneid = 3) : 5 == e && (i.id = 4, i.zoneid = 4);
  3406. var s = getOS().isAndroid ? 1 : 2;
  3407. post(this.shop_diamond, i,
  3408. function (i) {
  3409. if (i = JSON.parse(i), 0 == i.stat) n && n();
  3410. else if (1004 == i.stat) try {
  3411. var o = t.barVipInfo,
  3412. r = {
  3413. is_vip: o.is_vip,
  3414. openkey: _get.openkey,
  3415. openid: _get.openid,
  3416. appid: 1101730351,
  3417. score: o.score,
  3418. zoneid: s
  3419. };
  3420. r.defaultScore = Config.Prop[e],
  3421. window.__paySuccess = function () { },
  3422. console.log(r),
  3423. window.popPayTips(r)
  3424. } catch (a) {
  3425. alert(a)
  3426. } else alert("网络异常,请稍后重试。")
  3427. })
  3428. };
  3429. var i = {},
  3430. s = null;
  3431. return i.getInstance = function () {
  3432. return null == s && (s = new e),
  3433. s
  3434. },
  3435. i
  3436. }(),
  3437. Floor100 = function () {
  3438. var t = BaseUI.extend({
  3439. binds: "goOn,giveUp,share",
  3440. render: function () {
  3441. var t = this.handle = new Panel("div", {
  3442. "class": "floor100"
  3443. }).inject("stage");
  3444. this.icon100 = new Panel("div", {
  3445. "class": "main-png8 icon100"
  3446. }).inject(t),
  3447. this.continueBtn = new Panel("div", {
  3448. "class": "main-png32 continue"
  3449. }).inject(t).set("html", "继续游戏");
  3450. var e = "share-tips not-qq";
  3451. this.shareTips = new Panel("div", {
  3452. "class": "main-png8 " + e
  3453. }).inject(t),
  3454. this.attach()
  3455. },
  3456. attach: function () {
  3457. this.continueBtn.addEvent("fastclick", this.goOn),
  3458. this.shareTips.addEvent("fastclick", this.share)
  3459. },
  3460. goOn: function () {
  3461. this.fireEvent("continue"),
  3462. this.hide()
  3463. },
  3464. share: function () {
  3465. isInQQ() ? ShareQQUI.getInstance().show() : qzoneShare()
  3466. },
  3467. giveUp: function () { }
  3468. });
  3469. return t
  3470. }(),
  3471. ShareManager = function () {
  3472. var t = function () { },
  3473. e = function () {
  3474. this.initialize()
  3475. };
  3476. e.prototype = {
  3477. initialize: function () {
  3478. this.defaultShareInfo = {
  3479. // img_url: "http://img.59600.com/icon/150/8596175.png",
  3480. img_width: 150,
  3481. img_height: 150,
  3482. // link: "http://weixin.59600.com/wan/lovers-jump/",
  3483. desc: "我和千颂伊玩跑酷!停是肯定停不下来的,除了你那个不行!",
  3484. title: "我和千颂伊玩跑酷,你来当继承者跑下去吧!"
  3485. },
  3486. this.qqShareInfo = {
  3487. // link: "http://weixin.59600.com/wan/lovers-jump/",
  3488. // share_url: "http://weixin.59600.com/wan/lovers-jump/",
  3489. title: "我和千颂伊跑了'+App.score+'层,你来当继承者跑下去吧!",
  3490. desc: "我和千颂伊玩跑酷!停是肯定停不下来的,除了你那个不行!",
  3491. // image_url: "http://img.59600.com/icon/150/8596175.png"
  3492. },
  3493. this.reset(),
  3494. this.shareInit = lib.bind(this.shareInit, this),
  3495. "object" == typeof WeixinJSBridge && "function" == typeof WeixinJSBridge.invoke ? this.shareInit() : document.addEventListener ? document.addEventListener("WeixinJSBridgeReady", this.shareInit, !1) : document.attachEvent && (document.attachEvent("WeixinJSBridgeReady", this.shareInit), document.attachEvent("onWeixinJSBridgeReady", this.shareInit)),
  3496. this.onFailure = t,
  3497. this.onSuccess = t,
  3498. this.onCancel = t
  3499. },
  3500. setCallBack: function (e, n, i) {
  3501. return this.onFailure = i || t,
  3502. this.onSuccess = e || t,
  3503. this.onCancel = n || t,
  3504. this
  3505. },
  3506. shareInit: function () {
  3507. var t = this.groupShareInfo,
  3508. e = this.friendShareInfo,
  3509. n = this;
  3510. },
  3511. reset: function () {
  3512. var t = {},
  3513. e = {},
  3514. n = this.defaultShareInfo;
  3515. for (var i in n) t[i] = n[i],
  3516. e[i] = n[i];
  3517. return this.groupShareInfo = e,
  3518. this.friendShareInfo = t,
  3519. this
  3520. },
  3521. update: function (t, e, n) {
  3522. var i = this.groupShareInfo,
  3523. s = this.friendShareInfo,
  3524. o = this.qqShareInfo;
  3525. o.title = t,
  3526. o.desc = e,
  3527. t && (s.title = t),
  3528. e && (i.title = i.desc = e, s.desc = e),
  3529. n && (i.img_url = n, s.img_url = n, o.image_url = n);
  3530. try {
  3531. mqq.data.setShareInfo(o)
  3532. } catch (r) { }
  3533. return this
  3534. },
  3535. shareVedio: function (t) {
  3536. var e = this.groupShareInfo,
  3537. n = this.defaultShareInfo.link,
  3538. i = this.friendShareInfo;
  3539. return t ? (e.link = n + "&vedio=" + t, i.link = n + "&vedio=" + t) : (e.link = n, i.link = n),
  3540. this
  3541. }
  3542. };
  3543. var n = {},
  3544. i = null;
  3545. return n.getInstance = function () {
  3546. return i = i || new e
  3547. },
  3548. n
  3549. }(),
  3550. $CacheData = {
  3551. base_share: [{
  3552. id: "999998",
  3553. level: "40",
  3554. dec: "跑了$层,分享给小伙伴们挑战一下吧?"
  3555. }, {
  3556. id: "109",
  3557. level: "999999",
  3558. dec: "跑了$层,分享给小伙伴们挑战一下吧?"
  3559. }]
  3560. },
  3561. ShareQQUI = function () {
  3562. var t = BaseUI.extend({
  3563. binds: "hide,onClick1,onClick2,onClick3,onClick4",
  3564. render: function () {
  3565. var t = this.handle = new Panel("div", {
  3566. "class": "share-qq"
  3567. }).inject("stage");
  3568. this.btn1 = new Panel("div", {
  3569. "class": "share-qq-btn btn1"
  3570. }).set("html", "分享到空间").inject(t),
  3571. this.btn2 = new Panel("div", {
  3572. "class": "share-qq-btn btn2"
  3573. }).set("html", "分享到朋友圈").inject(t),
  3574. this.btn3 = new Panel("div", {
  3575. "class": "share-qq-btn btn3"
  3576. }).set("html", "分享到好友").inject(t),
  3577. this.btn4 = new Panel("div", {
  3578. "class": "share-qq-btn btn4"
  3579. }).set("html", "分享到微信").inject(t),
  3580. this.cancel = new Panel("div", {
  3581. "class": "share-qq-btn cancel"
  3582. }).set("html", "取消").inject(t),
  3583. this.mask = new Panel("div", {
  3584. "class": "share-qq-mask"
  3585. }).inject("stage"),
  3586. this.attach()
  3587. },
  3588. attach: function () {
  3589. this.btn1.addEvent("fastclick", this.onClick1),
  3590. this.btn2.addEvent("fastclick", this.onClick2),
  3591. this.btn3.addEvent("fastclick", this.onClick3),
  3592. this.btn4.addEvent("fastclick", this.onClick4),
  3593. this.cancel.addEvent("fastclick", this.hide)
  3594. },
  3595. show: function () {
  3596. return this.mask.show(),
  3597. this.parent("show")
  3598. },
  3599. hide: function () {
  3600. return this.mask.hide(),
  3601. this.parent("hide")
  3602. },
  3603. onClick1: function () {
  3604. shareAPI(1),
  3605. this.hide()
  3606. },
  3607. onClick2: function () {
  3608. shareAPI(3),
  3609. this.hide()
  3610. },
  3611. onClick3: function () {
  3612. shareAPI(0),
  3613. this.hide()
  3614. },
  3615. onClick4: function () {
  3616. shareAPI(2),
  3617. this.hide()
  3618. }
  3619. }),
  3620. e = null,
  3621. n = {};
  3622. return n.getInstance = function () {
  3623. return e = e || new t
  3624. },
  3625. n
  3626. }();
  3627. ; {
  3628. function clickMore() {
  3629. // Play68.goHome();
  3630. }
  3631. function dp_share() {
  3632. // play68_submitscore(App.score);
  3633. }
  3634. };