Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Файл - ads_moder.css (Старый размер - 12570 | Новый - 0):
- 0. - #ads_moder_css { display: none; }
- 1. -
- 2. - /* ------- */
- 3. - /* General */
- 4. - /* ------- */
- 5. -
- 6. - .ads_overflow_hidden_wrap1 {
- 7. - overflow: hidden;
- 8. - }
- 9. - .ads_overflow_hidden_wrap2 {
- 10. - overflow: visible;
- 11. - white-space: nowrap;
- 12. - width: 1px;
- 13. - }
- 14. -
- 15. - .ads_moder_tabs {
- 16. - padding-top: 0;
- 17. - }
- 18. - .ads_moder_tabs ul.t0 {
- 19. - width: auto;
- 20. - }
- 21. -
- 22. - /* -- */
- 23. - /* Ad */
- 24. - /* -- */
- 25. -
- 26. - .ads_ad_char_hint {
- 27. - position: relative;
- 28. - }
- 29. - .ads_ad_char_hint_color {
- 30. - visibility: hidden;
- 31. - position: absolute;
- 32. - height: 1px;
- 33. - bottom: 0;
- 34. - left: 0;
- 35. - border-bottom: 1px solid red;
- 36. - overflow: hidden;
- 37. - }
- 38. - .ads_ad_box a:hover .ads_ad_char_hint_color {
- 39. - visibility: visible;
- 40. - }
- 41. -
- 42. - /* ------- */
- 43. - /* Markers */
- 44. - /* ------- */
- 45. -
- 46. - .ads_marker_wrap_ad {
- 47. - position: relative;
- 48. - }
- 49. - .ads_marker_wrap {
- 50. - position: absolute;
- 51. - top: 1px;
- 52. - left: 1px;
- 53. - z-index: 10;
- 54. - }
- 55. - .ads_marker {
- 56. - float: left;
- 57. - width: 5px;
- 58. - height: 5px;
- 59. - margin-right: 2px;
- 60. - border-radius: 1px;
- 61. - }
- 62. - .ads_marker_wrap_ad:hover .ads_marker {
- 63. - width: 7px;
- 64. - height: 7px;
- 65. - border-radius: 2px;
- 66. - }
- 67. -
- 68. - .ads_marker_target {
- 69. - background-color: #ff8000;
- 70. - }
- 71. - .ads_marker_clicked {
- 72. - background-color: #9966cc;
- 73. - }
- 74. - .ads_marker_closed {
- 75. - background-color: #00b2cc;
- 76. - }
- 77. - .ads_marker_viewed {
- 78. - background-color: #ff55aa;
- 79. - }
- 80. -
- 81. - .ads_marker_offensive {
- 82. - background-color: #5090ff;
- 83. - }
- 84. - .ads_marker_porno {
- 85. - background-color: #ff2213;
- 86. - }
- 87. - .ads_marker_cheaters {
- 88. - background-color: #a0522d;
- 89. - }
- 90. - .ads_marker_against {
- 91. - background-color: #008000;
- 92. - }
- 93. -
- 94. - .ads_marker_enabled {
- 95. - background-color: #00aa00;
- 96. - }
- 97. - .ads_marker_enabling {
- 98. - background-color: #CFB53B;
- 99. - }
- 100. - .ads_marker_approved {
- 101. - background-color: #0000dd;
- 102. - }
- 103. - .ads_marker_disapproved {
- 104. - background-color: #aa0000;
- 105. - }
- 106. - .ads_marker_archived {
- 107. - background-color: #333333;
- 108. - }
- 109. -
- 110. - .ads_marker_request_manual {
- 111. - background-color: #e0b080;
- 112. - }
- 113. - .ads_marker_request_wrong {
- 114. - background-color: #00d07f;
- 115. - }
- 116. -
- 117. - .ads_marker_target_tip {
- 118. - color: #ff8000;
- 119. - }
- 120. - .ads_marker_clicked_tip {
- 121. - color: #9966cc;
- 122. - }
- 123. - .ads_marker_closed_tip {
- 124. - color: #00b2cc;
- 125. - }
- 126. - .ads_marker_viewed_tip {
- 127. - color: #ff55aa;
- 128. - }
- 129. -
- 130. - .ads_marker_offensive_tip {
- 131. - color: #5090ff;
- 132. - }
- 133. - .ads_marker_porno_tip {
- 134. - color: #ff2213;
- 135. - }
- 136. - .ads_marker_cheaters_tip {
- 137. - color: #a0522d;
- 138. - }
- 139. - .ads_marker_against_tip {
- 140. - color: #008000;
- 141. - }
- 142. -
- 143. - .ads_marker_enabled_tip {
- 144. - color: #00aa00;
- 145. - }
- 146. - .ads_marker_enabling_tip {
- 147. - color: #CFB53B;
- 148. - }
- 149. - .ads_marker_approved_tip {
- 150. - color: #0000dd;
- 151. - }
- 152. - .ads_marker_disapproved_tip {
- 153. - color: #aa0000;
- 154. - }
- 155. - .ads_marker_archived_tip {
- 156. - color: #333333;
- 157. - }
- 158. -
- 159. - .ads_marker_request_manual_tip {
- 160. - color: #e0b080;
- 161. - }
- 162. - .ads_marker_request_wrong_tip {
- 163. - color: #00d07f;
- 164. - }
- 165. -
- 166. - .ads_marker_other_tip {
- 167. - color: #2b587a;
- 168. - }
- 169. - .ads_marker_grey_tip {
- 170. - color: grey;
- 171. - }
- 172. - /* #8B00ff */
- 173. - /* 009090 */
- 174. -
- 175. - .ads_info_marker {
- 176. - position: absolute;
- 177. - z-index: 20;
- 178. - top: 2px;
- 179. - right: 2px;
- 180. -
- 181. - background-color: #D5DDE5;
- 182. - border-radius: 3px;
- 183. - text-align: center;
- 184. -
- 185. - width: 20px;
- 186. - height: 20px;
- 187. - line-height: 20px;
- 188. - font-size: 1px;
- 189. - opacity: 0.5;
- 190. -
- 191. - display: none;
- 192. - }
- 193. - .ads_marker_wrap_ad:hover .ads_info_marker {
- 194. - display: block;
- 195. - text-decoration: none;
- 196. - }
- 197. - .ads_marker_wrap_ad .ads_info_marker:hover {
- 198. - font-size: 11px;
- 199. - opacity: 1;
- 200. - }
- 201. -
- 202. - /* -------- */
- 203. - /* Category */
- 204. - /* -------- */
- 205. -
- 206. - .ads_category_wrap {
- 207. - max-width: 118px;
- 208. - margin-top: 4px;
- 209. - display: inline-block;
- 210. - font-size: 0.91em;
- 211. - position: relative;
- 212. - }
- 213. - .ads_category_wrap .ads_category_parent {
- 214. - position: absolute;
- 215. - z-index: 10;
- 216. - display: none;
- 217. - white-space: nowrap;
- 218. - padding-left: 5px;
- 219. - }
- 220. - .ads_category_wrap .ads_subcategory {
- 221. - font-weight: bold;
- 222. - }
- 223. - .ads_category_wrap:hover .ads_subcategory,
- 224. - .ads_category_wrap:hover .ads_category_parent {
- 225. - background-color: white;
- 226. - }
- 227. - .ads_category_wrap:hover .ads_category_parent {
- 228. - display: inline;
- 229. - }
- 230. -
- 231. - /* -------- */
- 232. - /* Ads info */
- 233. - /* -------- */
- 234. -
- 235. - .ads_info_premoderation_request .ads_ad_box.news {
- 236. - padding: 10px;
- 237. - }
- 238. - .ads_info_premoderation_request .ads_ad_box_border {
- 239. - border-width: 1px;
- 240. - }
- 241. - .ads_info_premoderation_request .label {
- 242. - color: grey;
- 243. - padding-right: 10px;
- 244. - }
- 245. - .ads_info_premoderation_request .info_msg {
- 246. - margin-top: 15px;
- 247. - }
- 248. - .ads_info_premoderation_request_info {
- 249. - line-height: 160%;
- 250. - }
- 251. - .ads_info_premoderation_request_info td {
- 252. - vertical-align: top;
- 253. - padding-bottom: 3px;
- 254. - }
- 255. - .ads_info_premoderation_request_ad_prev,
- 256. - .ads_info_premoderation_request_ad_cur,
- 257. - .ads_info_premoderation_request_arrow,
- 258. - .ads_info_premoderation_request_info {
- 259. - padding-right: 15px;
- 260. - }
- 261. - .ads_info_premoderation_request_ad_prev,
- 262. - .ads_info_premoderation_request_ad_cur,
- 263. - .ads_info_premoderation_request_info {
- 264. - vertical-align: top;
- 265. - }
- 266. - .ads_info_premoderation_request_ad_prev,
- 267. - .ads_info_premoderation_request_ad_cur {
- 268. - text-align: center;
- 269. - }
- 270. - .ads_info_premoderation_request_arrow {
- 271. - font-size: 30px;
- 272. - }
- 273. -
- 274. - /* ------- */
- 275. - /* All ads */
- 276. - /* ------- */
- 277. -
- 278. - .ads_all_navigation_page {
- 279. - display: block;
- 280. - float: left;
- 281. - text-decoration: none !important;
- 282. - padding: 5px;
- 283. - margin: 0 3px 3px 0;
- 284. - border: 1px solid #DAE1E8;
- 285. - min-width: 45px;
- 286. - }
- 287. - .ads_all_navigation_page.current {
- 288. - font-weight: bold;
- 289. - }
- 290. -
- 291. - .ads_all_ads_box {
- 292. - float: left;
- 293. - height: 300px;
- 294. - margin: 0 5px;
- 295. - }
- 296. -
- 297. - .ads_all_ads_box .ads_ad_box_border {
- 298. - border-width: 1px;
- 299. - }
- 300. -
- 301. - /* ------------- */
- 302. - /* Premoderation */
- 303. - /* ------------- */
- 304. -
- 305. - .ads_premoderation_requests {
- 306. - margin-right: -30px;
- 307. - }
- 308. - .ads_premoderation_request_wrap {
- 309. - float: left;
- 310. - height: 480px;
- 311. - margin: 10px 30px 0 0;
- 312. - }
- 313. - .ads_premoderation_request_wrap.first_of_3 {
- 314. - margin-right: 31px;
- 315. - }
- 316. -
- 317. - .ads_premoderation_requests .ads_ad_box.news {
- 318. - padding: 10px;
- 319. - }
- 320. - .ads_premoderation_requests .ads_ad_box_border {
- 321. - border-width: 1px;
- 322. - }
- 323. -
- 324. - .ads_premoderation_requests_office .label {
- 325. - padding-right: 10px;
- 326. - vertical-align: top;
- 327. - }
- 328. - .ads_premoderation_requests_office_columns {
- 329. - width: 100%;
- 330. - }
- 331. - .ads_premoderation_requests_office_column {
- 332. - vertical-align: top;
- 333. - }
- 334. - .ads_premoderation_requests_office_column_domains {
- 335. - text-align: right;
- 336. - }
- 337. - .ads_premoderation_requests_office_domains {
- 338. - display: inline-block;
- 339. - }
- 340. - .ads_premoderation_requests_office_domains .labeled {
- 341. - text-align: left;
- 342. - }
- 343. - .ads_premoderation_requests_office_domain_similar {
- 344. - color: #aa0000;
- 345. - }
- 346. -
- 347. - .ads_premoderation_request {
- 348. - border: 1px solid #D3DBE1;
- 349. - padding: 3px;
- 350. - width: 283px;
- 351. - }
- 352. - .ads_premoderation_request.news {
- 353. - width: 440px;
- 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: 5px 3px 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. - /* Mobile apps */
- 465. - /* ----------- */
- 466. -
- 467. - .ads_mobile_apps_filter {
- 468. - float: left;
- 469. - padding: 5px;
- 470. - margin: 0 5px 5px 5px;
- 471. - }
- 472. -
- 473. - .ads_mobile_apps_type_icon {
- 474. - display: block;
- 475. - width: 11px;
- 476. - height: 11px;
- 477. - background-image: url(/images/profile_icons.gif);
- 478. - background-position: 0 -198px;
- 479. - }
- 480. - .ads_mobile_apps_type_icon.android {
- 481. - background-position: 0 -174px;
- 482. - }
- 483. - .ads_mobile_apps_type_icon.iphone {
- 484. - background-position: 0 -186px;
- 485. - }
- 486. - .ads_mobile_apps_type_icon.wphone {
- 487. - background-position: 0 -220px;
- 488. - }
- 489. -
- 490. - .ads_mobile_apps_rating_icon {
- 491. - display: block;
- 492. - width: 20px;
- 493. - height: 20px;
- 494. - background-image: url(/images/icons/im_actions_iconset2.png);
- 495. - background-position: 0 -239px;
- 496. - }
- 497. -
- 498. - .ads_mobile_apps_photo_icon {
- 499. - display: block;
- 500. - width: 11px;
- 501. - height: 11px;
- 502. - background-image: url(/images/profile_icons.gif);
- 503. - margin: 4px 0 0 10px;
- 504. - }
- 505. - .ads_mobile_apps_photo_icon.no_center {
- 506. - margin-left: 0;
- 507. - }
- 508. -
- 509. - .ads_mobile_apps_photo_wrap {
- 510. - display: block;
- 511. - position: relative;
- 512. - height: 32px;
- 513. - width: 32px;
- 514. - }
- 515. - .ads_mobile_apps_photo_wrap .ads_mobile_apps_photo {
- 516. - position: absolute;
- 517. - height: 32px;
- 518. - left: 0;
- 519. - top: 0;
- 520. - }
- 521. - .ads_mobile_apps_photo_wrap:hover .ads_mobile_apps_photo {
- 522. - height: auto;
- 523. - left: 32px;
- 524. - }
- 525. -
- 526. - /* ------------ */
- 527. - /* Stat summary */
- 528. - /* ------------ */
- 529. -
- 530. - .ads_moder_stat_summary_range_wrap {
- 531. - margin-top: -2px;
- 532. - }
- 533. - @-moz-document url-prefix() {
- 534. - .ads_moder_stat_summary_range_wrap {
- 535. - margin-top: -1px;
- 536. - }
- 537. - }
- 538. - .ads_moder_stat_summary_range_part {
- 539. - padding-left: 8px;
- 540. - }
- 541. - .ads_moder_stat_summary_range_label {
- 542. - padding-top: 5px;
- 543. - }
- 544. - @-moz-document url-prefix() {
- 545. - .ads_moder_stat_summary_range_label {
- 546. - padding-top: 4px;
- 547. - }
- 548. - }
- 549. - #ads_moder_stat_summary_range_link {
- 550. - opacity: 0.5;
- 551. - display: block;
- 552. - padding: 1px;
- 553. - }
- 554. - #ads_moder_stat_summary_range_link:hover {
- 555. - opacity: 1;
- 556. - }
- 557. - #ads_moder_stat_summary_range_link img {
- 558. - display: block;
- 559. - }
- 560. -
- 561. - #ads_moder_stat_summary_filter_properties_shower {
- 562. - display: block;
- 563. - padding: 3px 8px 8px 8px;
- 564. - }
- 565. -
- 566. - .ads_stat_summary_graph_link {
- 567. - height: 11px;
- 568. - overflow: visible;
- 569. - }
- 570. - .ads_stat_summary_graph_image {
- 571. - display: block;
- 572. - margin-top: -1px;
- 573. - }
- 574. -
- 575. - /* ----- */
- 576. - /* Other */
- 577. - /* ----- */
- 578. -
- 579. - .ads_navigation_link.current {
- 580. - font-weight: bold;
- 581. - }
- 582. -
- 583. - .ads_note {
- 584. - padding-bottom: 5px;
- 585. - }
- 586. - .ads_note_object {
- 587. - font-weight: bold;
- 588. - }
- 589. - .ads_note_info {
- 590. - color: #999999;
- 591. - font-size: 0.91em;
- 592. - }
- 593. - .ads_note_info_user,
- 594. - .ads_note_info_edit_link {
- 595. - color: #999999;
- 596. - }
- 597. - .ads_note_edit_link {
- 598. - display: block;
- 599. - }
- 600. - .ads_note_edit_wrap {
- 601. - margin-right: 8px;
- 602. - }
- 603. - #ads_note_edit {
- 604. - width: 100%;
- 605. - height: 100px;
- 606. - }
- 607. -
- 608. - /* --- */
- 609. - /* OLD */
- 610. - /* --- */
- 611. -
- 612. - #ads_unions_bonuses * {
- 613. - text-align: left;
- 614. - }
- 615. -
- 616. - #ads_unions_queue .ads_unions_list td,
- 617. - #ads_unions_queue .ads_unions_list th {
- 618. - text-align: left;
- 619. - }
- 620. -
- 621. - #ads_premoderation_stat .ads_unions_list th.column_moder *,
- 622. - #ads_premoderation_stat .ads_unions_list td.column_moder,
- 623. - #ads_premoderation_stat .ads_unions_list th.column_period *,
- 624. - #ads_premoderation_stat .ads_unions_list td.column_period {
- 625. - text-align: left;
- 626. - }
- 627. -
- 628. - /* Distribution chart */
- 629. - .ads_moder_chart_table_wrap {
- 630. - position: relative;
- 631. - }
- 632. - .ads_moder_chart_table {
- 633. - background-color: #F3F5F7;
- 634. - border: 0 none;
- 635. - margin-bottom: 10px;
- 636. - vertical-align: bottom;
- 637. - margin: 0 auto;
- 638. - }
- 639. - .ads_moder_chart_table td.ads_moder_total_chart_row {
- 640. - background-color: #FFFFFF;
- 641. - color:#45688E;
- 642. - border: 0 none;
- 643. - padding-top: 10px;
- 644. - padding-bottom: 30px;
- 645. - vertical-align: bottom;
- 646. - }
- 647. - .ads_moder_chart_column {
- 648. - background-color: #B0C1CF;
- 649. - vertical-align: bottom;
- 650. - cursor: pointer;
- 651. - }
- 652. - .ads_moder_chart_column.even {
- 653. - background-color: #C7D3DD;
- 654. - }
- 655. - .ads_moder_chart_table td {
- 656. - vertical-align: bottom;
- 657. - }
- 658. - .ads_moder_chart_table td.ads_moder_chart_under_num {
- 659. - background-color: #EAEEF2;
- 660. - height: 15px;
- 661. - padding-bottom: 3px;
- 662. - }
- 663. - .ads_moder_chart_table td.ads_moder_chart_under_num.even {
- 664. - background-color: #FFFFFF;
- 665. - }
- 666. - .ads_moder_chart_date {
- 667. - font-size: 9px;
- 668. - height: 10px;
- 669. - padding-top: 4px;
- 670. - text-align: center;
- 671. - }
- 672. - .ads_moder_chart_max_label {
- 673. - background-color: #FFFFFF;
- 674. - color: #000000;
- 675. - display: none;
- 676. - font-size: 9px;
- 677. - padding: 2px 4px;
- 678. - position: absolute;
- 679. - z-index: 100;
- 680. - }
- 681. - .ads_moder_chart_max_label_out {
- 682. - background-color: #2B587A;
- 683. - display: none;
- 684. - opacity: 0.2;
- 685. - position: absolute;
- 686. - z-index: 90;
- 687. - }
- 688. - .ads_moder_chart_max_label_out2 {
- 689. - background-color: #2B587A;
- 690. - display: none;
- 691. - opacity: 0.1;
- 692. - position: absolute;
- 693. - z-index: 90;
- 694. - }
- ------
- Файл - ads_moder.js (Старый размер - 27910 | Новый - 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(ajaxParams, noteText, noteTextParams, boxTitle, editActionText, isEdit, isOtherUser) {
- 147. - function onBoxHide() {
- 148. - delete cur.noteEditBox;
- 149. - delete cur.noteEditAjaxParams;
- 150. - }
- 151. -
- 152. - cur.noteEditAjaxParams = ajaxParams;
- 153. -
- 154. - var boxHtml = '<div class="ads_note_edit_wrap"><div><textarea id="ads_note_edit" ' + noteTextParams + '>' + noteText + '</textarea></div></div>';
- 155. -
- 156. - cur.noteEditBox = showFastBox({title: boxTitle, width: 400, onHide: onBoxHide}, boxHtml);
- 157. - cur.noteEditBox.removeButtons();
- 158. - if (isOtherUser) {
- 159. - cur.noteEditBox.addButton(getLang('box_cancel'), false, 'yes');
- 160. - } else {
- 161. - cur.noteEditBox.addButton(getLang('box_cancel'), false, 'no');
- 162. - cur.noteEditBox.addButton(editActionText, AdsModer.saveNote.pbind(false), 'yes');
- 163. - }
- 164. - if (isEdit) {
- 165. - cur.noteEditBox.setControlsText('<a href="#" onclick="AdsModer.saveNote(true); return false;">�������</a>');
- 166. - }
- 167. - }
- 168. -
- 169. - AdsModer.saveNote = function(isDelete) {
- 170. - if (!Ads.lock('save_note', onLock, onUnlock)) {
- 171. - return;
- 172. - }
- 173. -
- 174. - var ajaxParams = {};
- 175. - ajaxParams = extend({}, ajaxParams, cur.noteEditAjaxParams);
- 176. - ajaxParams.note_text = (isDelete ? '' : ge('ads_note_edit').value);
- 177. - ajax.post('/adsmoder?act=a_edit_notes', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 178. -
- 179. - function onComplete(response) {
- 180. - Ads.unlock('save_note');
- 181. - if (response && response.ok) {
- 182. - nav.reload();
- 183. - } else {
- 184. - showFastBox({title: '������', onHide: function() { nav.reload(); }}, '������');
- 185. - }
- 186. - return true;
- 187. - }
- 188. - function onLock() {
- 189. - cur.noteEditBox.showProgress();
- 190. - }
- 191. - function onUnlock() {
- 192. - cur.noteEditBox.hide();
- 193. - }
- 194. - }
- 195. -
- 196. - AdsModer.openCategoriesEditBox = function(requestKey, linkElem) {
- 197. - var editBox = showFastBox({title: '��������� �������� ����������', width: 440}, cur.categoriesEditBoxHtml);
- 198. - editBox.removeButtons();
- 199. - editBox.addButton(getLang('box_cancel'), false, 'no');
- 200. - editBox.addButton('��������', applyChanges, 'yes');
- 201. -
- 202. - var requestParams = cur.requestsParams[requestKey];
- 203. -
- 204. - var category1_id = requestParams.ui_category1_id;
- 205. - var category2_id = requestParams.ui_category2_id;
- 206. - var subcategory1_id = requestParams.ui_subcategory1_id;
- 207. - var subcategory2_id = requestParams.ui_subcategory2_id;
- 208. -
- 209. - var uiCategory1 = new Dropdown(ge('ads_moder_category1'), cur.categoriesData, {
- 210. - selectedItems: category1_id,
- 211. - width: 250,
- 212. - height: 400,
- 213. - onChange: onChangeCategory1
- 214. - });
- 215. - var uiCategory2 = new Dropdown(ge('ads_moder_category2'), cur.categoriesData, {
- 216. - selectedItems: category2_id,
- 217. - width: 250,
- 218. - height: 400,
- 219. - onChange: onChangeCategory2
- 220. - });
- 221. - var uiSubcategory1 = new Dropdown(ge('ads_moder_subcategory1'), [], {
- 222. - width: 250,
- 223. - height: 400,
- 224. - onChange: function(value) {
- 225. - subcategory1_id = intval(value);
- 226. - }
- 227. - });
- 228. - var uiSubcategory2 = new Dropdown(ge('ads_moder_subcategory2'), [], {
- 229. - width: 250,
- 230. - height: 400,
- 231. - onChange: function(value) {
- 232. - subcategory2_id = intval(value);
- 233. - }
- 234. - });
- 235. -
- 236. - onChangeCategory1(category1_id);
- 237. - onChangeCategory2(category2_id);
- 238. -
- 239. - var boxOptions = {};
- 240. - boxOptions.onClean = function() {
- 241. - uiCategory1.destroy();
- 242. - uiCategory2.destroy();
- 243. - uiSubcategory1.destroy();
- 244. - uiSubcategory2.destroy();
- 245. - };
- 246. - editBox.setOptions(boxOptions);
- 247. -
- 248. - function onChangeCategory1(value) {
- 249. - value = intval(value);
- 250. - if (value != category1_id) {
- 251. - subcategory1_id = 0;
- 252. - }
- 253. - category1_id = value;
- 254. - var data = cur.subcategoriesData[value] || [];
- 255. - var disabledText = (value ? getLang('ads_no_subcategories') : getLang('ads_first_select_category1'));
- 256. - uiSubcategory1.setOptions({disabledText: disabledText});
- 257. - uiSubcategory1.setData(data);
- 258. - if (subcategory1_id) {
- 259. - uiSubcategory1.val(subcategory1_id);
- 260. - } else {
- 261. - uiSubcategory1.clear();
- 262. - }
- 263. - uiSubcategory1.disable(data.length == 0);
- 264. - }
- 265. - function onChangeCategory2(value) {
- 266. - value = intval(value);
- 267. - if (value != category2_id) {
- 268. - subcategory2_id = 0;
- 269. - }
- 270. - category2_id = value;
- 271. - var data = cur.subcategoriesData[value] || [];
- 272. - var disabledText = (value ? getLang('ads_no_subcategories') : getLang('ads_first_select_category2'));
- 273. - uiSubcategory2.setOptions({disabledText: disabledText});
- 274. - uiSubcategory2.setData(data);
- 275. - if (subcategory2_id) {
- 276. - uiSubcategory2.val(subcategory2_id);
- 277. - } else {
- 278. - uiSubcategory2.clear();
- 279. - }
- 280. - uiSubcategory2.disable(data.length == 0);
- 281. - }
- 282. - function applyChanges() {
- 283. - if (!category1_id && !category2_id) {
- 284. - showFastBox('������', '�� ������ ��������.');
- 285. - return;
- 286. - }
- 287. -
- 288. - cur.requestsParams[requestKey].category1_id = (subcategory1_id || category1_id);
- 289. - cur.requestsParams[requestKey].category2_id = (subcategory2_id || category2_id);
- 290. - cur.requestsParams[requestKey].ui_category1_id = category1_id;
- 291. - cur.requestsParams[requestKey].ui_category2_id = category2_id;
- 292. - cur.requestsParams[requestKey].ui_subcategory1_id = subcategory1_id;
- 293. - cur.requestsParams[requestKey].ui_subcategory2_id = subcategory2_id;
- 294. - cur.requestsParams[requestKey].categories_changed = true;
- 295. -
- 296. - var category1Elem = geByClass1('ads_category1', linkElem);
- 297. - var category1ParentElem = geByClass1('ads_category1_parent', linkElem);
- 298. - if (subcategory1_id) {
- 299. - replaceClass(category1Elem, 'ads_category', 'ads_subcategory');
- 300. - category1Elem.innerHTML = uiSubcategory1.val_full()[1];
- 301. - category1ParentElem.innerHTML = ' (' + uiCategory1.val_full()[1] + ')';
- 302. - } else {
- 303. - replaceClass(category1Elem, 'ads_subcategory', 'ads_category');
- 304. - category1Elem.innerHTML = (category1_id ? uiCategory1.val_full()[1] : '');
- 305. - category1ParentElem.innerHTML = '';
- 306. - }
- 307. -
- 308. - var category2Elem = geByClass1('ads_category2', linkElem);
- 309. - var category2ParentElem = geByClass1('ads_category2_parent', linkElem);
- 310. - if (subcategory2_id) {
- 311. - replaceClass(category2Elem, 'ads_category', 'ads_subcategory');
- 312. - category2Elem.innerHTML = uiSubcategory2.val_full()[1];
- 313. - category2ParentElem.innerHTML = ' (' + uiCategory2.val_full()[1] + ')';
- 314. - } else {
- 315. - replaceClass(category2Elem, 'ads_subcategory', 'ads_category');
- 316. - category2Elem.innerHTML = (category2_id ? uiCategory2.val_full()[1] : '');
- 317. - category2ParentElem.innerHTML = '';
- 318. - }
- 319. -
- 320. - editBox.hide();
- 321. - }
- 322. - }
- 323. -
- 324. - AdsModer.premoderationProcessRequest = function(action, requestKey, requestKeyModer, onCompleteExternal) {
- 325. -
- 326. - var requestParams = cur.requestsParams[requestKey];
- 327. - var requestParamsModer = cur.requestsParams[requestKeyModer];
- 328. -
- 329. - if (!requestKey || !requestKeyModer || !requestParams || !requestParamsModer) {
- 330. - return;
- 331. - }
- 332. -
- 333. - var result = AdsModer.premoderationProcessRequestsMassCheck(action, requestKey);
- 334. - if (result) {
- 335. - return;
- 336. - }
- 337. -
- 338. - var moderComment = ge('moder_comment_' + requestKeyModer);
- 339. - var resultArea = ge('request_result_area_' + requestKey);
- 340. -
- 341. - var ajaxParams = {};
- 342. - ajaxParams.action = action;
- 343. - ajaxParams.request_id = requestParams.request_id;
- 344. - ajaxParams.ad_id = requestParams.ad_id;
- 345. - ajaxParams.hash = requestParams.hash;
- 346. - ajaxParams.checksum = requestParams.checksum_all;
- 347. -
- 348. - if (action === 'approve') {
- 349. - if (requestParamsModer.categories_changed) {
- 350. - ajaxParams.category1_id = requestParamsModer.category1_id;
- 351. - ajaxParams.category2_id = requestParamsModer.category2_id;
- 352. - } else {
- 353. - ajaxParams.category1_id = requestParams.category1_id;
- 354. - ajaxParams.category2_id = requestParams.category2_id;
- 355. - }
- 356. - }
- 357. -
- 358. - ajaxParams.moder_comment = moderComment.getValue();
- 359. - if (action === 'disapprove') {
- 360. - ajaxParams.moder_rules = cur.uiReasonsControls[requestKeyModer].getSelectedItems().join(',');
- 361. - }
- 362. -
- 363. - resultArea.innerHTML = '<img src="/images/upload.gif" />';
- 364. -
- 365. - ajax.post('/adsmoder?act=a_premoderation_process', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 366. -
- 367. - function onComplete(response) {
- 368. - var responseText = ((response && response.text) ? response.text : '������!');
- 369. - resultArea.innerHTML = responseText;
- 370. - if (isFunction(onCompleteExternal)) {
- 371. - onCompleteExternal(response, requestKey, responseText);
- 372. - }
- 373. - return true;
- 374. - };
- 375. - }
- 376. -
- 377. - AdsModer.premoderationProcessRequestsMassCheck = function(action, requestKey) {
- 378. -
- 379. - var requestParams = cur.requestsParams[requestKey];
- 380. -
- 381. - var requestsKeys = [];
- 382. -
- 383. - if (action === 'approve') {
- 384. - if (requestParams.categories_changed) {
- 385. - if (cur.requestsChecksumsApproveWithoutCategories[requestParams.checksum_approve_without_categories].length < 5) {
- 386. - return false;
- 387. - }
- 388. - requestsKeys = cur.requestsChecksumsApproveWithoutCategories[requestParams.checksum_approve_without_categories];
- 389. - } else {
- 390. - if (cur.requestsChecksumsApproveWithCategories[requestParams.checksum_approve_with_categories].length < 5) {
- 391. - return false;
- 392. - }
- 393. - requestsKeys = cur.requestsChecksumsApproveWithCategories[requestParams.checksum_approve_with_categories];
- 394. - }
- 395. - } else if (action === 'disapprove') {
- 396. - if (cur.requestsChecksumsDisapprove[requestParams.checksum_disapprove].length < 5) {
- 397. - return false;
- 398. - }
- 399. - requestsKeys = cur.requestsChecksumsDisapprove[requestParams.checksum_disapprove];
- 400. - }
- 401. -
- 402. - var confirmTitle = ((action === 'approve') ? '�������� ���������' : '�������� ����������');
- 403. - var confirmText = '������� ���������� �� ������� ��������: '+requestsKeys.length;
- 404. - var processAllText = ((action === 'approve') ? '�������� ���' : '��������� ���');
- 405. - var processOneText = ((action === 'approve') ? '�������� ����' : '��������� ����');
- 406. -
- 407. - var box = showFastBox(confirmTitle, cur.massBoxHtml, processAllText, processAll, processOneText, processOne);
- 408. - geByClass1('ads_premoderation_mass_confirm_text', box.bodyNode).innerHTML = confirmText;
- 409. -
- 410. - return true;
- 411. -
- 412. - function processAll() {
- 413. - cleanChecksums();
- 414. - AdsModer.premoderationProcessRequestsMass(action, requestKey, requestsKeys, box);
- 415. - }
- 416. - function processOne() {
- 417. - cleanChecksums();
- 418. - box.hide();
- 419. - AdsModer.premoderationProcessRequest(action, requestKey, requestKey);
- 420. - }
- 421. - function cleanChecksums() {
- 422. - cur.requestsChecksumsApproveWithCategories[requestParams.checksum_approve_with_categories] = [];
- 423. - cur.requestsChecksumsApproveWithoutCategories[requestParams.checksum_approve_without_categories] = [];
- 424. - cur.requestsChecksumsDisapprove[requestParams.checksum_disapprove] = [];
- 425. - }
- 426. - }
- 427. -
- 428. - AdsModer.premoderationProcessRequestsMass = function(action, requestKeyModer, requestsKeys, box) {
- 429. - var requestParams = cur.requestsParams[requestKeyModer];
- 430. -
- 431. - var totalCount = requestsKeys.length;
- 432. - var completeCount = 0;
- 433. - var approvedCount = 0;
- 434. - var disapprovedCount = 0;
- 435. - var errorCount = 0;
- 436. - var responseInfos = [];
- 437. -
- 438. - box.removeButtons();
- 439. - box.addButton(getLang('box_close'), false, 'yes');
- 440. -
- 441. - var progressWrapElem = geByClass1('ads_premoderation_mass_progress_wrap2', box.bodyNode);
- 442. - var progressElem = geByClass1('ads_gradient_progress', box.bodyNode);
- 443. - var resultElem = geByClass1('ads_premoderation_mass_result', box.bodyNode);
- 444. - var resultTextElem = geByClass1('ads_premoderation_mass_result_text', box.bodyNode);
- 445. - var resultMoreElem = geByClass1('ads_premoderation_mass_result_more', box.bodyNode);
- 446. - drawProgress();
- 447. - show(progressWrapElem);
- 448. -
- 449. - for (var i = 0; requestKey = requestsKeys[i]; i++) {
- 450. - setTimeout(AdsModer.premoderationProcessRequest.pbind(action, requestKey, requestKeyModer, onComplete), 200 * i);
- 451. - }
- 452. -
- 453. - function onComplete(response, responseRequestKey, responseText) {
- 454. - var responseAdId = cur.requestsParams[responseRequestKey].ad_id;
- 455. - responseInfos.push('<a href="/ads?act=office&union_id='+responseAdId+'" target="_blank">'+responseAdId+' - '+responseText+'</a>');
- 456. -
- 457. - if (response && (response.approved || response.disapproved)) {
- 458. - if (response.approved) {
- 459. - approvedCount++;
- 460. - }
- 461. - if (response.disapproved) {
- 462. - disapprovedCount++;
- 463. - }
- 464. - } else {
- 465. - errorCount++;
- 466. - }
- 467. - completeCount++;
- 468. -
- 469. - drawProgress();
- 470. - if (completeCount == totalCount) {
- 471. - setTimeout(drawResults, 1000);
- 472. - }
- 473. - }
- 474. - function drawProgress() {
- 475. - var percent = intval(completeCount / totalCount * 100);
- 476. - setStyle(progressElem, {width: percent + '%'});
- 477. - }
- 478. - function drawResults() {
- 479. - hide(progressWrapElem);
- 480. -
- 481. - var resultText = '';
- 482. - if (approvedCount) {
- 483. - resultText += '��������: '+approvedCount+'<br>';
- 484. - }
- 485. - if (disapprovedCount) {
- 486. - resultText += '���������: '+disapprovedCount+'<br>';
- 487. - }
- 488. - resultText += '������: '+errorCount+'<br>';
- 489. -
- 490. - resultTextElem.innerHTML = resultText;
- 491. - resultMoreElem.innerHTML = responseInfos.join('<br>');
- 492. - show(resultElem);
- 493. - }
- 494. - }
- 495. -
- 496. - AdsModer.premoderationTakeUnion = function(unionId, hash) {
- 497. - var ajaxParams = {};
- 498. - ajaxParams.hash = hash;
- 499. - ajaxParams.union_id = unionId;
- 500. - ajaxParams.action = 'take_union';
- 501. - ajax.post('/adsmoder?act=a_premoderation_manage_work', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 502. -
- 503. - function onComplete(response) {
- 504. - if (response && response.ok) {
- 505. - if (response.redirect) {
- 506. - nav.go(response.redirect);
- 507. - }
- 508. - } else {
- 509. - var message = ((response && response.error) ? response.error : '������');
- 510. - showFastBox({title: '������', onHide: function() { nav.reload(); }}, message);
- 511. - }
- 512. - return true;
- 513. - }
- 514. - }
- 515. -
- 516. - AdsModer.premoderationTakeBackUnion = function(unionId, hash) {
- 517. - var ajaxParams = {};
- 518. - ajaxParams.hash = hash;
- 519. - ajaxParams.union_id = unionId;
- 520. - ajaxParams.action = 'take_back_union';
- 521. - ajax.post('/adsmoder?act=a_premoderation_manage_work', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 522. -
- 523. - function onComplete(response) {
- 524. - if (response && response.ok) {
- 525. - nav.reload();
- 526. - } else {
- 527. - var message = ((response && response.error) ? response.error : '������');
- 528. - showFastBox({title: '������', onHide: function() { nav.reload(); }}, message);
- 529. - }
- 530. - return true;
- 531. - }
- 532. - }
- 533. -
- 534. - AdsModer.premoderationStopWork = function(hash) {
- 535. - var ajaxParams = {};
- 536. - ajaxParams.hash = hash;
- 537. - ajaxParams.action = 'stop_work';
- 538. - ajax.post('/adsmoder?act=a_premoderation_manage_work', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 539. -
- 540. - function onComplete(response) {
- 541. - if (response && response.ok) {
- 542. - nav.reload();
- 543. - } else {
- 544. - var message = ((response && response.error) ? response.error : '������');
- 545. - showFastBox({title: '������', onHide: function() { nav.reload(); }}, message);
- 546. - }
- 547. - return true;
- 548. - }
- 549. - }
- 550. -
- 551. - AdsModer.premoderationFixRequest = function(wrapElemId, requestId, action, hash) {
- 552. - if (!Ads.lock(wrapElemId, onLock, onUnlock)) {
- 553. - return;
- 554. - }
- 555. -
- 556. - var ajaxParams = {}
- 557. - ajaxParams.request_id = requestId;
- 558. - ajaxParams.action = action;
- 559. - ajaxParams.hash = hash;
- 560. -
- 561. - ajax.post('/adsmoder?act=premoderation_fix_request', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 562. -
- 563. - function onComplete(response) {
- 564. - Ads.unlock(wrapElemId);
- 565. - if (response && response.text_new) {
- 566. - var wrapElem = ge(wrapElemId);
- 567. - if (wrapElem) {
- 568. - wrapElem.parentNode.replaceChild(se(response.text_new), wrapElem);
- 569. - }
- 570. - }
- 571. - return true;
- 572. - }
- 573. - function onLock() {
- 574. - show(geByTag1('img', ge(wrapElemId)));
- 575. - }
- 576. - function onUnlock() {
- 577. - var wrapElem = ge(wrapElemId);
- 578. - if (wrapElem) {
- 579. - hide(geByTag1('img', wrapElem));
- 580. - }
- 581. - }
- 582. - }
- 583. -
- 584. - AdsModer.switchOfficeBlock = function(actionLocation, confirmTitle, confirmText, actionText) {
- 585. - function switchBlocked() {
- 586. - Ads.simpleAjax(actionLocation);
- 587. - }
- 588. - showFastBox(confirmTitle, confirmText, actionText, switchBlocked, getLang('box_cancel'));
- 589. - }
- 590. -
- 591. - AdsModer.openCancelClicksBox = function(ajaxParams) {
- 592. - var showOptions = {params: {}};
- 593. - showBox('/adsweb?act=log_cancel_box', ajaxParams, showOptions);
- 594. - }
- 595. -
- 596. - AdsModer.initCancelClicksBox = function(box, ajaxParams) {
- 597. - var handler = AdsModer.cancelClicks.pbind(box, ajaxParams);
- 598. - box.removeButtons();
- 599. - box.addButton(getLang('box_cancel'), false, 'no');
- 600. - box.addButton('�������� �����', handler, 'yes');
- 601. - }
- 602. -
- 603. - AdsModer.cancelClicks = function(box, ajaxParams) {
- 604. - if (!Ads.lock('cancelClicks', onLock, onUnlock)) {
- 605. - return;
- 606. - }
- 607. -
- 608. - ajax.post('/adsweb?act=log_cancel', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 609. -
- 610. - function onComplete(response) {
- 611. - Ads.unlock('cancelClicks');
- 612. - if (response && response.ok) {
- 613. - nav.reload();
- 614. - } else {
- 615. - showFastBox('������', '������');
- 616. - }
- 617. - return true;
- 618. - }
- 619. - function onLock() {
- 620. - box.showProgress();
- 621. - }
- 622. - function onUnlock() {
- 623. - box.hide();
- 624. - }
- 625. - }
- 626. -
- 627. - AdsModer.openClickfraudersPrepareBanBox = function(usersIds, day) {
- 628. - var ajaxParams = {};
- 629. - ajaxParams.users_ids = usersIds;
- 630. - ajaxParams.day = day;
- 631. -
- 632. - var showOptions = {params: {}};
- 633. - showOptions.params.width = 650;
- 634. -
- 635. - showBox('/adsweb?act=clickfrauders_prepare_ban_box', ajaxParams, showOptions);
- 636. - }
- 637. -
- 638. - AdsModer.initClickfraudersPrepareBanBox = function(box, hash, usersIds, day) {
- 639. - var prepareBanHandler = AdsModer.clickfraudersPrepareBan.pbind(box, hash, usersIds, day);
- 640. - box.removeButtons();
- 641. - box.addButton(getLang('box_cancel'), false, 'no');
- 642. - box.addButton('��������', prepareBanHandler, 'yes');
- 643. - }
- 644. -
- 645. - AdsModer.clickfraudersPrepareBan = function(box, hash, usersIds, day) {
- 646. - if (!Ads.lock('clickfraudersPrepareBan', onLock, onUnlock)) {
- 647. - return;
- 648. - }
- 649. -
- 650. - var ajaxParams = {};
- 651. - ajaxParams.hash = hash;
- 652. - ajaxParams.users_ids = usersIds;
- 653. - ajaxParams.day = day;
- 654. -
- 655. - ajax.post('/adsweb?act=clickfrauders_prepare_ban', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 656. -
- 657. - function onComplete(response) {
- 658. - Ads.unlock('clickfraudersPrepareBan');
- 659. - if (response && response.message) {
- 660. - showFastBox('��', response.message);
- 661. - } else {
- 662. - showFastBox('������', '������');
- 663. - }
- 664. - return true;
- 665. - }
- 666. - function onLock() {
- 667. - box.showProgress();
- 668. - }
- 669. - function onUnlock() {
- 670. - box.hide();
- 671. - }
- 672. - }
- 673. -
- 674. - AdsModer.historyGet = function(elem, notNavigationParam) {
- 675. - while (elem && elem.nodeName.toLowerCase() !== 'form') {
- 676. - elem = elem.parentNode;
- 677. - }
- 678. - if (!elem) {
- 679. - return;
- 680. - }
- 681. - var values = serializeForm(elem);
- 682. - var params = values.other_params;
- 683. - delete values.other_params;
- 684. - for (var i in values) {
- 685. - if (values[i]) {
- 686. - params = '&' + i + '=' + values[i] + params;
- 687. - }
- 688. - }
- 689. - nav.go('/adsmoder?act=history' + params);
- 690. - }
- 691. -
- 692. - AdsModer.historyToggleFilters = function() {
- 693. - var filtersContainerElem = ge('ads_moder_history');
- 694. - var filtersElems = geByClass('ads_navigation_link', filtersContainerElem);
- 695. - for (var i = 0; elem = filtersElems[i]; i++) {
- 696. - if (hasClass(elem, 'current')) {
- 697. - continue
- 698. - }
- 699. - elem = elem.parentNode;
- 700. - if (elem.nodeName.toLowerCase() !== 'span') {
- 701. - continue
- 702. - }
- 703. - toggleClass(elem, 'unshown');
- 704. - }
- 705. - }
- 706. -
- 707. - AdsModer.statSummaryInit = function(periodType, fromYear, fromMonth, fromDay, toYear, toMonth, toDay) {
- 708. - var datePickerOptionsFrom = {
- 709. - mode: (periodType === 'month') ? 'm' : 'd',
- 710. - year: fromYear,
- 711. - month: fromMonth,
- 712. - day: fromDay,
- 713. - width: 130,
- 714. - pastActive: true,
- 715. - onUpdate: function(date, mode) {
- 716. - fromYear = date.y;
- 717. - fromMonth = date.m;
- 718. - fromDay = date.d;
- 719. - updateLink();
- 720. - }
- 721. - };
- 722. - var datePickerOptionsTo = {
- 723. - mode: (periodType === 'month') ? 'm' : 'd',
- 724. - year: toYear,
- 725. - month: toMonth,
- 726. - day: toDay,
- 727. - width: 130,
- 728. - pastActive: true,
- 729. - onUpdate: function(date, mode) {
- 730. - toYear = date.y;
- 731. - toMonth = date.m;
- 732. - toDay = date.d;
- 733. - updateLink();
- 734. - }
- 735. - };
- 736. - new Datepicker(ge('ads_moder_stat_summary_from'), datePickerOptionsFrom);
- 737. - new Datepicker(ge('ads_moder_stat_summary_to'), datePickerOptionsTo);
- 738. -
- 739. - function updateLink() {
- 740. - var fromPeriod = fromYear * 100 + fromMonth;
- 741. - var toPeriod = toYear * 100 + toMonth;
- 742. - if (periodType !== 'month') {
- 743. - fromPeriod = fromPeriod * 100 + fromDay;
- 744. - toPeriod = toPeriod * 100 + toDay;
- 745. - }
- 746. - var linkElem = ge('ads_moder_stat_summary_range_link');
- 747. - linkElem.href = linkElem.href.replace(/&period=\d+-\d+/, '&period=' + fromPeriod + '-' + toPeriod);
- 748. - linkElem.style.opacity = 1;
- 749. - }
- 750. - }
- 751. -
- 752. - AdsModer.statSummaryShowAllProperties = function() {
- 753. - var propertiesElem = ge('ads_moder_stat_summary_filter_properties');
- 754. - var elems = geByClass('ads_moder_stat_summary_filter_property', propertiesElem);
- 755. - each(elems, show);
- 756. - hide('ads_moder_stat_summary_filter_properties_shower_wrap');
- 757. - }
- 758. -
- 759. - AdsModer.statSummaryDistrShowCountLabel = function(id, i, val) {
- 760. - var contXy = getXY(ge(id+'_stats_graph_wrap'));
- 761. - var colXy = getXY(ge(id+'_distr_col_'+i));
- 762. -
- 763. - setStyle(ge(id+'_max_label'), {
- 764. - left: colXy[0] - contXy[0] + 14,
- 765. - top: colXy[1] - contXy[1] - 11
- 766. - });
- 767. - ge(id+'_max_label').innerHTML = val;
- 768. - show(id+'_max_label');
- 769. - setStyle(ge(id+'_max_label_out'), {
- 770. - width: ge(id+'_max_label').offsetWidth + 2,
- 771. - height: ge(id+'_max_label').offsetHeight + 2,
- 772. - left: colXy[0] - contXy[0] + 13,
- 773. - top: colXy[1] - contXy[1] - 12
- 774. - });
- 775. - show(id+'_max_label_out');
- 776. - setStyle(ge(id+'_max_label_out2'), {
- 777. - width: ge(id+'_max_label').offsetWidth + 4,
- 778. - height: ge(id+'_max_label').offsetHeight + 4,
- 779. - left: colXy[0] - contXy[0] + 12,
- 780. - top: colXy[1] - contXy[1] - 13
- 781. - });
- 782. - show(id+'_max_label_out2');
- 783. - }
- 784. -
- 785. - AdsModer.statSummaryDistrHideCountLabel = function(id) {
- 786. - hide(id+'_max_label');
- 787. - hide(id+'_max_label_out');
- 788. - hide(id+'_max_label_out2');
- 789. - }
- 790. -
- 791. - AdsModer.statSummaryShowVotesBox = function(periodType, period) {
- 792. - var ajaxParams = {};
- 793. - ajaxParams.period_type = periodType;
- 794. - ajaxParams.period = period;
- 795. -
- 796. - var showOptions = {params: {}};
- 797. -
- 798. - showBox('/adsmoder?act=stat_summary_votes', ajaxParams, showOptions);
- 799. - }
- 800. -
- 801. - AdsModer.increaseBudget = function() {
- 802. - if (!Ads.lock('increaseBudget', onLock, onUnlock)) {
- 803. - return;
- 804. - }
- 805. -
- 806. - var ajaxParams = {};
- 807. - ajaxParams.union_id = val('ads_increase_budget_union_id');
- 808. - ajaxParams.money_amount = val('ads_increase_budget_amount');
- 809. - ajaxParams.hash = val('ads_increase_budget_hash');
- 810. -
- 811. - ajax.post('/adsmoder?act=increase_budget', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 812. -
- 813. - function onComplete(response) {
- 814. - Ads.unlock('increaseBudget');
- 815. - if (response && response.redirect) {
- 816. - nav.go(response.redirect);
- 817. - } else {
- 818. - var msg = ((response && response.error) ? response.error : '������');
- 819. - showFastBox('������', msg);
- 820. - }
- 821. - return true;
- 822. - }
- 823. - function onLock() {
- 824. - lockButton('ads_increase_budget_button');
- 825. - }
- 826. - function onUnlock() {
- 827. - unlockButton('ads_increase_budget_button');
- 828. - }
- 829. - }
- 830. -
- 831. - AdsModer.openDisableOfficeBox = function(ajaxParams, isCompany) {
- 832. - cur.lang.ads_disable_office_box_title = '�������� ���������� ��������';
- 833. - cur.lang.ads_disable_office_box_button = '������� �������';
- 834. - cur.lang.ads_disable_office_confirm_message = '�� ������� ��� ������ ������� ��������� �������?<br><br>����� �������� �������� ��������� ������ � ����������, �� ����� �������� �������� ����� ����������.';
- 835. - cur.lang.ads_disable_office_company_confirm_message = '������ ����� �������� �������� �������� �������� ������ ���������� ����� � ����� ��������.';
- 836. - var message = getLang('ads_disable_office_confirm_message');
- 837. - if (isCompany) {
- 838. - message += '<br><br>' + getLang('ads_disable_office_company_confirm_message');
- 839. - }
- 840. - var messageBox = showFastBox(getLang('ads_disable_office_box_title'), message, getLang('ads_disable_office_box_button'), function(){ AdsModer.disableOffice(ajaxParams, messageBox); }, getLang('box_cancel'));
- 841. - }
- 842. -
- 843. - AdsModer.disableOffice = function(ajaxParams, box) {
- 844. - if (!Ads.lock('disableOffice', onLock, onUnlock)) {
- 845. - return;
- 846. - }
- 847. -
- 848. - ajax.post('/adsmoder?act=a_disable_office', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 849. -
- 850. - function onComplete(response) {
- 851. - Ads.unlock('disableOffice');
- 852. - if (response && response.redirect) {
- 853. - nav.reload();
- 854. - } else {
- 855. - box.hide();
- 856. - showFastBox(getLang('ads_error_box_title'), getLang('ads_error_text'));
- 857. - }
- 858. - return true;
- 859. - }
- 860. - function onLock() {
- 861. - box.showProgress();
- 862. - }
- 863. - function onUnlock() {
- 864. - box.hideProgress();
- 865. - }
- 866. - }
- 867. -
- 868. - try{stManager.done('ads_moder.js');}catch(e){}
- ------
Advertisement
Add Comment
Please, Sign In to add comment