app.js 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683
  1. /**
  2. * jQuery.browser.mobile (http://detectmobilebrowser.com/)
  3. *
  4. * jQuery.browser.mobile will be true if the browser is a mobile device
  5. *
  6. **/
  7. (function(a){(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);
  8. /*! jQuery JSON plugin 2.4.0 | code.google.com/p/jquery-json */
  9. (function(jQuery){'use strict';var escape=/["\\\x00-\x1f\x7f-\x9f]/g,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},hasOwn=Object.prototype.hasOwnProperty;jQuery.toJSON=typeof JSON==='object'&&JSON.stringify?JSON.stringify:function(o){if(o===null){return'null';}
  10. var pairs,k,name,val,type=jQuery.type(o);if(type==='undefined'){return undefined;}
  11. if(type==='number'||type==='boolean'){return String(o);}
  12. if(type==='string'){return jQuery.quoteString(o);}
  13. if(typeof o.toJSON==='function'){return jQuery.toJSON(o.toJSON());}
  14. if(type==='date'){var month=o.getUTCMonth()+1,day=o.getUTCDate(),year=o.getUTCFullYear(),hours=o.getUTCHours(),minutes=o.getUTCMinutes(),seconds=o.getUTCSeconds(),milli=o.getUTCMilliseconds();if(month<10){month='0'+month;}
  15. if(day<10){day='0'+day;}
  16. if(hours<10){hours='0'+hours;}
  17. if(minutes<10){minutes='0'+minutes;}
  18. if(seconds<10){seconds='0'+seconds;}
  19. if(milli<100){milli='0'+milli;}
  20. if(milli<10){milli='0'+milli;}
  21. return'"'+year+'-'+month+'-'+day+'T'+
  22. hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
  23. pairs=[];if(jQuery.isArray(o)){for(k=0;k<o.length;k++){pairs.push(jQuery.toJSON(o[k])||'null');}
  24. return'['+pairs.join(',')+']';}
  25. if(typeof o==='object'){for(k in o){if(hasOwn.call(o,k)){type=typeof k;if(type==='number'){name='"'+k+'"';}else if(type==='string'){name=jQuery.quoteString(k);}else{continue;}
  26. type=typeof o[k];if(type!=='function'&&type!=='undefined'){val=jQuery.toJSON(o[k]);pairs.push(name+':'+val);}}}
  27. return'{'+pairs.join(',')+'}';}};jQuery.evalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(str){return eval('('+str+')');};jQuery.secureEvalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(str){var filtered=str.replace(/\\["\\\/bfnrtu]/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*jQuery/.test(filtered)){return eval('('+str+')');}
  28. throw new SyntaxError('Error parsing JSON, source is not valid.');};jQuery.quoteString=function(str){if(str.match(escape)){return'"'+str.replace(escape,function(a){var c=meta[a];if(typeof c==='string'){return c;}
  29. c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
  30. return'"'+str+'"';};}(jQuery));
  31. $.fn.scrollTo = function( target, options, callback ){
  32. if(typeof options == 'function' && arguments.length == 2){ callback = options; options = target; }
  33. var settings = $.extend({
  34. scrollTarget : target,
  35. offsetTop : 50,
  36. duration : 10,
  37. easing : 'swing'
  38. }, options);
  39. return this.each(function(){
  40. var scrollPane = $(this);
  41. var scrollTarget = (typeof settings.scrollTarget == "number") ? settings.scrollTarget : $(settings.scrollTarget);
  42. var scrollY = (typeof scrollTarget == "number") ? scrollTarget : scrollTarget.offset().top + scrollPane.scrollTop() - parseInt(settings.offsetTop);
  43. scrollPane.animate({scrollTop : scrollY }, parseInt(settings.duration), settings.easing, function(){
  44. if (typeof callback == 'function') { callback.call(this); }
  45. });
  46. });
  47. }
  48. /*
  49. * Date Format 1.2.3
  50. * (c) 2007-2009 Steven Levithan <stevenlevithan.com>
  51. * MIT license
  52. *
  53. * Includes enhancements by Scott Trenda <scott.trenda.net>
  54. * and Kris Kowal <cixar.com/~kris.kowal/>
  55. *
  56. * Accepts a date, a mask, or a date and a mask.
  57. * Returns a formatted version of the given date.
  58. * The date defaults to the current date/time.
  59. * The mask defaults to dateFormat.masks.default.
  60. */
  61. var dateFormat = function () {
  62. var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
  63. timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
  64. timezoneClip = /[^-+\dA-Z]/g,
  65. pad = function (val, len) {
  66. val = String(val);
  67. len = len || 2;
  68. while (val.length < len) val = "0" + val;
  69. return val;
  70. };
  71. // Regexes and supporting functions are cached through closure
  72. return function (date, mask, utc) {
  73. var dF = dateFormat;
  74. // You can't provide utc if you skip other args (use the "UTC:" mask prefix)
  75. if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) {
  76. mask = date;
  77. date = undefined;
  78. }
  79. // Passing date through Date applies Date.parse, if necessary
  80. date = date ? new Date(date) : new Date;
  81. if (isNaN(date)) throw SyntaxError("invalid date");
  82. mask = String(dF.masks[mask] || mask || dF.masks["default"]);
  83. // Allow setting the utc argument via the mask
  84. if (mask.slice(0, 4) == "UTC:") {
  85. mask = mask.slice(4);
  86. utc = true;
  87. }
  88. var _ = utc ? "getUTC" : "get",
  89. d = date[_ + "Date"](),
  90. D = date[_ + "Day"](),
  91. m = date[_ + "Month"](),
  92. y = date[_ + "FullYear"](),
  93. H = date[_ + "Hours"](),
  94. M = date[_ + "Minutes"](),
  95. s = date[_ + "Seconds"](),
  96. L = date[_ + "Milliseconds"](),
  97. o = utc ? 0 : date.getTimezoneOffset(),
  98. flags = {
  99. d: d,
  100. dd: pad(d),
  101. ddd: dF.i18n.dayNames[D],
  102. dddd: dF.i18n.dayNames[D + 7],
  103. m: m + 1,
  104. mm: pad(m + 1),
  105. mmm: dF.i18n.monthNames[m],
  106. mmmm: dF.i18n.monthNames[m + 12],
  107. yy: String(y).slice(2),
  108. yyyy: y,
  109. h: H % 12 || 12,
  110. hh: pad(H % 12 || 12),
  111. H: H,
  112. HH: pad(H),
  113. M: M,
  114. MM: pad(M),
  115. s: s,
  116. ss: pad(s),
  117. l: pad(L, 3),
  118. L: pad(L > 99 ? Math.round(L / 10) : L),
  119. t: H < 12 ? "a" : "p",
  120. tt: H < 12 ? "am" : "pm",
  121. T: H < 12 ? "A" : "P",
  122. TT: H < 12 ? "AM" : "PM",
  123. Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
  124. o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
  125. S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10]
  126. };
  127. return mask.replace(token, function ($0) {
  128. return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1);
  129. });
  130. };
  131. }();
  132. // Some common format strings
  133. dateFormat.masks = {
  134. "default": "ddd mmm dd yyyy HH:MM:ss",
  135. shortDate: "m/d/yy",
  136. mediumDate: "mmm d, yyyy",
  137. longDate: "mmmm d, yyyy",
  138. fullDate: "dddd, mmmm d, yyyy",
  139. shortTime: "h:MM TT",
  140. mediumTime: "h:MM:ss TT",
  141. longTime: "h:MM:ss TT Z",
  142. isoDate: "yyyy-mm-dd",
  143. isoTime: "HH:MM:ss",
  144. isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
  145. isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
  146. };
  147. // Internationalization strings
  148. dateFormat.i18n = {
  149. dayNames: [
  150. "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
  151. "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
  152. ],
  153. monthNames: [
  154. "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
  155. "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
  156. ]
  157. };
  158. // For convenience...
  159. Date.prototype.format = function (mask, utc) {
  160. return dateFormat(this, mask, utc);
  161. };
  162. /*
  163. * http://code.google.com/p/flexible-js-formatting/
  164. *
  165. * Copyright (C) 2004 Baron Schwartz <baron at sequent dot org>
  166. *
  167. * Permission is hereby granted, free of charge, to any person obtaining a copy
  168. * of this software and associated documentation files (the "Software"), to deal
  169. * in the Software without restriction, including without limitation the rights
  170. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  171. * copies of the Software, and to permit persons to whom the Software is
  172. * furnished to do so, subject to the following conditions:
  173. *
  174. * The above copyright notice and this permission notice shall be included in
  175. * all copies or substantial portions of the Software.
  176. *
  177. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  178. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  179. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  180. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  181. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  182. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  183. * THE SOFTWARE.
  184. */
  185. Date.parseFunctions = {count:0};
  186. Date.parseRegexes = [];
  187. Date.formatFunctions = {count:0};
  188. Date.prototype.dateFormat = function(format, ignore_offset) {
  189. if (Date.formatFunctions[format] == null) {
  190. Date.createNewFormat(format);
  191. }
  192. var func = Date.formatFunctions[format];
  193. if (ignore_offset || ! this.offset) {
  194. return this[func]();
  195. } else {
  196. return (new Date(this.valueOf() - this.offset))[func]();
  197. }
  198. };
  199. Date.createNewFormat = function(format) {
  200. var funcName = "format" + Date.formatFunctions.count++;
  201. Date.formatFunctions[format] = funcName;
  202. var code = "Date.prototype." + funcName + " = function(){return ";
  203. var special = false;
  204. var ch = '';
  205. for (var i = 0; i < format.length; ++i) {
  206. ch = format.charAt(i);
  207. // escape character start
  208. if (!special && ch == "\\") {
  209. special = true;
  210. }
  211. // escaped string
  212. else if (!special && ch == '"') {
  213. var end = format.indexOf('"', i+1);
  214. if (end==-1)
  215. {
  216. end = format.length;
  217. }
  218. code += "'" + String.escape(format.substring(i+1, end)) + "' + ";
  219. i = end;
  220. }
  221. // escaped character
  222. else if (special) {
  223. special = false;
  224. code += "'" + String.escape(ch) + "' + ";
  225. }
  226. else {
  227. code += Date.getFormatCode(ch);
  228. }
  229. }
  230. eval(code.substring(0, code.length - 3) + ";}");
  231. };
  232. Date.getFormatCode = function(character) {
  233. switch (character) {
  234. case "d":
  235. return "String.leftPad(this.getDate(), 2, '0') + ";
  236. case "D":
  237. return "Date.dayNames[this.getDay()].substring(0, 3) + ";
  238. case "j":
  239. return "this.getDate() + ";
  240. case "l":
  241. return "Date.dayNames[this.getDay()] + ";
  242. case "S":
  243. return "this.getSuffix() + ";
  244. case "w":
  245. return "this.getDay() + ";
  246. case "z":
  247. return "this.getDayOfYear() + ";
  248. case "W":
  249. return "this.getWeekOfYear() + ";
  250. case "F":
  251. return "Date.monthNames[this.getMonth()] + ";
  252. case "m":
  253. return "String.leftPad(this.getMonth() + 1, 2, '0') + ";
  254. case "M":
  255. return "Date.monthNames[this.getMonth()].substring(0, 3) + ";
  256. case "n":
  257. return "(this.getMonth() + 1) + ";
  258. case "t":
  259. return "this.getDaysInMonth() + ";
  260. case "L":
  261. return "(this.isLeapYear() ? 1 : 0) + ";
  262. case "Y":
  263. return "this.getFullYear() + ";
  264. case "y":
  265. return "('' + this.getFullYear()).substring(2, 4) + ";
  266. case "a":
  267. return "(this.getHours() < 12 ? 'am' : 'pm') + ";
  268. case "A":
  269. return "(this.getHours() < 12 ? 'AM' : 'PM') + ";
  270. case "g":
  271. return "((this.getHours() %12) ? this.getHours() % 12 : 12) + ";
  272. case "G":
  273. return "this.getHours() + ";
  274. case "h":
  275. return "String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";
  276. case "H":
  277. return "String.leftPad(this.getHours(), 2, '0') + ";
  278. case "i":
  279. return "String.leftPad(this.getMinutes(), 2, '0') + ";
  280. case "s":
  281. return "String.leftPad(this.getSeconds(), 2, '0') + ";
  282. case "X":
  283. return "String.leftPad(this.getMilliseconds(), 3, '0') + ";
  284. case "O":
  285. return "this.getGMTOffset() + ";
  286. case "T":
  287. return "this.getTimezone() + ";
  288. case "Z":
  289. return "(this.getTimezoneOffset() * -60) + ";
  290. case "q": // quarter num, Q for name?
  291. return "this.getQuarter() + ";
  292. default:
  293. return "'" + String.escape(character) + "' + ";
  294. }
  295. };
  296. Date.parseDate = function(input, format) {
  297. if (Date.parseFunctions[format] == null) {
  298. Date.createParser(format);
  299. }
  300. var func = Date.parseFunctions[format];
  301. return Date[func](input);
  302. };
  303. Date.createParser = function(format) {
  304. var funcName = "parse" + Date.parseFunctions.count++;
  305. var regexNum = Date.parseRegexes.length;
  306. var currentGroup = 1;
  307. Date.parseFunctions[format] = funcName;
  308. var code = "Date." + funcName + " = function(input){\n"
  309. + "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, ms = -1, z = 0;\n"
  310. + "var d = new Date();\n"
  311. + "y = d.getFullYear();\n"
  312. + "m = d.getMonth();\n"
  313. + "d = d.getDate();\n"
  314. + "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n"
  315. + "if (results && results.length > 0) {" ;
  316. var regex = "";
  317. var special = false;
  318. var ch = '';
  319. for (var i = 0; i < format.length; ++i) {
  320. ch = format.charAt(i);
  321. if (!special && ch == "\\") {
  322. special = true;
  323. }
  324. else if (special) {
  325. special = false;
  326. regex += String.escape(ch);
  327. }
  328. else {
  329. obj = Date.formatCodeToRegex(ch, currentGroup);
  330. currentGroup += obj.g;
  331. regex += obj.s;
  332. if (obj.g && obj.c) {
  333. code += obj.c;
  334. }
  335. }
  336. }
  337. code += "if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0 && ms >= 0)\n"
  338. + "{return new Date(y, m, d, h, i, s, ms).applyOffset(z);}\n"
  339. + "if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"
  340. + "{return new Date(y, m, d, h, i, s).applyOffset(z);}\n"
  341. + "else if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"
  342. + "{return new Date(y, m, d, h, i).applyOffset(z);}\n"
  343. + "else if (y > 0 && m >= 0 && d > 0 && h >= 0)\n"
  344. + "{return new Date(y, m, d, h).applyOffset(z);}\n"
  345. + "else if (y > 0 && m >= 0 && d > 0)\n"
  346. + "{return new Date(y, m, d).applyOffset(z);}\n"
  347. + "else if (y > 0 && m >= 0)\n"
  348. + "{return new Date(y, m).applyOffset(z);}\n"
  349. + "else if (y > 0)\n"
  350. + "{return new Date(y).applyOffset(z);}\n"
  351. + "}return null;}";
  352. Date.parseRegexes[regexNum] = new RegExp("^" + regex + "$");
  353. eval(code);
  354. };
  355. Date.formatCodeToRegex = function(character, currentGroup) {
  356. switch (character) {
  357. case "D":
  358. return {g:0,
  359. c:null,
  360. s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};
  361. case "j":
  362. case "d":
  363. return {g:1,
  364. c:"d = parseInt(results[" + currentGroup + "], 10);\n",
  365. s:"(\\d{1,2})"};
  366. case "l":
  367. return {g:0,
  368. c:null,
  369. s:"(?:" + Date.dayNames.join("|") + ")"};
  370. case "S":
  371. return {g:0,
  372. c:null,
  373. s:"(?:st|nd|rd|th)"};
  374. case "w":
  375. return {g:0,
  376. c:null,
  377. s:"\\d"};
  378. case "z":
  379. return {g:0,
  380. c:null,
  381. s:"(?:\\d{1,3})"};
  382. case "W":
  383. return {g:0,
  384. c:null,
  385. s:"(?:\\d{2})"};
  386. case "F":
  387. return {g:1,
  388. c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "].substring(0, 3)], 10);\n",
  389. s:"(" + Date.monthNames.join("|") + ")"};
  390. case "M":
  391. return {g:1,
  392. c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "]], 10);\n",
  393. s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};
  394. case "n":
  395. case "m":
  396. return {g:1,
  397. c:"m = parseInt(results[" + currentGroup + "], 10) - 1;\n",
  398. s:"(\\d{1,2})"};
  399. case "t":
  400. return {g:0,
  401. c:null,
  402. s:"\\d{1,2}"};
  403. case "L":
  404. return {g:0,
  405. c:null,
  406. s:"(?:1|0)"};
  407. case "Y":
  408. return {g:1,
  409. c:"y = parseInt(results[" + currentGroup + "], 10);\n",
  410. s:"(\\d{4})"};
  411. case "y":
  412. return {g:1,
  413. c:"var ty = parseInt(results[" + currentGroup + "], 10);\n"
  414. + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
  415. s:"(\\d{1,2})"};
  416. case "a":
  417. return {g:1,
  418. c:"if (results[" + currentGroup + "] == 'am') {\n"
  419. + "if (h == 12) { h = 0; }\n"
  420. + "} else { if (h < 12) { h += 12; }}",
  421. s:"(am|pm)"};
  422. case "A":
  423. return {g:1,
  424. c:"if (results[" + currentGroup + "] == 'AM') {\n"
  425. + "if (h == 12) { h = 0; }\n"
  426. + "} else { if (h < 12) { h += 12; }}",
  427. s:"(AM|PM)"};
  428. case "g":
  429. case "G":
  430. case "h":
  431. case "H":
  432. return {g:1,
  433. c:"h = parseInt(results[" + currentGroup + "], 10);\n",
  434. s:"(\\d{1,2})"};
  435. case "i":
  436. return {g:1,
  437. c:"i = parseInt(results[" + currentGroup + "], 10);\n",
  438. s:"(\\d{2})"};
  439. case "s":
  440. return {g:1,
  441. c:"s = parseInt(results[" + currentGroup + "], 10);\n",
  442. s:"(\\d{2})"};
  443. case "X":
  444. return {g:1,
  445. c:"ms = parseInt(results[" + currentGroup + "], 10);\n",
  446. s:"(\\d{3})"};
  447. case "O":
  448. case "P":
  449. return {g:1,
  450. c:"z = Date.parseOffset(results[" + currentGroup + "], 10);\n",
  451. s:"(Z|[+-]\\d{2}:?\\d{2})"}; // "Z", "+05:00", "+0500" all acceptable.
  452. case "T":
  453. return {g:0,
  454. c:null,
  455. s:"[A-Z]{3}"};
  456. case "Z":
  457. return {g:1,
  458. c:"s = parseInt(results[" + currentGroup + "], 10);\n",
  459. s:"([+-]\\d{1,5})"};
  460. default:
  461. return {g:0,
  462. c:null,
  463. s:String.escape(character)};
  464. }
  465. };
  466. Date.parseOffset = function(str) {
  467. if (str == "Z") { return 0 ; } // UTC, no offset.
  468. var seconds ;
  469. seconds = parseInt(str[0] + str[1] + str[2]) * 3600 ; // e.g., "+05" or "-08"
  470. if (str[3] == ":") { // "+HH:MM" is preferred iso8601 format ("O")
  471. seconds += parseInt(str[4] + str[5]) * 60;
  472. } else { // "+HHMM" is frequently used, though. ("P")
  473. seconds += parseInt(str[3] + str[4]) * 60;
  474. }
  475. return seconds ;
  476. };
  477. Date.today = function() {
  478. var now = new Date();
  479. now.setHours(0);
  480. now.setMinutes(0);
  481. now.setSeconds(0);
  482. return now;
  483. }
  484. // convert the parsed date into UTC, but store the offset so we can optionally use it in dateFormat()
  485. Date.prototype.applyOffset = function(offset_seconds) {
  486. this.offset = offset_seconds * 1000 ;
  487. this.setTime(this.valueOf() + this.offset);
  488. return this ;
  489. };
  490. Date.prototype.getTimezone = function() {
  491. return this.toString().replace(
  492. /^.*? ([A-Z]{3}) [0-9]{4}.*$/, "$1").replace(
  493. /^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, "$1$2$3").replace(
  494. /^.*?[0-9]{4} \(([A-Z]{3})\)/, "$1");
  495. };
  496. Date.prototype.getGMTOffset = function() {
  497. return (this.getTimezoneOffset() > 0 ? "-" : "+")
  498. + String.leftPad(Math.floor(this.getTimezoneOffset() / 60), 2, "0")
  499. + String.leftPad(this.getTimezoneOffset() % 60, 2, "0");
  500. };
  501. Date.prototype.getDayOfYear = function() {
  502. var num = 0;
  503. Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
  504. for (var i = 0; i < this.getMonth(); ++i) {
  505. num += Date.daysInMonth[i];
  506. }
  507. return num + this.getDate() - 1;
  508. };
  509. Date.prototype.getWeekOfYear = function() {
  510. // Skip to Thursday of this week
  511. var now = this.getDayOfYear() + (4 - this.getDay());
  512. // Find the first Thursday of the year
  513. var jan1 = new Date(this.getFullYear(), 0, 1);
  514. var then = (7 - jan1.getDay() + 4);
  515. document.write(then);
  516. return String.leftPad(((now - then) / 7) + 1, 2, "0");
  517. };
  518. Date.prototype.isLeapYear = function() {
  519. var year = this.getFullYear();
  520. return ((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year)));
  521. };
  522. Date.prototype.getFirstDayOfMonth = function() {
  523. var day = (this.getDay() - (this.getDate() - 1)) % 7;
  524. return (day < 0) ? (day + 7) : day;
  525. };
  526. Date.prototype.getLastDayOfMonth = function() {
  527. var day = (this.getDay() + (Date.daysInMonth[this.getMonth()] - this.getDate())) % 7;
  528. return (day < 0) ? (day + 7) : day;
  529. };
  530. Date.prototype.getDaysInMonth = function() {
  531. Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
  532. return Date.daysInMonth[this.getMonth()];
  533. };
  534. Date.prototype.getQuarter = function() {
  535. return Date.quarterFromMonthNum[this.getMonth()];
  536. };
  537. Date.prototype.getSuffix = function() {
  538. switch (this.getDate()) {
  539. case 1:
  540. case 21:
  541. case 31:
  542. return "st";
  543. case 2:
  544. case 22:
  545. return "nd";
  546. case 3:
  547. case 23:
  548. return "rd";
  549. default:
  550. return "th";
  551. }
  552. };
  553. String.escape = function(string) {
  554. return string.replace(/('|\\)/g, "\\$1");
  555. };
  556. String.leftPad = function (val, size, ch) {
  557. var result = new String(val);
  558. if (ch == null) {
  559. ch = " ";
  560. }
  561. while (result.length < size) {
  562. result = ch + result;
  563. }
  564. return result;
  565. };
  566. Date.quarterFromMonthNum = [1,1,1,2,2,2,3,3,3,4,4,4];
  567. Date.daysInMonth = [31,28,31,30,31,30,31,31,30,31,30,31];
  568. Date.monthNames =
  569. ["January",
  570. "February",
  571. "March",
  572. "April",
  573. "May",
  574. "June",
  575. "July",
  576. "August",
  577. "September",
  578. "October",
  579. "November",
  580. "December"];
  581. Date.dayNames =
  582. ["Sunday",
  583. "Monday",
  584. "Tuesday",
  585. "Wednesday",
  586. "Thursday",
  587. "Friday",
  588. "Saturday"];
  589. Date.y2kYear = 50;
  590. Date.monthNumbers = {
  591. Jan:0,
  592. Feb:1,
  593. Mar:2,
  594. Apr:3,
  595. May:4,
  596. Jun:5,
  597. Jul:6,
  598. Aug:7,
  599. Sep:8,
  600. Oct:9,
  601. Nov:10,
  602. Dec:11};
  603. Date.patterns = {
  604. ISO8601LongPattern: "Y\\-m\\-d\\TH\\:i\\:sO",
  605. ISO8601ShortPattern: "Y\\-m\\-d",
  606. ShortDatePattern: "n/j/Y",
  607. LongDatePattern: "l, F d, Y",
  608. FullDateTimePattern: "l, F d, Y g:i:s A",
  609. MonthDayPattern: "F d",
  610. ShortTimePattern: "g:i A",
  611. LongTimePattern: "g:i:s A",
  612. SortableDateTimePattern: "Y-m-d\\TH:i:s",
  613. UniversalSortableDateTimePattern: "Y-m-d H:i:sO",
  614. YearMonthPattern: "F, Y"};
  615. /**
  616. *
  617. * @author: Malishev Dmitry <dima.malishev@gmail.com>
  618. */
  619. var _DEBUG = true;
  620. var _DEBUG_LEVEL = 'ALL';
  621. // possible levels: ALL, IMPORTANT
  622. var Error = {FATAL: 1, WARNING: 0, NORMAL: -1};
  623. //
  624. // GLOBAL SETTINGS
  625. //
  626. GLOBAL = {};
  627. GLOBAL.FTP_USER_PREFIX = 'admin_';
  628. GLOBAL.DB_USER_PREFIX = 'admin_';
  629. GLOBAL.DB_DBNAME_PREFIX = 'admin_';
  630. GLOBAL.AJAX_URL = '';
  631. /**
  632. * Init debug, grabs console object if accessible, or makes dummy debugger
  633. */
  634. var fb = _DEBUG && 'undefined' != typeof(console) ? console : {
  635. log : function(){},
  636. debug : function(){},
  637. info : function(){},
  638. warn : function(){},
  639. error : function(){},
  640. assert : function(){},
  641. dir : function(){},
  642. dirxml : function(){},
  643. trace : function(){},
  644. group : function(){},
  645. groupEnd : function(){},
  646. time : function(){},
  647. timeEnd : function(){},
  648. profile : function(){},
  649. profileEnd : function(){},
  650. count : function(){},
  651. msg : function(){}
  652. };
  653. var checked = false;
  654. var frmname = '';
  655. var lastScrollTop = 0;
  656. //
  657. var App = {
  658. // Main namespases for page specific functions
  659. // Core namespaces
  660. Ajax: {
  661. Busy: {}
  662. },
  663. Core: {},
  664. // CONSTANT VALUES
  665. Constants: {
  666. UNLIM_VALUE: 'unlimited', // overritten in i18n.js.php
  667. UNLIM_TRANSLATED_VALUE: 'unlimited' // overritten in i18n.js.php
  668. },
  669. // Actions. More widly used funcs
  670. Actions: {
  671. DB: {},
  672. WEB: {},
  673. PACKAGE: {},
  674. MAIL_ACC:{}
  675. },
  676. // Utilities
  677. Helpers: {},
  678. HTML: {
  679. Build: {}
  680. },
  681. Filters: {},
  682. Env: {
  683. lang: GLOBAL.lang,
  684. },
  685. i18n: {},
  686. Listeners: {
  687. DB: {},
  688. WEB: {},
  689. PACKAGE: {},
  690. MAIL_ACC:{}
  691. },
  692. View:{
  693. HTML: {
  694. Build: {}
  695. },
  696. // pages related views
  697. },
  698. Cache: {
  699. clear: function() {} // TODO: stub method, will be used later
  700. },
  701. Ref: {},
  702. Tmp: {},
  703. Thread: {
  704. run: function(delay, ref) {
  705. setTimeout(function() {
  706. ref();
  707. }, delay*10);
  708. }
  709. },
  710. Settings: {
  711. GLOBAL: {},
  712. General: {}
  713. },
  714. Templates: {
  715. Templator: null,
  716. Tpl: {},
  717. _indexes: {}
  718. }
  719. };
  720. // Internals
  721. Array.prototype.set = function(key, value){
  722. var index = this[0][key];
  723. this[1][index] = value;
  724. }
  725. Array.prototype.get = function(key){
  726. var index = this[0][key];
  727. return this[1][index];
  728. }
  729. Array.prototype.finalize = function(){
  730. this.shift();
  731. this[0] = this[0].join('');
  732. return this[0];
  733. }
  734. Array.prototype.done = function(){
  735. return this.join('');
  736. }
  737. String.prototype.wrapperize = function(key, ns){
  738. var tpl = App.Templates.get(key, ns);
  739. tpl.set(':content', this);
  740. return tpl.finalize();
  741. }
  742. App.Ajax.request = function(method, data, callback, onError){
  743. // this will prevent multiple ajaxes on user clicks
  744. /*if (App.Helpers.isAjaxBusy(method, data)) {
  745. fb.warn('ajax request ['+method+'] is busy');
  746. return;
  747. }*/
  748. //App.Helpers.setAjaxBusy(method, data);
  749. data = data || {};
  750. var prgs = $('.progress-container');
  751. switch (method) {
  752. case 'cd':
  753. prgs.find('title').text('Opening dir');
  754. prgs.show();
  755. break;
  756. case 'delete_files':
  757. prgs.find('title').text('Deleting');
  758. prgs.show();
  759. break;
  760. case 'unpack_item':
  761. prgs.find('title').text('Unpacking');
  762. prgs.show();
  763. break;
  764. case 'create_file':
  765. prgs.find('title').text('Creating file');
  766. prgs.show();
  767. break;
  768. case 'create_dir':
  769. prgs.find('title').text('Creating directory');
  770. prgs.show();
  771. break;
  772. case 'rename_file':
  773. prgs.find('title').text('Renaming file');
  774. prgs.show();
  775. break;
  776. default:
  777. break;
  778. }
  779. jQuery.ajax({
  780. url: GLOBAL.ajax_url,
  781. global: false,
  782. type: data.request_method || "GET",
  783. data: jQuery.extend(data, {'action': method}),
  784. dataType: "text boost",
  785. converters: {
  786. "text boost": function(value) {
  787. value = value.trim();
  788. return $.parseJSON(value);
  789. }},
  790. async: true,
  791. cache: false,
  792. error: function(jqXHR, textStatus, errorThrown)
  793. {
  794. prgs.hide();
  795. onError && onError();
  796. if ('undefined' != typeof onError) {
  797. fb.error(textStatus);
  798. }
  799. },
  800. complete: function()
  801. {
  802. //App.Helpers.setAjaxFree(method, data);
  803. prgs.hide();
  804. },
  805. success: function(reply)
  806. {
  807. prgs.hide();
  808. //App.Helpers.setAjaxFree(method, data);
  809. try {
  810. callback && callback(reply);
  811. }
  812. catch(e) {
  813. fb.error('GENERAL ERROR with ajax method: ' + data.request_method + ' ' + e);
  814. //App.Helpers.generalError();
  815. }
  816. }
  817. });
  818. }
  819. jQuery.extend({
  820. keys: function(obj){
  821. if (!obj) {
  822. return [];
  823. }
  824. var a = [];
  825. jQuery.each(obj, function(k){ a.push(k) });
  826. return a;
  827. }
  828. })
  829. App.Core.create_hidden_form = function(action){
  830. var form = jQuery('<form>', {
  831. id : 'hidden-form',
  832. method : 'post',
  833. action : action
  834. });
  835. jQuery('body').append(form);
  836. return form;
  837. };
  838. App.Core.extend_from_json = function(elm, data, prefix){
  839. elm = jQuery(elm);
  840. var data = App.Core.flatten_json(data, prefix);
  841. var keys = jQuery.keys(data);
  842. for(var i=0, cnt=keys.length; i<cnt; i++)
  843. {
  844. elm.append(jQuery('<input>', {
  845. name : keys[i],
  846. value: data[keys[i]],
  847. type : 'hidden'
  848. }));
  849. }
  850. return elm;
  851. }
  852. App.Core.flatten_json = function(data, prefix){
  853. var keys = jQuery.keys(data);
  854. var result = {};
  855. prefix || (prefix = '');
  856. if(keys.length)
  857. {
  858. for(var i=0, cnt=keys.length; i<cnt; i++)
  859. {
  860. var value = data[keys[i]];
  861. switch(typeof(value))
  862. {
  863. case 'function': break;
  864. case 'object' : result = jQuery.extend(result, App.Core.flatten_json(value, prefix + '[' + keys[i] + ']')); break;
  865. default : result[prefix + '[' + keys[i] + ']'] = value;
  866. }
  867. }
  868. return result;
  869. }
  870. else
  871. {
  872. return false;
  873. }
  874. }
  875. //
  876. // Cookies adapter
  877. // Allow to work old pages realisations of cookie requests
  878. //
  879. function createCookie(name, value, expire_days) {
  880. jQuery.cookie(name, value, { expires: expire_days});
  881. }
  882. function readCookie(name) {
  883. jQuery.cookie(name);
  884. }
  885. function eraseCookie(name) {
  886. jQuery.removeCookie(name);
  887. }
  888. /**
  889. * Timer for profiling
  890. */
  891. var timer = {};
  892. timer.start = function()
  893. {
  894. timer.start_time = new Date();
  895. }
  896. timer.stop = function( msg )
  897. {
  898. timer.stop_time = new Date();
  899. timer.print( msg );
  900. }
  901. timer.print = function( msg )
  902. {
  903. var passed = timer.stop_time - timer.start_time;
  904. fb.info( msg || '' + passed / 1000 );
  905. }
  906. String.prototype.trim = function()
  907. {
  908. var str = this;
  909. str = str.replace(/^\s+/, '');
  910. for (var i = str.length - 1; i >= 0; i--) {
  911. if (/\S/.test(str.charAt(i))) {
  912. str = str.substring(0, i + 1);
  913. break;
  914. }
  915. }
  916. return str;
  917. }
  918. hover_menu = function() {
  919. var sep_1 = $('div.l-content > div.l-separator:nth-of-type(2)');
  920. var sep_2 = $('div.l-content > div.l-separator:nth-of-type(4)');
  921. var nav_main = $('.l-stat');
  922. var nav_a = $('.l-stat .l-stat__col a');
  923. var nav_context = $('.l-sort');
  924. var st = $(window).scrollTop();
  925. if (st <= 112) {
  926. sep_1.css({'margin-top': 214 - st + 'px'});
  927. sep_2.css({'margin-top': 259 - st + 'px'});
  928. nav_a.css({'height': 111 - st + 'px'});
  929. nav_a.css({'min-height': 111 - st + 'px'});
  930. nav_context.css({'margin-top': 215 - st + 'px'});
  931. sep_2.css({'box-shadow':'none'});
  932. sep_2.css({'background-color': '#ddd'});
  933. sep_2.css({'height': '1px'});
  934. }
  935. if(st > 112){
  936. sep_1.css({'margin-top': '100px'});
  937. sep_2.css({'margin-top': '130px'});
  938. sep_2.css({'height': '15px'});
  939. sep_2.css({'background-color': '#fff'});
  940. nav_a.css({'height': '0'});
  941. nav_a.css({'min-height': '0'});
  942. nav_context.css({'margin-top': '101px'});
  943. nav_a.find('ul').css({'visibility': 'hidden'});
  944. nav_main.css({'padding-top': '27px'});
  945. sep_2.css({'box-shadow':'0 5px 3px 0 rgba(200, 200, 200, 0.5)'});
  946. }
  947. if(st == 0){
  948. nav_a.css({'min-height': '111px'});
  949. nav_a.css({'height': '111px'});
  950. }
  951. if(st < 109 ){
  952. nav_a.find('ul').css({'visibility': 'visible'});
  953. nav_main.css({'padding-top': 30 + 'px'});
  954. }
  955. if (st <= 112 && st > 110 ) {
  956. nav_main.css({'padding-top': 30 - st + 109 + 'px'});
  957. }
  958. lastScrollTop = st;
  959. }
  960. function checkedAll(frmname) {
  961. if ($('.l-unit.selected:not(.header)').length > 0) {
  962. $('.l-unit:not(.header)').removeClass("selected");
  963. $('.ch-toggle').attr("checked", false);
  964. $('.toggle-all').removeClass('clicked-on');
  965. }
  966. else {
  967. $('.l-unit:not(.header)').addClass("selected");
  968. $('.ch-toggle').attr("checked", true);
  969. $('.toggle-all').addClass('clicked-on');
  970. }
  971. }
  972. function doSearch(url) {
  973. var url = url || '/search/';
  974. var loc = url + '?q=' + $('.search-input').val();
  975. location.href = loc;
  976. return false;
  977. }
  978. $(document).ready(function(){
  979. if($('.body-login')[0]){
  980. $('input').first().focus();
  981. }
  982. $(".submenu-select-dropdown").each(function(){
  983. $(this).wrap("<span class='submenu-select-wrapper'></span>");
  984. $(this).after("<span class='holder'></span>");
  985. });
  986. $(".submenu-select-dropdown").change(function(){
  987. var selectedOption = $(this).find(":selected").text();
  988. $(this).next(".holder").text(selectedOption);
  989. }).trigger('change');
  990. $('.to-top').bind('click', function(evt) {
  991. $("html, body").animate({ scrollTop: 0 }, "normal");
  992. });
  993. var isMobile = false; //initiate as false
  994. // device detection
  995. if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
  996. || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))){
  997. isMobile = true;
  998. $('body').addClass('mobile');
  999. }
  1000. $(window).scroll(function(){hover_menu()});
  1001. $('.l-sort-toolbar .sort-by').click(function(){
  1002. $('.context-menu.sort-order').toggle().css({left: $(this).position().left - 10});
  1003. });
  1004. // CREATE BUTTON
  1005. $('.l-sort__create-btn').hover(function(){
  1006. $(".l-sort__create-btn").append("<div id='add-icon'></div>");
  1007. $(".l-sort__create-btn").append("<div id='tooltip'>"+$('.l-sort__create-btn').attr('title').replace(' ','&nbsp;')+"</div>");
  1008. }, function(){
  1009. $("#add-icon").remove();
  1010. $("#tooltip").remove();
  1011. });
  1012. // SEARCH BOX
  1013. $('.l-sort-toolbar__search, .l-sort-toolbar__search-box .search-input').hover(function(){
  1014. clearTimeout(VE.tmp.search_display_interval);
  1015. clearTimeout(VE.tmp.search_hover_interval);
  1016. VE.tmp.search_display_interval = setTimeout(function(){$('.search-input').addClass('activated');}, 150);
  1017. }, function(){
  1018. clearTimeout(VE.tmp.search_display_interval);
  1019. clearTimeout(VE.tmp.search_hover_interval);
  1020. VE.tmp.search_hover_interval = setTimeout(function(){
  1021. if(!VE.tmp.search_activated && !$(".search-input").val().length){
  1022. $(".search-input").removeClass('activated');
  1023. }
  1024. }, 600);
  1025. });
  1026. $('.search-input').focus(function(){
  1027. VE.tmp.search_activated = 1;
  1028. clearTimeout(VE.tmp.search_hover_interval);
  1029. });
  1030. $('.search-input').blur(function(){
  1031. VE.tmp.search_activated = 0;
  1032. clearTimeout(VE.tmp.search_hover_interval);
  1033. VE.tmp.search_hover_interval = setTimeout(function(){
  1034. if(!$(".search-input").val().length){
  1035. $(".search-input").removeClass('activated');
  1036. }
  1037. }, 600);
  1038. });
  1039. // TIMER
  1040. if($('.movement.left').length){
  1041. VE.helpers.refresh_timer.right = $('.movement.right');
  1042. VE.helpers.refresh_timer.left = $('.movement.left');
  1043. VE.helpers.refresh_timer.start();
  1044. $('.pause').click(function(){
  1045. VE.helpers.refresh_timer.stop();
  1046. $('.pause').addClass('hidden');
  1047. $('.play').removeClass('hidden');
  1048. $('.refresh-timer').addClass('paused');
  1049. });
  1050. $('.play').click(function(){
  1051. VE.helpers.refresh_timer.start();
  1052. $('.pause').removeClass('hidden');
  1053. $('.play').addClass('hidden');
  1054. $('.refresh-timer').removeClass('paused');
  1055. });
  1056. }
  1057. // SORTING
  1058. $('#vstobjects input, #vstobjects select, #vstobjects textarea').change(function(){VE.tmp.form_changed=1});
  1059. $('.sort-order span').click(function(){
  1060. $('.context-menu.sort-order').toggle();
  1061. if($(this).hasClass('active'))
  1062. return;
  1063. $('.sort-order span').removeClass('active');
  1064. $(this).addClass('active');
  1065. VE.tmp.sort_par = $(this).parent('li').attr('entity');
  1066. VE.tmp.sort_as_int = $(this).parent('li').attr('sort_as_int');
  1067. VE.tmp.sort_direction = $(this).hasClass('up')*1 || -1;
  1068. $('.l-sort .sort-by span b').html($(this).parent('li').find('.name').html());
  1069. $('.l-sort .sort-by i').removeClass('l-icon-up-arrow l-icon-down-arrow');
  1070. $(this).hasClass('up') ? $('.l-sort .sort-by i').addClass('l-icon-up-arrow') : $('.l-sort .sort-by i').addClass('l-icon-down-arrow');
  1071. $('.units .l-unit').sort(function (a, b) {
  1072. if(VE.tmp.sort_as_int)
  1073. return parseInt($(a).attr(VE.tmp.sort_par)) >= parseInt($(b).attr(VE.tmp.sort_par)) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
  1074. else
  1075. return $(a).attr(VE.tmp.sort_par) <= $(b).attr(VE.tmp.sort_par) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
  1076. }).appendTo(".l-center.units");
  1077. });
  1078. // STARS
  1079. $('.l-unit .l-icon-star').click(function(){
  1080. var l_unit = $(this).parents('.l-unit');
  1081. if(l_unit.hasClass('l-unit--starred')){
  1082. // removing star
  1083. $.ajax({
  1084. method: "POST",
  1085. url: "/delete/favorite/index.php",
  1086. data: { v_section: l_unit.attr('v_section'), v_unit_id: l_unit.attr('v_unit_id') }
  1087. });
  1088. l_unit.attr({'sort-star': 0});
  1089. l_unit.removeClass('l-unit--starred');
  1090. }
  1091. else{
  1092. $.ajax({
  1093. method: "POST",
  1094. url: "/add/favorite/index.php",
  1095. data: { v_unit_id: l_unit.attr('v_unit_id'), v_section: l_unit.attr('v_section') }
  1096. });
  1097. l_unit.attr({'sort-star': 1});
  1098. l_unit.addClass('l-unit--starred');
  1099. }
  1100. });
  1101. // Shortcuts
  1102. shortcut.add("Ctrl+Enter", function(){
  1103. $('form#vstobjects').submit();
  1104. }, {
  1105. 'type': 'keydown',
  1106. 'propagate': false,
  1107. 'disable_in_input': false,
  1108. 'target': document
  1109. }
  1110. );
  1111. shortcut.add("Ctrl+Backspace", function(){
  1112. if(VE.tmp.form_changed && $('form#vstobjects .button.cancel')[0]){
  1113. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'",""));
  1114. } else if($('form#vstobjects .button.cancel')[0]){
  1115. location.href=$('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'","");
  1116. } else if($('#vstobjects a.button.cancel')[0]){
  1117. location.href=$('#vstobjects a.button.cancel').attr('href');
  1118. }
  1119. }, {
  1120. 'type': 'keydown',
  1121. 'propagate': false,
  1122. 'disable_in_input': false,
  1123. 'target': document
  1124. }
  1125. );
  1126. shortcut.add("f", function(){
  1127. $('.search-input').addClass('activated').focus();
  1128. }, {
  1129. 'type': 'keydown',
  1130. 'propagate': false,
  1131. 'disable_in_input': true,
  1132. 'target': document
  1133. }
  1134. );
  1135. $(window).bind('keypress', function(evt) {
  1136. var tag = evt.target.tagName.toLowerCase();
  1137. if (evt.charCode == 97 && tag != 'input' && tag != 'textarea' && tag != 'selectbox') {
  1138. evt.preventDefault();
  1139. if (!evt.ctrlKey && !evt.shiftKey) {
  1140. if ($('.l-sort__create-btn')[0]) {
  1141. location.href=$('.l-sort__create-btn').attr('href');
  1142. }
  1143. }
  1144. else {
  1145. if ($('.l-unit .ch-toggle:eq(0)').attr('checked')) {
  1146. $('.l-unit').removeClass('selected');
  1147. $('.l-unit .ch-toggle').attr('checked', false);
  1148. }
  1149. else {
  1150. $('.l-unit').addClass('selected');
  1151. $('.l-unit .ch-toggle').attr('checked', true);
  1152. }
  1153. }
  1154. }
  1155. });
  1156. shortcut.add("1", function(){
  1157. if(VE.tmp.form_changed){
  1158. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(1) a').attr('href'));
  1159. } else {
  1160. location.href=$('.l-stat .l-stat__col:nth-of-type(1) a').attr('href');
  1161. }
  1162. }, {
  1163. 'type': 'keydown',
  1164. 'propagate': false,
  1165. 'disable_in_input': true,
  1166. 'target': document
  1167. }
  1168. );
  1169. shortcut.add("2", function(){
  1170. if(VE.tmp.form_changed){
  1171. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(2) a').attr('href'));
  1172. } else {
  1173. location.href=$('.l-stat .l-stat__col:nth-of-type(2) a').attr('href');
  1174. }
  1175. }, {
  1176. 'type': 'keydown',
  1177. 'propagate': false,
  1178. 'disable_in_input': true,
  1179. 'target': document
  1180. }
  1181. );
  1182. shortcut.add("3", function(){
  1183. if(VE.tmp.form_changed){
  1184. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(3) a').attr('href'));
  1185. } else {
  1186. location.href=$('.l-stat .l-stat__col:nth-of-type(3) a').attr('href');
  1187. }
  1188. }, {
  1189. 'type': 'keydown',
  1190. 'propagate': false,
  1191. 'disable_in_input': true,
  1192. 'target': document
  1193. }
  1194. );
  1195. shortcut.add("4", function(){
  1196. if(VE.tmp.form_changed){
  1197. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(4) a').attr('href'));
  1198. } else {
  1199. location.href=$('.l-stat .l-stat__col:nth-of-type(4) a').attr('href');
  1200. }
  1201. }, {
  1202. 'type': 'keydown',
  1203. 'propagate': false,
  1204. 'disable_in_input': true,
  1205. 'target': document
  1206. }
  1207. );
  1208. shortcut.add("5", function(){
  1209. if(VE.tmp.form_changed){
  1210. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(5) a').attr('href'));
  1211. } else {
  1212. location.href=$('.l-stat .l-stat__col:nth-of-type(5) a').attr('href');
  1213. }
  1214. }, {
  1215. 'type': 'keydown',
  1216. 'propagate': false,
  1217. 'disable_in_input': true,
  1218. 'target': document
  1219. }
  1220. );
  1221. shortcut.add("6", function(){
  1222. if(VE.tmp.form_changed){
  1223. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(6) a').attr('href'));
  1224. } else {
  1225. location.href=$('.l-stat .l-stat__col:nth-of-type(6) a').attr('href');
  1226. }
  1227. }, {
  1228. 'type': 'keydown',
  1229. 'propagate': false,
  1230. 'disable_in_input': true,
  1231. 'target': document
  1232. }
  1233. );
  1234. shortcut.add("7", function(){
  1235. if(VE.tmp.form_changed){
  1236. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(7) a').attr('href'));
  1237. } else {
  1238. location.href=$('.l-stat .l-stat__col:nth-of-type(7) a').attr('href');
  1239. }
  1240. }, {
  1241. 'type': 'keydown',
  1242. 'propagate': false,
  1243. 'disable_in_input': true,
  1244. 'target': document
  1245. }
  1246. );
  1247. shortcut.add("h", function(){
  1248. $('.shortcuts').toggle();
  1249. }, {
  1250. 'type': 'keydown',
  1251. 'propagate': false,
  1252. 'disable_in_input': true,
  1253. 'target': document
  1254. }
  1255. );
  1256. shortcut.add("Esc", function(){
  1257. $('.shortcuts').hide();
  1258. $('input, checkbox, textarea, select').blur();
  1259. }, {
  1260. 'type': 'keydown',
  1261. 'propagate': false,
  1262. 'disable_in_input': false,
  1263. 'target': document
  1264. }
  1265. );
  1266. shortcut.add("Left", function(){
  1267. VE.navigation.move_focus_left();
  1268. }, {
  1269. 'type': 'keydown',
  1270. 'propagate': false,
  1271. 'disable_in_input': true,
  1272. 'target': document
  1273. }
  1274. );
  1275. shortcut.add("Right", function(){
  1276. VE.navigation.move_focus_right();
  1277. }, {
  1278. 'type': 'keydown',
  1279. 'propagate': false,
  1280. 'disable_in_input': true,
  1281. 'target': document
  1282. }
  1283. );
  1284. shortcut.add("down", function(){
  1285. VE.navigation.move_focus_down();
  1286. }, {
  1287. 'type': 'keydown',
  1288. 'propagate': false,
  1289. 'disable_in_input': true,
  1290. 'target': document
  1291. }
  1292. );
  1293. shortcut.add("up", function(){
  1294. VE.navigation.move_focus_up();
  1295. }, {
  1296. 'type': 'keydown',
  1297. 'propagate': false,
  1298. 'disable_in_input': true,
  1299. 'target': document
  1300. }
  1301. );
  1302. shortcut.add("l", function(){
  1303. var elm = $('.units.active .l-unit.focus .shortcut-l');
  1304. if(elm.length){
  1305. VE.navigation.shortcut(elm);
  1306. }
  1307. }, {
  1308. 'type': 'keydown',
  1309. 'propagate': false,
  1310. 'disable_in_input': true,
  1311. 'target': document
  1312. }
  1313. );
  1314. shortcut.add("s", function(){
  1315. var elm = $('.units.active .l-unit.focus .shortcut-s');
  1316. if(elm.length){
  1317. VE.navigation.shortcut(elm);
  1318. }
  1319. }, {
  1320. 'type': 'keydown',
  1321. 'propagate': false,
  1322. 'disable_in_input': true,
  1323. 'target': document
  1324. }
  1325. );
  1326. shortcut.add("w", function(){
  1327. var elm = $('.units.active .l-unit.focus .shortcut-w');
  1328. if(elm.length){
  1329. VE.navigation.shortcut(elm);
  1330. }
  1331. }, {
  1332. 'type': 'keydown',
  1333. 'propagate': false,
  1334. 'disable_in_input': true,
  1335. 'target': document
  1336. }
  1337. );
  1338. shortcut.add("d", function(){
  1339. var elm = $('.units.active .l-unit.focus .shortcut-d');
  1340. if(elm.length){
  1341. VE.navigation.shortcut(elm);
  1342. }
  1343. }, {
  1344. 'type': 'keydown',
  1345. 'propagate': false,
  1346. 'disable_in_input': true,
  1347. 'target': document
  1348. }
  1349. );
  1350. shortcut.add("r", function(){
  1351. var elm = $('.units.active .l-unit.focus .shortcut-r');
  1352. if(elm.length){
  1353. VE.navigation.shortcut(elm);
  1354. }
  1355. }, {
  1356. 'type': 'keydown',
  1357. 'propagate': false,
  1358. 'disable_in_input': true,
  1359. 'target': document
  1360. }
  1361. );
  1362. shortcut.add("n", function(){
  1363. var elm = $('.units.active .l-unit.focus .shortcut-n');
  1364. if(elm.length){
  1365. VE.navigation.shortcut(elm);
  1366. }
  1367. }, {
  1368. 'type': 'keydown',
  1369. 'propagate': false,
  1370. 'disable_in_input': true,
  1371. 'target': document
  1372. }
  1373. );
  1374. shortcut.add("u", function(){
  1375. var elm = $('.units.active .l-unit.focus .shortcut-u');
  1376. if(elm.length){
  1377. VE.navigation.shortcut(elm);
  1378. }
  1379. }, {
  1380. 'type': 'keydown',
  1381. 'propagate': false,
  1382. 'disable_in_input': true,
  1383. 'target': document
  1384. }
  1385. );
  1386. shortcut.add("Delete", function(){
  1387. var elm = $('.units.active .l-unit.focus .shortcut-delete');
  1388. if(elm.length){
  1389. VE.navigation.shortcut(elm);
  1390. }
  1391. }, {
  1392. 'type': 'keydown',
  1393. 'propagate': false,
  1394. 'disable_in_input': true,
  1395. 'target': document
  1396. }
  1397. );
  1398. shortcut.add("Enter", function(){
  1399. if(VE.tmp.form_changed){
  1400. if(!$('.ui-dialog').is(':visible')){
  1401. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect')[0], '', $(VE.navigation.state.menu_selector + '.focus a').attr('href'));
  1402. } else { // if dialog is opened - submitting confirm box by "enter" shortcut
  1403. $('.ui-dialog button.submit').click();
  1404. }
  1405. } else {
  1406. if(!$('.ui-dialog').is(':visible')){
  1407. var elm = $('.units.active .l-unit.focus .shortcut-enter');
  1408. if(elm.length){
  1409. VE.navigation.shortcut(elm);
  1410. } else {
  1411. VE.navigation.enter_focused();
  1412. }
  1413. } else { // if dialog is opened - submitting confirm box by "enter" shortcut
  1414. $('.ui-dialog button.submit').click();
  1415. }
  1416. }
  1417. }, {
  1418. 'type': 'keydown',
  1419. 'propagate': false,
  1420. 'disable_in_input': true,
  1421. 'target': document
  1422. }
  1423. );
  1424. $('.shortcuts .close').click(function(){
  1425. $('.shortcuts').hide();
  1426. });
  1427. $('.to-shortcuts').click(function(){
  1428. $('.shortcuts').toggle();
  1429. });
  1430. $(document).click(function(evt){
  1431. //close notification popup
  1432. if(!$(evt.target).hasClass('l-profile__notifications') && $(evt.target).parents('ul.notification-container').length == 0){
  1433. $('.notification-container').hide();
  1434. $('.l-profile__notifications').removeClass('active');
  1435. }
  1436. });
  1437. // focusing on the first input at form
  1438. if( location.href.indexOf('lead=') == -1 && !$('.ui-dialog').is(':visible') ){
  1439. $('#vstobjects .vst-input:not([disabled]), #vstobjects .vst-list:not([disabled])').first().focus();
  1440. }
  1441. $('.l-profile__notifications').click(function(){
  1442. if(!$('.l-profile__notifications').hasClass('active')){
  1443. VE.notifications.get_list();
  1444. $('.l-profile__notifications').addClass('active');
  1445. left = $('.l-profile__notifications').offset().left - $('.notification-container').outerWidth() + 28;
  1446. $('.notification-container').css({left: left+'px'});
  1447. } else {
  1448. $('.notification-container').hide();
  1449. $('.l-profile__notifications').removeClass('active');
  1450. }
  1451. });
  1452. VE.navigation.init();
  1453. VE.core.register();
  1454. if (location.href.search(/list/) != -1) {
  1455. var shift_select_ref = $('body').finderSelect({
  1456. children: '.l-unit',
  1457. 'onFinish': function(evt) {
  1458. var ref = $(evt.target);
  1459. $('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
  1460. $('.l-content').find('.l-unit.selected .ch-toggle').attr('checked', true);
  1461. if ($('.l-content').find('.l-unit.selected').length == $('.l-content').find('.l-unit').length) {
  1462. $('.toggle-all').addClass('clicked-on');
  1463. }
  1464. },
  1465. 'toggleAllHook': function() {
  1466. if ($('.l-unit').length == $('.ch-toggle:checked').length) {
  1467. $('.l-unit.selected').removeClass('selected');
  1468. $('.ch-toggle').attr('checked', false);
  1469. $('#toggle-all').attr('checked', false);
  1470. }
  1471. else {
  1472. $('.ch-toggle').attr('checked', true);
  1473. $('#toggle-all').attr('checked', true);
  1474. }
  1475. }
  1476. });
  1477. $('table').on('mousedown', 'td', function(e) {
  1478. if (e.ctrlKey) {
  1479. e.preventDefault();
  1480. }
  1481. });
  1482. }
  1483. //
  1484. $('form#objects').bind('submit', function(evt) {
  1485. $('.l-unit.selected').find('.ch-toggle').attr('checked', true);
  1486. });
  1487. // CRON HELPER
  1488. $( "#tabs" ).tabs();
  1489. $('.context-helper').click(function(){ $('#tabs').toggle(); $('.context-helper').toggle(); });
  1490. $('.context-helper-close').click(function(){ $('#tabs').toggle(); $('.context-helper').toggle(); });
  1491. $('.helper-container form').submit(function(){
  1492. $('#vstobjects input[name=v_min]').val($(this).find(':input[name=h_min]').val()).effect('highlight');
  1493. $('#vstobjects input[name=v_hour]').val($(this).find(':input[name=h_hour]').val()).effect('highlight');
  1494. $('#vstobjects input[name=v_day]').val($(this).find(':input[name=h_day]').val()).effect('highlight');
  1495. $('#vstobjects input[name=v_month]').val($(this).find(':input[name=h_month]').val()).effect('highlight');
  1496. $('#vstobjects input[name=v_wday]').val($(this).find(':input[name=h_wday]').val()).effect('highlight');
  1497. return false;
  1498. });
  1499. });