Hormold

VK Change (#1375717522)

Aug 5th, 2013
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 78.48 KB | None | 0 0
  1. Файл - graph.js (Старый размер - 74677 | Новый - 73591):
  2. 40.  +               0x85afd0, 0xd391bb, 0x8ecfce, 0xa8d1a9, 0xe47070, 0xf2ec96, 0xf7be5a, 0xbeaadf,
  3. 42.  -               0x6391bc, 0xc77bb1, 0x62b1bc, 0x80bb88, 0xb75454, 0xc9c255, 0xdca94f, 0x997fc4,
  4. 43.  -               0x85afd0, 0xc77bb1, 0x8ecfce, 0x80bb88, 0xe47070, 0xc9c255, 0xf7be5a, 0xbeaadf];
  5. 44.  +               0x6391bc, 0xbc6b9e, 0x62b1bc, 0x69a57a, 0xb75454, 0xd4ce68, 0xdca94f, 0x997fc4];
  6. 207.  - function drawLines(ctx, x, y, w, h, lines, stTime, enTime, xfactor, yfactor, yDelta, zoomedOut, active, smooth) {
  7. 208.  -   smooth = (!zoomedOut) && smooth;
  8. 209.  + function drawLines(ctx, x, y, w, h, lines, stTime, enTime, xfactor, yfactor, yDelta, zoomedOut, active) {
  9. 210.  +   var smooth = (!zoomedOut) && ((enTime - stTime) < (35 * 24 * 60 * 60));
  10. 412.  -   setStyle(this.graphDiv, {fontFamily: 'tahoma, arial, verdana, sans-serif, Lucida Sans', fontSize: '11px', color: '#36638e', width: this.viewWidth + 'px', clear: 'both', lineHeight: '130%', textAlign: 'left'});
  11. 413.  +   setStyle(this.graphDiv, {fontFamily: 'tahoma, arial, verdana, sans-serif, Lucida Sans', fontSize: '11px', color: '#36638e', width: this.viewWidth + 'px', clear: 'both'});
  12. 455.  -   var defaultGraph = 0;
  13. 457.  -     if (!params.multiple.def) params.multiple.def = 0;
  14. 458.  +     if (!params.multiple.del) params.multiple.def = 0;
  15. 487.  -     defaultGraph = params.multiple.def;
  16. 499.  -     dragElement: null, maskDragging: false, viewClick: false, smoothLines: false,
  17. 500.  +     dragElement: null, maskDragging: false, viewClick: false,
  18. 561.  -     graph.setData((typeof(data) == 'string') ? data : (data[defaultGraph] || []), isArray(params.adjust) ? params.adjust[0] : params.adjust);
  19. 562.  +     graph.setData((typeof(data) == 'string') ? data : (data[0] || []), isArray(params.adjust) ? params.adjust[0] : params.adjust);
  20. 870.  -     if (!g.smoothLines || !tooltips) {
  21. 871.  +     if (g.rightTime - g.leftTime >= 35 * 24 * 60 * 60 || !tooltips) {
  22. 973.  -     var g = ev.currentTarget.graph, line = ev.currentTarget.line, dot = line.dotLabel.dot, pos = line.dotLabel.pos;
  23. 974.  -     if (!g.smoothLines) {
  24. 975.  -       var text = '';
  25. 976.  -       if (line.l) {
  26. 977.  -         text += langNumeric(dot.y, line.l, true);
  27. 978.  -       } else {
  28. 979.  -         text += (dot.l ? dot.l : formatValue(dot.y)) + ' ' + line.name;
  29. 980.  +     var g = ev.currentTarget.graph, line = ev.currentTarget.line;
  30. 981.  +     for (var l = 0; l < g.lines.length; l++) {
  31. 982.  +       if (g.lines[l] == line) {
  32. 983.  +         g.showDotTT(l);
  33. 984.  +         break;;
  34. 986.  -       line.dotLabel.innerHTML = text;
  35. 987.  -       var sz = getSize(line.dotLabel)[0];
  36. 988.  -       if (pos + sz + line.dot.posX > g.viewWidth) {
  37. 989.  -         line.dotLabel.innerHTML = line.name + ' ' + (dot.l ? dot.l : formatValue(dot.y));
  38. 990.  -         line.dotLabel.style.left = pos - (sz - line.dotLabel.w) + "px";
  39. 991.  -       } else
  40. 992.  -         line.dotLabel.style.left = pos + "px";
  41. 993.  -
  42. 994.  -       for (var l = 0; l < g.lines.length; l++)
  43. 995.  -         g.lines[l].dotLabel.style.zIndex = (g.lines[l] == line) ? 1000 : 200;
  44. 1024.  -     if (!this.smoothLines) {
  45. 1025.  +     if (this.rightTime - this.leftTime >= 35 * 24 * 60 * 60) {
  46. 1037.  -       text += (dot.l ? dot.l : formatValue(dot.y)) + ' &ndash; ' + line.name;
  47. 1038.  +       text += (dot.l ? dot.l : formatValue(dot.y)) + ' ' + line.name;
  48. 1111.  -     if (this.isNegative)
  49. 1112.  -       drawLines(ctx, 0, 4, this.viewWidth, 32, this.lines, this.minTime, this.maxTime, this.xfactorOut, this.yfactorOut, -this.localBottom, true, null, false);
  50. 1113.  +     if (this.minValue < -1e-6)
  51. 1114.  +       drawLines(ctx, 0, 4, this.viewWidth, 32, this.lines, this.minTime, this.maxTime, this.xfactorOut, this.yfactorOut, -this.minValue, true, null);
  52. 1116.  -       drawLines(ctx, 0, 4, this.viewWidth, 36, this.lines, this.minTime, this.maxTime, this.xfactorOut, this.yfactorOut, 0, true, null, false);
  53. 1117.  +       drawLines(ctx, 0, 4, this.viewWidth, 36, this.lines, this.minTime, this.maxTime, this.xfactorOut, this.yfactorOut, 0, true, null);
  54. 1144.  -     var localMax = (this.adjust ? -1e9 : 0), localMin = (this.adjust ? 1e9 : 0), outMax = 0, outMin = 0, dotsVisible = 0;
  55. 1145.  +     var localMax = (this.adjust ? -1e9 : 0), localMin = (this.adjust ? 1e9 : 0), outMax = 0, outMin = 0;
  56. 1156.  -         if (enIdx >= stIdx && (ps[enIdx].x >= this.leftTime) && (ps[stIdx].x <= this.rightTime)) {
  57. 1157.  +         if (enIdx >= stIdx && (ps[enIdx].x >= this.leftTime) && (ps[stIdx].x <= this.rightTime))
  58. 1164.  -           dotsVisible = Math.max(dotsVisible, enIdx - stIdx);
  59. 1165.  -         }
  60. 1185.  -     this.smoothLines = dotsVisible < 30 ? true : false;
  61. 1226.  -     var i_start = this.params.show_time || this.params.show_minutes ? 0 : 6;
  62. 1227.  -     for (var i = i_start; (i < 100) && !fin; i++) {
  63. 1228.  -       if (i < xscales.length) {
  64. 1229.  +     for (var i = 0; (i < 100) && !fin; i++) {
  65. 1230.  +       if (i < xscales.length)
  66. 1232.  -       } else {
  67. 1233.  +       else {
  68. 1297.  -       drawLines(ctx, 0, 9, this.viewWidth, this.viewHeight - 43, this.lines, this.leftTime, this.rightTime, this.xfactorIn, this.yfactorIn, -this.localBottom, false, this.activeLine, this.smoothLines);
  69. 1298.  +       drawLines(ctx, 0, 9, this.viewWidth, this.viewHeight - 43, this.lines, this.leftTime, this.rightTime, this.xfactorIn, this.yfactorIn, -this.localBottom, false, this.activeLine);
  70. 1300.  -       drawLines(ctx, 0, 9, this.viewWidth, this.viewHeight - 34, this.lines, this.leftTime, this.rightTime, this.xfactorIn, this.yfactorIn, this.adjust ? -this.localBottom : 0, false, this.activeLine, this.smoothLines);
  71. 1301.  +       drawLines(ctx, 0, 9, this.viewWidth, this.viewHeight - 34, this.lines, this.leftTime, this.rightTime, this.xfactorIn, this.yfactorIn, this.adjust ? -this.localBottom : 0, false, this.activeLine);
  72. 1325.  -       }
  73. 1326.  -       if (line.legend.parentNode) {
  74. 1327.  -         line.legend.parentNode.removeChild(line.legend);
  75. 1329.  +       line.legend.parentNode.removeChild(line.legend);
  76. 1444.  -       addEventEx(this, line.dotLabel, 'mouseover', this.expandLabel);
  77. 1445.  +       //addEventEx(this, line.dotLabel, 'mouseover', this.expandLabel);
  78. 1488.  -         if (i > 0 && i < 10 && Math.abs(line.d[i].x - line.d[i - 1].x) > 1) {
  79. 1489.  +         if (i > 0 && Math.abs(line.d[i].x - line.d[i - 1].x) > 1) {
  80. 1606.  -         var colors_row = l % 4;
  81. 1607.  -         colors_row = colors_row == 1 ? 3 : colors_row;
  82. 1608.  -         line.c = colors[(colors_row * 8 + Math.floor(l / 4)) % colors.length];
  83. 1609.  +         line.c = colors[((l % 4) * 8 + Math.floor(l / 4)) % colors.length];
  84. 1717.  -     this.scaleWidth = (this.lines.length == 0) ? 0 : (maxWidth + 30);
  85. 1718.  +     this.scaleWidth = (this.lines.length == 0) ? 0 : (maxWidth + 25);
  86. ------
  87. Файл - datepicker.js (Старый размер - 21372 | Новый - 0):
  88. 0.  - (function() {
  89. 1.  -
  90. 2.  - var l = {
  91. 3.  -   mn: [],
  92. 4.  -   mnOf: [],
  93. 5.  -   mnOfSm: [],
  94. 6.  -   days: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']
  95. 7.  - };
  96. 8.  -
  97. 9.  - var dateFormat = getLang('datepicker_dateFormat');
  98. 10.  - if (dateFormat === 'dateFormat') dateFormat = '{day} {month} {year}';
  99. 11.  - var monthFormat = getLang('datepicker_monthFormat');
  100. 12.  - if (monthFormat === 'monthFormat') monthFormat = '{month} {year}';
  101. 13.  -
  102. 14.  - var larr = getLang('larr');
  103. 15.  - if (larr === 'larr') larr = '&larr;';
  104. 16.  - var rarr = getLang('rarr');
  105. 17.  - if (rarr === 'rarr') rarr = '&rarr;';
  106. 18.  -
  107. 19.  - var modes = ['d', 'w', 'm'];
  108. 20.  -
  109. 21.  - for (var i = 1; i < 13; i++) {
  110. 22.  -   l.mn.push(getLang('Month' + i));
  111. 23.  -   l.mnOf.push(getLang('Month' + i + '_of'));
  112. 24.  -   l.mnOfSm.push(getLang('month' + i + '_of'));
  113. 25.  - }
  114. 26.  - for (var i = 0; i < 7; i++) {
  115. 27.  -   var wd = getLang('events_' + l.days[i]);
  116. 28.  -   if (wd.substr(0, 6) != 'events') l.days[i] = wd;
  117. 29.  - }
  118. 30.  -
  119. 31.  - var dim = [31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  120. 32.  -
  121. 33.  - if (!window.cals) {
  122. 34.  -   window.cals = {
  123. 35.  -     list: {},
  124. 36.  -     getMonth: function(guid, m, y, monthsel) {
  125. 37.  -       if (cals.list[guid]) cals.list[guid].getMonth(m, y, false, monthsel);
  126. 38.  -       return false;
  127. 39.  -     },
  128. 40.  -     getDay: function(guid, d, m, y) {
  129. 41.  -       if (cals.list[guid]) cals.list[guid].getDay(d, m, y);
  130. 42.  -       return false;
  131. 43.  -     }
  132. 44.  -   };
  133. 45.  - }
  134. 46.  -
  135. 47.  - window.Calendar = function(params) {
  136. 48.  -   var place = params.container;
  137. 49.  -   var rnd = Math.round(Math.random() * 1000000);
  138. 50.  -   if (!place) return;
  139. 51.  -
  140. 52.  -   var guid = _ui.reg(this);
  141. 53.  -   cals.list[guid] = this;
  142. 54.  -
  143. 55.  -   place.innerHTML = '<div></div>';
  144. 56.  -   place = place.firstChild;
  145. 57.  -   var mode = (modes[params.mode] || params.mode || 'd').toString().replace(/(this|next|prev)/, '');
  146. 58.  -   var hideNextMonth = params.hideNextMonth && true;
  147. 59.  -
  148. 60.  -   var parseDay = this.parseDay = function(day) {
  149. 61.  -     day = day.toString();
  150. 62.  -     return {
  151. 63.  -       y: parseInt(day.substr(0, 4), 10),
  152. 64.  -       m: parseInt(day.substr(4, 2), 10),
  153. 65.  -       d: parseInt(day.substr(6, 2), 10)
  154. 66.  -     };
  155. 67.  -   }
  156. 68.  -
  157. 69.  -   var day = params.day || { d: -1, m: -1, y: -1 };
  158. 70.  -   if (!day.m) {
  159. 71.  -     day = parseDay(day);
  160. 72.  -   }
  161. 73.  -
  162. 74.  -   var _t = this;
  163. 75.  -   var addRows = params.addRows || '';
  164. 76.  -   var addRowsM = params.addRowsM || addRows;
  165. 77.  -
  166. 78.  -   this.setDay = function(d, m, y) {
  167. 79.  -     day = m ? { d: d, m: m, y: y } : parseDay(d);
  168. 80.  -     _t.getMonth(day.m, day.y);
  169. 81.  -   };
  170. 82.  -
  171. 83.  -   this.setMode = function(m) {
  172. 84.  -     mode = (modes[m] || m || 'd').replace(/(this|next|prev)/, '');
  173. 85.  -     _t.getMonth(day.m, day.y, true);
  174. 86.  -   };
  175. 87.  -
  176. 88.  -   var getChild = function(el, inds) {
  177. 89.  -     for (var i = 0; i < inds.length; i++) {
  178. 90.  -       var el = el.childNodes[inds[i]];
  179. 91.  -       if (!el) return null;
  180. 92.  -     }
  181. 93.  -     return el;
  182. 94.  -   };
  183. 95.  -
  184. 96.  -   this.getDay = params.getDay || function(d, m, y) {};
  185. 97.  -
  186. 98.  -   this.getMonth = function(m, y, noheight, monthsel) {
  187. 99.  -     var mn = l.mn;
  188. 100.  -     var oD = new Date(y, m - 1, 1);
  189. 101.  -     oD.od = oD.getDay();
  190. 102.  -     if (oD.od == 0) {
  191. 103.  -       oD.od = 7;
  192. 104.  -     }
  193. 105.  -
  194. 106.  -     var disabled = (mode == '-1');
  195. 107.  -
  196. 108.  -     var dontDoLine = false;
  197. 109.  -     var leftStyle = '';
  198. 110.  -     var todayDate = !disabled ? new Date() : new Date(3000, 1, 1);
  199. 111.  -     todayDate = new Date(todayDate.getFullYear(), todayDate.getMonth(), (mode === 'm') ? 1 : todayDate.getDate());
  200. 112.  -
  201. 113.  -     var d_y = oD.getFullYear();
  202. 114.  -     dim[1] = (((d_y % 100 != 0) && (d_y % 4 == 0)) || (d_y % 400 == 0)) ? 29 : 28;
  203. 115.  -     var t = [];
  204. 116.  -     var t2 = [];
  205. 117.  -
  206. 118.  -     var tbl = '<table class="%cls%" cols="%cols%" cellpadding="0" border="0" cellspacing="0"><tbody>%rows%</tbody></table>';
  207. 119.  -     var headerNormal;
  208. 120.  -     var headerDisabled;
  209. 121.  -
  210. 122.  -     switch (mode) {
  211. 123.  -     case 'm':
  212. 124.  -       var selDay = (y == day.y) ? day.m : 0;
  213. 125.  -       nextYear = y + 1;
  214. 126.  -       lastYear = y - 1;
  215. 127.  -
  216. 128.  -       headerNormal = ''
  217. 129.  -         + '<tr>'
  218. 130.  -         + '<td class="month_arr"><a class="arr left" onclick="return cals.getMonth('+guid+',1,'+lastYear+');"></a></td>'
  219. 131.  -         + '<td align="center" class="month">' + y + '</td>'
  220. 132.  -         + '<td class="month_arr"><a class="arr right" onclick="return cals.getMonth('+guid+',1,'+nextYear+');"></a></td>'
  221. 133.  -         + '</tr>';
  222. 134.  -
  223. 135.  -       t.push('<tr><td colspan="2">');
  224. 136.  -       t.push(rs(tbl, {cls: 'cal_table_head', cols: '3', rows: headerNormal}));
  225. 137.  -       t.push('</td></tr><tr>');
  226. 138.  -       for (var i = 1; i <= 12; i++) {
  227. 139.  -         leftStyle = "";
  228. 140.  -         if (i % 2 == 1) {
  229. 141.  -           if (i > 1) t.push('</tr><tr>');
  230. 142.  -           leftStyle = ' day_left';
  231. 143.  -         }
  232. 144.  -         clDay = (i == selDay) ? 'day sel' : 'day';
  233. 145.  -         curDate = new Date(y, i - 1, 1);
  234. 146.  -         if (!params.pastActive && curDate < todayDate || params.pastActive && curDate > todayDate) {
  235. 147.  -           clDay += ' past_day';
  236. 148.  -         }
  237. 149.  -         if (curDate.getTime() == todayDate.getTime()) {
  238. 150.  -           clDay += ' today';
  239. 151.  -         }
  240. 152.  -         t.push('<td class="' + clDay + leftStyle + '" style="width:50%" id="day' + i + '_' + rnd + '" onclick="return cals.getDay('+guid+', 1, '+i+', '+y+');" onmouseover="addClass(this, \'hover\')"  onmouseout="removeClass(this, \'hover\')">' + mn[i - 1] + '</td>');
  241. 153.  -       }
  242. 154.  -       t.push('</tr>');
  243. 155.  -
  244. 156.  -       t2.push(rs(tbl, {cls: 'cal_table', cols: '2', rows: t.join('')}));
  245. 157.  -
  246. 158.  -       if (!noheight) place.style.height = place.offsetHeight + "px";
  247. 159.  -
  248. 160.  -       val(place, t2.join(''));
  249. 161.  -
  250. 162.  -       break;
  251. 163.  -
  252. 164.  -     default:
  253. 165.  -       var selDay = (y == day.y && m == day.m) ? day.d : 0;
  254. 166.  -
  255. 167.  -       if (m == 12) {
  256. 168.  -         nextMonth = 1;
  257. 169.  -         nextYear = y + 1;
  258. 170.  -       } else {
  259. 171.  -         nextMonth = m + 1;
  260. 172.  -         nextYear = y;
  261. 173.  -       }
  262. 174.  -       if (m == 1) {
  263. 175.  -         lastMonth = 12;
  264. 176.  -         lastYear = y - 1;
  265. 177.  -       } else {
  266. 178.  -         lastMonth = m - 1;
  267. 179.  -         lastYear = y;
  268. 180.  -       }
  269. 181.  -
  270. 182.  -       var monthYear = monthFormat.replace('{month}', mn[m - 1]).replace('{year}', y);
  271. 183.  -       var calClass = 'cal_table' + (disabled ? ' disabled' : '') + (monthsel ? ' unshown' : '');
  272. 184.  -       var hoverEl = (mode === 'w') ? 'this.parentNode' : 'this';
  273. 185.  -
  274. 186.  -       var headerNormal = ''
  275. 187.  -         + '<tr>'
  276. 188.  -         + '<td class="month_arr"><a class="arr left" onclick="return cals.getMonth('+guid+','+lastMonth+','+lastYear+');"></a></td>'
  277. 189.  -         + '<td align="center" class="month"><a class="cal_month_sel" onclick="return cals.getMonth('+guid+','+m+','+y+',1);">' + monthYear + '</a></td>'
  278. 190.  -         + '<td class="month_arr"><a class="arr right" onclick="return cals.getMonth('+guid+','+nextMonth+','+nextYear+');"></a></td>'
  279. 191.  -         + '</tr>';
  280. 192.  -       var headerDisabled = ''
  281. 193.  -         + '<tr>'
  282. 194.  -         + '<td class="month_arr"><span class="arr left"></span></td>'
  283. 195.  -         + '<td align="center" class="month">' + monthYear + '</td>'
  284. 196.  -         + '<td class="month_arr"><span class="arr right"></span></td>'
  285. 197.  -         + '</tr>';
  286. 198.  -
  287. 199.  -       t.push('<tr><td colspan="7">');
  288. 200.  -       t.push(rs(tbl, {cls: 'cal_table_head', cols: '3', rows: disabled ? headerDisabled : headerNormal}));
  289. 201.  -       t.push('</td></tr><tr>');
  290. 202.  -
  291. 203.  -       for (var s = 0; s < 7; s++) {
  292. 204.  -         t.push('<td class="daysofweek">' + l.days[s] + '</td>');
  293. 205.  -       }
  294. 206.  -       t.push('</tr><tr>');
  295. 207.  -
  296. 208.  -       var dayPos = [];
  297. 209.  -
  298. 210.  -       for (var i = 1; i <= 42; i++) {
  299. 211.  -         var leftStyle = (i % 7 == 1) ? ' day_left' : '';
  300. 212.  -         var x = ((i - oD.od >= 0) && (i - oD.od < dim[m - 1])) ? i - oD.od + 1 : 0;
  301. 213.  -         var curDate = new Date(y, m - 1, i - oD.od + 1);
  302. 214.  -         var x1 = x;
  303. 215.  -         var lim = 1;
  304. 216.  -         if (mode === 'w') {
  305. 217.  -           var x1 = i - oD.od - i % 7 + 2;
  306. 218.  -           if (i % 7 == 0) x1 -= 7;
  307. 219.  -           if (selDay) {
  308. 220.  -             var lim = 8 - (selDay + oD.od - 1) % 7;
  309. 221.  -             if (lim == 8) lim = 1;
  310. 222.  -           }
  311. 223.  -         }
  312. 224.  -
  313. 225.  -         clDay = leftStyle;
  314. 226.  -         if (x >= selDay && x < selDay + lim) {
  315. 227.  -           clDay += ' day sel';
  316. 228.  -         } else {
  317. 229.  -           clDay += ' day';
  318. 230.  -         }
  319. 231.  -         if (!params.pastActive && curDate < todayDate || params.pastActive && curDate > todayDate) {
  320. 232.  -           clDay += ' past_day';
  321. 233.  -         }
  322. 234.  -         if (curDate.getTime() == todayDate.getTime()) {
  323. 235.  -           clDay += ' today';
  324. 236.  -         }
  325. 237.  -
  326. 238.  -         if (x > 0) {
  327. 239.  -           dayPos[i] = x1;
  328. 240.  -           t.push('<td id="day' + x + '_' + rnd + '" class="' + clDay + '" onclick="return cals.getDay('+guid+', '+x1+', '+m+', '+y+');" onmouseover="addClass('+hoverEl+', \'hover\')"  onmouseout="removeClass('+hoverEl+', \'hover\')">' + x + '</td>');
  329. 241.  -         } else {
  330. 242.  -           if (i != 36) {
  331. 243.  -             if (!dontDoLine) {
  332. 244.  -               if (mode === 'w') dayPos[i] = x1;
  333. 245.  -               date = (i > 7 && !hideNextMonth) ? curDate.getDate() : '&nbsp';
  334. 246.  -               t.push('<td class="day no_month_day' + leftStyle + '">' + date + '</td>');
  335. 247.  -             }
  336. 248.  -           } else {
  337. 249.  -             dontDoLine = true;
  338. 250.  -           }
  339. 251.  -         }
  340. 252.  -         if ((i % 7 == 0) && (i < 36)) {
  341. 253.  -           t.push('</tr><tr>');
  342. 254.  -         }
  343. 255.  -       }
  344. 256.  -       t.push('</tr>' + addRows);
  345. 257.  -
  346. 258.  -       t2.push(rs(tbl, {cls: calClass, cols: '7', rows: t.join('')}));
  347. 259.  -
  348. 260.  -       t = [];
  349. 261.  -
  350. 262.  -       todayDate = new Date(todayDate.getFullYear(), todayDate.getMonth(), 1);
  351. 263.  -
  352. 264.  -       var selDay = (y == day.y) ? day.m : 0;
  353. 265.  -       var calClass = 'cal_table' + (disabled ? ' disabled' : '') + (monthsel ? '' : ' unshown');
  354. 266.  -
  355. 267.  -       headerNormal = ''
  356. 268.  -         + '<tr>'
  357. 269.  -         + '<td class="month_arr"><a class="arr left" onclick="return cals.getMonth('+guid+','+m+','+(y-1)+',1);"></a></td>'
  358. 270.  -         + '<td align="center" class="month"><a class="cal_month_sel" onclick="return cals.getMonth('+guid+','+m+','+y+');">' + y + '</a></td>'
  359. 271.  -         + '<td class="month_arr"><a class="arr right" onclick="return cals.getMonth('+guid+','+m+','+(y+1)+',1);"></a></td>'
  360. 272.  -         + '</tr>';
  361. 273.  -       headerDisabled = ''
  362. 274.  -         + '<tr>'
  363. 275.  -         + '<td class="month_arr"><span class="arr left"></span></td>'
  364. 276.  -         + '<td align="center" class="month">' + y + '</td>'
  365. 277.  -         + '<td class="month_arr"><span class="arr right"></span></td>'
  366. 278.  -         + '</tr>';
  367. 279.  -
  368. 280.  -       t.push('<tr><td colspan="2">');
  369. 281.  -       t.push(rs(tbl, {cls: 'cal_table_head', cols: '3', rows: disabled ? headerDisabled : headerNormal}));
  370. 282.  -       t.push('</td></tr><tr>');
  371. 283.  -       for (var i = 1; i <= 12; i++) {
  372. 284.  -         leftStyle = '';
  373. 285.  -         if (i % 2 == 1) {
  374. 286.  -           if (i > 1) t.push('</tr><tr>');
  375. 287.  -           leftStyle = ' day_left';
  376. 288.  -         }
  377. 289.  -         clDay = (i == selDay) ? 'day sel' : 'day';
  378. 290.  -         curDate = new Date(y, i - 1, 1);
  379. 291.  -         if (!params.pastActive && curDate < todayDate || params.pastActive && curDate > todayDate) {
  380. 292.  -           clDay += ' past_day';
  381. 293.  -         }
  382. 294.  -         if (curDate.getTime() == todayDate.getTime()) {
  383. 295.  -           clDay += ' today';
  384. 296.  -         }
  385. 297.  -         t.push('<td class="' + clDay + leftStyle + '" style="width:50%" id="day' + i + '_' + rnd + '" onclick="return cals.getMonth('+guid+', '+i+', '+y+');" onmouseover="addClass(this, \'hover\')"  onmouseout="removeClass(this, \'hover\')">' + mn[i - 1] + '</td>');
  386. 298.  -       }
  387. 299.  -       t.push('</tr>' + addRowsM);
  388. 300.  -
  389. 301.  -       t2.push(rs(tbl, {cls: calClass, cols: '2', rows: t.join('')}));
  390. 302.  -
  391. 303.  -       val(place, t2.join(''));
  392. 304.  -
  393. 305.  -       if (browser.opera && !browser.mobile) {
  394. 306.  -         animate(place, {opacity: 0.99}, 20, animate.pbind(place, {opacity: 1}, 20)); // fuck opera!
  395. 307.  -       }
  396. 308.  -
  397. 309.  -       break;
  398. 310.  -     }
  399. 311.  -   }
  400. 312.  -
  401. 313.  -   this.getMonth(day.m, day.y);
  402. 314.  - };
  403. 315.  -
  404. 316.  - window.Datepicker = function(el, options) {
  405. 317.  -
  406. 318.  -   el = ge(el);
  407. 319.  -   if (!el) return;
  408. 320.  -
  409. 321.  -   var dates = {};
  410. 322.  -   var lockHide = false;
  411. 323.  -   var _t = this;
  412. 324.  -   var w;
  413. 325.  -   var isShown = false;
  414. 326.  -   var hour = 0;
  415. 327.  -   var min = 0;
  416. 328.  -   var id = el.id;
  417. 329.  -   var inputId = id + "_date_input";
  418. 330.  -   var n = el.name || id;
  419. 331.  -   var p = el.parentNode;
  420. 332.  -   var calBox = id + '_cal_box';
  421. 333.  -   var calDiv = id + '_cal_div';
  422. 334.  -   var calFrame = id + '_cal_frame';
  423. 335.  -
  424. 336.  -   var defaults = {
  425. 337.  -     mode:       'd',
  426. 338.  -     resfmt:     'ts', // could be 'plain'
  427. 339.  -     width:      145,
  428. 340.  -     addRows:    '',
  429. 341.  -     noPast:     false,
  430. 342.  -     pastActive: false,
  431. 343.  -     onUpdate:   function(d, m) {}
  432. 344.  -   };
  433. 345.  -
  434. 346.  -   options = extend({}, defaults, options);
  435. 347.  -
  436. 348.  -   var mode       = options.mode;
  437. 349.  -   var onUpdate   = options.onUpdate;
  438. 350.  -   var w          = options.width;
  439. 351.  -   var fmt        = options.resfmt;
  440. 352.  -   var addRows    = options.addRows;
  441. 353.  -   var addRowsM   = options.addRowsM || addRows;
  442. 354.  -
  443. 355.  -   var onClick = function(e) {
  444. 356.  -     if (mode === 'h') return false;
  445. 357.  -     if (isShown) {
  446. 358.  -       _t.hide();
  447. 359.  -     } else {
  448. 360.  -       showCalendar();
  449. 361.  -     }
  450. 362.  -     ge(inputId).blur();
  451. 363.  -     return false;
  452. 364.  -   };
  453. 365.  -
  454. 366.  -   var showCalendar = function() {
  455. 367.  -     if (isShown) return;
  456. 368.  -     isShown = true;
  457. 369.  -
  458. 370.  -     _ui.sel(_t.guid);
  459. 371.  -     show(calBox);
  460. 372.  -     new Calendar({
  461. 373.  -       container:     ge(calDiv),
  462. 374.  -       day:           dates,
  463. 375.  -       mode:          mode,
  464. 376.  -       addRows:       addRows,
  465. 377.  -       addRowsM:      addRowsM,
  466. 378.  -       hideNextMonth: true,
  467. 379.  -       pastActive:    options.pastActive,
  468. 380.  -       getDay: function(d, m, y) {
  469. 381.  -         updateDate({
  470. 382.  -           'd': d,
  471. 383.  -           'm': m,
  472. 384.  -           'y': y
  473. 385.  -         }, mode);
  474. 386.  -       }
  475. 387.  -     });
  476. 388.  -     var s = getSize(ge(calDiv));
  477. 389.  -     setStyle(ge(calFrame), {width: s[0], height: s[1]});
  478. 390.  -     ge(inputId).focus();
  479. 391.  -   };
  480. 392.  -
  481. 393.  -   var updateDate = function(date, mode, init) {
  482. 394.  -     if (!init && options.noPast) {
  483. 395.  -       if (new Date(date.y, date.m - 1, date.d, 23, 59) < new Date()) {
  484. 396.  -         return;
  485. 397.  -       }
  486. 398.  -     }
  487. 399.  -     dates = date;
  488. 400.  -     var controlElem = geByClass1('datepicker_control', wrap);
  489. 401.  -     if (mode === 'h') {
  490. 402.  -       addClass(controlElem, 'disabled');
  491. 403.  -     } else {
  492. 404.  -       removeClass(controlElem, 'disabled');
  493. 405.  -       if (mode === 'm') {
  494. 406.  -         ge(inputId).value = monthFormat.replace('{month}', winToUtf(l.mn[date.m - 1])).replace('{year}', date.y);
  495. 407.  -       } else {
  496. 408.  -         ge(inputId).value = dateFormat.replace('{day}', date.d).replace('{month}', winToUtf(l.mnOf[date.m - 1])).replace('{year}', date.y);
  497. 409.  -       }
  498. 410.  -     }
  499. 411.  -     _t.hide();
  500. 412.  -     if (fmt === 'plain') {
  501. 413.  -       ge(id).value = date.d + '.' + date.m + '.' + date.y + (options.time ? (' ' + hour + ':' + min) : '');
  502. 414.  -     } else if (fmt === 'ts') {
  503. 415.  -       ge(id).value = Math.floor(new Date(date.y, date.m - 1, date.d, hour, min).getTime() / 1000) - ((new Date()).getTimezoneOffset() + 240) * 60 - intval(vk.dt);
  504. 416.  -     }
  505. 417.  -     if (!init) onUpdate(date, mode);
  506. 418.  -   };
  507. 419.  -
  508. 420.  -   this.hide = function() {
  509. 421.  -     if (!isShown) return;
  510. 422.  -     isShown = false;
  511. 423.  -
  512. 424.  -     _ui.sel(false);
  513. 425.  -     hide(calBox);
  514. 426.  -   };
  515. 427.  -   this.setMode = function(m) {
  516. 428.  -     mode = m;
  517. 429.  -     updateDate(dates, mode);
  518. 430.  -   };
  519. 431.  -   this.setDate = function(year, month, day) {
  520. 432.  -     if (!year && !month && !day) {
  521. 433.  -       var d = new Date();
  522. 434.  -       if (mode != 'm') dates.d = d.getDate();
  523. 435.  -       dates.m = d.getMonth() + 1;
  524. 436.  -       dates.y = d.getFullYear();
  525. 437.  -     } else {
  526. 438.  -       if (mode != 'm') dates.d = day;
  527. 439.  -       dates.m = month;
  528. 440.  -       dates.y = year;
  529. 441.  -     }
  530. 442.  -     updateDate(dates, mode);
  531. 443.  -   }
  532. 444.  -
  533. 445.  -   var d = 0, m;
  534. 446.  -   if (options.day || options.month || options.year) {
  535. 447.  -     if (mode != 'm') dates.d = options.day;
  536. 448.  -     dates.m = options.month;
  537. 449.  -     dates.y = options.year;
  538. 450.  -     if (options.time) {
  539. 451.  -       hour = options.hour || 0;
  540. 452.  -       min = options.min || 0;
  541. 453.  -     }
  542. 454.  -   } else if (m = (el.value || '').match(/(\d+)\.(\d+)(?:\.(\d+))?(?:\s+(\d+)\:(\d+))?/)) {
  543. 455.  -     if (mode != 'm') dates.d = intval(m[3].length ? m[1] : 0);
  544. 456.  -     dates.m = intval(m[3].length ? m[2] : m[1]);
  545. 457.  -     dates.y = intval(m[3].length ? m[3] : m[2]);
  546. 458.  -     if (options.time) {
  547. 459.  -       hour = m[4] || 0;
  548. 460.  -       min = m[5] || 0;
  549. 461.  -     }
  550. 462.  -   } else if (parseInt(el.value)) {
  551. 463.  -     var ts = parseInt(el.value) + ((new Date()).getTimezoneOffset() + 240) * 60 + intval(vk.dt);
  552. 464.  -     d = new Date(ts * 1000);
  553. 465.  -   } else {
  554. 466.  -     d = new Date();
  555. 467.  -   }
  556. 468.  -   if (d) {
  557. 469.  -     dates.d = d.getDate();
  558. 470.  -     dates.m = d.getMonth() + 1;
  559. 471.  -     dates.y = d.getFullYear();
  560. 472.  -     hour = d.getHours();
  561. 473.  -     min = d.getMinutes();
  562. 474.  -   }
  563. 475.  -
  564. 476.  -   var html = '<input type="hidden" name="' + n + '" id="' + id + '"/>' + '<div class="datepicker_control"><input readonly="1" style="width:' + (w - 25) + 'px;" type="text" class="datepicker_text" id="' + inputId + '"/></div>' + '<div id="' + calBox + '" class="cal_box"><iframe id="' + calFrame + '" class="cal_frame"></iframe><div id="' + calDiv + '" class="cal_div"></div></div>';
  565. 477.  -   var wrap = ce('div', {
  566. 478.  -     id: id + "_datepicker_container",
  567. 479.  -     className: "datepicker_container",
  568. 480.  -     innerHTML: html
  569. 481.  -   }, {
  570. 482.  -     width: w
  571. 483.  -   });
  572. 484.  -   p.replaceChild(wrap, el);
  573. 485.  -   addEvent(geByClass1('datepicker_control', wrap), 'mousedown', onClick);
  574. 486.  -   updateDate(dates, mode, true);
  575. 487.  -
  576. 488.  -   _t.guid = _ui.reg({
  577. 489.  -     container: wrap,
  578. 490.  -     onEvent: function(e) {
  579. 491.  -       if (e.type === 'mousedown') {
  580. 492.  -         var outside = true,
  581. 493.  -             t = e.target;
  582. 494.  -         while (t && t != t.parentNode) {
  583. 495.  -           if (t == wrap) {
  584. 496.  -             outside = false;
  585. 497.  -             break;
  586. 498.  -           }
  587. 499.  -           t = t.parentNode;
  588. 500.  -         }
  589. 501.  -         if (outside) {
  590. 502.  -           _t.hide();
  591. 503.  -         }
  592. 504.  -       }
  593. 505.  -     },
  594. 506.  -     _blur: function() {
  595. 507.  -       _t.hide();
  596. 508.  -     }
  597. 509.  -   });
  598. 510.  -
  599. 511.  -   if (options.time) {
  600. 512.  -     var time = ge(options.time);
  601. 513.  -     new Timepicker(time, {
  602. 514.  -       onUpdate: function(h, m) {
  603. 515.  -         hour = h;
  604. 516.  -         min = m;
  605. 517.  -         updateDate(dates, mode);
  606. 518.  -       },
  607. 519.  -       resfmt: fmt,
  608. 520.  -       hour: hour,
  609. 521.  -       min: min
  610. 522.  -     });
  611. 523.  -   }
  612. 524.  -
  613. 525.  -   if (browser.mozilla) {
  614. 526.  -     hide(calFrame);
  615. 527.  -   }
  616. 528.  - };
  617. 529.  -
  618. 530.  - window.Timepicker = function(el, options) {
  619. 531.  -   el = ge(el);
  620. 532.  -   if (!el) return;
  621. 533.  -   var id = el.id,
  622. 534.  -       n = el.name || '',
  623. 535.  -       v = el.value || '';
  624. 536.  -
  625. 537.  -   var defaults = {
  626. 538.  -     onUpdate: function(h, m) {},
  627. 539.  -     time: 0,
  628. 540.  -     hour: 0,
  629. 541.  -     min: 0,
  630. 542.  -     resfmt: 'ts', // could be 'plain'
  631. 543.  -     format: '{hour}<div class="fl_l" style="padding:5px 3px 0;"> : </div>{min}' //TEMP
  632. 544.  -   };
  633. 545.  -
  634. 546.  -   var o = extend({}, defaults, options);
  635. 547.  -
  636. 548.  -   var p = el.parentNode;
  637. 549.  -   if (v) o.time = v;
  638. 550.  -   if (o.time) {
  639. 551.  -     o.hour = Math.floor(o.time / 3600);
  640. 552.  -     o.min = Math.floor((o.time - o.hour * 3600) / 60);
  641. 553.  -   }
  642. 554.  -   var h = o.hour || 0;
  643. 555.  -   var m = o.min || 0;
  644. 556.  -   var fmt = o.resfmt;
  645. 557.  -   m = m - m % 5;
  646. 558.  -
  647. 559.  -   var html = '<input type="hidden" name="' + n + '" id="' + id + '" value="' + v + '"/>' + o.format.replace('{hour}', '<div class="fl_l"><input type="hidden" id="' + id + '_hour_input" value="' + h + '"/></div>').replace('{min}', '<div class="fl_l"><input type="hidden" id="' + id + '_min_input" value="' + m + '"/></div>') + '<div class="results_container"><div class="result_list" style="display:none;"></div><div class="result_list_shadow"><div class="shadow1"></div><div class="shadow2"></div></div></div>';
  648. 560.  -   var wrap = ce('div', {
  649. 561.  -     id: id + "_timepicker_container",
  650. 562.  -     className: 'timepicker_container',
  651. 563.  -     innerHTML: html
  652. 564.  -   });
  653. 565.  -   p.replaceChild(wrap, el);
  654. 566.  -
  655. 567.  -   var onChange = function() {
  656. 568.  -     var hour = hourDD.val(),
  657. 569.  -         min = minDD.val();
  658. 570.  -     if (fmt === 'plain') {
  659. 571.  -       ge(id).value = hour + ':' + min;
  660. 572.  -     } else if (fmt === 'ts') {
  661. 573.  -       ge(id).value = hour * 3600 + min * 60;
  662. 574.  -     }
  663. 575.  -     o.onUpdate(hour, min);
  664. 576.  -   }
  665. 577.  -
  666. 578.  -   var hours = [],
  667. 579.  -       mins = [];
  668. 580.  -   for (var i = 0; i < 24; i++) {
  669. 581.  -     hours.push([i, i]);
  670. 582.  -   }
  671. 583.  -   for (var i = 0; i < 60; i += 5) {
  672. 584.  -     mins.push([i, i < 10 ? '0' + i.toString() : i]);
  673. 585.  -   }
  674. 586.  -
  675. 587.  -   var hourDD = new Dropdown(ge(id + '_hour_input'), hours, {
  676. 588.  -     width: 47,
  677. 589.  -     multiselect: false,
  678. 590.  -     onChange: onChange
  679. 591.  -   });
  680. 592.  -   var minDD = new Dropdown(ge(id + '_min_input'), mins, {
  681. 593.  -     width: 47,
  682. 594.  -     multiselect: false,
  683. 595.  -     onChange: onChange
  684. 596.  -   });
  685. 597.  - };
  686. 598.  -
  687. 599.  - window.Daypicker = function(el, options) {
  688. 600.  -   el = ge(el);
  689. 601.  -   if (!el) return;
  690. 602.  -   var id = el.id,
  691. 603.  -       n = el.name || '',
  692. 604.  -       v = el.value || '';
  693. 605.  -
  694. 606.  -   var defaults = {
  695. 607.  -     onUpdate: function(d, m, y) {},
  696. 608.  -     date: 0,
  697. 609.  -     year: 0,
  698. 610.  -     month: 0,
  699. 611.  -     day: 0,
  700. 612.  -     format: '{day}<div class="fl_l" style="padding:0 3px;">&nbsp;</div>{month}<div class="fl_l" style="padding:0 3px;">&nbsp;</div>{year}',
  701. 613.  -     width: 0
  702. 614.  -   };
  703. 615.  -
  704. 616.  -   var o = extend({}, defaults, options);
  705. 617.  -
  706. 618.  -   var p = el.parentNode;
  707. 619.  -   if (v) o.date = v;
  708. 620.  -   if (o.date) {
  709. 621.  -     if (o.date < 30000000) {
  710. 622.  -       o.year = Math.floor(o.date / 10000);
  711. 623.  -       o.month = Math.floor((o.date - o.year * 10000) / 100);
  712. 624.  -       o.day = o.date - o.year * 10000 - o.month * 100;
  713. 625.  -     } else {
  714. 626.  -       var d = new Date(o.date * 1000);
  715. 627.  -       o.year = d.getFullYear();
  716. 628.  -       o.month = d.getMonth();
  717. 629.  -       o.day = d.getDate();
  718. 630.  -     }
  719. 631.  -   }
  720. 632.  -
  721. 633.  -   var html = '<div class="fl_l"><input type="hidden" name="' + n + '" id="' + id + '" value="' + v + '"/>' + o.format.replace('{year}', '<div class="fl_l"><input type="hidden" id="' + id + '_year_input" value="' + o.year + '"/></div>').replace('{month}', '<div class="fl_l"><input type="hidden" id="' + id + '_month_input" value="' + o.month + '"/></div>').replace('{day}', '<div class="fl_l"><input type="hidden" id="' + id + '_day_input" value="' + o.day + '"/></div>') + '</div>';
  722. 634.  -   var wrap = ce('div', {
  723. 635.  -     id: id + "_daypicker_container",
  724. 636.  -     className: 'daypicker_container clear_fix',
  725. 637.  -     innerHTML: html
  726. 638.  -   });
  727. 639.  -   p.replaceChild(wrap, el);
  728. 640.  -
  729. 641.  -   var daysInMonth = function(month, year) {
  730. 642.  -     var days = (new Date(year ? year : 2004, month, 0)).getDate(),
  731. 643.  -         res = [[0, getLang('global_day_label')]];
  732. 644.  -     for (var i = 1; i <= days; i++) {
  733. 645.  -       res.push([i, i]);
  734. 646.  -     }
  735. 647.  -     return res;
  736. 648.  -   }
  737. 649.  -
  738. 650.  -   var onChange = function() {
  739. 651.  -     var year = parseInt(yearDD.val()),
  740. 652.  -         month = parseInt(monthDD.val()),
  741. 653.  -         day = parseInt(dayDD.val());
  742. 654.  -     ge(id).value = year * 10000 + month * 100 + day;
  743. 655.  -     dayDD.setData(daysInMonth(month, year));
  744. 656.  -     o.onUpdate(year, month, day);
  745. 657.  -   }
  746. 658.  -   var d = new Date(),
  747. 659.  -       years = [[0, getLang('global_year_label')]],
  748. 660.  -       months = [[0, getLang('global_month_label')]];
  749. 661.  -   for (var i = d.getFullYear(); i >= (o.startYear || 1800); i--) {
  750. 662.  -     years.push([i, i]);
  751. 663.  -   }
  752. 664.  -   for (var i = 0; i < 12; i++) {
  753. 665.  -     months.push([i + 1, l.mnOf[i]]);
  754. 666.  -   }
  755. 667.  -
  756. 668.  -   var dayDD = new Dropdown(ge(id + '_day_input'), daysInMonth(o.month, o.year), {
  757. 669.  -     width: 58,
  758. 670.  -     onChange: onChange
  759. 671.  -   });
  760. 672.  -   var monthDD = new Dropdown(ge(id + '_month_input'), months, {
  761. 673.  -     width: 95,
  762. 674.  -     onChange: onChange
  763. 675.  -   });
  764. 676.  -   var yearDD = new Dropdown(ge(id + '_year_input'), years, {
  765. 677.  -     width: 60,
  766. 678.  -     onChange: onChange
  767. 679.  -   });
  768. 680.  -   if (o.width) {
  769. 681.  -     var w = getSize(wrap.firstChild)[0],
  770. 682.  -         d = o.width - w,
  771. 683.  -         w1 = getSize(monthDD.container)[0];
  772. 684.  -     setStyle(monthDD.container, {
  773. 685.  -       width: w1 + d
  774. 686.  -     });
  775. 687.  -   }
  776. 688.  - }
  777. 689.  -
  778. 690.  - })();
  779. 691.  -
  780. 692.  - try { stManager.done('datepicker.js'); } catch (e) {}
  781. ------
  782. Файл - ads_moder.css (Старый размер - 11221 | Новый - 0):
  783. 0.  - #ads_moder_css { display: none; }
  784. 1.  -
  785. 2.  - /* ------- */
  786. 3.  - /* General */
  787. 4.  - /* ------- */
  788. 5.  -
  789. 6.  - td.ads_table_overflow_hidden {
  790. 7.  -   height: 20px;
  791. 8.  -   vertical-align: top;
  792. 9.  - }
  793. 10.  - td.ads_table_overflow_hidden div {
  794. 11.  -   position: relative;
  795. 12.  - }
  796. 13.  - td.ads_table_overflow_hidden div div {
  797. 14.  -   position: absolute;
  798. 15.  -   overflow: hidden;
  799. 16.  -   white-space: nowrap;
  800. 17.  -   width: 100%;
  801. 18.  - }
  802. 19.  -
  803. 20.  - .ads_moder_tabs {
  804. 21.  -   padding-top: 0;
  805. 22.  - }
  806. 23.  - .ads_moder_tabs ul.t0 {
  807. 24.  -   width: 700px;
  808. 25.  - }
  809. 26.  -
  810. 27.  - .ads_moder_stat_filter {
  811. 28.  -   background-color: #F7F7F7;
  812. 29.  -   border-bottom: 1px solid #DAE1E8;
  813. 30.  -   padding: 10px 10px 5px 10px;
  814. 31.  - }
  815. 32.  - .ads_moder_stat_filter_tab_wrap {
  816. 33.  -   padding: 0 5px 5px 0;
  817. 34.  -   text-align: center;
  818. 35.  - }
  819. 36.  - .ads_moder_stat_filter_tab_wrap .round_tab.disabled:hover,
  820. 37.  - .ads_moder_stat_filter_tab_wrap .round_tab.label:hover {
  821. 38.  -   background-color: transparent;
  822. 39.  -   cursor: default;
  823. 40.  - }
  824. 41.  - .ads_moder_stat_filter_tab_wrap .round_tab.label {
  825. 42.  -   color: #555555;
  826. 43.  - }
  827. 44.  - .ads_moder_stat_filter_period_day .round_tab {
  828. 45.  -   width: 100px;
  829. 46.  - }
  830. 47.  - .ads_moder_stat_filter_period_week .round_tab {
  831. 48.  -   width: 180px;
  832. 49.  - }
  833. 50.  - .ads_moder_stat_filter_period_month .round_tab {
  834. 51.  -   width: 100px;
  835. 52.  - }
  836. 53.  -
  837. 54.  - /* -- */
  838. 55.  - /* Ad */
  839. 56.  - /* -- */
  840. 57.  -
  841. 58.  - .ads_ad_char_hint {
  842. 59.  -   position: relative;
  843. 60.  - }
  844. 61.  - .ads_ad_char_hint_color {
  845. 62.  -   visibility: hidden;
  846. 63.  -   position: absolute;
  847. 64.  -   height: 1px;
  848. 65.  -   bottom: 0;
  849. 66.  -   left: 0;
  850. 67.  -   border-bottom: 1px solid red;
  851. 68.  -   overflow: hidden;
  852. 69.  - }
  853. 70.  - .ads_ad_box a:hover .ads_ad_char_hint_color {
  854. 71.  -   visibility: visible;
  855. 72.  - }
  856. 73.  -
  857. 74.  - /* ------- */
  858. 75.  - /* Markers */
  859. 76.  - /* ------- */
  860. 77.  -
  861. 78.  - .ads_marker_wrap_ad {
  862. 79.  -   position: relative;
  863. 80.  - }
  864. 81.  - .ads_marker_wrap {
  865. 82.  -   position: absolute;
  866. 83.  -   top: 1px;
  867. 84.  -   left: 1px;
  868. 85.  -   z-index: 10;
  869. 86.  - }
  870. 87.  - .ads_marker {
  871. 88.  -   float: left;
  872. 89.  -   width: 5px;
  873. 90.  -   height: 5px;
  874. 91.  -   margin-right: 2px;
  875. 92.  -   border-radius: 1px;
  876. 93.  - }
  877. 94.  - .ads_marker_wrap_ad:hover .ads_marker {
  878. 95.  -   width: 7px;
  879. 96.  -   height: 7px;
  880. 97.  -   border-radius: 2px;
  881. 98.  - }
  882. 99.  -
  883. 100.  - .ads_marker_target {
  884. 101.  -   background-color: #ff8000;
  885. 102.  - }
  886. 103.  - .ads_marker_clicked {
  887. 104.  -   background-color: #9966cc;
  888. 105.  - }
  889. 106.  - .ads_marker_closed {
  890. 107.  -   background-color: #00b2cc;
  891. 108.  - }
  892. 109.  - .ads_marker_viewed {
  893. 110.  -   background-color: #ff55aa;
  894. 111.  - }
  895. 112.  -
  896. 113.  - .ads_marker_offensive {
  897. 114.  -   background-color: #5090ff;
  898. 115.  - }
  899. 116.  - .ads_marker_porno {
  900. 117.  -   background-color: #ff2213;
  901. 118.  - }
  902. 119.  - .ads_marker_cheaters {
  903. 120.  -   background-color: #a0522d;
  904. 121.  - }
  905. 122.  - .ads_marker_against {
  906. 123.  -   background-color: #008000;
  907. 124.  - }
  908. 125.  -
  909. 126.  - .ads_marker_enabled {
  910. 127.  -   background-color: #00aa00;
  911. 128.  - }
  912. 129.  - .ads_marker_enabling {
  913. 130.  -   background-color: #CFB53B;
  914. 131.  - }
  915. 132.  - .ads_marker_approved {
  916. 133.  -   background-color: #0000dd;
  917. 134.  - }
  918. 135.  - .ads_marker_disapproved {
  919. 136.  -   background-color: #aa0000;
  920. 137.  - }
  921. 138.  - .ads_marker_archived {
  922. 139.  -   background-color: #333333;
  923. 140.  - }
  924. 141.  -
  925. 142.  - .ads_marker_request_manual {
  926. 143.  -   background-color: #e0b080;
  927. 144.  - }
  928. 145.  - .ads_marker_request_wrong {
  929. 146.  -   background-color: #00d07f;
  930. 147.  - }
  931. 148.  -
  932. 149.  - .ads_marker_target_tip {
  933. 150.  -   color: #ff8000;
  934. 151.  - }
  935. 152.  - .ads_marker_clicked_tip {
  936. 153.  -   color: #9966cc;
  937. 154.  - }
  938. 155.  - .ads_marker_closed_tip {
  939. 156.  -   color: #00b2cc;
  940. 157.  - }
  941. 158.  - .ads_marker_viewed_tip {
  942. 159.  -   color: #ff55aa;
  943. 160.  - }
  944. 161.  -
  945. 162.  - .ads_marker_offensive_tip {
  946. 163.  -   color: #5090ff;
  947. 164.  - }
  948. 165.  - .ads_marker_porno_tip {
  949. 166.  -   color: #ff2213;
  950. 167.  - }
  951. 168.  - .ads_marker_cheaters_tip {
  952. 169.  -   color: #a0522d;
  953. 170.  - }
  954. 171.  - .ads_marker_against_tip {
  955. 172.  -   color: #008000;
  956. 173.  - }
  957. 174.  -
  958. 175.  - .ads_marker_enabled_tip {
  959. 176.  -   color: #00aa00;
  960. 177.  - }
  961. 178.  - .ads_marker_enabling_tip {
  962. 179.  -   color: #CFB53B;
  963. 180.  - }
  964. 181.  - .ads_marker_approved_tip {
  965. 182.  -   color: #0000dd;
  966. 183.  - }
  967. 184.  - .ads_marker_disapproved_tip {
  968. 185.  -   color: #aa0000;
  969. 186.  - }
  970. 187.  - .ads_marker_archived_tip {
  971. 188.  -   color: #333333;
  972. 189.  - }
  973. 190.  -
  974. 191.  - .ads_marker_request_manual_tip {
  975. 192.  -   color: #e0b080;
  976. 193.  - }
  977. 194.  - .ads_marker_request_wrong_tip {
  978. 195.  -   color: #00d07f;
  979. 196.  - }
  980. 197.  -
  981. 198.  - .ads_marker_other_tip {
  982. 199.  -   color: #2b587a;
  983. 200.  - }
  984. 201.  - .ads_marker_grey_tip {
  985. 202.  -   color: grey;
  986. 203.  - }
  987. 204.  - /* #8B00ff */
  988. 205.  - /* 009090 */
  989. 206.  -
  990. 207.  - .ads_info_marker {
  991. 208.  -   position: absolute;
  992. 209.  -   z-index: 20;
  993. 210.  -   top: 2px;
  994. 211.  -   right: 2px;
  995. 212.  -
  996. 213.  -   background-color: #D5DDE5;
  997. 214.  -   border-radius: 3px;
  998. 215.  -   text-align: center;
  999. 216.  -
  1000. 217.  -   width: 20px;
  1001. 218.  -   height: 20px;
  1002. 219.  -   line-height: 20px;
  1003. 220.  -   font-size: 1px;
  1004. 221.  -   opacity: 0.5;
  1005. 222.  -
  1006. 223.  -   display: none;
  1007. 224.  - }
  1008. 225.  - .ads_marker_wrap_ad:hover .ads_info_marker {
  1009. 226.  -   display: block;
  1010. 227.  -   text-decoration: none;
  1011. 228.  - }
  1012. 229.  - .ads_marker_wrap_ad .ads_info_marker:hover {
  1013. 230.  -   font-size: 11px;
  1014. 231.  -   opacity: 1;
  1015. 232.  - }
  1016. 233.  -
  1017. 234.  - /* -------- */
  1018. 235.  - /* Category */
  1019. 236.  - /* -------- */
  1020. 237.  -
  1021. 238.  - .ads_category_wrap {
  1022. 239.  -   max-width: 118px;
  1023. 240.  -   margin-top: 4px;
  1024. 241.  -   display: inline-block;
  1025. 242.  -   font-size: 0.91em;
  1026. 243.  -   position: relative;
  1027. 244.  - }
  1028. 245.  - .ads_category_wrap .ads_category_parent {
  1029. 246.  -   position: absolute;
  1030. 247.  -   z-index: 10;
  1031. 248.  -   display: none;
  1032. 249.  -   white-space: nowrap;
  1033. 250.  -   padding-left: 5px;
  1034. 251.  - }
  1035. 252.  - .ads_category_wrap .ads_subcategory {
  1036. 253.  -   font-weight: bold;
  1037. 254.  - }
  1038. 255.  - .ads_category_wrap:hover .ads_subcategory,
  1039. 256.  - .ads_category_wrap:hover .ads_category_parent {
  1040. 257.  -   background-color: white;
  1041. 258.  - }
  1042. 259.  - .ads_category_wrap:hover .ads_category_parent {
  1043. 260.  -   display: inline;
  1044. 261.  - }
  1045. 262.  -
  1046. 263.  - /* -------- */
  1047. 264.  - /* Ads info */
  1048. 265.  - /* -------- */
  1049. 266.  -
  1050. 267.  - .ads_info_premoderation_request .ads_ad_box_border {
  1051. 268.  -   border-width: 1px;
  1052. 269.  - }
  1053. 270.  - .ads_info_premoderation_request .label {
  1054. 271.  -   color: grey;
  1055. 272.  -   padding-right: 10px;
  1056. 273.  - }
  1057. 274.  - .ads_info_premoderation_request .info_msg {
  1058. 275.  -   margin-top: 15px;
  1059. 276.  - }
  1060. 277.  - .ads_info_premoderation_request_info {
  1061. 278.  -   line-height: 160%;
  1062. 279.  - }
  1063. 280.  - .ads_info_premoderation_request_info td {
  1064. 281.  -   vertical-align: top;
  1065. 282.  -   padding-bottom: 3px;
  1066. 283.  - }
  1067. 284.  - .ads_info_premoderation_request_ad_prev,
  1068. 285.  - .ads_info_premoderation_request_ad_cur,
  1069. 286.  - .ads_info_premoderation_request_arrow,
  1070. 287.  - .ads_info_premoderation_request_info {
  1071. 288.  -   padding-right: 15px;
  1072. 289.  - }
  1073. 290.  - .ads_info_premoderation_request_ad_prev,
  1074. 291.  - .ads_info_premoderation_request_ad_cur,
  1075. 292.  - .ads_info_premoderation_request_info {
  1076. 293.  -   vertical-align: top;
  1077. 294.  - }
  1078. 295.  - .ads_info_premoderation_request_ad_prev,
  1079. 296.  - .ads_info_premoderation_request_ad_cur {
  1080. 297.  -   text-align: center;
  1081. 298.  - }
  1082. 299.  - .ads_info_premoderation_request_arrow {
  1083. 300.  -   font-size: 30px;
  1084. 301.  - }
  1085. 302.  -
  1086. 303.  - /* ------- */
  1087. 304.  - /* All ads */
  1088. 305.  - /* ------- */
  1089. 306.  -
  1090. 307.  - .ads_all_navigation_page {
  1091. 308.  -   display: block;
  1092. 309.  -   float: left;
  1093. 310.  -   text-decoration: none !important;
  1094. 311.  -   padding: 5px;
  1095. 312.  -   margin: 0 3px 3px 0;
  1096. 313.  -   border: 1px solid #DAE1E8;
  1097. 314.  -   min-width: 45px;
  1098. 315.  - }
  1099. 316.  - .ads_all_navigation_page.current {
  1100. 317.  -   font-weight: bold;
  1101. 318.  - }
  1102. 319.  -
  1103. 320.  - .ads_all_ads_box {
  1104. 321.  -   float: left;
  1105. 322.  -   height: 300px;
  1106. 323.  -   margin: 0 5px;
  1107. 324.  - }
  1108. 325.  -
  1109. 326.  - .ads_all_ads_box .ads_ad_box_border {
  1110. 327.  -   border-width: 1px;
  1111. 328.  - }
  1112. 329.  -
  1113. 330.  - /* ------------- */
  1114. 331.  - /* Premoderation */
  1115. 332.  - /* ------------- */
  1116. 333.  -
  1117. 334.  - .ads_premoderation_requests {
  1118. 335.  -   margin-right: -30px;
  1119. 336.  - }
  1120. 337.  - .ads_premoderation_request_wrap {
  1121. 338.  -   float: left;
  1122. 339.  -   height: 480px;
  1123. 340.  -   margin: 5px 30px 0 0;
  1124. 341.  - }
  1125. 342.  - .ads_premoderation_request_wrap.first {
  1126. 343.  -   margin-right: 31px;
  1127. 344.  - }
  1128. 345.  -
  1129. 346.  - .ads_premoderation_requests .ads_ad_box_border {
  1130. 347.  -   border-width: 1px;
  1131. 348.  - }
  1132. 349.  -
  1133. 350.  - .ads_premoderation_request {
  1134. 351.  -   border: 1px solid #D3DBE1;
  1135. 352.  -   padding: 3px;
  1136. 353.  -   width: 283px;
  1137. 354.  - }
  1138. 355.  - .ads_premoderation_request_ad_wrap {
  1139. 356.  -   vertical-align: top;
  1140. 357.  -   text-align: center;
  1141. 358.  -   padding-top: 5px;
  1142. 359.  - }
  1143. 360.  - .ads_premoderation_request_ad_wrap2 {
  1144. 361.  -   display: inline-block;
  1145. 362.  - }
  1146. 363.  - .ads_premoderation_request_ad_page_link_wrap {
  1147. 364.  -   font-size: 30px;
  1148. 365.  -   text-align: center;
  1149. 366.  -   line-height: 20px;
  1150. 367.  -   overflow: hidden;
  1151. 368.  - }
  1152. 369.  - a.ads_premoderation_request_ad_page_link {
  1153. 370.  -   text-decoration: none;
  1154. 371.  - }
  1155. 372.  - .ads_premoderation_request_ad_link_url_wrap {
  1156. 373.  -   padding: 5px 3px 0 3px;
  1157. 374.  - }
  1158. 375.  - .ads_premoderation_request_notes_wrap {
  1159. 376.  -   padding: 0 3px;
  1160. 377.  - }
  1161. 378.  - .ads_premoderation_request_comment_wrap {
  1162. 379.  -   padding-top: 3px;
  1163. 380.  - }
  1164. 381.  - .ads_premoderation_request_comment_wrap2 {
  1165. 382.  -   margin-right: 8px;
  1166. 383.  - }
  1167. 384.  - .ads_premoderation_request_comment {
  1168. 385.  -   width: 100%;
  1169. 386.  -   margin: 0;
  1170. 387.  - }
  1171. 388.  - .ads_premoderation_request_actions_wrap {
  1172. 389.  -   padding-top: 8px;
  1173. 390.  - }
  1174. 391.  - .ads_premoderation_request_actions_wrap2 {
  1175. 392.  -   width: 100%;
  1176. 393.  -   border-collapse: collapse;
  1177. 394.  - }
  1178. 395.  - .ads_premoderation_request_reasons_wrap2 {
  1179. 396.  -   position: relative;
  1180. 397.  - }
  1181. 398.  - .ads_premoderation_request_result_wrap {
  1182. 399.  -   height: 20px;
  1183. 400.  -   padding: 5px 3px 3px 3px;
  1184. 401.  - }
  1185. 402.  - .ads_premoderation_request_result {
  1186. 403.  -   color: grey;
  1187. 404.  - }
  1188. 405.  -
  1189. 406.  - .ads_premoderation_categories_edit_box .info_msg {
  1190. 407.  -   margin-bottom: 15px;
  1191. 408.  - }
  1192. 409.  - .ads_premoderation_categories_edit_box .label {
  1193. 410.  -   padding-top: 4px;
  1194. 411.  -   color: grey;
  1195. 412.  -   width: 150px;
  1196. 413.  -   text-align: right;
  1197. 414.  - }
  1198. 415.  - .ads_premoderation_categories_edit_box .labeled {
  1199. 416.  -   padding-bottom: 10px;
  1200. 417.  - }
  1201. 418.  -
  1202. 419.  - .ads_premoderation_mass_progress_wrap2,
  1203. 420.  - .ads_premoderation_mass_result {
  1204. 421.  -   padding-top: 10px;
  1205. 422.  - }
  1206. 423.  - .ads_premoderation_mass_progress_wrap1 {
  1207. 424.  -   width: 250px;
  1208. 425.  - }
  1209. 426.  -
  1210. 427.  - .ads_premoderation_stat_moder_name_wrap {
  1211. 428.  -   visibility: hidden;
  1212. 429.  -   position: relative;
  1213. 430.  - }
  1214. 431.  - .ads_premoderation_stat_moder_name {
  1215. 432.  -   visibility: visible;
  1216. 433.  -   position: absolute;
  1217. 434.  -   left: 0;
  1218. 435.  -   top: 0;
  1219. 436.  -   white-space: nowrap;
  1220. 437.  - }
  1221. 438.  - .ads_premoderation_stat_value_hint,
  1222. 439.  - .ads_premoderation_stat_value_hint a {
  1223. 440.  -  color: gray;
  1224. 441.  - }
  1225. 442.  -
  1226. 443.  - /* ---- */
  1227. 444.  - /* Logs */
  1228. 445.  - /* ---- */
  1229. 446.  -
  1230. 447.  - table.ads_logs_users {
  1231. 448.  -   border-collapse: collapse;
  1232. 449.  - }
  1233. 450.  - table.ads_logs_users td,
  1234. 451.  - table.ads_logs_users th {
  1235. 452.  -   padding: 2px 5px;
  1236. 453.  - }
  1237. 454.  -
  1238. 455.  - table.ads_logs_info {
  1239. 456.  -   border-collapse: collapse;
  1240. 457.  - }
  1241. 458.  - table.ads_logs_info td,
  1242. 459.  - table.ads_logs_info th {
  1243. 460.  -   padding: 1px 10px;
  1244. 461.  - }
  1245. 462.  -
  1246. 463.  - /* ------------ */
  1247. 464.  - /* Stat summary */
  1248. 465.  - /* ------------ */
  1249. 466.  -
  1250. 467.  - .ads_stat_sumary_content {
  1251. 468.  -   padding: 20px;
  1252. 469.  - }
  1253. 470.  -
  1254. 471.  - .ads_moder_stat_summary_range_wrap {
  1255. 472.  -   margin-top: -2px;
  1256. 473.  - }
  1257. 474.  - @-moz-document url-prefix() {
  1258. 475.  - .ads_moder_stat_summary_range_wrap {
  1259. 476.  -   margin-top: -1px;
  1260. 477.  - }
  1261. 478.  - }
  1262. 479.  - .ads_moder_stat_summary_range_part {
  1263. 480.  -   padding-left: 8px;
  1264. 481.  - }
  1265. 482.  - .ads_moder_stat_summary_range_label {
  1266. 483.  -   padding-top: 5px;
  1267. 484.  - }
  1268. 485.  - @-moz-document url-prefix() {
  1269. 486.  - .ads_moder_stat_summary_range_label {
  1270. 487.  -   padding-top: 4px;
  1271. 488.  - }
  1272. 489.  - }
  1273. 490.  - #ads_moder_stat_summary_range_link {
  1274. 491.  -   opacity: 0.5;
  1275. 492.  -   display: block;
  1276. 493.  -   padding: 1px;
  1277. 494.  - }
  1278. 495.  - #ads_moder_stat_summary_range_link:hover {
  1279. 496.  -   opacity: 1;
  1280. 497.  - }
  1281. 498.  - #ads_moder_stat_summary_range_link img {
  1282. 499.  -   display: block;
  1283. 500.  - }
  1284. 501.  -
  1285. 502.  - #ads_moder_stat_summary_filter_properties_shower {
  1286. 503.  -   display: block;
  1287. 504.  -   padding: 3px 8px 8px 8px;
  1288. 505.  - }
  1289. 506.  -
  1290. 507.  - .ads_stat_summary_graph_link {
  1291. 508.  -   height: 11px;
  1292. 509.  -   overflow: visible;
  1293. 510.  - }
  1294. 511.  - .ads_stat_summary_graph_image {
  1295. 512.  -   display: block;
  1296. 513.  -   margin-top: -1px;
  1297. 514.  - }
  1298. 515.  -
  1299. 516.  - /* ----- */
  1300. 517.  - /* Other */
  1301. 518.  - /* ----- */
  1302. 519.  -
  1303. 520.  - .ads_navigation_link.current {
  1304. 521.  -   font-weight: bold;
  1305. 522.  - }
  1306. 523.  -
  1307. 524.  - .ads_note {
  1308. 525.  -   padding-bottom: 5px;
  1309. 526.  - }
  1310. 527.  - .ads_note_info {
  1311. 528.  -   color: #999999;
  1312. 529.  -   font-size: 0.91em;
  1313. 530.  - }
  1314. 531.  - .ads_note_info_user {
  1315. 532.  -   color: #999999;
  1316. 533.  - }
  1317. 534.  -
  1318. 535.  - /* --- */
  1319. 536.  - /* OLD */
  1320. 537.  - /* --- */
  1321. 538.  -
  1322. 539.  - #ads_unions_bonuses * {
  1323. 540.  -   text-align: left;
  1324. 541.  - }
  1325. 542.  -
  1326. 543.  - #ads_unions_queue .ads_unions_list td,
  1327. 544.  - #ads_unions_queue .ads_unions_list th {
  1328. 545.  -   text-align: left;
  1329. 546.  - }
  1330. 547.  -
  1331. 548.  - #ads_premoderation_stat .ads_unions_list th.column_moder *,
  1332. 549.  - #ads_premoderation_stat .ads_unions_list td.column_moder,
  1333. 550.  - #ads_premoderation_stat .ads_unions_list th.column_period *,
  1334. 551.  - #ads_premoderation_stat .ads_unions_list td.column_period {
  1335. 552.  -   text-align: left;
  1336. 553.  - }
  1337. 554.  -
  1338. 555.  - /* Distribution chart */
  1339. 556.  - .ads_moder_chart_table_wrap {
  1340. 557.  -   position: relative;
  1341. 558.  - }
  1342. 559.  - .ads_moder_chart_table {
  1343. 560.  -   background-color: #F3F5F7;
  1344. 561.  -   border: 0 none;
  1345. 562.  -   margin-bottom: 10px;
  1346. 563.  -   vertical-align: bottom;
  1347. 564.  -   margin: 0 auto;
  1348. 565.  - }
  1349. 566.  - .ads_moder_chart_table td.ads_moder_total_chart_row {
  1350. 567.  -   background-color: #FFFFFF;
  1351. 568.  -   color:#45688E;
  1352. 569.  -   border: 0 none;
  1353. 570.  -   padding-top: 10px;
  1354. 571.  -   padding-bottom: 30px;
  1355. 572.  -   vertical-align: bottom;
  1356. 573.  - }
  1357. 574.  - .ads_moder_chart_column {
  1358. 575.  -   background-color: #B0C1CF;
  1359. 576.  -   vertical-align: bottom;
  1360. 577.  -   cursor: pointer;
  1361. 578.  - }
  1362. 579.  - .ads_moder_chart_column.even {
  1363. 580.  -   background-color: #C7D3DD;
  1364. 581.  - }
  1365. 582.  - .ads_moder_chart_table td {
  1366. 583.  -   vertical-align: bottom;
  1367. 584.  - }
  1368. 585.  - .ads_moder_chart_table td.ads_moder_chart_under_num {
  1369. 586.  -   background-color: #EAEEF2;
  1370. 587.  -   height: 15px;
  1371. 588.  -   padding-bottom: 3px;
  1372. 589.  - }
  1373. 590.  - .ads_moder_chart_table td.ads_moder_chart_under_num.even {
  1374. 591.  -   background-color: #FFFFFF;
  1375. 592.  - }
  1376. 593.  - .ads_moder_chart_date {
  1377. 594.  -   font-size: 9px;
  1378. 595.  -   height: 10px;
  1379. 596.  -   padding-top: 4px;
  1380. 597.  -   text-align: center;
  1381. 598.  - }
  1382. 599.  - .ads_moder_chart_max_label {
  1383. 600.  -   background-color: #FFFFFF;
  1384. 601.  -   color: #000000;
  1385. 602.  -   display: none;
  1386. 603.  -   font-size: 9px;
  1387. 604.  -   padding: 2px 4px;
  1388. 605.  -   position: absolute;
  1389. 606.  -   z-index: 100;
  1390. 607.  - }
  1391. 608.  - .ads_moder_chart_max_label_out {
  1392. 609.  -   background-color: #2B587A;
  1393. 610.  -   display: none;
  1394. 611.  -   opacity: 0.2;
  1395. 612.  -   position: absolute;
  1396. 613.  -   z-index: 90;
  1397. 614.  - }
  1398. 615.  - .ads_moder_chart_max_label_out2 {
  1399. 616.  -   background-color: #2B587A;
  1400. 617.  -   display: none;
  1401. 618.  -   opacity: 0.1;
  1402. 619.  -   position: absolute;
  1403. 620.  -   z-index: 90;
  1404. 621.  - }
  1405. ------
  1406. Файл - ads_moder.js (Старый размер - 24181 | Новый - 0):
  1407. 0.  - var AdsModer = {};
  1408. 1.  -
  1409. 2.  - AdsModer.init = function() {
  1410. 3.  -   AdsModer.initDelayedImages();
  1411. 4.  - }
  1412. 5.  -
  1413. 6.  - AdsModer.initDelayedImages = function() {
  1414. 7.  -   var imagesIndex;
  1415. 8.  -   var indexStep = 500;
  1416. 9.  -   var lastImage;
  1417. 10.  -   var lastImageY;
  1418. 11.  -
  1419. 12.  -   buildIndex();
  1420. 13.  -   if (isEmpty(imagesIndex)) {
  1421. 14.  -     return;
  1422. 15.  -   }
  1423. 16.  -
  1424. 17.  -   var scrolledNode = (browser.msie6 ? pageNode : window);
  1425. 18.  -   var handler = checkImages.pbind(false);
  1426. 19.  -   function deinit() {
  1427. 20.  -     removeEvent(scrolledNode, 'scroll', handler);
  1428. 21.  -   }
  1429. 22.  -   cur.destroy.push(deinit);
  1430. 23.  -   addEvent(scrolledNode, 'scroll', handler);
  1431. 24.  -   handler();
  1432. 25.  -
  1433. 26.  -   function buildIndex() {
  1434. 27.  -     if (lastImage && lastImage.hasAttribute('src_') && lastImageY == getXY(lastImage)[1]) {
  1435. 28.  -       return;
  1436. 29.  -     }
  1437. 30.  -
  1438. 31.  -     var imagesAll = geByTag('img');
  1439. 32.  -     var image;
  1440. 33.  -     var indexKey;
  1441. 34.  -
  1442. 35.  -     imagesIndex = {};
  1443. 36.  -
  1444. 37.  -     if (!imagesAll.length) {
  1445. 38.  -       return;
  1446. 39.  -     }
  1447. 40.  -
  1448. 41.  -     for (var i = 0, image; image = imagesAll[i]; i++) {
  1449. 42.  -       if (!image.hasAttribute('src_')) {
  1450. 43.  -         continue;
  1451. 44.  -       }
  1452. 45.  -       indexKey = intval(getXY(image)[1] / indexStep);
  1453. 46.  -       if (!(indexKey in imagesIndex)) {
  1454. 47.  -         imagesIndex[indexKey] = [];
  1455. 48.  -       }
  1456. 49.  -       imagesIndex[indexKey].push(image);
  1457. 50.  -       lastImage = image;
  1458. 51.  -     }
  1459. 52.  -
  1460. 53.  -     lastImageY = getXY(lastImage)[1];
  1461. 54.  -   }
  1462. 55.  -
  1463. 56.  -   function checkIndex() {
  1464. 57.  -     buildIndex();
  1465. 58.  -     if (isEmpty(imagesIndex)) {
  1466. 59.  -       deinit();
  1467. 60.  -     }
  1468. 61.  -   }
  1469. 62.  -
  1470. 63.  -   function checkImages(delayed) {
  1471. 64.  -     var yTop        = scrollGetY()
  1472. 65.  -     var yBottom     = yTop + lastWindowHeight;
  1473. 66.  -     var indexTop    = intval(yTop / indexStep);
  1474. 67.  -     var indexBottom = intval(yBottom / indexStep);
  1475. 68.  -     var image;
  1476. 69.  -     for (var i = indexTop; i <= indexBottom; i++) {
  1477. 70.  -       if (!(i in imagesIndex)) {
  1478. 71.  -         continue;
  1479. 72.  -       }
  1480. 73.  -       for (var j = 0, len = imagesIndex[i].length; j < len; j++) {
  1481. 74.  -         image = imagesIndex[i][j];
  1482. 75.  -         image.src = image.getAttribute('src_');
  1483. 76.  -         image.removeAttribute('src_')
  1484. 77.  -       }
  1485. 78.  -       delete imagesIndex[i];
  1486. 79.  -     }
  1487. 80.  -     checkIndex();
  1488. 81.  -     setTimeout(checkIndex, 1000);
  1489. 82.  -   }
  1490. 83.  - }
  1491. 84.  -
  1492. 85.  - AdsModer.showObjectInfo = function(objectType, objectId) {
  1493. 86.  -   var ajaxParams = {};
  1494. 87.  -   ajaxParams.object_type = objectType;
  1495. 88.  -   ajaxParams.object_id   = objectId;
  1496. 89.  -
  1497. 90.  -   var showOptions = {params: {}};
  1498. 91.  -
  1499. 92.  -   showBox('/adsmoder?act=object_info', ajaxParams, showOptions);
  1500. 93.  - }
  1501. 94.  -
  1502. 95.  - AdsModer.openFeaturesEditBox = function(unionId, hash, featuresInfo, featuresEditHtml) {
  1503. 96.  -   var editBox = showFastBox({title: '�����������', width: 550}, featuresEditHtml);
  1504. 97.  -   var saveFeaturesHandler = AdsModer.saveFeatures.pbind(unionId, hash, featuresInfo, editBox);
  1505. 98.  -   editBox.removeButtons();
  1506. 99.  -   editBox.addButton(getLang('box_cancel'), false, 'no');
  1507. 100.  -   editBox.addButton('��������', saveFeaturesHandler, 'yes');
  1508. 101.  -
  1509. 102.  -   for (var i in featuresInfo) {
  1510. 103.  -     var featureInfo = featuresInfo[i];
  1511. 104.  -     new Checkbox(ge('ads_moder_feature_' + featureInfo.key), {
  1512. 105.  -       label: featureInfo.name,
  1513. 106.  -       checked: intval(featureInfo.value),
  1514. 107.  -       width: 500
  1515. 108.  -     });
  1516. 109.  -   }
  1517. 110.  - }
  1518. 111.  -
  1519. 112.  - AdsModer.saveFeatures = function(unionId, hash, featuresInfo, editBox) {
  1520. 113.  -   if (!Ads.lock('saveFeatures', onLock, onUnlock)) {
  1521. 114.  -     return;
  1522. 115.  -   }
  1523. 116.  -
  1524. 117.  -   var ajaxParams = {};
  1525. 118.  -   ajaxParams.union_id = unionId;
  1526. 119.  -   ajaxParams.hash = hash;
  1527. 120.  -   ajaxParams.features = [];
  1528. 121.  -   for (var i in featuresInfo) {
  1529. 122.  -     var featureInfo = featuresInfo[i];
  1530. 123.  -     ajaxParams.features.push(featureInfo.key + ':' + intval(ge('ads_moder_feature_' + featureInfo.key).value));
  1531. 124.  -   }
  1532. 125.  -   ajaxParams.features = ajaxParams.features.join(',');
  1533. 126.  -
  1534. 127.  -   ajax.post('/adsmoder?act=a_edit_features', ajaxParams, {onDone: onComplete, onFail: onComplete});
  1535. 128.  -
  1536. 129.  -   function onComplete(response) {
  1537. 130.  -     Ads.unlock('saveFeatures');
  1538. 131.  -     if (response && response.ok) {
  1539. 132.  -       nav.reload();
  1540. 133.  -     } else {
  1541. 134.  -       showFastBox('������', '������');
  1542. 135.  -     }
  1543. 136.  -     return true;
  1544. 137.  -   }
  1545. 138.  -   function onLock() {
  1546. 139.  -     editBox.showProgress();
  1547. 140.  -   }
  1548. 141.  -   function onUnlock() {
  1549. 142.  -     editBox.hide();
  1550. 143.  -   }
  1551. 144.  - }
  1552. 145.  -
  1553. 146.  - AdsModer.openNoteEditBox = function(objectId, noteType, noteText, hash, editActionText, isEdit) {
  1554. 147.  -   function onBoxHide() {
  1555. 148.  -     delete cur.noteEditBox;
  1556. 149.  -     delete cur.noteEditBoxContext;
  1557. 150.  -   }
  1558. 151.  -
  1559. 152.  -   cur.noteEditBoxContext = {};
  1560. 153.  -   cur.noteEditBoxContext.hash = hash;
  1561. 154.  -   cur.noteEditBoxContext.objectId = objectId;
  1562. 155.  -   cur.noteEditBoxContext.noteType = noteType;
  1563. 156.  -
  1564. 157.  -   var boxHtml = '<div style="margin-right: 8px;"><div><textarea id="ads_note_edit" style="width: 100%; height: 100px;">' + noteText + '</textarea></div></div>';
  1565. 158.  -
  1566. 159.  -   cur.noteEditBox = showFastBox({title: '�������', width: 400, onHide: onBoxHide}, boxHtml, editActionText, function() { AdsModer.saveNote(); }, getLang('box_cancel'));
  1567. 160.  -   if (isEdit) {
  1568. 161.  -     cur.noteEditBox.setControlsText('<a href="#" onclick="AdsModer.saveNote(true); return false;">�������</a>');
  1569. 162.  -   }
  1570. 163.  - }
  1571. 164.  -
  1572. 165.  - AdsModer.saveNote = function(isDelete) {
  1573. 166.  -   if (!Ads.lock('save_note', onLock, onUnlock)) {
  1574. 167.  -     return;
  1575. 168.  -   }
  1576. 169.  -
  1577. 170.  -   var ajaxParams = {};
  1578. 171.  -   ajaxParams.hash      = cur.noteEditBoxContext.hash;
  1579. 172.  -   ajaxParams.object_id = cur.noteEditBoxContext.objectId;
  1580. 173.  -   ajaxParams.note_type = cur.noteEditBoxContext.noteType;
  1581. 174.  -   ajaxParams.note_text = (isDelete ? '' : ge('ads_note_edit').value);
  1582. 175.  -   ajax.post('/adsmoder?act=a_edit_notes', ajaxParams, {onDone: onComplete, onFail: onComplete});
  1583. 176.  -
  1584. 177.  -   function onComplete(response) {
  1585. 178.  -     Ads.unlock('save_note');
  1586. 179.  -     if (response && response.ok) {
  1587. 180.  -       nav.reload();
  1588. 181.  -     } else {
  1589. 182.  -       showFastBox({title: '������', onHide: function() { nav.reload(); }}, '������');
  1590. 183.  -     }
  1591. 184.  -     return true;
  1592. 185.  -   }
  1593. 186.  -   function onLock() {
  1594. 187.  -     cur.noteEditBox.showProgress();
  1595. 188.  -   }
  1596. 189.  -   function onUnlock() {
  1597. 190.  -     cur.noteEditBox.hide();
  1598. 191.  -   }
  1599. 192.  - }
  1600. 193.  -
  1601. 194.  - AdsModer.openCategoriesEditBox = function(requestKey, linkElem) {
  1602. 195.  -   var editBox = showFastBox({title: '��������� �������� ����������', width: 440}, cur.categoriesEditBoxHtml);
  1603. 196.  -   editBox.removeButtons();
  1604. 197.  -   editBox.addButton(getLang('box_cancel'), false, 'no');
  1605. 198.  -   editBox.addButton('��������', applyChanges, 'yes');
  1606. 199.  -
  1607. 200.  -   var requestParams = cur.requestsParams[requestKey];
  1608. 201.  -
  1609. 202.  -   var category1_id    = requestParams.ui_category1_id;
  1610. 203.  -   var category2_id    = requestParams.ui_category2_id;
  1611. 204.  -   var subcategory1_id = requestParams.ui_subcategory1_id;
  1612. 205.  -   var subcategory2_id = requestParams.ui_subcategory2_id;
  1613. 206.  -
  1614. 207.  -   var uiCategory1 = new Dropdown(ge('ads_moder_category1'), cur.categoriesData, {
  1615. 208.  -     selectedItems: category1_id,
  1616. 209.  -     width:         250,
  1617. 210.  -     height:        400,
  1618. 211.  -     onChange:      onChangeCategory1
  1619. 212.  -   });
  1620. 213.  -   var uiCategory2 = new Dropdown(ge('ads_moder_category2'), cur.categoriesData, {
  1621. 214.  -     selectedItems: category2_id,
  1622. 215.  -     width:         250,
  1623. 216.  -     height:        400,
  1624. 217.  -     onChange:      onChangeCategory2
  1625. 218.  -   });
  1626. 219.  -   var uiSubcategory1 = new Dropdown(ge('ads_moder_subcategory1'), [], {
  1627. 220.  -     width:    250,
  1628. 221.  -     height:   400,
  1629. 222.  -     onChange: function(value) {
  1630. 223.  -       subcategory1_id = intval(value);
  1631. 224.  -     }
  1632. 225.  -   });
  1633. 226.  -   var uiSubcategory2 = new Dropdown(ge('ads_moder_subcategory2'), [], {
  1634. 227.  -     width:    250,
  1635. 228.  -     height:   400,
  1636. 229.  -     onChange: function(value) {
  1637. 230.  -       subcategory2_id = intval(value);
  1638. 231.  -     }
  1639. 232.  -   });
  1640. 233.  -
  1641. 234.  -   onChangeCategory1(category1_id);
  1642. 235.  -   onChangeCategory2(category2_id);
  1643. 236.  -
  1644. 237.  -   var boxOptions = {};
  1645. 238.  -   boxOptions.onClean = function() {
  1646. 239.  -     uiCategory1.destroy();
  1647. 240.  -     uiCategory2.destroy();
  1648. 241.  -     uiSubcategory1.destroy();
  1649. 242.  -     uiSubcategory2.destroy();
  1650. 243.  -   };
  1651. 244.  -   editBox.setOptions(boxOptions);
  1652. 245.  -
  1653. 246.  -   function onChangeCategory1(value) {
  1654. 247.  -     value = intval(value);
  1655. 248.  -     if (value != category1_id) {
  1656. 249.  -       subcategory1_id = 0;
  1657. 250.  -     }
  1658. 251.  -     category1_id = value;
  1659. 252.  -     var data = cur.subcategoriesData[value] || [];
  1660. 253.  -     var disabledText = (value ? getLang('ads_no_subcategories') : getLang('ads_first_select_category1'));
  1661. 254.  -     uiSubcategory1.setOptions({disabledText: disabledText});
  1662. 255.  -     uiSubcategory1.setData(data);
  1663. 256.  -     if (subcategory1_id) {
  1664. 257.  -       uiSubcategory1.val(subcategory1_id);
  1665. 258.  -     } else {
  1666. 259.  -       uiSubcategory1.clear();
  1667. 260.  -     }
  1668. 261.  -     uiSubcategory1.disable(data.length == 0);
  1669. 262.  -   }
  1670. 263.  -   function onChangeCategory2(value) {
  1671. 264.  -     value = intval(value);
  1672. 265.  -     if (value != category2_id) {
  1673. 266.  -       subcategory2_id = 0;
  1674. 267.  -     }
  1675. 268.  -     category2_id = value;
  1676. 269.  -     var data = cur.subcategoriesData[value] || [];
  1677. 270.  -     var disabledText = (value ? getLang('ads_no_subcategories') : getLang('ads_first_select_category2'));
  1678. 271.  -     uiSubcategory2.setOptions({disabledText: disabledText});
  1679. 272.  -     uiSubcategory2.setData(data);
  1680. 273.  -     if (subcategory2_id) {
  1681. 274.  -       uiSubcategory2.val(subcategory2_id);
  1682. 275.  -     } else {
  1683. 276.  -       uiSubcategory2.clear();
  1684. 277.  -     }
  1685. 278.  -     uiSubcategory2.disable(data.length == 0);
  1686. 279.  -   }
  1687. 280.  -   function applyChanges() {
  1688. 281.  -     if (!category1_id && !category2_id) {
  1689. 282.  -       showFastBox('������', '�� ������ ��������.');
  1690. 283.  -       return;
  1691. 284.  -     }
  1692. 285.  -
  1693. 286.  -     cur.requestsParams[requestKey].category1_id       = (subcategory1_id || category1_id);
  1694. 287.  -     cur.requestsParams[requestKey].category2_id       = (subcategory2_id || category2_id);
  1695. 288.  -     cur.requestsParams[requestKey].ui_category1_id    = category1_id;
  1696. 289.  -     cur.requestsParams[requestKey].ui_category2_id    = category2_id;
  1697. 290.  -     cur.requestsParams[requestKey].ui_subcategory1_id = subcategory1_id;
  1698. 291.  -     cur.requestsParams[requestKey].ui_subcategory2_id = subcategory2_id;
  1699. 292.  -     cur.requestsParams[requestKey].categories_changed = true;
  1700. 293.  -
  1701. 294.  -     var category1Elem       = geByClass1('ads_category1', linkElem);
  1702. 295.  -     var category1ParentElem = geByClass1('ads_category1_parent', linkElem);
  1703. 296.  -     if (subcategory1_id) {
  1704. 297.  -       replaceClass(category1Elem, 'ads_category', 'ads_subcategory');
  1705. 298.  -       category1Elem.innerHTML = uiSubcategory1.val_full()[1];
  1706. 299.  -       category1ParentElem.innerHTML = ' (' + uiCategory1.val_full()[1] + ')';
  1707. 300.  -     } else {
  1708. 301.  -       replaceClass(category1Elem, 'ads_subcategory', 'ads_category');
  1709. 302.  -       category1Elem.innerHTML = (category1_id ? uiCategory1.val_full()[1] : '');
  1710. 303.  -       category1ParentElem.innerHTML = '';
  1711. 304.  -     }
  1712. 305.  -
  1713. 306.  -     var category2Elem       = geByClass1('ads_category2', linkElem);
  1714. 307.  -     var category2ParentElem = geByClass1('ads_category2_parent', linkElem);
  1715. 308.  -     if (subcategory2_id) {
  1716. 309.  -       replaceClass(category2Elem, 'ads_category', 'ads_subcategory');
  1717. 310.  -       category2Elem.innerHTML = uiSubcategory2.val_full()[1];
  1718. 311.  -       category2ParentElem.innerHTML = ' (' + uiCategory2.val_full()[1] + ')';
  1719. 312.  -     } else {
  1720. 313.  -       replaceClass(category2Elem, 'ads_subcategory', 'ads_category');
  1721. 314.  -       category2Elem.innerHTML = (category2_id ? uiCategory2.val_full()[1] : '');
  1722. 315.  -       category2ParentElem.innerHTML = '';
  1723. 316.  -     }
  1724. 317.  -
  1725. 318.  -     editBox.hide();
  1726. 319.  -   }
  1727. 320.  - }
  1728. 321.  -
  1729. 322.  - AdsModer.premoderationProcessRequest = function(action, requestKey, requestKeyModer, onCompleteExternal) {
  1730. 323.  -
  1731. 324.  -   var requestParams      = cur.requestsParams[requestKey];
  1732. 325.  -   var requestParamsModer = cur.requestsParams[requestKeyModer];
  1733. 326.  -
  1734. 327.  -   if (!requestKey || !requestKeyModer || !requestParams || !requestParamsModer) {
  1735. 328.  -     return;
  1736. 329.  -   }
  1737. 330.  -
  1738. 331.  -   var result = AdsModer.premoderationProcessRequestsMassCheck(action, requestKey);
  1739. 332.  -   if (result) {
  1740. 333.  -     return;
  1741. 334.  -   }
  1742. 335.  -
  1743. 336.  -   var moderComment = ge('moder_comment_' + requestKeyModer);
  1744. 337.  -   var resultArea   = ge('request_result_area_' + requestKey);
  1745. 338.  -
  1746. 339.  -   var ajaxParams = {};
  1747. 340.  -   ajaxParams.action       = action;
  1748. 341.  -   ajaxParams.request_id   = requestParams.request_id;
  1749. 342.  -   ajaxParams.ad_id        = requestParams.ad_id;
  1750. 343.  -   ajaxParams.hash         = requestParams.hash;
  1751. 344.  -   ajaxParams.checksum     = requestParams.checksum_all;
  1752. 345.  -
  1753. 346.  -   if (action === 'approve') {
  1754. 347.  -     if (requestParamsModer.categories_changed) {
  1755. 348.  -       ajaxParams.category1_id = requestParamsModer.category1_id;
  1756. 349.  -       ajaxParams.category2_id = requestParamsModer.category2_id;
  1757. 350.  -     } else {
  1758. 351.  -       ajaxParams.category1_id = requestParams.category1_id;
  1759. 352.  -       ajaxParams.category2_id = requestParams.category2_id;
  1760. 353.  -     }
  1761. 354.  -   }
  1762. 355.  -
  1763. 356.  -   ajaxParams.moder_comment = moderComment.getValue();
  1764. 357.  -   if (action === 'disapprove') {
  1765. 358.  -     ajaxParams.moder_rules = cur.uiReasonsControls[requestKeyModer].getSelectedItems().join(',');
  1766. 359.  -   }
  1767. 360.  -
  1768. 361.  -   resultArea.innerHTML = '<img src="/images/upload.gif" />';
  1769. 362.  -
  1770. 363.  -   ajax.post('/adsmoder?act=a_premoderation_process', ajaxParams, {onDone: onComplete, onFail: onComplete});
  1771. 364.  -
  1772. 365.  -   function onComplete(response) {
  1773. 366.  -     var responseText = ((response && response.text) ? response.text : '������!');
  1774. 367.  -     resultArea.innerHTML = responseText;
  1775. 368.  -     if (isFunction(onCompleteExternal)) {
  1776. 369.  -       onCompleteExternal(response, requestKey, responseText);
  1777. 370.  -     }
  1778. 371.  -     return true;
  1779. 372.  -   };
  1780. 373.  - }
  1781. 374.  -
  1782. 375.  - AdsModer.premoderationProcessRequestsMassCheck = function(action, requestKey) {
  1783. 376.  -
  1784. 377.  -   var requestParams = cur.requestsParams[requestKey];
  1785. 378.  -
  1786. 379.  -   var requestsKeys = [];
  1787. 380.  -
  1788. 381.  -   if (action === 'approve') {
  1789. 382.  -     if (requestParams.categories_changed) {
  1790. 383.  -       if (cur.requestsChecksumsApproveWithoutCategories[requestParams.checksum_approve_without_categories].length < 5) {
  1791. 384.  -         return false;
  1792. 385.  -       }
  1793. 386.  -       requestsKeys = cur.requestsChecksumsApproveWithoutCategories[requestParams.checksum_approve_without_categories];
  1794. 387.  -     } else {
  1795. 388.  -       if (cur.requestsChecksumsApproveWithCategories[requestParams.checksum_approve_with_categories].length < 5) {
  1796. 389.  -         return false;
  1797. 390.  -       }
  1798. 391.  -       requestsKeys = cur.requestsChecksumsApproveWithCategories[requestParams.checksum_approve_with_categories];
  1799. 392.  -     }
  1800. 393.  -   } else if (action === 'disapprove') {
  1801. 394.  -     if (cur.requestsChecksumsDisapprove[requestParams.checksum_disapprove].length < 5) {
  1802. 395.  -       return false;
  1803. 396.  -     }
  1804. 397.  -     requestsKeys = cur.requestsChecksumsDisapprove[requestParams.checksum_disapprove];
  1805. 398.  -   }
  1806. 399.  -
  1807. 400.  -   var confirmTitle   = ((action === 'approve') ? '�������� ���������' : '�������� ����������');
  1808. 401.  -   var confirmText    = '������� ���������� �� ������� ��������: '+requestsKeys.length;
  1809. 402.  -   var processAllText = ((action === 'approve') ? '�������� ���' : '��������� ���');
  1810. 403.  -   var processOneText = ((action === 'approve') ? '�������� ����' : '��������� ����');
  1811. 404.  -
  1812. 405.  -   var box = showFastBox(confirmTitle, cur.massBoxHtml, processAllText, processAll, processOneText, processOne);
  1813. 406.  -   geByClass1('ads_premoderation_mass_confirm_text', box.bodyNode).innerHTML = confirmText;
  1814. 407.  -
  1815. 408.  -   return true;
  1816. 409.  -
  1817. 410.  -   function processAll() {
  1818. 411.  -     cleanChecksums();
  1819. 412.  -     AdsModer.premoderationProcessRequestsMass(action, requestKey, requestsKeys, box);
  1820. 413.  -   }
  1821. 414.  -   function processOne() {
  1822. 415.  -     cleanChecksums();
  1823. 416.  -     box.hide();
  1824. 417.  -     AdsModer.premoderationProcessRequest(action, requestKey, requestKey);
  1825. 418.  -   }
  1826. 419.  -   function cleanChecksums() {
  1827. 420.  -     cur.requestsChecksumsApproveWithCategories[requestParams.checksum_approve_with_categories] = [];
  1828. 421.  -     cur.requestsChecksumsApproveWithoutCategories[requestParams.checksum_approve_without_categories] = [];
  1829. 422.  -     cur.requestsChecksumsDisapprove[requestParams.checksum_disapprove] = [];
  1830. 423.  -   }
  1831. 424.  - }
  1832. 425.  -
  1833. 426.  - AdsModer.premoderationProcessRequestsMass = function(action, requestKeyModer, requestsKeys, box) {
  1834. 427.  -   var requestParams = cur.requestsParams[requestKeyModer];
  1835. 428.  -
  1836. 429.  -   var totalCount       = requestsKeys.length;
  1837. 430.  -   var completeCount    = 0;
  1838. 431.  -   var approvedCount    = 0;
  1839. 432.  -   var disapprovedCount = 0;
  1840. 433.  -   var errorCount       = 0;
  1841. 434.  -   var responseInfos    = [];
  1842. 435.  -
  1843. 436.  -   box.removeButtons();
  1844. 437.  -   box.addButton(getLang('box_close'), false, 'yes');
  1845. 438.  -
  1846. 439.  -   var progressWrapElem = geByClass1('ads_premoderation_mass_progress_wrap2', box.bodyNode);
  1847. 440.  -   var progressElem     = geByClass1('ads_gradient_progress', box.bodyNode);
  1848. 441.  -   var resultElem       = geByClass1('ads_premoderation_mass_result', box.bodyNode);
  1849. 442.  -   var resultTextElem   = geByClass1('ads_premoderation_mass_result_text', box.bodyNode);
  1850. 443.  -   var resultMoreElem   = geByClass1('ads_premoderation_mass_result_more', box.bodyNode);
  1851. 444.  -   drawProgress();
  1852. 445.  -   show(progressWrapElem);
  1853. 446.  -
  1854. 447.  -   for (var i = 0; requestKey = requestsKeys[i]; i++) {
  1855. 448.  -     AdsModer.premoderationProcessRequest(action, requestKey, requestKeyModer, onComplete);
  1856. 449.  -   }
  1857. 450.  -
  1858. 451.  -   function onComplete(response, responseRequestKey, responseText) {
  1859. 452.  -     var responseAdId = cur.requestsParams[responseRequestKey].ad_id;
  1860. 453.  -     responseInfos.push('<a href="/ads?act=office&union_id='+responseAdId+'" target="_blank">'+responseAdId+' - '+responseText+'</a>');
  1861. 454.  -
  1862. 455.  -     if (response && (response.approved || response.disapproved)) {
  1863. 456.  -       if (response.approved) {
  1864. 457.  -         approvedCount++;
  1865. 458.  -       }
  1866. 459.  -       if (response.disapproved) {
  1867. 460.  -         disapprovedCount++;
  1868. 461.  -       }
  1869. 462.  -     } else {
  1870. 463.  -       errorCount++;
  1871. 464.  -     }
  1872. 465.  -     completeCount++;
  1873. 466.  -
  1874. 467.  -     drawProgress();
  1875. 468.  -     if (completeCount == totalCount) {
  1876. 469.  -       setTimeout(drawResults, 1000);
  1877. 470.  -     }
  1878. 471.  -   }
  1879. 472.  -   function drawProgress() {
  1880. 473.  -     var percent = intval(completeCount / totalCount * 100);
  1881. 474.  -     setStyle(progressElem, {width: percent + '%'});
  1882. 475.  -   }
  1883. 476.  -   function drawResults() {
  1884. 477.  -     hide(progressWrapElem);
  1885. 478.  -
  1886. 479.  -     var resultText = '';
  1887. 480.  -     if (approvedCount) {
  1888. 481.  -       resultText += '��������: '+approvedCount+'<br>';
  1889. 482.  -     }
  1890. 483.  -     if (disapprovedCount) {
  1891. 484.  -       resultText += '���������: '+disapprovedCount+'<br>';
  1892. 485.  -     }
  1893. 486.  -     resultText += '������: '+errorCount+'<br>';
  1894. 487.  -
  1895. 488.  -     resultTextElem.innerHTML = resultText;
  1896. 489.  -     resultMoreElem.innerHTML = responseInfos.join('<br>');
  1897. 490.  -     show(resultElem);
  1898. 491.  -   }
  1899. 492.  - }
  1900. 493.  -
  1901. 494.  - AdsModer.premoderationTakeUnion = function(unionId, hash) {
  1902. 495.  -   var ajaxParams = {};
  1903. 496.  -   ajaxParams.hash     = hash;
  1904. 497.  -   ajaxParams.union_id = unionId;
  1905. 498.  -   ajaxParams.action   = 'take_union';
  1906. 499.  -   ajax.post('/adsmoder?act=a_premoderation_manage_work', ajaxParams, {onDone: onComplete, onFail: onComplete});
  1907. 500.  -
  1908. 501.  -   function onComplete(response) {
  1909. 502.  -     if (response && response.ok) {
  1910. 503.  -       if (response.redirect) {
  1911. 504.  -         nav.go(response.redirect);
  1912. 505.  -       }
  1913. 506.  -     } else {
  1914. 507.  -       var message = ((response && response.error) ? response.error : '������');
  1915. 508.  -       showFastBox({title: '������', onHide: function() { nav.reload(); }}, message);
  1916. 509.  -     }
  1917. 510.  -     return true;
  1918. 511.  -   }
  1919. 512.  - }
  1920. 513.  -
  1921. 514.  - AdsModer.premoderationTakeBackUnion = function(unionId, hash) {
  1922. 515.  -   var ajaxParams = {};
  1923. 516.  -   ajaxParams.hash     = hash;
  1924. 517.  -   ajaxParams.union_id = unionId;
  1925. 518.  -   ajaxParams.action   = 'take_back_union';
  1926. 519.  -   ajax.post('/adsmoder?act=a_premoderation_manage_work', ajaxParams, {onDone: onComplete, onFail: onComplete});
  1927. 520.  -
  1928. 521.  -   function onComplete(response) {
  1929. 522.  -     if (response && response.ok) {
  1930. 523.  -       nav.reload();
  1931. 524.  -     } else {
  1932. 525.  -       var message = ((response && response.error) ? response.error : '������');
  1933. 526.  -       showFastBox({title: '������', onHide: function() { nav.reload(); }}, message);
  1934. 527.  -     }
  1935. 528.  -     return true;
  1936. 529.  -   }
  1937. 530.  - }
  1938. 531.  -
  1939. 532.  - AdsModer.premoderationStopWork = function(hash) {
  1940. 533.  -   var ajaxParams = {};
  1941. 534.  -   ajaxParams.hash   = hash;
  1942. 535.  -   ajaxParams.action = 'stop_work';
  1943. 536.  -   ajax.post('/adsmoder?act=a_premoderation_manage_work', ajaxParams, {onDone: onComplete, onFail: onComplete});
  1944. 537.  -
  1945. 538.  -   function onComplete(response) {
  1946. 539.  -     if (response && response.ok) {
  1947. 540.  -       nav.reload();
  1948. 541.  -     } else {
  1949. 542.  -       var message = ((response && response.error) ? response.error : '������');
  1950. 543.  -       showFastBox({title: '������', onHide: function() { nav.reload(); }}, message);
  1951. 544.  -     }
  1952. 545.  -     return true;
  1953. 546.  -   }
  1954. 547.  - }
  1955. 548.  -
  1956. 549.  - AdsModer.premoderationFixRequest = function(wrapElemId, requestId, action, hash) {
  1957. 550.  -   if (!Ads.lock(wrapElemId, onLock, onUnlock)) {
  1958. 551.  -     return;
  1959. 552.  -   }
  1960. 553.  -
  1961. 554.  -   var ajaxParams = {}
  1962. 555.  -   ajaxParams.request_id = requestId;
  1963. 556.  -   ajaxParams.action     = action;
  1964. 557.  -   ajaxParams.hash       = hash;
  1965. 558.  -
  1966. 559.  -   ajax.post('/adsmoder?act=premoderation_fix_request', ajaxParams, {onDone: onComplete, onFail: onComplete});
  1967. 560.  -
  1968. 561.  -   function onComplete(response) {
  1969. 562.  -     Ads.unlock(wrapElemId);
  1970. 563.  -     if (response && response.text_new) {
  1971. 564.  -       var wrapElem = ge(wrapElemId);
  1972. 565.  -       if (wrapElem) {
  1973. 566.  -         wrapElem.parentNode.replaceChild(se(response.text_new), wrapElem);
  1974. 567.  -       }
  1975. 568.  -     }
  1976. 569.  -     return true;
  1977. 570.  -   }
  1978. 571.  -   function onLock() {
  1979. 572.  -     show(geByTag1('img', ge(wrapElemId)));
  1980. 573.  -   }
  1981. 574.  -   function onUnlock() {
  1982. 575.  -     var wrapElem = ge(wrapElemId);
  1983. 576.  -     if (wrapElem) {
  1984. 577.  -       hide(geByTag1('img', wrapElem));
  1985. 578.  -     }
  1986. 579.  -   }
  1987. 580.  - }
  1988. 581.  -
  1989. 582.  - AdsModer.switchOfficeBlock = function(actionLocation, confirmTitle, confirmText, actionText) {
  1990. 583.  -   function switchBlocked() {
  1991. 584.  -     Ads.simpleAjax(actionLocation);
  1992. 585.  -   }
  1993. 586.  -   showFastBox(confirmTitle, confirmText, actionText, switchBlocked, getLang('box_cancel'));
  1994. 587.  - }
  1995. 588.  -
  1996. 589.  - AdsModer.openCancelClicksBox = function(webSiteId, day, hash, boxHtml) {
  1997. 590.  -   var box = showFastBox({title: '������ ������'}, boxHtml);
  1998. 591.  -   var cancelClicksHandler = AdsModer.cancelClicks.pbind(webSiteId, day, hash, box);
  1999. 592.  -   box.removeButtons();
  2000. 593.  -   box.addButton(getLang('box_cancel'), false, 'no');
  2001. 594.  -   box.addButton('�������� �����', cancelClicksHandler, 'yes');
  2002. 595.  - }
  2003. 596.  -
  2004. 597.  - AdsModer.cancelClicks = function(webSiteId, day, hash, box) {
  2005. 598.  -   if (!Ads.lock('cancelClicks', onLock, onUnlock)) {
  2006. 599.  -     return;
  2007. 600.  -   }
  2008. 601.  -
  2009. 602.  -   var ajaxParams = {};
  2010. 603.  -   ajaxParams.web_site_id = webSiteId;
  2011. 604.  -   ajaxParams.day = day;
  2012. 605.  -   ajaxParams.hash = hash;
  2013. 606.  -
  2014. 607.  -   ajax.post('/adsweb?act=log_cancel', ajaxParams, {onDone: onComplete, onFail: onComplete});
  2015. 608.  -
  2016. 609.  -   function onComplete(response) {
  2017. 610.  -     Ads.unlock('cancelClicks');
  2018. 611.  -     if (response && response.ok) {
  2019. 612.  -       nav.reload();
  2020. 613.  -     } else {
  2021. 614.  -       showFastBox('������', '������');
  2022. 615.  -     }
  2023. 616.  -     return true;
  2024. 617.  -   }
  2025. 618.  -   function onLock() {
  2026. 619.  -     box.showProgress();
  2027. 620.  -   }
  2028. 621.  -   function onUnlock() {
  2029. 622.  -     box.hide();
  2030. 623.  -   }
  2031. 624.  - }
  2032. 625.  -
  2033. 626.  - AdsModer.historyGet = function(elem, notNavigationParam) {
  2034. 627.  -   while (elem && elem.nodeName.toLowerCase() !== 'form') {
  2035. 628.  -     elem = elem.parentNode;
  2036. 629.  -   }
  2037. 630.  -   if (!elem) {
  2038. 631.  -     return;
  2039. 632.  -   }
  2040. 633.  -   var values = serializeForm(elem);
  2041. 634.  -   var params = values.other_params;
  2042. 635.  -   delete values.other_params;
  2043. 636.  -   for (var i in values) {
  2044. 637.  -     if (values[i]) {
  2045. 638.  -       params = '&' + i + '=' + values[i] + params;
  2046. 639.  -     }
  2047. 640.  -   }
  2048. 641.  -   nav.go('/adsmoder?act=history' + params);
  2049. 642.  - }
  2050. 643.  -
  2051. 644.  - AdsModer.historyToggleFilters = function() {
  2052. 645.  -   var filtersContainerElem = ge('ads_moder_history');
  2053. 646.  -   var filtersElems = geByClass('ads_navigation_link', filtersContainerElem);
  2054. 647.  -   for (var i = 0; elem = filtersElems[i]; i++) {
  2055. 648.  -       if (hasClass(elem, 'current')) {
  2056. 649.  -           continue
  2057. 650.  -       }
  2058. 651.  -       elem = elem.parentNode;
  2059. 652.  -       if (elem.nodeName.toLowerCase() !== 'span') {
  2060. 653.  -           continue
  2061. 654.  -       }
  2062. 655.  -       toggleClass(elem, 'unshown');
  2063. 656.  -   }
  2064. 657.  - }
  2065. 658.  -
  2066. 659.  - AdsModer.statSummaryInit = function(periodType, fromYear, fromMonth, fromDay, toYear, toMonth, toDay) {
  2067. 660.  -   var datePickerOptionsFrom = {
  2068. 661.  -     mode: (periodType === 'month') ? 'm' : 'd',
  2069. 662.  -     year:  fromYear,
  2070. 663.  -     month: fromMonth,
  2071. 664.  -     day:   fromDay,
  2072. 665.  -     width: 130,
  2073. 666.  -     pastActive: true,
  2074. 667.  -     onUpdate: function(date, mode) {
  2075. 668.  -       fromYear  = date.y;
  2076. 669.  -       fromMonth = date.m;
  2077. 670.  -       fromDay   = date.d;
  2078. 671.  -       updateLink();
  2079. 672.  -     }
  2080. 673.  -   };
  2081. 674.  -   var datePickerOptionsTo = {
  2082. 675.  -     mode: (periodType === 'month') ? 'm' : 'd',
  2083. 676.  -     year:  toYear,
  2084. 677.  -     month: toMonth,
  2085. 678.  -     day:   toDay,
  2086. 679.  -     width: 130,
  2087. 680.  -     pastActive: true,
  2088. 681.  -     onUpdate: function(date, mode) {
  2089. 682.  -       toYear  = date.y;
  2090. 683.  -       toMonth = date.m;
  2091. 684.  -       toDay   = date.d;
  2092. 685.  -       updateLink();
  2093. 686.  -     }
  2094. 687.  -   };
  2095. 688.  -   new Datepicker(ge('ads_moder_stat_summary_from'), datePickerOptionsFrom);
  2096. 689.  -   new Datepicker(ge('ads_moder_stat_summary_to'), datePickerOptionsTo);
  2097. 690.  -
  2098. 691.  -   function updateLink() {
  2099. 692.  -     var fromPeriod = fromYear * 100 + fromMonth;
  2100. 693.  -     var toPeriod   = toYear   * 100 + toMonth;
  2101. 694.  -     if (periodType !== 'month') {
  2102. 695.  -       fromPeriod = fromPeriod * 100 + fromDay;
  2103. 696.  -       toPeriod   = toPeriod   * 100 + toDay;
  2104. 697.  -     }
  2105. 698.  -     var linkElem = ge('ads_moder_stat_summary_range_link');
  2106. 699.  -     linkElem.href = linkElem.href.replace(/&period=\d+-\d+/, '&period=' + fromPeriod + '-' + toPeriod);
  2107. 700.  -     linkElem.style.opacity = 1;
  2108. 701.  -   }
  2109. 702.  - }
  2110. 703.  -
  2111. 704.  - AdsModer.statSummaryShowAllProperties = function() {
  2112. 705.  -   var propertiesElem = ge('ads_moder_stat_summary_filter_properties');
  2113. 706.  -   var elems = geByClass('ads_moder_stat_summary_filter_property', propertiesElem);
  2114. 707.  -   each(elems, show);
  2115. 708.  -   hide('ads_moder_stat_summary_filter_properties_shower');
  2116. 709.  - }
  2117. 710.  -
  2118. 711.  - AdsModer.statSummaryDistrShowCountLabel = function(id, i, val) {
  2119. 712.  -   var contXy = getXY(ge(id+'_stats_graph_wrap'));
  2120. 713.  -   var colXy  = getXY(ge(id+'_distr_col_'+i));
  2121. 714.  -
  2122. 715.  -   setStyle(ge(id+'_max_label'), {
  2123. 716.  -     left: colXy[0] - contXy[0] + 14,
  2124. 717.  -     top:  colXy[1] - contXy[1] - 11
  2125. 718.  -   });
  2126. 719.  -   ge(id+'_max_label').innerHTML = val;
  2127. 720.  -   show(id+'_max_label');
  2128. 721.  -   setStyle(ge(id+'_max_label_out'), {
  2129. 722.  -     width:  ge(id+'_max_label').offsetWidth + 2,
  2130. 723.  -     height: ge(id+'_max_label').offsetHeight + 2,
  2131. 724.  -     left:   colXy[0] - contXy[0] + 13,
  2132. 725.  -     top:    colXy[1] - contXy[1] - 12
  2133. 726.  -   });
  2134. 727.  -   show(id+'_max_label_out');
  2135. 728.  -   setStyle(ge(id+'_max_label_out2'), {
  2136. 729.  -     width:  ge(id+'_max_label').offsetWidth + 4,
  2137. 730.  -     height: ge(id+'_max_label').offsetHeight + 4,
  2138. 731.  -     left:   colXy[0] - contXy[0] + 12,
  2139. 732.  -     top:    colXy[1] - contXy[1] - 13
  2140. 733.  -   });
  2141. 734.  -   show(id+'_max_label_out2');
  2142. 735.  - }
  2143. 736.  -
  2144. 737.  - AdsModer.statSummaryDistrHideCountLabel = function(id) {
  2145. 738.  -   hide(id+'_max_label');
  2146. 739.  -   hide(id+'_max_label_out');
  2147. 740.  -   hide(id+'_max_label_out2');
  2148. 741.  - }
  2149. 742.  -
  2150. 743.  - AdsModer.statSummaryShowVotesBox = function(periodType, period) {
  2151. 744.  -   var ajaxParams = {};
  2152. 745.  -   ajaxParams.period_type = periodType;
  2153. 746.  -   ajaxParams.period      = period;
  2154. 747.  -
  2155. 748.  -   var showOptions = {params: {}};
  2156. 749.  -
  2157. 750.  -   showBox('/adsmoder?act=stat_summary_votes', ajaxParams, showOptions);
  2158. 751.  - }
  2159. 752.  -
  2160. 753.  - try{stManager.done('ads_moder.js');}catch(e){}
  2161. ------
  2162. Файл - sms_office.js (Старый размер - 5679 | Новый - 5663):
  2163. 86.  -       stManager.add(['graph.js', 'graph.css'], function(){
  2164. 87.  +       stManager.add('graph.js',function(){
  2165. ------
Advertisement
Add Comment
Please, Sign In to add comment