Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Файл - graph.js (Старый размер - 74677 | Новый - 73591):
- 40. + 0x85afd0, 0xd391bb, 0x8ecfce, 0xa8d1a9, 0xe47070, 0xf2ec96, 0xf7be5a, 0xbeaadf,
- 42. - 0x6391bc, 0xc77bb1, 0x62b1bc, 0x80bb88, 0xb75454, 0xc9c255, 0xdca94f, 0x997fc4,
- 43. - 0x85afd0, 0xc77bb1, 0x8ecfce, 0x80bb88, 0xe47070, 0xc9c255, 0xf7be5a, 0xbeaadf];
- 44. + 0x6391bc, 0xbc6b9e, 0x62b1bc, 0x69a57a, 0xb75454, 0xd4ce68, 0xdca94f, 0x997fc4];
- 207. - function drawLines(ctx, x, y, w, h, lines, stTime, enTime, xfactor, yfactor, yDelta, zoomedOut, active, smooth) {
- 208. - smooth = (!zoomedOut) && smooth;
- 209. + function drawLines(ctx, x, y, w, h, lines, stTime, enTime, xfactor, yfactor, yDelta, zoomedOut, active) {
- 210. + var smooth = (!zoomedOut) && ((enTime - stTime) < (35 * 24 * 60 * 60));
- 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'});
- 413. + setStyle(this.graphDiv, {fontFamily: 'tahoma, arial, verdana, sans-serif, Lucida Sans', fontSize: '11px', color: '#36638e', width: this.viewWidth + 'px', clear: 'both'});
- 455. - var defaultGraph = 0;
- 457. - if (!params.multiple.def) params.multiple.def = 0;
- 458. + if (!params.multiple.del) params.multiple.def = 0;
- 487. - defaultGraph = params.multiple.def;
- 499. - dragElement: null, maskDragging: false, viewClick: false, smoothLines: false,
- 500. + dragElement: null, maskDragging: false, viewClick: false,
- 561. - graph.setData((typeof(data) == 'string') ? data : (data[defaultGraph] || []), isArray(params.adjust) ? params.adjust[0] : params.adjust);
- 562. + graph.setData((typeof(data) == 'string') ? data : (data[0] || []), isArray(params.adjust) ? params.adjust[0] : params.adjust);
- 870. - if (!g.smoothLines || !tooltips) {
- 871. + if (g.rightTime - g.leftTime >= 35 * 24 * 60 * 60 || !tooltips) {
- 973. - var g = ev.currentTarget.graph, line = ev.currentTarget.line, dot = line.dotLabel.dot, pos = line.dotLabel.pos;
- 974. - if (!g.smoothLines) {
- 975. - var text = '';
- 976. - if (line.l) {
- 977. - text += langNumeric(dot.y, line.l, true);
- 978. - } else {
- 979. - text += (dot.l ? dot.l : formatValue(dot.y)) + ' ' + line.name;
- 980. + var g = ev.currentTarget.graph, line = ev.currentTarget.line;
- 981. + for (var l = 0; l < g.lines.length; l++) {
- 982. + if (g.lines[l] == line) {
- 983. + g.showDotTT(l);
- 984. + break;;
- 986. - line.dotLabel.innerHTML = text;
- 987. - var sz = getSize(line.dotLabel)[0];
- 988. - if (pos + sz + line.dot.posX > g.viewWidth) {
- 989. - line.dotLabel.innerHTML = line.name + ' ' + (dot.l ? dot.l : formatValue(dot.y));
- 990. - line.dotLabel.style.left = pos - (sz - line.dotLabel.w) + "px";
- 991. - } else
- 992. - line.dotLabel.style.left = pos + "px";
- 993. -
- 994. - for (var l = 0; l < g.lines.length; l++)
- 995. - g.lines[l].dotLabel.style.zIndex = (g.lines[l] == line) ? 1000 : 200;
- 1024. - if (!this.smoothLines) {
- 1025. + if (this.rightTime - this.leftTime >= 35 * 24 * 60 * 60) {
- 1037. - text += (dot.l ? dot.l : formatValue(dot.y)) + ' – ' + line.name;
- 1038. + text += (dot.l ? dot.l : formatValue(dot.y)) + ' ' + line.name;
- 1111. - if (this.isNegative)
- 1112. - drawLines(ctx, 0, 4, this.viewWidth, 32, this.lines, this.minTime, this.maxTime, this.xfactorOut, this.yfactorOut, -this.localBottom, true, null, false);
- 1113. + if (this.minValue < -1e-6)
- 1114. + drawLines(ctx, 0, 4, this.viewWidth, 32, this.lines, this.minTime, this.maxTime, this.xfactorOut, this.yfactorOut, -this.minValue, true, null);
- 1116. - drawLines(ctx, 0, 4, this.viewWidth, 36, this.lines, this.minTime, this.maxTime, this.xfactorOut, this.yfactorOut, 0, true, null, false);
- 1117. + drawLines(ctx, 0, 4, this.viewWidth, 36, this.lines, this.minTime, this.maxTime, this.xfactorOut, this.yfactorOut, 0, true, null);
- 1144. - var localMax = (this.adjust ? -1e9 : 0), localMin = (this.adjust ? 1e9 : 0), outMax = 0, outMin = 0, dotsVisible = 0;
- 1145. + var localMax = (this.adjust ? -1e9 : 0), localMin = (this.adjust ? 1e9 : 0), outMax = 0, outMin = 0;
- 1156. - if (enIdx >= stIdx && (ps[enIdx].x >= this.leftTime) && (ps[stIdx].x <= this.rightTime)) {
- 1157. + if (enIdx >= stIdx && (ps[enIdx].x >= this.leftTime) && (ps[stIdx].x <= this.rightTime))
- 1164. - dotsVisible = Math.max(dotsVisible, enIdx - stIdx);
- 1165. - }
- 1185. - this.smoothLines = dotsVisible < 30 ? true : false;
- 1226. - var i_start = this.params.show_time || this.params.show_minutes ? 0 : 6;
- 1227. - for (var i = i_start; (i < 100) && !fin; i++) {
- 1228. - if (i < xscales.length) {
- 1229. + for (var i = 0; (i < 100) && !fin; i++) {
- 1230. + if (i < xscales.length)
- 1232. - } else {
- 1233. + else {
- 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);
- 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);
- 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);
- 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);
- 1325. - }
- 1326. - if (line.legend.parentNode) {
- 1327. - line.legend.parentNode.removeChild(line.legend);
- 1329. + line.legend.parentNode.removeChild(line.legend);
- 1444. - addEventEx(this, line.dotLabel, 'mouseover', this.expandLabel);
- 1445. + //addEventEx(this, line.dotLabel, 'mouseover', this.expandLabel);
- 1488. - if (i > 0 && i < 10 && Math.abs(line.d[i].x - line.d[i - 1].x) > 1) {
- 1489. + if (i > 0 && Math.abs(line.d[i].x - line.d[i - 1].x) > 1) {
- 1606. - var colors_row = l % 4;
- 1607. - colors_row = colors_row == 1 ? 3 : colors_row;
- 1608. - line.c = colors[(colors_row * 8 + Math.floor(l / 4)) % colors.length];
- 1609. + line.c = colors[((l % 4) * 8 + Math.floor(l / 4)) % colors.length];
- 1717. - this.scaleWidth = (this.lines.length == 0) ? 0 : (maxWidth + 30);
- 1718. + this.scaleWidth = (this.lines.length == 0) ? 0 : (maxWidth + 25);
- ------
- Файл - datepicker.js (Старый размер - 21372 | Новый - 0):
- 0. - (function() {
- 1. -
- 2. - var l = {
- 3. - mn: [],
- 4. - mnOf: [],
- 5. - mnOfSm: [],
- 6. - days: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']
- 7. - };
- 8. -
- 9. - var dateFormat = getLang('datepicker_dateFormat');
- 10. - if (dateFormat === 'dateFormat') dateFormat = '{day} {month} {year}';
- 11. - var monthFormat = getLang('datepicker_monthFormat');
- 12. - if (monthFormat === 'monthFormat') monthFormat = '{month} {year}';
- 13. -
- 14. - var larr = getLang('larr');
- 15. - if (larr === 'larr') larr = '←';
- 16. - var rarr = getLang('rarr');
- 17. - if (rarr === 'rarr') rarr = '→';
- 18. -
- 19. - var modes = ['d', 'w', 'm'];
- 20. -
- 21. - for (var i = 1; i < 13; i++) {
- 22. - l.mn.push(getLang('Month' + i));
- 23. - l.mnOf.push(getLang('Month' + i + '_of'));
- 24. - l.mnOfSm.push(getLang('month' + i + '_of'));
- 25. - }
- 26. - for (var i = 0; i < 7; i++) {
- 27. - var wd = getLang('events_' + l.days[i]);
- 28. - if (wd.substr(0, 6) != 'events') l.days[i] = wd;
- 29. - }
- 30. -
- 31. - var dim = [31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
- 32. -
- 33. - if (!window.cals) {
- 34. - window.cals = {
- 35. - list: {},
- 36. - getMonth: function(guid, m, y, monthsel) {
- 37. - if (cals.list[guid]) cals.list[guid].getMonth(m, y, false, monthsel);
- 38. - return false;
- 39. - },
- 40. - getDay: function(guid, d, m, y) {
- 41. - if (cals.list[guid]) cals.list[guid].getDay(d, m, y);
- 42. - return false;
- 43. - }
- 44. - };
- 45. - }
- 46. -
- 47. - window.Calendar = function(params) {
- 48. - var place = params.container;
- 49. - var rnd = Math.round(Math.random() * 1000000);
- 50. - if (!place) return;
- 51. -
- 52. - var guid = _ui.reg(this);
- 53. - cals.list[guid] = this;
- 54. -
- 55. - place.innerHTML = '<div></div>';
- 56. - place = place.firstChild;
- 57. - var mode = (modes[params.mode] || params.mode || 'd').toString().replace(/(this|next|prev)/, '');
- 58. - var hideNextMonth = params.hideNextMonth && true;
- 59. -
- 60. - var parseDay = this.parseDay = function(day) {
- 61. - day = day.toString();
- 62. - return {
- 63. - y: parseInt(day.substr(0, 4), 10),
- 64. - m: parseInt(day.substr(4, 2), 10),
- 65. - d: parseInt(day.substr(6, 2), 10)
- 66. - };
- 67. - }
- 68. -
- 69. - var day = params.day || { d: -1, m: -1, y: -1 };
- 70. - if (!day.m) {
- 71. - day = parseDay(day);
- 72. - }
- 73. -
- 74. - var _t = this;
- 75. - var addRows = params.addRows || '';
- 76. - var addRowsM = params.addRowsM || addRows;
- 77. -
- 78. - this.setDay = function(d, m, y) {
- 79. - day = m ? { d: d, m: m, y: y } : parseDay(d);
- 80. - _t.getMonth(day.m, day.y);
- 81. - };
- 82. -
- 83. - this.setMode = function(m) {
- 84. - mode = (modes[m] || m || 'd').replace(/(this|next|prev)/, '');
- 85. - _t.getMonth(day.m, day.y, true);
- 86. - };
- 87. -
- 88. - var getChild = function(el, inds) {
- 89. - for (var i = 0; i < inds.length; i++) {
- 90. - var el = el.childNodes[inds[i]];
- 91. - if (!el) return null;
- 92. - }
- 93. - return el;
- 94. - };
- 95. -
- 96. - this.getDay = params.getDay || function(d, m, y) {};
- 97. -
- 98. - this.getMonth = function(m, y, noheight, monthsel) {
- 99. - var mn = l.mn;
- 100. - var oD = new Date(y, m - 1, 1);
- 101. - oD.od = oD.getDay();
- 102. - if (oD.od == 0) {
- 103. - oD.od = 7;
- 104. - }
- 105. -
- 106. - var disabled = (mode == '-1');
- 107. -
- 108. - var dontDoLine = false;
- 109. - var leftStyle = '';
- 110. - var todayDate = !disabled ? new Date() : new Date(3000, 1, 1);
- 111. - todayDate = new Date(todayDate.getFullYear(), todayDate.getMonth(), (mode === 'm') ? 1 : todayDate.getDate());
- 112. -
- 113. - var d_y = oD.getFullYear();
- 114. - dim[1] = (((d_y % 100 != 0) && (d_y % 4 == 0)) || (d_y % 400 == 0)) ? 29 : 28;
- 115. - var t = [];
- 116. - var t2 = [];
- 117. -
- 118. - var tbl = '<table class="%cls%" cols="%cols%" cellpadding="0" border="0" cellspacing="0"><tbody>%rows%</tbody></table>';
- 119. - var headerNormal;
- 120. - var headerDisabled;
- 121. -
- 122. - switch (mode) {
- 123. - case 'm':
- 124. - var selDay = (y == day.y) ? day.m : 0;
- 125. - nextYear = y + 1;
- 126. - lastYear = y - 1;
- 127. -
- 128. - headerNormal = ''
- 129. - + '<tr>'
- 130. - + '<td class="month_arr"><a class="arr left" onclick="return cals.getMonth('+guid+',1,'+lastYear+');"></a></td>'
- 131. - + '<td align="center" class="month">' + y + '</td>'
- 132. - + '<td class="month_arr"><a class="arr right" onclick="return cals.getMonth('+guid+',1,'+nextYear+');"></a></td>'
- 133. - + '</tr>';
- 134. -
- 135. - t.push('<tr><td colspan="2">');
- 136. - t.push(rs(tbl, {cls: 'cal_table_head', cols: '3', rows: headerNormal}));
- 137. - t.push('</td></tr><tr>');
- 138. - for (var i = 1; i <= 12; i++) {
- 139. - leftStyle = "";
- 140. - if (i % 2 == 1) {
- 141. - if (i > 1) t.push('</tr><tr>');
- 142. - leftStyle = ' day_left';
- 143. - }
- 144. - clDay = (i == selDay) ? 'day sel' : 'day';
- 145. - curDate = new Date(y, i - 1, 1);
- 146. - if (!params.pastActive && curDate < todayDate || params.pastActive && curDate > todayDate) {
- 147. - clDay += ' past_day';
- 148. - }
- 149. - if (curDate.getTime() == todayDate.getTime()) {
- 150. - clDay += ' today';
- 151. - }
- 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>');
- 153. - }
- 154. - t.push('</tr>');
- 155. -
- 156. - t2.push(rs(tbl, {cls: 'cal_table', cols: '2', rows: t.join('')}));
- 157. -
- 158. - if (!noheight) place.style.height = place.offsetHeight + "px";
- 159. -
- 160. - val(place, t2.join(''));
- 161. -
- 162. - break;
- 163. -
- 164. - default:
- 165. - var selDay = (y == day.y && m == day.m) ? day.d : 0;
- 166. -
- 167. - if (m == 12) {
- 168. - nextMonth = 1;
- 169. - nextYear = y + 1;
- 170. - } else {
- 171. - nextMonth = m + 1;
- 172. - nextYear = y;
- 173. - }
- 174. - if (m == 1) {
- 175. - lastMonth = 12;
- 176. - lastYear = y - 1;
- 177. - } else {
- 178. - lastMonth = m - 1;
- 179. - lastYear = y;
- 180. - }
- 181. -
- 182. - var monthYear = monthFormat.replace('{month}', mn[m - 1]).replace('{year}', y);
- 183. - var calClass = 'cal_table' + (disabled ? ' disabled' : '') + (monthsel ? ' unshown' : '');
- 184. - var hoverEl = (mode === 'w') ? 'this.parentNode' : 'this';
- 185. -
- 186. - var headerNormal = ''
- 187. - + '<tr>'
- 188. - + '<td class="month_arr"><a class="arr left" onclick="return cals.getMonth('+guid+','+lastMonth+','+lastYear+');"></a></td>'
- 189. - + '<td align="center" class="month"><a class="cal_month_sel" onclick="return cals.getMonth('+guid+','+m+','+y+',1);">' + monthYear + '</a></td>'
- 190. - + '<td class="month_arr"><a class="arr right" onclick="return cals.getMonth('+guid+','+nextMonth+','+nextYear+');"></a></td>'
- 191. - + '</tr>';
- 192. - var headerDisabled = ''
- 193. - + '<tr>'
- 194. - + '<td class="month_arr"><span class="arr left"></span></td>'
- 195. - + '<td align="center" class="month">' + monthYear + '</td>'
- 196. - + '<td class="month_arr"><span class="arr right"></span></td>'
- 197. - + '</tr>';
- 198. -
- 199. - t.push('<tr><td colspan="7">');
- 200. - t.push(rs(tbl, {cls: 'cal_table_head', cols: '3', rows: disabled ? headerDisabled : headerNormal}));
- 201. - t.push('</td></tr><tr>');
- 202. -
- 203. - for (var s = 0; s < 7; s++) {
- 204. - t.push('<td class="daysofweek">' + l.days[s] + '</td>');
- 205. - }
- 206. - t.push('</tr><tr>');
- 207. -
- 208. - var dayPos = [];
- 209. -
- 210. - for (var i = 1; i <= 42; i++) {
- 211. - var leftStyle = (i % 7 == 1) ? ' day_left' : '';
- 212. - var x = ((i - oD.od >= 0) && (i - oD.od < dim[m - 1])) ? i - oD.od + 1 : 0;
- 213. - var curDate = new Date(y, m - 1, i - oD.od + 1);
- 214. - var x1 = x;
- 215. - var lim = 1;
- 216. - if (mode === 'w') {
- 217. - var x1 = i - oD.od - i % 7 + 2;
- 218. - if (i % 7 == 0) x1 -= 7;
- 219. - if (selDay) {
- 220. - var lim = 8 - (selDay + oD.od - 1) % 7;
- 221. - if (lim == 8) lim = 1;
- 222. - }
- 223. - }
- 224. -
- 225. - clDay = leftStyle;
- 226. - if (x >= selDay && x < selDay + lim) {
- 227. - clDay += ' day sel';
- 228. - } else {
- 229. - clDay += ' day';
- 230. - }
- 231. - if (!params.pastActive && curDate < todayDate || params.pastActive && curDate > todayDate) {
- 232. - clDay += ' past_day';
- 233. - }
- 234. - if (curDate.getTime() == todayDate.getTime()) {
- 235. - clDay += ' today';
- 236. - }
- 237. -
- 238. - if (x > 0) {
- 239. - dayPos[i] = x1;
- 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>');
- 241. - } else {
- 242. - if (i != 36) {
- 243. - if (!dontDoLine) {
- 244. - if (mode === 'w') dayPos[i] = x1;
- 245. - date = (i > 7 && !hideNextMonth) ? curDate.getDate() : ' ';
- 246. - t.push('<td class="day no_month_day' + leftStyle + '">' + date + '</td>');
- 247. - }
- 248. - } else {
- 249. - dontDoLine = true;
- 250. - }
- 251. - }
- 252. - if ((i % 7 == 0) && (i < 36)) {
- 253. - t.push('</tr><tr>');
- 254. - }
- 255. - }
- 256. - t.push('</tr>' + addRows);
- 257. -
- 258. - t2.push(rs(tbl, {cls: calClass, cols: '7', rows: t.join('')}));
- 259. -
- 260. - t = [];
- 261. -
- 262. - todayDate = new Date(todayDate.getFullYear(), todayDate.getMonth(), 1);
- 263. -
- 264. - var selDay = (y == day.y) ? day.m : 0;
- 265. - var calClass = 'cal_table' + (disabled ? ' disabled' : '') + (monthsel ? '' : ' unshown');
- 266. -
- 267. - headerNormal = ''
- 268. - + '<tr>'
- 269. - + '<td class="month_arr"><a class="arr left" onclick="return cals.getMonth('+guid+','+m+','+(y-1)+',1);"></a></td>'
- 270. - + '<td align="center" class="month"><a class="cal_month_sel" onclick="return cals.getMonth('+guid+','+m+','+y+');">' + y + '</a></td>'
- 271. - + '<td class="month_arr"><a class="arr right" onclick="return cals.getMonth('+guid+','+m+','+(y+1)+',1);"></a></td>'
- 272. - + '</tr>';
- 273. - headerDisabled = ''
- 274. - + '<tr>'
- 275. - + '<td class="month_arr"><span class="arr left"></span></td>'
- 276. - + '<td align="center" class="month">' + y + '</td>'
- 277. - + '<td class="month_arr"><span class="arr right"></span></td>'
- 278. - + '</tr>';
- 279. -
- 280. - t.push('<tr><td colspan="2">');
- 281. - t.push(rs(tbl, {cls: 'cal_table_head', cols: '3', rows: disabled ? headerDisabled : headerNormal}));
- 282. - t.push('</td></tr><tr>');
- 283. - for (var i = 1; i <= 12; i++) {
- 284. - leftStyle = '';
- 285. - if (i % 2 == 1) {
- 286. - if (i > 1) t.push('</tr><tr>');
- 287. - leftStyle = ' day_left';
- 288. - }
- 289. - clDay = (i == selDay) ? 'day sel' : 'day';
- 290. - curDate = new Date(y, i - 1, 1);
- 291. - if (!params.pastActive && curDate < todayDate || params.pastActive && curDate > todayDate) {
- 292. - clDay += ' past_day';
- 293. - }
- 294. - if (curDate.getTime() == todayDate.getTime()) {
- 295. - clDay += ' today';
- 296. - }
- 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>');
- 298. - }
- 299. - t.push('</tr>' + addRowsM);
- 300. -
- 301. - t2.push(rs(tbl, {cls: calClass, cols: '2', rows: t.join('')}));
- 302. -
- 303. - val(place, t2.join(''));
- 304. -
- 305. - if (browser.opera && !browser.mobile) {
- 306. - animate(place, {opacity: 0.99}, 20, animate.pbind(place, {opacity: 1}, 20)); // fuck opera!
- 307. - }
- 308. -
- 309. - break;
- 310. - }
- 311. - }
- 312. -
- 313. - this.getMonth(day.m, day.y);
- 314. - };
- 315. -
- 316. - window.Datepicker = function(el, options) {
- 317. -
- 318. - el = ge(el);
- 319. - if (!el) return;
- 320. -
- 321. - var dates = {};
- 322. - var lockHide = false;
- 323. - var _t = this;
- 324. - var w;
- 325. - var isShown = false;
- 326. - var hour = 0;
- 327. - var min = 0;
- 328. - var id = el.id;
- 329. - var inputId = id + "_date_input";
- 330. - var n = el.name || id;
- 331. - var p = el.parentNode;
- 332. - var calBox = id + '_cal_box';
- 333. - var calDiv = id + '_cal_div';
- 334. - var calFrame = id + '_cal_frame';
- 335. -
- 336. - var defaults = {
- 337. - mode: 'd',
- 338. - resfmt: 'ts', // could be 'plain'
- 339. - width: 145,
- 340. - addRows: '',
- 341. - noPast: false,
- 342. - pastActive: false,
- 343. - onUpdate: function(d, m) {}
- 344. - };
- 345. -
- 346. - options = extend({}, defaults, options);
- 347. -
- 348. - var mode = options.mode;
- 349. - var onUpdate = options.onUpdate;
- 350. - var w = options.width;
- 351. - var fmt = options.resfmt;
- 352. - var addRows = options.addRows;
- 353. - var addRowsM = options.addRowsM || addRows;
- 354. -
- 355. - var onClick = function(e) {
- 356. - if (mode === 'h') return false;
- 357. - if (isShown) {
- 358. - _t.hide();
- 359. - } else {
- 360. - showCalendar();
- 361. - }
- 362. - ge(inputId).blur();
- 363. - return false;
- 364. - };
- 365. -
- 366. - var showCalendar = function() {
- 367. - if (isShown) return;
- 368. - isShown = true;
- 369. -
- 370. - _ui.sel(_t.guid);
- 371. - show(calBox);
- 372. - new Calendar({
- 373. - container: ge(calDiv),
- 374. - day: dates,
- 375. - mode: mode,
- 376. - addRows: addRows,
- 377. - addRowsM: addRowsM,
- 378. - hideNextMonth: true,
- 379. - pastActive: options.pastActive,
- 380. - getDay: function(d, m, y) {
- 381. - updateDate({
- 382. - 'd': d,
- 383. - 'm': m,
- 384. - 'y': y
- 385. - }, mode);
- 386. - }
- 387. - });
- 388. - var s = getSize(ge(calDiv));
- 389. - setStyle(ge(calFrame), {width: s[0], height: s[1]});
- 390. - ge(inputId).focus();
- 391. - };
- 392. -
- 393. - var updateDate = function(date, mode, init) {
- 394. - if (!init && options.noPast) {
- 395. - if (new Date(date.y, date.m - 1, date.d, 23, 59) < new Date()) {
- 396. - return;
- 397. - }
- 398. - }
- 399. - dates = date;
- 400. - var controlElem = geByClass1('datepicker_control', wrap);
- 401. - if (mode === 'h') {
- 402. - addClass(controlElem, 'disabled');
- 403. - } else {
- 404. - removeClass(controlElem, 'disabled');
- 405. - if (mode === 'm') {
- 406. - ge(inputId).value = monthFormat.replace('{month}', winToUtf(l.mn[date.m - 1])).replace('{year}', date.y);
- 407. - } else {
- 408. - ge(inputId).value = dateFormat.replace('{day}', date.d).replace('{month}', winToUtf(l.mnOf[date.m - 1])).replace('{year}', date.y);
- 409. - }
- 410. - }
- 411. - _t.hide();
- 412. - if (fmt === 'plain') {
- 413. - ge(id).value = date.d + '.' + date.m + '.' + date.y + (options.time ? (' ' + hour + ':' + min) : '');
- 414. - } else if (fmt === 'ts') {
- 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);
- 416. - }
- 417. - if (!init) onUpdate(date, mode);
- 418. - };
- 419. -
- 420. - this.hide = function() {
- 421. - if (!isShown) return;
- 422. - isShown = false;
- 423. -
- 424. - _ui.sel(false);
- 425. - hide(calBox);
- 426. - };
- 427. - this.setMode = function(m) {
- 428. - mode = m;
- 429. - updateDate(dates, mode);
- 430. - };
- 431. - this.setDate = function(year, month, day) {
- 432. - if (!year && !month && !day) {
- 433. - var d = new Date();
- 434. - if (mode != 'm') dates.d = d.getDate();
- 435. - dates.m = d.getMonth() + 1;
- 436. - dates.y = d.getFullYear();
- 437. - } else {
- 438. - if (mode != 'm') dates.d = day;
- 439. - dates.m = month;
- 440. - dates.y = year;
- 441. - }
- 442. - updateDate(dates, mode);
- 443. - }
- 444. -
- 445. - var d = 0, m;
- 446. - if (options.day || options.month || options.year) {
- 447. - if (mode != 'm') dates.d = options.day;
- 448. - dates.m = options.month;
- 449. - dates.y = options.year;
- 450. - if (options.time) {
- 451. - hour = options.hour || 0;
- 452. - min = options.min || 0;
- 453. - }
- 454. - } else if (m = (el.value || '').match(/(\d+)\.(\d+)(?:\.(\d+))?(?:\s+(\d+)\:(\d+))?/)) {
- 455. - if (mode != 'm') dates.d = intval(m[3].length ? m[1] : 0);
- 456. - dates.m = intval(m[3].length ? m[2] : m[1]);
- 457. - dates.y = intval(m[3].length ? m[3] : m[2]);
- 458. - if (options.time) {
- 459. - hour = m[4] || 0;
- 460. - min = m[5] || 0;
- 461. - }
- 462. - } else if (parseInt(el.value)) {
- 463. - var ts = parseInt(el.value) + ((new Date()).getTimezoneOffset() + 240) * 60 + intval(vk.dt);
- 464. - d = new Date(ts * 1000);
- 465. - } else {
- 466. - d = new Date();
- 467. - }
- 468. - if (d) {
- 469. - dates.d = d.getDate();
- 470. - dates.m = d.getMonth() + 1;
- 471. - dates.y = d.getFullYear();
- 472. - hour = d.getHours();
- 473. - min = d.getMinutes();
- 474. - }
- 475. -
- 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>';
- 477. - var wrap = ce('div', {
- 478. - id: id + "_datepicker_container",
- 479. - className: "datepicker_container",
- 480. - innerHTML: html
- 481. - }, {
- 482. - width: w
- 483. - });
- 484. - p.replaceChild(wrap, el);
- 485. - addEvent(geByClass1('datepicker_control', wrap), 'mousedown', onClick);
- 486. - updateDate(dates, mode, true);
- 487. -
- 488. - _t.guid = _ui.reg({
- 489. - container: wrap,
- 490. - onEvent: function(e) {
- 491. - if (e.type === 'mousedown') {
- 492. - var outside = true,
- 493. - t = e.target;
- 494. - while (t && t != t.parentNode) {
- 495. - if (t == wrap) {
- 496. - outside = false;
- 497. - break;
- 498. - }
- 499. - t = t.parentNode;
- 500. - }
- 501. - if (outside) {
- 502. - _t.hide();
- 503. - }
- 504. - }
- 505. - },
- 506. - _blur: function() {
- 507. - _t.hide();
- 508. - }
- 509. - });
- 510. -
- 511. - if (options.time) {
- 512. - var time = ge(options.time);
- 513. - new Timepicker(time, {
- 514. - onUpdate: function(h, m) {
- 515. - hour = h;
- 516. - min = m;
- 517. - updateDate(dates, mode);
- 518. - },
- 519. - resfmt: fmt,
- 520. - hour: hour,
- 521. - min: min
- 522. - });
- 523. - }
- 524. -
- 525. - if (browser.mozilla) {
- 526. - hide(calFrame);
- 527. - }
- 528. - };
- 529. -
- 530. - window.Timepicker = function(el, options) {
- 531. - el = ge(el);
- 532. - if (!el) return;
- 533. - var id = el.id,
- 534. - n = el.name || '',
- 535. - v = el.value || '';
- 536. -
- 537. - var defaults = {
- 538. - onUpdate: function(h, m) {},
- 539. - time: 0,
- 540. - hour: 0,
- 541. - min: 0,
- 542. - resfmt: 'ts', // could be 'plain'
- 543. - format: '{hour}<div class="fl_l" style="padding:5px 3px 0;"> : </div>{min}' //TEMP
- 544. - };
- 545. -
- 546. - var o = extend({}, defaults, options);
- 547. -
- 548. - var p = el.parentNode;
- 549. - if (v) o.time = v;
- 550. - if (o.time) {
- 551. - o.hour = Math.floor(o.time / 3600);
- 552. - o.min = Math.floor((o.time - o.hour * 3600) / 60);
- 553. - }
- 554. - var h = o.hour || 0;
- 555. - var m = o.min || 0;
- 556. - var fmt = o.resfmt;
- 557. - m = m - m % 5;
- 558. -
- 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>';
- 560. - var wrap = ce('div', {
- 561. - id: id + "_timepicker_container",
- 562. - className: 'timepicker_container',
- 563. - innerHTML: html
- 564. - });
- 565. - p.replaceChild(wrap, el);
- 566. -
- 567. - var onChange = function() {
- 568. - var hour = hourDD.val(),
- 569. - min = minDD.val();
- 570. - if (fmt === 'plain') {
- 571. - ge(id).value = hour + ':' + min;
- 572. - } else if (fmt === 'ts') {
- 573. - ge(id).value = hour * 3600 + min * 60;
- 574. - }
- 575. - o.onUpdate(hour, min);
- 576. - }
- 577. -
- 578. - var hours = [],
- 579. - mins = [];
- 580. - for (var i = 0; i < 24; i++) {
- 581. - hours.push([i, i]);
- 582. - }
- 583. - for (var i = 0; i < 60; i += 5) {
- 584. - mins.push([i, i < 10 ? '0' + i.toString() : i]);
- 585. - }
- 586. -
- 587. - var hourDD = new Dropdown(ge(id + '_hour_input'), hours, {
- 588. - width: 47,
- 589. - multiselect: false,
- 590. - onChange: onChange
- 591. - });
- 592. - var minDD = new Dropdown(ge(id + '_min_input'), mins, {
- 593. - width: 47,
- 594. - multiselect: false,
- 595. - onChange: onChange
- 596. - });
- 597. - };
- 598. -
- 599. - window.Daypicker = function(el, options) {
- 600. - el = ge(el);
- 601. - if (!el) return;
- 602. - var id = el.id,
- 603. - n = el.name || '',
- 604. - v = el.value || '';
- 605. -
- 606. - var defaults = {
- 607. - onUpdate: function(d, m, y) {},
- 608. - date: 0,
- 609. - year: 0,
- 610. - month: 0,
- 611. - day: 0,
- 612. - format: '{day}<div class="fl_l" style="padding:0 3px;"> </div>{month}<div class="fl_l" style="padding:0 3px;"> </div>{year}',
- 613. - width: 0
- 614. - };
- 615. -
- 616. - var o = extend({}, defaults, options);
- 617. -
- 618. - var p = el.parentNode;
- 619. - if (v) o.date = v;
- 620. - if (o.date) {
- 621. - if (o.date < 30000000) {
- 622. - o.year = Math.floor(o.date / 10000);
- 623. - o.month = Math.floor((o.date - o.year * 10000) / 100);
- 624. - o.day = o.date - o.year * 10000 - o.month * 100;
- 625. - } else {
- 626. - var d = new Date(o.date * 1000);
- 627. - o.year = d.getFullYear();
- 628. - o.month = d.getMonth();
- 629. - o.day = d.getDate();
- 630. - }
- 631. - }
- 632. -
- 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>';
- 634. - var wrap = ce('div', {
- 635. - id: id + "_daypicker_container",
- 636. - className: 'daypicker_container clear_fix',
- 637. - innerHTML: html
- 638. - });
- 639. - p.replaceChild(wrap, el);
- 640. -
- 641. - var daysInMonth = function(month, year) {
- 642. - var days = (new Date(year ? year : 2004, month, 0)).getDate(),
- 643. - res = [[0, getLang('global_day_label')]];
- 644. - for (var i = 1; i <= days; i++) {
- 645. - res.push([i, i]);
- 646. - }
- 647. - return res;
- 648. - }
- 649. -
- 650. - var onChange = function() {
- 651. - var year = parseInt(yearDD.val()),
- 652. - month = parseInt(monthDD.val()),
- 653. - day = parseInt(dayDD.val());
- 654. - ge(id).value = year * 10000 + month * 100 + day;
- 655. - dayDD.setData(daysInMonth(month, year));
- 656. - o.onUpdate(year, month, day);
- 657. - }
- 658. - var d = new Date(),
- 659. - years = [[0, getLang('global_year_label')]],
- 660. - months = [[0, getLang('global_month_label')]];
- 661. - for (var i = d.getFullYear(); i >= (o.startYear || 1800); i--) {
- 662. - years.push([i, i]);
- 663. - }
- 664. - for (var i = 0; i < 12; i++) {
- 665. - months.push([i + 1, l.mnOf[i]]);
- 666. - }
- 667. -
- 668. - var dayDD = new Dropdown(ge(id + '_day_input'), daysInMonth(o.month, o.year), {
- 669. - width: 58,
- 670. - onChange: onChange
- 671. - });
- 672. - var monthDD = new Dropdown(ge(id + '_month_input'), months, {
- 673. - width: 95,
- 674. - onChange: onChange
- 675. - });
- 676. - var yearDD = new Dropdown(ge(id + '_year_input'), years, {
- 677. - width: 60,
- 678. - onChange: onChange
- 679. - });
- 680. - if (o.width) {
- 681. - var w = getSize(wrap.firstChild)[0],
- 682. - d = o.width - w,
- 683. - w1 = getSize(monthDD.container)[0];
- 684. - setStyle(monthDD.container, {
- 685. - width: w1 + d
- 686. - });
- 687. - }
- 688. - }
- 689. -
- 690. - })();
- 691. -
- 692. - try { stManager.done('datepicker.js'); } catch (e) {}
- ------
- Файл - ads_moder.css (Старый размер - 11221 | Новый - 0):
- 0. - #ads_moder_css { display: none; }
- 1. -
- 2. - /* ------- */
- 3. - /* General */
- 4. - /* ------- */
- 5. -
- 6. - td.ads_table_overflow_hidden {
- 7. - height: 20px;
- 8. - vertical-align: top;
- 9. - }
- 10. - td.ads_table_overflow_hidden div {
- 11. - position: relative;
- 12. - }
- 13. - td.ads_table_overflow_hidden div div {
- 14. - position: absolute;
- 15. - overflow: hidden;
- 16. - white-space: nowrap;
- 17. - width: 100%;
- 18. - }
- 19. -
- 20. - .ads_moder_tabs {
- 21. - padding-top: 0;
- 22. - }
- 23. - .ads_moder_tabs ul.t0 {
- 24. - width: 700px;
- 25. - }
- 26. -
- 27. - .ads_moder_stat_filter {
- 28. - background-color: #F7F7F7;
- 29. - border-bottom: 1px solid #DAE1E8;
- 30. - padding: 10px 10px 5px 10px;
- 31. - }
- 32. - .ads_moder_stat_filter_tab_wrap {
- 33. - padding: 0 5px 5px 0;
- 34. - text-align: center;
- 35. - }
- 36. - .ads_moder_stat_filter_tab_wrap .round_tab.disabled:hover,
- 37. - .ads_moder_stat_filter_tab_wrap .round_tab.label:hover {
- 38. - background-color: transparent;
- 39. - cursor: default;
- 40. - }
- 41. - .ads_moder_stat_filter_tab_wrap .round_tab.label {
- 42. - color: #555555;
- 43. - }
- 44. - .ads_moder_stat_filter_period_day .round_tab {
- 45. - width: 100px;
- 46. - }
- 47. - .ads_moder_stat_filter_period_week .round_tab {
- 48. - width: 180px;
- 49. - }
- 50. - .ads_moder_stat_filter_period_month .round_tab {
- 51. - width: 100px;
- 52. - }
- 53. -
- 54. - /* -- */
- 55. - /* Ad */
- 56. - /* -- */
- 57. -
- 58. - .ads_ad_char_hint {
- 59. - position: relative;
- 60. - }
- 61. - .ads_ad_char_hint_color {
- 62. - visibility: hidden;
- 63. - position: absolute;
- 64. - height: 1px;
- 65. - bottom: 0;
- 66. - left: 0;
- 67. - border-bottom: 1px solid red;
- 68. - overflow: hidden;
- 69. - }
- 70. - .ads_ad_box a:hover .ads_ad_char_hint_color {
- 71. - visibility: visible;
- 72. - }
- 73. -
- 74. - /* ------- */
- 75. - /* Markers */
- 76. - /* ------- */
- 77. -
- 78. - .ads_marker_wrap_ad {
- 79. - position: relative;
- 80. - }
- 81. - .ads_marker_wrap {
- 82. - position: absolute;
- 83. - top: 1px;
- 84. - left: 1px;
- 85. - z-index: 10;
- 86. - }
- 87. - .ads_marker {
- 88. - float: left;
- 89. - width: 5px;
- 90. - height: 5px;
- 91. - margin-right: 2px;
- 92. - border-radius: 1px;
- 93. - }
- 94. - .ads_marker_wrap_ad:hover .ads_marker {
- 95. - width: 7px;
- 96. - height: 7px;
- 97. - border-radius: 2px;
- 98. - }
- 99. -
- 100. - .ads_marker_target {
- 101. - background-color: #ff8000;
- 102. - }
- 103. - .ads_marker_clicked {
- 104. - background-color: #9966cc;
- 105. - }
- 106. - .ads_marker_closed {
- 107. - background-color: #00b2cc;
- 108. - }
- 109. - .ads_marker_viewed {
- 110. - background-color: #ff55aa;
- 111. - }
- 112. -
- 113. - .ads_marker_offensive {
- 114. - background-color: #5090ff;
- 115. - }
- 116. - .ads_marker_porno {
- 117. - background-color: #ff2213;
- 118. - }
- 119. - .ads_marker_cheaters {
- 120. - background-color: #a0522d;
- 121. - }
- 122. - .ads_marker_against {
- 123. - background-color: #008000;
- 124. - }
- 125. -
- 126. - .ads_marker_enabled {
- 127. - background-color: #00aa00;
- 128. - }
- 129. - .ads_marker_enabling {
- 130. - background-color: #CFB53B;
- 131. - }
- 132. - .ads_marker_approved {
- 133. - background-color: #0000dd;
- 134. - }
- 135. - .ads_marker_disapproved {
- 136. - background-color: #aa0000;
- 137. - }
- 138. - .ads_marker_archived {
- 139. - background-color: #333333;
- 140. - }
- 141. -
- 142. - .ads_marker_request_manual {
- 143. - background-color: #e0b080;
- 144. - }
- 145. - .ads_marker_request_wrong {
- 146. - background-color: #00d07f;
- 147. - }
- 148. -
- 149. - .ads_marker_target_tip {
- 150. - color: #ff8000;
- 151. - }
- 152. - .ads_marker_clicked_tip {
- 153. - color: #9966cc;
- 154. - }
- 155. - .ads_marker_closed_tip {
- 156. - color: #00b2cc;
- 157. - }
- 158. - .ads_marker_viewed_tip {
- 159. - color: #ff55aa;
- 160. - }
- 161. -
- 162. - .ads_marker_offensive_tip {
- 163. - color: #5090ff;
- 164. - }
- 165. - .ads_marker_porno_tip {
- 166. - color: #ff2213;
- 167. - }
- 168. - .ads_marker_cheaters_tip {
- 169. - color: #a0522d;
- 170. - }
- 171. - .ads_marker_against_tip {
- 172. - color: #008000;
- 173. - }
- 174. -
- 175. - .ads_marker_enabled_tip {
- 176. - color: #00aa00;
- 177. - }
- 178. - .ads_marker_enabling_tip {
- 179. - color: #CFB53B;
- 180. - }
- 181. - .ads_marker_approved_tip {
- 182. - color: #0000dd;
- 183. - }
- 184. - .ads_marker_disapproved_tip {
- 185. - color: #aa0000;
- 186. - }
- 187. - .ads_marker_archived_tip {
- 188. - color: #333333;
- 189. - }
- 190. -
- 191. - .ads_marker_request_manual_tip {
- 192. - color: #e0b080;
- 193. - }
- 194. - .ads_marker_request_wrong_tip {
- 195. - color: #00d07f;
- 196. - }
- 197. -
- 198. - .ads_marker_other_tip {
- 199. - color: #2b587a;
- 200. - }
- 201. - .ads_marker_grey_tip {
- 202. - color: grey;
- 203. - }
- 204. - /* #8B00ff */
- 205. - /* 009090 */
- 206. -
- 207. - .ads_info_marker {
- 208. - position: absolute;
- 209. - z-index: 20;
- 210. - top: 2px;
- 211. - right: 2px;
- 212. -
- 213. - background-color: #D5DDE5;
- 214. - border-radius: 3px;
- 215. - text-align: center;
- 216. -
- 217. - width: 20px;
- 218. - height: 20px;
- 219. - line-height: 20px;
- 220. - font-size: 1px;
- 221. - opacity: 0.5;
- 222. -
- 223. - display: none;
- 224. - }
- 225. - .ads_marker_wrap_ad:hover .ads_info_marker {
- 226. - display: block;
- 227. - text-decoration: none;
- 228. - }
- 229. - .ads_marker_wrap_ad .ads_info_marker:hover {
- 230. - font-size: 11px;
- 231. - opacity: 1;
- 232. - }
- 233. -
- 234. - /* -------- */
- 235. - /* Category */
- 236. - /* -------- */
- 237. -
- 238. - .ads_category_wrap {
- 239. - max-width: 118px;
- 240. - margin-top: 4px;
- 241. - display: inline-block;
- 242. - font-size: 0.91em;
- 243. - position: relative;
- 244. - }
- 245. - .ads_category_wrap .ads_category_parent {
- 246. - position: absolute;
- 247. - z-index: 10;
- 248. - display: none;
- 249. - white-space: nowrap;
- 250. - padding-left: 5px;
- 251. - }
- 252. - .ads_category_wrap .ads_subcategory {
- 253. - font-weight: bold;
- 254. - }
- 255. - .ads_category_wrap:hover .ads_subcategory,
- 256. - .ads_category_wrap:hover .ads_category_parent {
- 257. - background-color: white;
- 258. - }
- 259. - .ads_category_wrap:hover .ads_category_parent {
- 260. - display: inline;
- 261. - }
- 262. -
- 263. - /* -------- */
- 264. - /* Ads info */
- 265. - /* -------- */
- 266. -
- 267. - .ads_info_premoderation_request .ads_ad_box_border {
- 268. - border-width: 1px;
- 269. - }
- 270. - .ads_info_premoderation_request .label {
- 271. - color: grey;
- 272. - padding-right: 10px;
- 273. - }
- 274. - .ads_info_premoderation_request .info_msg {
- 275. - margin-top: 15px;
- 276. - }
- 277. - .ads_info_premoderation_request_info {
- 278. - line-height: 160%;
- 279. - }
- 280. - .ads_info_premoderation_request_info td {
- 281. - vertical-align: top;
- 282. - padding-bottom: 3px;
- 283. - }
- 284. - .ads_info_premoderation_request_ad_prev,
- 285. - .ads_info_premoderation_request_ad_cur,
- 286. - .ads_info_premoderation_request_arrow,
- 287. - .ads_info_premoderation_request_info {
- 288. - padding-right: 15px;
- 289. - }
- 290. - .ads_info_premoderation_request_ad_prev,
- 291. - .ads_info_premoderation_request_ad_cur,
- 292. - .ads_info_premoderation_request_info {
- 293. - vertical-align: top;
- 294. - }
- 295. - .ads_info_premoderation_request_ad_prev,
- 296. - .ads_info_premoderation_request_ad_cur {
- 297. - text-align: center;
- 298. - }
- 299. - .ads_info_premoderation_request_arrow {
- 300. - font-size: 30px;
- 301. - }
- 302. -
- 303. - /* ------- */
- 304. - /* All ads */
- 305. - /* ------- */
- 306. -
- 307. - .ads_all_navigation_page {
- 308. - display: block;
- 309. - float: left;
- 310. - text-decoration: none !important;
- 311. - padding: 5px;
- 312. - margin: 0 3px 3px 0;
- 313. - border: 1px solid #DAE1E8;
- 314. - min-width: 45px;
- 315. - }
- 316. - .ads_all_navigation_page.current {
- 317. - font-weight: bold;
- 318. - }
- 319. -
- 320. - .ads_all_ads_box {
- 321. - float: left;
- 322. - height: 300px;
- 323. - margin: 0 5px;
- 324. - }
- 325. -
- 326. - .ads_all_ads_box .ads_ad_box_border {
- 327. - border-width: 1px;
- 328. - }
- 329. -
- 330. - /* ------------- */
- 331. - /* Premoderation */
- 332. - /* ------------- */
- 333. -
- 334. - .ads_premoderation_requests {
- 335. - margin-right: -30px;
- 336. - }
- 337. - .ads_premoderation_request_wrap {
- 338. - float: left;
- 339. - height: 480px;
- 340. - margin: 5px 30px 0 0;
- 341. - }
- 342. - .ads_premoderation_request_wrap.first {
- 343. - margin-right: 31px;
- 344. - }
- 345. -
- 346. - .ads_premoderation_requests .ads_ad_box_border {
- 347. - border-width: 1px;
- 348. - }
- 349. -
- 350. - .ads_premoderation_request {
- 351. - border: 1px solid #D3DBE1;
- 352. - padding: 3px;
- 353. - width: 283px;
- 354. - }
- 355. - .ads_premoderation_request_ad_wrap {
- 356. - vertical-align: top;
- 357. - text-align: center;
- 358. - padding-top: 5px;
- 359. - }
- 360. - .ads_premoderation_request_ad_wrap2 {
- 361. - display: inline-block;
- 362. - }
- 363. - .ads_premoderation_request_ad_page_link_wrap {
- 364. - font-size: 30px;
- 365. - text-align: center;
- 366. - line-height: 20px;
- 367. - overflow: hidden;
- 368. - }
- 369. - a.ads_premoderation_request_ad_page_link {
- 370. - text-decoration: none;
- 371. - }
- 372. - .ads_premoderation_request_ad_link_url_wrap {
- 373. - padding: 5px 3px 0 3px;
- 374. - }
- 375. - .ads_premoderation_request_notes_wrap {
- 376. - padding: 0 3px;
- 377. - }
- 378. - .ads_premoderation_request_comment_wrap {
- 379. - padding-top: 3px;
- 380. - }
- 381. - .ads_premoderation_request_comment_wrap2 {
- 382. - margin-right: 8px;
- 383. - }
- 384. - .ads_premoderation_request_comment {
- 385. - width: 100%;
- 386. - margin: 0;
- 387. - }
- 388. - .ads_premoderation_request_actions_wrap {
- 389. - padding-top: 8px;
- 390. - }
- 391. - .ads_premoderation_request_actions_wrap2 {
- 392. - width: 100%;
- 393. - border-collapse: collapse;
- 394. - }
- 395. - .ads_premoderation_request_reasons_wrap2 {
- 396. - position: relative;
- 397. - }
- 398. - .ads_premoderation_request_result_wrap {
- 399. - height: 20px;
- 400. - padding: 5px 3px 3px 3px;
- 401. - }
- 402. - .ads_premoderation_request_result {
- 403. - color: grey;
- 404. - }
- 405. -
- 406. - .ads_premoderation_categories_edit_box .info_msg {
- 407. - margin-bottom: 15px;
- 408. - }
- 409. - .ads_premoderation_categories_edit_box .label {
- 410. - padding-top: 4px;
- 411. - color: grey;
- 412. - width: 150px;
- 413. - text-align: right;
- 414. - }
- 415. - .ads_premoderation_categories_edit_box .labeled {
- 416. - padding-bottom: 10px;
- 417. - }
- 418. -
- 419. - .ads_premoderation_mass_progress_wrap2,
- 420. - .ads_premoderation_mass_result {
- 421. - padding-top: 10px;
- 422. - }
- 423. - .ads_premoderation_mass_progress_wrap1 {
- 424. - width: 250px;
- 425. - }
- 426. -
- 427. - .ads_premoderation_stat_moder_name_wrap {
- 428. - visibility: hidden;
- 429. - position: relative;
- 430. - }
- 431. - .ads_premoderation_stat_moder_name {
- 432. - visibility: visible;
- 433. - position: absolute;
- 434. - left: 0;
- 435. - top: 0;
- 436. - white-space: nowrap;
- 437. - }
- 438. - .ads_premoderation_stat_value_hint,
- 439. - .ads_premoderation_stat_value_hint a {
- 440. - color: gray;
- 441. - }
- 442. -
- 443. - /* ---- */
- 444. - /* Logs */
- 445. - /* ---- */
- 446. -
- 447. - table.ads_logs_users {
- 448. - border-collapse: collapse;
- 449. - }
- 450. - table.ads_logs_users td,
- 451. - table.ads_logs_users th {
- 452. - padding: 2px 5px;
- 453. - }
- 454. -
- 455. - table.ads_logs_info {
- 456. - border-collapse: collapse;
- 457. - }
- 458. - table.ads_logs_info td,
- 459. - table.ads_logs_info th {
- 460. - padding: 1px 10px;
- 461. - }
- 462. -
- 463. - /* ------------ */
- 464. - /* Stat summary */
- 465. - /* ------------ */
- 466. -
- 467. - .ads_stat_sumary_content {
- 468. - padding: 20px;
- 469. - }
- 470. -
- 471. - .ads_moder_stat_summary_range_wrap {
- 472. - margin-top: -2px;
- 473. - }
- 474. - @-moz-document url-prefix() {
- 475. - .ads_moder_stat_summary_range_wrap {
- 476. - margin-top: -1px;
- 477. - }
- 478. - }
- 479. - .ads_moder_stat_summary_range_part {
- 480. - padding-left: 8px;
- 481. - }
- 482. - .ads_moder_stat_summary_range_label {
- 483. - padding-top: 5px;
- 484. - }
- 485. - @-moz-document url-prefix() {
- 486. - .ads_moder_stat_summary_range_label {
- 487. - padding-top: 4px;
- 488. - }
- 489. - }
- 490. - #ads_moder_stat_summary_range_link {
- 491. - opacity: 0.5;
- 492. - display: block;
- 493. - padding: 1px;
- 494. - }
- 495. - #ads_moder_stat_summary_range_link:hover {
- 496. - opacity: 1;
- 497. - }
- 498. - #ads_moder_stat_summary_range_link img {
- 499. - display: block;
- 500. - }
- 501. -
- 502. - #ads_moder_stat_summary_filter_properties_shower {
- 503. - display: block;
- 504. - padding: 3px 8px 8px 8px;
- 505. - }
- 506. -
- 507. - .ads_stat_summary_graph_link {
- 508. - height: 11px;
- 509. - overflow: visible;
- 510. - }
- 511. - .ads_stat_summary_graph_image {
- 512. - display: block;
- 513. - margin-top: -1px;
- 514. - }
- 515. -
- 516. - /* ----- */
- 517. - /* Other */
- 518. - /* ----- */
- 519. -
- 520. - .ads_navigation_link.current {
- 521. - font-weight: bold;
- 522. - }
- 523. -
- 524. - .ads_note {
- 525. - padding-bottom: 5px;
- 526. - }
- 527. - .ads_note_info {
- 528. - color: #999999;
- 529. - font-size: 0.91em;
- 530. - }
- 531. - .ads_note_info_user {
- 532. - color: #999999;
- 533. - }
- 534. -
- 535. - /* --- */
- 536. - /* OLD */
- 537. - /* --- */
- 538. -
- 539. - #ads_unions_bonuses * {
- 540. - text-align: left;
- 541. - }
- 542. -
- 543. - #ads_unions_queue .ads_unions_list td,
- 544. - #ads_unions_queue .ads_unions_list th {
- 545. - text-align: left;
- 546. - }
- 547. -
- 548. - #ads_premoderation_stat .ads_unions_list th.column_moder *,
- 549. - #ads_premoderation_stat .ads_unions_list td.column_moder,
- 550. - #ads_premoderation_stat .ads_unions_list th.column_period *,
- 551. - #ads_premoderation_stat .ads_unions_list td.column_period {
- 552. - text-align: left;
- 553. - }
- 554. -
- 555. - /* Distribution chart */
- 556. - .ads_moder_chart_table_wrap {
- 557. - position: relative;
- 558. - }
- 559. - .ads_moder_chart_table {
- 560. - background-color: #F3F5F7;
- 561. - border: 0 none;
- 562. - margin-bottom: 10px;
- 563. - vertical-align: bottom;
- 564. - margin: 0 auto;
- 565. - }
- 566. - .ads_moder_chart_table td.ads_moder_total_chart_row {
- 567. - background-color: #FFFFFF;
- 568. - color:#45688E;
- 569. - border: 0 none;
- 570. - padding-top: 10px;
- 571. - padding-bottom: 30px;
- 572. - vertical-align: bottom;
- 573. - }
- 574. - .ads_moder_chart_column {
- 575. - background-color: #B0C1CF;
- 576. - vertical-align: bottom;
- 577. - cursor: pointer;
- 578. - }
- 579. - .ads_moder_chart_column.even {
- 580. - background-color: #C7D3DD;
- 581. - }
- 582. - .ads_moder_chart_table td {
- 583. - vertical-align: bottom;
- 584. - }
- 585. - .ads_moder_chart_table td.ads_moder_chart_under_num {
- 586. - background-color: #EAEEF2;
- 587. - height: 15px;
- 588. - padding-bottom: 3px;
- 589. - }
- 590. - .ads_moder_chart_table td.ads_moder_chart_under_num.even {
- 591. - background-color: #FFFFFF;
- 592. - }
- 593. - .ads_moder_chart_date {
- 594. - font-size: 9px;
- 595. - height: 10px;
- 596. - padding-top: 4px;
- 597. - text-align: center;
- 598. - }
- 599. - .ads_moder_chart_max_label {
- 600. - background-color: #FFFFFF;
- 601. - color: #000000;
- 602. - display: none;
- 603. - font-size: 9px;
- 604. - padding: 2px 4px;
- 605. - position: absolute;
- 606. - z-index: 100;
- 607. - }
- 608. - .ads_moder_chart_max_label_out {
- 609. - background-color: #2B587A;
- 610. - display: none;
- 611. - opacity: 0.2;
- 612. - position: absolute;
- 613. - z-index: 90;
- 614. - }
- 615. - .ads_moder_chart_max_label_out2 {
- 616. - background-color: #2B587A;
- 617. - display: none;
- 618. - opacity: 0.1;
- 619. - position: absolute;
- 620. - z-index: 90;
- 621. - }
- ------
- Файл - ads_moder.js (Старый размер - 24181 | Новый - 0):
- 0. - var AdsModer = {};
- 1. -
- 2. - AdsModer.init = function() {
- 3. - AdsModer.initDelayedImages();
- 4. - }
- 5. -
- 6. - AdsModer.initDelayedImages = function() {
- 7. - var imagesIndex;
- 8. - var indexStep = 500;
- 9. - var lastImage;
- 10. - var lastImageY;
- 11. -
- 12. - buildIndex();
- 13. - if (isEmpty(imagesIndex)) {
- 14. - return;
- 15. - }
- 16. -
- 17. - var scrolledNode = (browser.msie6 ? pageNode : window);
- 18. - var handler = checkImages.pbind(false);
- 19. - function deinit() {
- 20. - removeEvent(scrolledNode, 'scroll', handler);
- 21. - }
- 22. - cur.destroy.push(deinit);
- 23. - addEvent(scrolledNode, 'scroll', handler);
- 24. - handler();
- 25. -
- 26. - function buildIndex() {
- 27. - if (lastImage && lastImage.hasAttribute('src_') && lastImageY == getXY(lastImage)[1]) {
- 28. - return;
- 29. - }
- 30. -
- 31. - var imagesAll = geByTag('img');
- 32. - var image;
- 33. - var indexKey;
- 34. -
- 35. - imagesIndex = {};
- 36. -
- 37. - if (!imagesAll.length) {
- 38. - return;
- 39. - }
- 40. -
- 41. - for (var i = 0, image; image = imagesAll[i]; i++) {
- 42. - if (!image.hasAttribute('src_')) {
- 43. - continue;
- 44. - }
- 45. - indexKey = intval(getXY(image)[1] / indexStep);
- 46. - if (!(indexKey in imagesIndex)) {
- 47. - imagesIndex[indexKey] = [];
- 48. - }
- 49. - imagesIndex[indexKey].push(image);
- 50. - lastImage = image;
- 51. - }
- 52. -
- 53. - lastImageY = getXY(lastImage)[1];
- 54. - }
- 55. -
- 56. - function checkIndex() {
- 57. - buildIndex();
- 58. - if (isEmpty(imagesIndex)) {
- 59. - deinit();
- 60. - }
- 61. - }
- 62. -
- 63. - function checkImages(delayed) {
- 64. - var yTop = scrollGetY()
- 65. - var yBottom = yTop + lastWindowHeight;
- 66. - var indexTop = intval(yTop / indexStep);
- 67. - var indexBottom = intval(yBottom / indexStep);
- 68. - var image;
- 69. - for (var i = indexTop; i <= indexBottom; i++) {
- 70. - if (!(i in imagesIndex)) {
- 71. - continue;
- 72. - }
- 73. - for (var j = 0, len = imagesIndex[i].length; j < len; j++) {
- 74. - image = imagesIndex[i][j];
- 75. - image.src = image.getAttribute('src_');
- 76. - image.removeAttribute('src_')
- 77. - }
- 78. - delete imagesIndex[i];
- 79. - }
- 80. - checkIndex();
- 81. - setTimeout(checkIndex, 1000);
- 82. - }
- 83. - }
- 84. -
- 85. - AdsModer.showObjectInfo = function(objectType, objectId) {
- 86. - var ajaxParams = {};
- 87. - ajaxParams.object_type = objectType;
- 88. - ajaxParams.object_id = objectId;
- 89. -
- 90. - var showOptions = {params: {}};
- 91. -
- 92. - showBox('/adsmoder?act=object_info', ajaxParams, showOptions);
- 93. - }
- 94. -
- 95. - AdsModer.openFeaturesEditBox = function(unionId, hash, featuresInfo, featuresEditHtml) {
- 96. - var editBox = showFastBox({title: '�����������', width: 550}, featuresEditHtml);
- 97. - var saveFeaturesHandler = AdsModer.saveFeatures.pbind(unionId, hash, featuresInfo, editBox);
- 98. - editBox.removeButtons();
- 99. - editBox.addButton(getLang('box_cancel'), false, 'no');
- 100. - editBox.addButton('��������', saveFeaturesHandler, 'yes');
- 101. -
- 102. - for (var i in featuresInfo) {
- 103. - var featureInfo = featuresInfo[i];
- 104. - new Checkbox(ge('ads_moder_feature_' + featureInfo.key), {
- 105. - label: featureInfo.name,
- 106. - checked: intval(featureInfo.value),
- 107. - width: 500
- 108. - });
- 109. - }
- 110. - }
- 111. -
- 112. - AdsModer.saveFeatures = function(unionId, hash, featuresInfo, editBox) {
- 113. - if (!Ads.lock('saveFeatures', onLock, onUnlock)) {
- 114. - return;
- 115. - }
- 116. -
- 117. - var ajaxParams = {};
- 118. - ajaxParams.union_id = unionId;
- 119. - ajaxParams.hash = hash;
- 120. - ajaxParams.features = [];
- 121. - for (var i in featuresInfo) {
- 122. - var featureInfo = featuresInfo[i];
- 123. - ajaxParams.features.push(featureInfo.key + ':' + intval(ge('ads_moder_feature_' + featureInfo.key).value));
- 124. - }
- 125. - ajaxParams.features = ajaxParams.features.join(',');
- 126. -
- 127. - ajax.post('/adsmoder?act=a_edit_features', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 128. -
- 129. - function onComplete(response) {
- 130. - Ads.unlock('saveFeatures');
- 131. - if (response && response.ok) {
- 132. - nav.reload();
- 133. - } else {
- 134. - showFastBox('������', '������');
- 135. - }
- 136. - return true;
- 137. - }
- 138. - function onLock() {
- 139. - editBox.showProgress();
- 140. - }
- 141. - function onUnlock() {
- 142. - editBox.hide();
- 143. - }
- 144. - }
- 145. -
- 146. - AdsModer.openNoteEditBox = function(objectId, noteType, noteText, hash, editActionText, isEdit) {
- 147. - function onBoxHide() {
- 148. - delete cur.noteEditBox;
- 149. - delete cur.noteEditBoxContext;
- 150. - }
- 151. -
- 152. - cur.noteEditBoxContext = {};
- 153. - cur.noteEditBoxContext.hash = hash;
- 154. - cur.noteEditBoxContext.objectId = objectId;
- 155. - cur.noteEditBoxContext.noteType = noteType;
- 156. -
- 157. - var boxHtml = '<div style="margin-right: 8px;"><div><textarea id="ads_note_edit" style="width: 100%; height: 100px;">' + noteText + '</textarea></div></div>';
- 158. -
- 159. - cur.noteEditBox = showFastBox({title: '�������', width: 400, onHide: onBoxHide}, boxHtml, editActionText, function() { AdsModer.saveNote(); }, getLang('box_cancel'));
- 160. - if (isEdit) {
- 161. - cur.noteEditBox.setControlsText('<a href="#" onclick="AdsModer.saveNote(true); return false;">�������</a>');
- 162. - }
- 163. - }
- 164. -
- 165. - AdsModer.saveNote = function(isDelete) {
- 166. - if (!Ads.lock('save_note', onLock, onUnlock)) {
- 167. - return;
- 168. - }
- 169. -
- 170. - var ajaxParams = {};
- 171. - ajaxParams.hash = cur.noteEditBoxContext.hash;
- 172. - ajaxParams.object_id = cur.noteEditBoxContext.objectId;
- 173. - ajaxParams.note_type = cur.noteEditBoxContext.noteType;
- 174. - ajaxParams.note_text = (isDelete ? '' : ge('ads_note_edit').value);
- 175. - ajax.post('/adsmoder?act=a_edit_notes', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 176. -
- 177. - function onComplete(response) {
- 178. - Ads.unlock('save_note');
- 179. - if (response && response.ok) {
- 180. - nav.reload();
- 181. - } else {
- 182. - showFastBox({title: '������', onHide: function() { nav.reload(); }}, '������');
- 183. - }
- 184. - return true;
- 185. - }
- 186. - function onLock() {
- 187. - cur.noteEditBox.showProgress();
- 188. - }
- 189. - function onUnlock() {
- 190. - cur.noteEditBox.hide();
- 191. - }
- 192. - }
- 193. -
- 194. - AdsModer.openCategoriesEditBox = function(requestKey, linkElem) {
- 195. - var editBox = showFastBox({title: '��������� �������� ����������', width: 440}, cur.categoriesEditBoxHtml);
- 196. - editBox.removeButtons();
- 197. - editBox.addButton(getLang('box_cancel'), false, 'no');
- 198. - editBox.addButton('��������', applyChanges, 'yes');
- 199. -
- 200. - var requestParams = cur.requestsParams[requestKey];
- 201. -
- 202. - var category1_id = requestParams.ui_category1_id;
- 203. - var category2_id = requestParams.ui_category2_id;
- 204. - var subcategory1_id = requestParams.ui_subcategory1_id;
- 205. - var subcategory2_id = requestParams.ui_subcategory2_id;
- 206. -
- 207. - var uiCategory1 = new Dropdown(ge('ads_moder_category1'), cur.categoriesData, {
- 208. - selectedItems: category1_id,
- 209. - width: 250,
- 210. - height: 400,
- 211. - onChange: onChangeCategory1
- 212. - });
- 213. - var uiCategory2 = new Dropdown(ge('ads_moder_category2'), cur.categoriesData, {
- 214. - selectedItems: category2_id,
- 215. - width: 250,
- 216. - height: 400,
- 217. - onChange: onChangeCategory2
- 218. - });
- 219. - var uiSubcategory1 = new Dropdown(ge('ads_moder_subcategory1'), [], {
- 220. - width: 250,
- 221. - height: 400,
- 222. - onChange: function(value) {
- 223. - subcategory1_id = intval(value);
- 224. - }
- 225. - });
- 226. - var uiSubcategory2 = new Dropdown(ge('ads_moder_subcategory2'), [], {
- 227. - width: 250,
- 228. - height: 400,
- 229. - onChange: function(value) {
- 230. - subcategory2_id = intval(value);
- 231. - }
- 232. - });
- 233. -
- 234. - onChangeCategory1(category1_id);
- 235. - onChangeCategory2(category2_id);
- 236. -
- 237. - var boxOptions = {};
- 238. - boxOptions.onClean = function() {
- 239. - uiCategory1.destroy();
- 240. - uiCategory2.destroy();
- 241. - uiSubcategory1.destroy();
- 242. - uiSubcategory2.destroy();
- 243. - };
- 244. - editBox.setOptions(boxOptions);
- 245. -
- 246. - function onChangeCategory1(value) {
- 247. - value = intval(value);
- 248. - if (value != category1_id) {
- 249. - subcategory1_id = 0;
- 250. - }
- 251. - category1_id = value;
- 252. - var data = cur.subcategoriesData[value] || [];
- 253. - var disabledText = (value ? getLang('ads_no_subcategories') : getLang('ads_first_select_category1'));
- 254. - uiSubcategory1.setOptions({disabledText: disabledText});
- 255. - uiSubcategory1.setData(data);
- 256. - if (subcategory1_id) {
- 257. - uiSubcategory1.val(subcategory1_id);
- 258. - } else {
- 259. - uiSubcategory1.clear();
- 260. - }
- 261. - uiSubcategory1.disable(data.length == 0);
- 262. - }
- 263. - function onChangeCategory2(value) {
- 264. - value = intval(value);
- 265. - if (value != category2_id) {
- 266. - subcategory2_id = 0;
- 267. - }
- 268. - category2_id = value;
- 269. - var data = cur.subcategoriesData[value] || [];
- 270. - var disabledText = (value ? getLang('ads_no_subcategories') : getLang('ads_first_select_category2'));
- 271. - uiSubcategory2.setOptions({disabledText: disabledText});
- 272. - uiSubcategory2.setData(data);
- 273. - if (subcategory2_id) {
- 274. - uiSubcategory2.val(subcategory2_id);
- 275. - } else {
- 276. - uiSubcategory2.clear();
- 277. - }
- 278. - uiSubcategory2.disable(data.length == 0);
- 279. - }
- 280. - function applyChanges() {
- 281. - if (!category1_id && !category2_id) {
- 282. - showFastBox('������', '�� ������ ��������.');
- 283. - return;
- 284. - }
- 285. -
- 286. - cur.requestsParams[requestKey].category1_id = (subcategory1_id || category1_id);
- 287. - cur.requestsParams[requestKey].category2_id = (subcategory2_id || category2_id);
- 288. - cur.requestsParams[requestKey].ui_category1_id = category1_id;
- 289. - cur.requestsParams[requestKey].ui_category2_id = category2_id;
- 290. - cur.requestsParams[requestKey].ui_subcategory1_id = subcategory1_id;
- 291. - cur.requestsParams[requestKey].ui_subcategory2_id = subcategory2_id;
- 292. - cur.requestsParams[requestKey].categories_changed = true;
- 293. -
- 294. - var category1Elem = geByClass1('ads_category1', linkElem);
- 295. - var category1ParentElem = geByClass1('ads_category1_parent', linkElem);
- 296. - if (subcategory1_id) {
- 297. - replaceClass(category1Elem, 'ads_category', 'ads_subcategory');
- 298. - category1Elem.innerHTML = uiSubcategory1.val_full()[1];
- 299. - category1ParentElem.innerHTML = ' (' + uiCategory1.val_full()[1] + ')';
- 300. - } else {
- 301. - replaceClass(category1Elem, 'ads_subcategory', 'ads_category');
- 302. - category1Elem.innerHTML = (category1_id ? uiCategory1.val_full()[1] : '');
- 303. - category1ParentElem.innerHTML = '';
- 304. - }
- 305. -
- 306. - var category2Elem = geByClass1('ads_category2', linkElem);
- 307. - var category2ParentElem = geByClass1('ads_category2_parent', linkElem);
- 308. - if (subcategory2_id) {
- 309. - replaceClass(category2Elem, 'ads_category', 'ads_subcategory');
- 310. - category2Elem.innerHTML = uiSubcategory2.val_full()[1];
- 311. - category2ParentElem.innerHTML = ' (' + uiCategory2.val_full()[1] + ')';
- 312. - } else {
- 313. - replaceClass(category2Elem, 'ads_subcategory', 'ads_category');
- 314. - category2Elem.innerHTML = (category2_id ? uiCategory2.val_full()[1] : '');
- 315. - category2ParentElem.innerHTML = '';
- 316. - }
- 317. -
- 318. - editBox.hide();
- 319. - }
- 320. - }
- 321. -
- 322. - AdsModer.premoderationProcessRequest = function(action, requestKey, requestKeyModer, onCompleteExternal) {
- 323. -
- 324. - var requestParams = cur.requestsParams[requestKey];
- 325. - var requestParamsModer = cur.requestsParams[requestKeyModer];
- 326. -
- 327. - if (!requestKey || !requestKeyModer || !requestParams || !requestParamsModer) {
- 328. - return;
- 329. - }
- 330. -
- 331. - var result = AdsModer.premoderationProcessRequestsMassCheck(action, requestKey);
- 332. - if (result) {
- 333. - return;
- 334. - }
- 335. -
- 336. - var moderComment = ge('moder_comment_' + requestKeyModer);
- 337. - var resultArea = ge('request_result_area_' + requestKey);
- 338. -
- 339. - var ajaxParams = {};
- 340. - ajaxParams.action = action;
- 341. - ajaxParams.request_id = requestParams.request_id;
- 342. - ajaxParams.ad_id = requestParams.ad_id;
- 343. - ajaxParams.hash = requestParams.hash;
- 344. - ajaxParams.checksum = requestParams.checksum_all;
- 345. -
- 346. - if (action === 'approve') {
- 347. - if (requestParamsModer.categories_changed) {
- 348. - ajaxParams.category1_id = requestParamsModer.category1_id;
- 349. - ajaxParams.category2_id = requestParamsModer.category2_id;
- 350. - } else {
- 351. - ajaxParams.category1_id = requestParams.category1_id;
- 352. - ajaxParams.category2_id = requestParams.category2_id;
- 353. - }
- 354. - }
- 355. -
- 356. - ajaxParams.moder_comment = moderComment.getValue();
- 357. - if (action === 'disapprove') {
- 358. - ajaxParams.moder_rules = cur.uiReasonsControls[requestKeyModer].getSelectedItems().join(',');
- 359. - }
- 360. -
- 361. - resultArea.innerHTML = '<img src="/images/upload.gif" />';
- 362. -
- 363. - ajax.post('/adsmoder?act=a_premoderation_process', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 364. -
- 365. - function onComplete(response) {
- 366. - var responseText = ((response && response.text) ? response.text : '������!');
- 367. - resultArea.innerHTML = responseText;
- 368. - if (isFunction(onCompleteExternal)) {
- 369. - onCompleteExternal(response, requestKey, responseText);
- 370. - }
- 371. - return true;
- 372. - };
- 373. - }
- 374. -
- 375. - AdsModer.premoderationProcessRequestsMassCheck = function(action, requestKey) {
- 376. -
- 377. - var requestParams = cur.requestsParams[requestKey];
- 378. -
- 379. - var requestsKeys = [];
- 380. -
- 381. - if (action === 'approve') {
- 382. - if (requestParams.categories_changed) {
- 383. - if (cur.requestsChecksumsApproveWithoutCategories[requestParams.checksum_approve_without_categories].length < 5) {
- 384. - return false;
- 385. - }
- 386. - requestsKeys = cur.requestsChecksumsApproveWithoutCategories[requestParams.checksum_approve_without_categories];
- 387. - } else {
- 388. - if (cur.requestsChecksumsApproveWithCategories[requestParams.checksum_approve_with_categories].length < 5) {
- 389. - return false;
- 390. - }
- 391. - requestsKeys = cur.requestsChecksumsApproveWithCategories[requestParams.checksum_approve_with_categories];
- 392. - }
- 393. - } else if (action === 'disapprove') {
- 394. - if (cur.requestsChecksumsDisapprove[requestParams.checksum_disapprove].length < 5) {
- 395. - return false;
- 396. - }
- 397. - requestsKeys = cur.requestsChecksumsDisapprove[requestParams.checksum_disapprove];
- 398. - }
- 399. -
- 400. - var confirmTitle = ((action === 'approve') ? '�������� ���������' : '�������� ����������');
- 401. - var confirmText = '������� ���������� �� ������� ��������: '+requestsKeys.length;
- 402. - var processAllText = ((action === 'approve') ? '�������� ���' : '��������� ���');
- 403. - var processOneText = ((action === 'approve') ? '�������� ����' : '��������� ����');
- 404. -
- 405. - var box = showFastBox(confirmTitle, cur.massBoxHtml, processAllText, processAll, processOneText, processOne);
- 406. - geByClass1('ads_premoderation_mass_confirm_text', box.bodyNode).innerHTML = confirmText;
- 407. -
- 408. - return true;
- 409. -
- 410. - function processAll() {
- 411. - cleanChecksums();
- 412. - AdsModer.premoderationProcessRequestsMass(action, requestKey, requestsKeys, box);
- 413. - }
- 414. - function processOne() {
- 415. - cleanChecksums();
- 416. - box.hide();
- 417. - AdsModer.premoderationProcessRequest(action, requestKey, requestKey);
- 418. - }
- 419. - function cleanChecksums() {
- 420. - cur.requestsChecksumsApproveWithCategories[requestParams.checksum_approve_with_categories] = [];
- 421. - cur.requestsChecksumsApproveWithoutCategories[requestParams.checksum_approve_without_categories] = [];
- 422. - cur.requestsChecksumsDisapprove[requestParams.checksum_disapprove] = [];
- 423. - }
- 424. - }
- 425. -
- 426. - AdsModer.premoderationProcessRequestsMass = function(action, requestKeyModer, requestsKeys, box) {
- 427. - var requestParams = cur.requestsParams[requestKeyModer];
- 428. -
- 429. - var totalCount = requestsKeys.length;
- 430. - var completeCount = 0;
- 431. - var approvedCount = 0;
- 432. - var disapprovedCount = 0;
- 433. - var errorCount = 0;
- 434. - var responseInfos = [];
- 435. -
- 436. - box.removeButtons();
- 437. - box.addButton(getLang('box_close'), false, 'yes');
- 438. -
- 439. - var progressWrapElem = geByClass1('ads_premoderation_mass_progress_wrap2', box.bodyNode);
- 440. - var progressElem = geByClass1('ads_gradient_progress', box.bodyNode);
- 441. - var resultElem = geByClass1('ads_premoderation_mass_result', box.bodyNode);
- 442. - var resultTextElem = geByClass1('ads_premoderation_mass_result_text', box.bodyNode);
- 443. - var resultMoreElem = geByClass1('ads_premoderation_mass_result_more', box.bodyNode);
- 444. - drawProgress();
- 445. - show(progressWrapElem);
- 446. -
- 447. - for (var i = 0; requestKey = requestsKeys[i]; i++) {
- 448. - AdsModer.premoderationProcessRequest(action, requestKey, requestKeyModer, onComplete);
- 449. - }
- 450. -
- 451. - function onComplete(response, responseRequestKey, responseText) {
- 452. - var responseAdId = cur.requestsParams[responseRequestKey].ad_id;
- 453. - responseInfos.push('<a href="/ads?act=office&union_id='+responseAdId+'" target="_blank">'+responseAdId+' - '+responseText+'</a>');
- 454. -
- 455. - if (response && (response.approved || response.disapproved)) {
- 456. - if (response.approved) {
- 457. - approvedCount++;
- 458. - }
- 459. - if (response.disapproved) {
- 460. - disapprovedCount++;
- 461. - }
- 462. - } else {
- 463. - errorCount++;
- 464. - }
- 465. - completeCount++;
- 466. -
- 467. - drawProgress();
- 468. - if (completeCount == totalCount) {
- 469. - setTimeout(drawResults, 1000);
- 470. - }
- 471. - }
- 472. - function drawProgress() {
- 473. - var percent = intval(completeCount / totalCount * 100);
- 474. - setStyle(progressElem, {width: percent + '%'});
- 475. - }
- 476. - function drawResults() {
- 477. - hide(progressWrapElem);
- 478. -
- 479. - var resultText = '';
- 480. - if (approvedCount) {
- 481. - resultText += '��������: '+approvedCount+'<br>';
- 482. - }
- 483. - if (disapprovedCount) {
- 484. - resultText += '���������: '+disapprovedCount+'<br>';
- 485. - }
- 486. - resultText += '������: '+errorCount+'<br>';
- 487. -
- 488. - resultTextElem.innerHTML = resultText;
- 489. - resultMoreElem.innerHTML = responseInfos.join('<br>');
- 490. - show(resultElem);
- 491. - }
- 492. - }
- 493. -
- 494. - AdsModer.premoderationTakeUnion = function(unionId, hash) {
- 495. - var ajaxParams = {};
- 496. - ajaxParams.hash = hash;
- 497. - ajaxParams.union_id = unionId;
- 498. - ajaxParams.action = 'take_union';
- 499. - ajax.post('/adsmoder?act=a_premoderation_manage_work', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 500. -
- 501. - function onComplete(response) {
- 502. - if (response && response.ok) {
- 503. - if (response.redirect) {
- 504. - nav.go(response.redirect);
- 505. - }
- 506. - } else {
- 507. - var message = ((response && response.error) ? response.error : '������');
- 508. - showFastBox({title: '������', onHide: function() { nav.reload(); }}, message);
- 509. - }
- 510. - return true;
- 511. - }
- 512. - }
- 513. -
- 514. - AdsModer.premoderationTakeBackUnion = function(unionId, hash) {
- 515. - var ajaxParams = {};
- 516. - ajaxParams.hash = hash;
- 517. - ajaxParams.union_id = unionId;
- 518. - ajaxParams.action = 'take_back_union';
- 519. - ajax.post('/adsmoder?act=a_premoderation_manage_work', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 520. -
- 521. - function onComplete(response) {
- 522. - if (response && response.ok) {
- 523. - nav.reload();
- 524. - } else {
- 525. - var message = ((response && response.error) ? response.error : '������');
- 526. - showFastBox({title: '������', onHide: function() { nav.reload(); }}, message);
- 527. - }
- 528. - return true;
- 529. - }
- 530. - }
- 531. -
- 532. - AdsModer.premoderationStopWork = function(hash) {
- 533. - var ajaxParams = {};
- 534. - ajaxParams.hash = hash;
- 535. - ajaxParams.action = 'stop_work';
- 536. - ajax.post('/adsmoder?act=a_premoderation_manage_work', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 537. -
- 538. - function onComplete(response) {
- 539. - if (response && response.ok) {
- 540. - nav.reload();
- 541. - } else {
- 542. - var message = ((response && response.error) ? response.error : '������');
- 543. - showFastBox({title: '������', onHide: function() { nav.reload(); }}, message);
- 544. - }
- 545. - return true;
- 546. - }
- 547. - }
- 548. -
- 549. - AdsModer.premoderationFixRequest = function(wrapElemId, requestId, action, hash) {
- 550. - if (!Ads.lock(wrapElemId, onLock, onUnlock)) {
- 551. - return;
- 552. - }
- 553. -
- 554. - var ajaxParams = {}
- 555. - ajaxParams.request_id = requestId;
- 556. - ajaxParams.action = action;
- 557. - ajaxParams.hash = hash;
- 558. -
- 559. - ajax.post('/adsmoder?act=premoderation_fix_request', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 560. -
- 561. - function onComplete(response) {
- 562. - Ads.unlock(wrapElemId);
- 563. - if (response && response.text_new) {
- 564. - var wrapElem = ge(wrapElemId);
- 565. - if (wrapElem) {
- 566. - wrapElem.parentNode.replaceChild(se(response.text_new), wrapElem);
- 567. - }
- 568. - }
- 569. - return true;
- 570. - }
- 571. - function onLock() {
- 572. - show(geByTag1('img', ge(wrapElemId)));
- 573. - }
- 574. - function onUnlock() {
- 575. - var wrapElem = ge(wrapElemId);
- 576. - if (wrapElem) {
- 577. - hide(geByTag1('img', wrapElem));
- 578. - }
- 579. - }
- 580. - }
- 581. -
- 582. - AdsModer.switchOfficeBlock = function(actionLocation, confirmTitle, confirmText, actionText) {
- 583. - function switchBlocked() {
- 584. - Ads.simpleAjax(actionLocation);
- 585. - }
- 586. - showFastBox(confirmTitle, confirmText, actionText, switchBlocked, getLang('box_cancel'));
- 587. - }
- 588. -
- 589. - AdsModer.openCancelClicksBox = function(webSiteId, day, hash, boxHtml) {
- 590. - var box = showFastBox({title: '������ ������'}, boxHtml);
- 591. - var cancelClicksHandler = AdsModer.cancelClicks.pbind(webSiteId, day, hash, box);
- 592. - box.removeButtons();
- 593. - box.addButton(getLang('box_cancel'), false, 'no');
- 594. - box.addButton('�������� �����', cancelClicksHandler, 'yes');
- 595. - }
- 596. -
- 597. - AdsModer.cancelClicks = function(webSiteId, day, hash, box) {
- 598. - if (!Ads.lock('cancelClicks', onLock, onUnlock)) {
- 599. - return;
- 600. - }
- 601. -
- 602. - var ajaxParams = {};
- 603. - ajaxParams.web_site_id = webSiteId;
- 604. - ajaxParams.day = day;
- 605. - ajaxParams.hash = hash;
- 606. -
- 607. - ajax.post('/adsweb?act=log_cancel', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 608. -
- 609. - function onComplete(response) {
- 610. - Ads.unlock('cancelClicks');
- 611. - if (response && response.ok) {
- 612. - nav.reload();
- 613. - } else {
- 614. - showFastBox('������', '������');
- 615. - }
- 616. - return true;
- 617. - }
- 618. - function onLock() {
- 619. - box.showProgress();
- 620. - }
- 621. - function onUnlock() {
- 622. - box.hide();
- 623. - }
- 624. - }
- 625. -
- 626. - AdsModer.historyGet = function(elem, notNavigationParam) {
- 627. - while (elem && elem.nodeName.toLowerCase() !== 'form') {
- 628. - elem = elem.parentNode;
- 629. - }
- 630. - if (!elem) {
- 631. - return;
- 632. - }
- 633. - var values = serializeForm(elem);
- 634. - var params = values.other_params;
- 635. - delete values.other_params;
- 636. - for (var i in values) {
- 637. - if (values[i]) {
- 638. - params = '&' + i + '=' + values[i] + params;
- 639. - }
- 640. - }
- 641. - nav.go('/adsmoder?act=history' + params);
- 642. - }
- 643. -
- 644. - AdsModer.historyToggleFilters = function() {
- 645. - var filtersContainerElem = ge('ads_moder_history');
- 646. - var filtersElems = geByClass('ads_navigation_link', filtersContainerElem);
- 647. - for (var i = 0; elem = filtersElems[i]; i++) {
- 648. - if (hasClass(elem, 'current')) {
- 649. - continue
- 650. - }
- 651. - elem = elem.parentNode;
- 652. - if (elem.nodeName.toLowerCase() !== 'span') {
- 653. - continue
- 654. - }
- 655. - toggleClass(elem, 'unshown');
- 656. - }
- 657. - }
- 658. -
- 659. - AdsModer.statSummaryInit = function(periodType, fromYear, fromMonth, fromDay, toYear, toMonth, toDay) {
- 660. - var datePickerOptionsFrom = {
- 661. - mode: (periodType === 'month') ? 'm' : 'd',
- 662. - year: fromYear,
- 663. - month: fromMonth,
- 664. - day: fromDay,
- 665. - width: 130,
- 666. - pastActive: true,
- 667. - onUpdate: function(date, mode) {
- 668. - fromYear = date.y;
- 669. - fromMonth = date.m;
- 670. - fromDay = date.d;
- 671. - updateLink();
- 672. - }
- 673. - };
- 674. - var datePickerOptionsTo = {
- 675. - mode: (periodType === 'month') ? 'm' : 'd',
- 676. - year: toYear,
- 677. - month: toMonth,
- 678. - day: toDay,
- 679. - width: 130,
- 680. - pastActive: true,
- 681. - onUpdate: function(date, mode) {
- 682. - toYear = date.y;
- 683. - toMonth = date.m;
- 684. - toDay = date.d;
- 685. - updateLink();
- 686. - }
- 687. - };
- 688. - new Datepicker(ge('ads_moder_stat_summary_from'), datePickerOptionsFrom);
- 689. - new Datepicker(ge('ads_moder_stat_summary_to'), datePickerOptionsTo);
- 690. -
- 691. - function updateLink() {
- 692. - var fromPeriod = fromYear * 100 + fromMonth;
- 693. - var toPeriod = toYear * 100 + toMonth;
- 694. - if (periodType !== 'month') {
- 695. - fromPeriod = fromPeriod * 100 + fromDay;
- 696. - toPeriod = toPeriod * 100 + toDay;
- 697. - }
- 698. - var linkElem = ge('ads_moder_stat_summary_range_link');
- 699. - linkElem.href = linkElem.href.replace(/&period=\d+-\d+/, '&period=' + fromPeriod + '-' + toPeriod);
- 700. - linkElem.style.opacity = 1;
- 701. - }
- 702. - }
- 703. -
- 704. - AdsModer.statSummaryShowAllProperties = function() {
- 705. - var propertiesElem = ge('ads_moder_stat_summary_filter_properties');
- 706. - var elems = geByClass('ads_moder_stat_summary_filter_property', propertiesElem);
- 707. - each(elems, show);
- 708. - hide('ads_moder_stat_summary_filter_properties_shower');
- 709. - }
- 710. -
- 711. - AdsModer.statSummaryDistrShowCountLabel = function(id, i, val) {
- 712. - var contXy = getXY(ge(id+'_stats_graph_wrap'));
- 713. - var colXy = getXY(ge(id+'_distr_col_'+i));
- 714. -
- 715. - setStyle(ge(id+'_max_label'), {
- 716. - left: colXy[0] - contXy[0] + 14,
- 717. - top: colXy[1] - contXy[1] - 11
- 718. - });
- 719. - ge(id+'_max_label').innerHTML = val;
- 720. - show(id+'_max_label');
- 721. - setStyle(ge(id+'_max_label_out'), {
- 722. - width: ge(id+'_max_label').offsetWidth + 2,
- 723. - height: ge(id+'_max_label').offsetHeight + 2,
- 724. - left: colXy[0] - contXy[0] + 13,
- 725. - top: colXy[1] - contXy[1] - 12
- 726. - });
- 727. - show(id+'_max_label_out');
- 728. - setStyle(ge(id+'_max_label_out2'), {
- 729. - width: ge(id+'_max_label').offsetWidth + 4,
- 730. - height: ge(id+'_max_label').offsetHeight + 4,
- 731. - left: colXy[0] - contXy[0] + 12,
- 732. - top: colXy[1] - contXy[1] - 13
- 733. - });
- 734. - show(id+'_max_label_out2');
- 735. - }
- 736. -
- 737. - AdsModer.statSummaryDistrHideCountLabel = function(id) {
- 738. - hide(id+'_max_label');
- 739. - hide(id+'_max_label_out');
- 740. - hide(id+'_max_label_out2');
- 741. - }
- 742. -
- 743. - AdsModer.statSummaryShowVotesBox = function(periodType, period) {
- 744. - var ajaxParams = {};
- 745. - ajaxParams.period_type = periodType;
- 746. - ajaxParams.period = period;
- 747. -
- 748. - var showOptions = {params: {}};
- 749. -
- 750. - showBox('/adsmoder?act=stat_summary_votes', ajaxParams, showOptions);
- 751. - }
- 752. -
- 753. - try{stManager.done('ads_moder.js');}catch(e){}
- ------
- Файл - sms_office.js (Старый размер - 5679 | Новый - 5663):
- 86. - stManager.add(['graph.js', 'graph.css'], function(){
- 87. + stManager.add('graph.js',function(){
- ------
Advertisement
Add Comment
Please, Sign In to add comment