Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Файл - ads.css (Старый размер - 31512 | Новый - 0):
- 0. - #ads_css { display: none; }
- 1. -
- 2. - /* ------- */
- 3. - /* General */
- 4. - /* ------- */
- 5. -
- 6. - ul.ads_listing {
- 7. - padding: 0 0 0 30px;
- 8. - margin: 0 0 15px 0;
- 9. - }
- 10. - ul.ads_listing li {
- 11. - list-style: square;
- 12. - color: #758EAC;
- 13. - line-height: 160%;
- 14. - }
- 15. - ul.ads_listing li span {
- 16. - color: #000000;
- 17. - }
- 18. -
- 19. - a .ads_sub_link:hover {
- 20. - text-decoration: underline;
- 21. - }
- 22. -
- 23. - .ads_h2_add {
- 24. - font-weight: normal;
- 25. - font-size: 11px;
- 26. - padding-top: 0.185em;
- 27. - }
- 28. - .font_medium .ads_h2_add {
- 29. - font-size: 12px;
- 30. - padding-top: 0.14em;
- 31. - }
- 32. -
- 33. - .ads_gradient_progress_wrap {
- 34. - height: 18px;
- 35. - margin: 0 auto;
- 36. - background: #FFFFFF;
- 37. - border: 1px solid #CCCCCC;
- 38. - }
- 39. -
- 40. - .ads_gradient_progress {
- 41. - height: 18px;
- 42. - background: #597DA3 url(/images/progress_grad.gif) repeat;
- 43. - border: 1px solid #45688E;
- 44. - margin: -1px;
- 45. - }
- 46. -
- 47. - /* ---- */
- 48. - /* Page */
- 49. - /* ---- */
- 50. -
- 51. - #ads_page_wrap2 {
- 52. - border: 1px solid #EBF0F4;
- 53. - border-top: 0;
- 54. - width: 791px;
- 55. - float: right;
- 56. - }
- 57. -
- 58. - #ads_page_wrap1 {
- 59. - border: 1px solid #DAE1E8;
- 60. - border-top: 0;
- 61. - width: 789px;
- 62. - overflow: hidden;
- 63. - }
- 64. -
- 65. - #ads_page {
- 66. - padding: 20px;
- 67. - }
- 68. - #ads_page.ads_page_no_padding {
- 69. - padding: 0;
- 70. - }
- 71. -
- 72. - #ads_page_top {
- 73. - padding-top: 10px;
- 74. - }
- 75. -
- 76. - .ads_page_extra_wide #ads_page_wrap2,
- 77. - .ads_page_extra_wide #ads_page_wrap1 {
- 78. - width: auto;
- 79. - }
- 80. -
- 81. - .ads_page_extra_wide #ads_page_wrap2 {
- 82. - float: none;
- 83. - }
- 84. -
- 85. - #ads_page_bottom_info {
- 86. - border-top: 1px solid #DAE1E8;
- 87. - background-color: #F7F7F7;
- 88. - text-align: center;
- 89. - padding: 6px 20px;
- 90. - color: #777777;
- 91. - }
- 92. -
- 93. - .ads_page_small {
- 94. - padding: 0 60px;
- 95. - }
- 96. -
- 97. - /* ----- */
- 98. - /* Title */
- 99. - /* ----- */
- 100. -
- 101. - #ads_page_title {
- 102. - background-color: #E9EDF1;
- 103. - padding: 7px 10px;
- 104. - margin: 0;
- 105. - font-weight: bold;
- 106. - color: #607387;
- 107. - line-height: 140%;
- 108. - }
- 109. -
- 110. - #ads_page_title h1 {
- 111. - font-size: 1em;
- 112. - overflow: hidden;
- 113. - padding: 0;
- 114. - margin: 0;
- 115. - }
- 116. -
- 117. - #ads_page_title h1 a {
- 118. - color: #2B587A;
- 119. - }
- 120. -
- 121. - #ads_page_title b {
- 122. - color: #AAB7C5;
- 123. - float: right;
- 124. - }
- 125. -
- 126. - /* --------------- */
- 127. - /* Main navigation */
- 128. - /* --------------- */
- 129. -
- 130. - .ads_page_extra_wide #ads_navigation {
- 131. - display: none;
- 132. - }
- 133. -
- 134. - #ads_navigation {
- 135. - width: 150px;
- 136. - padding: 12px 0 12px 0;
- 137. - word-wrap: break-word;
- 138. - }
- 139. -
- 140. - #ads_navigation .edit_button_wrap {
- 141. - padding-bottom: 10px;
- 142. - }
- 143. -
- 144. - #ads_navigation.ads_nav .nav {
- 145. - max-width: 128px;
- 146. - }
- 147. -
- 148. - #ads_navigation a:hover {
- 149. - text-decoration: none;
- 150. - }
- 151. -
- 152. - /* ------------------------------ */
- 153. - /* Main navigation - offices menu */
- 154. - /* ------------------------------ */
- 155. -
- 156. - #ads_navigation.ads_nav #ads_navigation_offices_menu.nav {
- 157. - padding-right: 2px;
- 158. - width: 137px;
- 159. - max-width: 137px;
- 160. - }
- 161. -
- 162. - #ads_navigation.ads_nav #ads_navigation_offices_menu.nav .dd_link {
- 163. - display: block;
- 164. - }
- 165. -
- 166. - #ads_navigation.ads_nav #ads_navigation_offices_menu.nav .dd_link #ads_navigation_offices_menu_text_wrap {
- 167. - display: block;
- 168. - overflow: hidden;
- 169. - white-space: nowrap;
- 170. - font-size: 0; /* Remove extra margin from inline-block */
- 171. - }
- 172. -
- 173. - #ads_navigation.ads_nav #ads_navigation_offices_menu.nav .dd_link #ads_navigation_offices_menu_text {
- 174. - display: inline-block;
- 175. - overflow: hidden;
- 176. - white-space: nowrap;
- 177. - font-size: 11px; /* Remove extra margin from inline-block */
- 178. - }
- 179. - .font_medium #ads_navigation.ads_nav #ads_navigation_offices_menu.nav .dd_link #ads_navigation_offices_menu_text {
- 180. - font-size: 12px;
- 181. - }
- 182. -
- 183. - .dd_menu.ads_navigation_dd_menu_header_wrap {
- 184. - margin: 4px 0 0 7px;
- 185. - }
- 186. -
- 187. - .dd_menu.ads_navigation_dd_menu_header_wrap .dd_menu_header {
- 188. - width: 148px;
- 189. - }
- 190. -
- 191. - .dd_menu.ads_navigation_dd_menu_header_wrap .dd_menu_header div {
- 192. - background-position: right -14px;
- 193. - *background-position: right -13px;
- 194. - }
- 195. -
- 196. - .dd_menu.ads_navigation_dd_menu_header_wrap .dd_menu_header div #ads_navigation_dd_menu_header_text {
- 197. - padding: 1px 0 1px 4px;
- 198. - display: block;
- 199. - overflow: hidden;
- 200. - white-space: nowrap;
- 201. - }
- 202. -
- 203. - .dd_menu.ads_navigation_dd_menu_header_wrap .dd_menu_body .ads_office_name_wrap {
- 204. - display: inline-block;
- 205. - overflow: hidden;
- 206. - max-width: 300px;
- 207. - }
- 208. -
- 209. - /* ---------------------- */
- 210. - /* Main navigation - news */
- 211. - /* ---------------------- */
- 212. -
- 213. - .ads_naviagation_news {
- 214. - padding: 20px 0 5px 11px;
- 215. - }
- 216. -
- 217. - .ads_naviagation_news .news_title {
- 218. - font-weight: bold;
- 219. - color: #2B587A;
- 220. - padding-bottom: 10px;
- 221. - }
- 222. -
- 223. - .ads_naviagation_news ul {
- 224. - padding: 0;
- 225. - margin: 0;
- 226. - list-style-type: none;
- 227. - color: #758EAC;
- 228. - }
- 229. -
- 230. - .ads_naviagation_news li {
- 231. - padding-bottom: 10px;
- 232. - }
- 233. -
- 234. - .ads_naviagation_news span {
- 235. - color: #666666;
- 236. - font-size: 0.91em;
- 237. - }
- 238. -
- 239. - #ads_navigation .ads_naviagation_news a:hover {
- 240. - text-decoration: underline;
- 241. - }
- 242. -
- 243. - /* ---------- */
- 244. - /* Navigation */
- 245. - /* ---------- */
- 246. -
- 247. - .ads_nav .nav {
- 248. - padding: 6px 11px 7px 11px;
- 249. - display: block;
- 250. - overflow: hidden;
- 251. - }
- 252. -
- 253. - .ads_nav .nav:hover {
- 254. - background-color: #E1E7ED;
- 255. - text-decoration: none;
- 256. - }
- 257. -
- 258. - .ads_nav .nav_selected,
- 259. - .ads_nav .nav_selected:hover {
- 260. - background-color: #6186AD;
- 261. - color: white;
- 262. - }
- 263. -
- 264. - .ads_nav .nav_separator {
- 265. - border-bottom: 1px solid #D3DBE1;
- 266. - height: 1px;
- 267. - overflow: hidden;
- 268. - margin: 7px 0px 8px 0;
- 269. - }
- 270. -
- 271. - /* ---- */
- 272. - /* Tabs */
- 273. - /* ---- */
- 274. -
- 275. - .ads_tabs_filters {
- 276. - background-color: #F7F7F7;
- 277. - border-bottom: 1px solid #DAE1E8;
- 278. - padding: 10px 10px 5px 10px;
- 279. - }
- 280. - .ads_tabs_filters.separate {
- 281. - border-top: 1px solid #DAE1E8;
- 282. - }
- 283. - .ads_round_tab_wrap {
- 284. - padding: 0 5px 5px 0;
- 285. - text-align: center;
- 286. - }
- 287. - .ads_round_tab_wrap .round_tab.disabled:hover,
- 288. - .ads_round_tab_wrap .round_tab.label:hover {
- 289. - background-color: transparent;
- 290. - cursor: default;
- 291. - }
- 292. - .ads_round_tab_wrap .round_tab.label {
- 293. - color: #555555;
- 294. - }
- 295. - .ads_round_tabs_period_day .round_tab {
- 296. - width: 100px;
- 297. - }
- 298. - .ads_round_tabs_period_week .round_tab {
- 299. - width: 180px;
- 300. - }
- 301. - .ads_round_tabs_period_month .round_tab {
- 302. - width: 100px;
- 303. - }
- 304. -
- 305. - /* ----- */
- 306. - /* Intro */
- 307. - /* ----- */
- 308. -
- 309. - .ads_intro_page,
- 310. - .ads_intro_section_title {
- 311. - line-height: 160%;
- 312. - }
- 313. -
- 314. - .ads_intro_title,
- 315. - .ads_intro_section_title,
- 316. - .ads_intro_subsection_title,
- 317. - .ads_intro_new_title {
- 318. - color: #5c7b9b;
- 319. - }
- 320. -
- 321. - .ads_intro_title {
- 322. - font-size: 1.3em;
- 323. - font-weight: bold;
- 324. - padding-bottom: 16px;
- 325. - }
- 326. -
- 327. - .ads_intro_section_title {
- 328. - font-size: 1.2em;
- 329. - font-weight: bold;
- 330. - padding: 8px 10px 0 10px;
- 331. - }
- 332. -
- 333. - .ads_intro_subsection_title {
- 334. - font-size: 1.2em;
- 335. - font-weight: bold;
- 336. - padding-bottom: 8px;
- 337. - }
- 338. -
- 339. - .ads_intro_new_title {
- 340. - font-size: 1.2em;
- 341. - font-weight: bold;
- 342. - border-bottom: 1px solid #dae1e8;
- 343. - }
- 344. -
- 345. - .ads_intro_subsection_text {
- 346. - color: #808080;
- 347. - }
- 348. -
- 349. - .ads_intro_header_wrap2 {
- 350. - height: 380px;
- 351. - }
- 352. -
- 353. - .ads_intro_header_wrap1 {
- 354. - height: 280px;
- 355. - background-color: #edf1f5;
- 356. - padding: 22px 40px 0 40px;
- 357. - position: relative;
- 358. - }
- 359. -
- 360. - .ads_intro_text {
- 361. - width: 440px;
- 362. - }
- 363. -
- 364. - .ads_intro_sections {
- 365. - margin-right: -100px;
- 366. - top: 190px;
- 367. - position: absolute;
- 368. - }
- 369. -
- 370. - .ads_intro_section_button {
- 371. - width: 188px;
- 372. - height: 162px;
- 373. - background-color: #f4f6f8;
- 374. - border: 1px solid #e1e6eb;
- 375. - border-bottom: 2px solid #dce1e6;
- 376. - display: inline-block;
- 377. - margin-right: 43px;
- 378. - -moz-border-radius: 3px;
- 379. - -webkit-border-radius: 3px;
- 380. - -khtml-border-radius: 3px;
- 381. - border-radius: 3px;
- 382. - text-align: center;
- 383. - position: relative;
- 384. - top: 0;
- 385. -
- 386. - -webkit-transition: all 200ms ease-out;
- 387. - -moz-transition: all 200ms ease-out;
- 388. - -o-transition: all 200ms ease-out;
- 389. - transition: all 200ms ease-out;
- 390. - }
- 391. -
- 392. - .ads_intro_section_button:hover {
- 393. - text-decoration: none;
- 394. - top: -8px;
- 395. - }
- 396. -
- 397. - .ads_intro_section_image {
- 398. - width: 95px;
- 399. - height: 82px;
- 400. - background-size: 95px auto;
- 401. - background-image: url(/images/ads_intro_icons.png);
- 402. - background-color: argb(77, 77, 77, 77);
- 403. - display: inline-block;
- 404. - margin-top: 16px;
- 405. - }
- 406. - .is_2x .ads_intro_section_image {
- 407. - background-image: url(/images/ads_intro_icons_2x.png);
- 408. - }
- 409. -
- 410. - .ads_intro_section_button2 .ads_intro_section_image {
- 411. - background-position: 0 -82px;
- 412. - }
- 413. - .ads_intro_section_button3 .ads_intro_section_image {
- 414. - background-position: 0 -164px;
- 415. - }
- 416. -
- 417. - .ads_intro_section_label {
- 418. - width: 60px;
- 419. - height: 60px;
- 420. - background-size: 60px auto;
- 421. - position: absolute;
- 422. - left: -2px;
- 423. - top: -2px;
- 424. - }
- 425. -
- 426. - .ads_intro_section_label.label_ru {
- 427. - background-image: url(/images/ads_intro_label_new_ru.png);
- 428. - }
- 429. - .is_2x .ads_intro_section_label.label_ru {
- 430. - background-image: url(/images/ads_intro_label_new_ru_2x.png);
- 431. - }
- 432. - .ads_intro_section_label.label_en {
- 433. - background-image: url(/images/ads_intro_label_new_en.png);
- 434. - }
- 435. - .is_2x .ads_intro_section_label.label_en {
- 436. - background-image: url(/images/ads_intro_label_new_en_2x.png);
- 437. - }
- 438. - .ads_intro_section_label.label_ua {
- 439. - background-image: url(/images/ads_intro_label_new_ua.png);
- 440. - }
- 441. - .is_2x .ads_intro_section_label.label_ua {
- 442. - background-image: url(/images/ads_intro_label_new_ua_2x.png);
- 443. - }
- 444. -
- 445. - .ads_intro_subsections {
- 446. - padding: 3px 25px 20px 20px;
- 447. - display: inline-block;
- 448. - vertical-align: top;
- 449. - }
- 450. -
- 451. - .ads_intro_subsection {
- 452. - padding: 15px 20px;
- 453. - display: block;
- 454. - width: 423px;
- 455. - }
- 456. -
- 457. - .ads_intro_subsection:hover {
- 458. - text-decoration: none;
- 459. - background: #F7F7F7;
- 460. - }
- 461. -
- 462. - .ads_intro_news {
- 463. - width: 200px;
- 464. - padding-top: 18px;
- 465. - display: inline-block;
- 466. - }
- 467. -
- 468. - .ads_intro_news_widget_wrap {
- 469. - margin-left: -10px;
- 470. - padding-top: 8px;
- 471. - }
- 472. -
- 473. - /* ------ */
- 474. - /* Office */
- 475. - /* ------ */
- 476. -
- 477. - .ads_create_button_office {
- 478. - float: right;
- 479. - position: relative;
- 480. - width: 0;
- 481. - }
- 482. - .ads_create_button_office .edit_button_wrap {
- 483. - position: absolute;
- 484. - right: 0;
- 485. - }
- 486. -
- 487. - /* Other */
- 488. -
- 489. - /* --- */
- 490. - /* OLD */
- 491. - /* --- */
- 492. -
- 493. - /* From rustyle.css */
- 494. -
- 495. - /* Uses in paginated_table.js */
- 496. - .ads_lite_cb {
- 497. - background: transparent url(/images/icons/check_lt.gif) 0px 0px no-repeat;
- 498. - line-height: 0.81em;
- 499. - vertical-align: baseline;
- 500. - padding: 0px 0px 1px 20px;
- 501. - cursor: pointer;
- 502. - }
- 503. - .ads_lite_cb:hover {
- 504. - background-position: 0px -32px;
- 505. - text-decoration: none;
- 506. - }
- 507. - .ads_lite_cb.on {
- 508. - background-position: 0px -16px;
- 509. - }
- 510. - .ads_lite_cb.on:hover {
- 511. - background-position: 0px -48px;
- 512. - }
- 513. -
- 514. - .ads_mass_act_container {
- 515. - text-align: right;
- 516. - }
- 517. - .ads_mass_act_container div {
- 518. - margin-right: 8px;
- 519. - margin-bottom: 5px;
- 520. - }
- 521. - .ads_mass_act_container button {
- 522. - height: 21px;
- 523. - line-height: 0.9em;
- 524. - padding: 4px 10px 4px;
- 525. - }
- 526. - .ads_search_cell {
- 527. - width: 140px;
- 528. - }
- 529. - .ads_search_cell div.pt_search_container {
- 530. - margin: 0px -3px 5px -3px;
- 531. - }
- 532. -
- 533. - div.ads_selecting_subclasses {
- 534. - margin-bottom: 4px;
- 535. - }
- 536. -
- 537. - .dd_menu_header.ads_dd_wide.ads_dd_header_popup div {
- 538. - background: url(/images/flydead.gif) no-repeat right 6px #FFFFFF;
- 539. - padding-right: 17px;
- 540. - border: 1px solid #FFFFFF;
- 541. - color: #2B587A;
- 542. - font-weight: normal;
- 543. - text-decoration: none;
- 544. - }
- 545. -
- 546. - .dd_menu_header.ads_dd_wide div {
- 547. - background: #5e82a8 url(/images/flydead.gif) no-repeat right -12px;
- 548. - width: 106px;
- 549. - }
- 550. -
- 551. - .dd_menu_body.ads_dd_wide .dd_menu_rows a {
- 552. - height: 20px;
- 553. - }
- 554. - .dd_menu_body.ads_dd_wide .dd_menu_rows a .ads_status_image_span {
- 555. - margin: 4px 5px -2px -1px;
- 556. - }
- 557. -
- 558. - .dd_menu_header.ads_dd_wide div .ads_status_image_span {
- 559. - margin: 4px 5px -1px -1px;
- 560. - }
- 561. - .dd_menu_header.ads_dd_wide div {
- 562. - line-height: 1.45em;
- 563. - }
- 564. -
- 565. - td.paginated_table_cell.column_status_view {
- 566. - padding-left: 10px;
- 567. - }
- 568. -
- 569. - .ads_status_selector_box {
- 570. - display: block;
- 571. - margin: 0px auto;
- 572. - width: 20px;
- 573. - height: 20px;
- 574. - }
- 575. -
- 576. - .ads_status_selector_box.pnt {
- 577. - cursor: pointer;
- 578. - }
- 579. -
- 580. - .ads_status_selector_box.pnt:hover {
- 581. - background-color: #E1E7ED;
- 582. - border-radius: 3px;
- 583. - -moz-border-radius: 3px;
- 584. - }
- 585. -
- 586. - #ads_unions_content .table_label {
- 587. - min-width: 150px;
- 588. - max-width: 180px;
- 589. - color: rgb(102, 102, 102);
- 590. - padding: 0 10px 7px 0;
- 591. - vertical-align: top;
- 592. - word-wrap: break-word;
- 593. - }
- 594. - #ads_unions_content .table_value {
- 595. - padding: 0 0 7px 0;
- 596. - vertical-align: top;
- 597. - word-wrap: break-word;
- 598. - }
- 599. -
- 600. - #ads_unions_content.ad_help {
- 601. - padding: 0;
- 602. - }
- 603. -
- 604. - #ads_unions_content {
- 605. - vertical-align: top;
- 606. - }
- 607. -
- 608. - #ads_union_children,
- 609. - #ads_unions_budget,
- 610. - #ads_unions_budget_posts {
- 611. - padding-top: 20px;
- 612. - }
- 613. -
- 614. - #ads_union_children_graph {
- 615. - padding: 30px 0 15px 0;
- 616. - }
- 617. -
- 618. - #ads_union_children .row_div.control_label {
- 619. - padding-left: 0;
- 620. - }
- 621. -
- 622. - .ads_unions_box td.label {
- 623. - color: #777;
- 624. - padding: 5px 10px 5px 0px;
- 625. - text-align: right;
- 626. - }
- 627. - .ads_unions_box td.labeled {
- 628. - padding: 2px 0;
- 629. - }
- 630. - .ads_unions_box td.labeled_info {
- 631. - padding: 2px 0 2px 5px;
- 632. - }
- 633. -
- 634. - .ads_unions_box input {
- 635. - width: 150px;
- 636. - }
- 637. -
- 638. - .ads_unions_list table {
- 639. - border-collapse: collapse;
- 640. - border-left: 1px solid;
- 641. - border-right: 1px solid;
- 642. - width: 100%;
- 643. - }
- 644. -
- 645. - .ads_unions_list th,
- 646. - .ads_unions_list td {
- 647. - height: 32px;
- 648. - vertical-align: middle;
- 649. - }
- 650. -
- 651. - .ads_unions_list .checkbox_container td {
- 652. - height: 20px;
- 653. - }
- 654. -
- 655. - .ads_unions_list th {
- 656. - text-align: right;
- 657. - background-color: rgb(227, 233, 238);
- 658. - border: 1px solid;
- 659. - padding: 0;
- 660. - }
- 661. - .ads_table_header th th,
- 662. - .ads_table_header th th * {
- 663. - background-color: transparent !important;
- 664. - }
- 665. -
- 666. - .ads_unions_list th,
- 667. - .ads_unions_list th * {
- 668. - color: rgb(81, 103, 122);
- 669. - }
- 670. -
- 671. - .ads_unions_list td {
- 672. - text-align: right;
- 673. - }
- 674. -
- 675. - .ads_unions_list .column_date_view,
- 676. - .ads_unions_list .column_date_view *,
- 677. - .ads_unions_list .column_action_view,
- 678. - .ads_unions_list .column_action_view *,
- 679. - .ads_unions_list .column_access_view,
- 680. - .ads_unions_list .column_access_view *,
- 681. - .ads_unions_list .column_name_view,
- 682. - .ads_unions_list .column_name_view *,
- 683. - .ads_unions_list .column_name,
- 684. - .ads_unions_list .column_name *,
- 685. - .ads_unions_list .column_status,
- 686. - .ads_unions_list .column_status * {
- 687. - text-align: left;
- 688. - }
- 689. -
- 690. - .ads_unions_list td.column_name_view {
- 691. - max-width: 160px;
- 692. - }
- 693. -
- 694. - .ads_unions_list .table_footer td {
- 695. - background-color: rgb(246, 247, 249);
- 696. - border-top: 1px solid rgb(211, 219, 225);
- 697. - border-bottom: 1px solid rgb(211, 219, 225);
- 698. - }
- 699. -
- 700. - .ads_unions_list table,
- 701. - .ads_unions_list th,
- 702. - .ads_unions_list td {
- 703. - border-color: rgb(211, 219, 225);
- 704. - }
- 705. -
- 706. - .ads_unions_list th * {
- 707. - border: 0;
- 708. - padding: 0;
- 709. - height: auto;
- 710. - }
- 711. -
- 712. - .ads_unions_list th table {
- 713. - height: 100%;
- 714. - border: 0;
- 715. - }
- 716. -
- 717. - .ads_unions_list tr.ads_table_header th th {
- 718. - border-left: 1px solid rgb(239, 242, 245);
- 719. - white-space: nowrap;
- 720. - }
- 721. -
- 722. - .ads_unions_list tr.ads_table_header th.first_table_header,
- 723. - .ads_unions_list tr.ads_table_header th.first_table_header * {
- 724. - border-left: 0 none;
- 725. - }
- 726. -
- 727. - .ads_unions_list th th,
- 728. - .ads_unions_list td {
- 729. - padding: 0 8px;
- 730. - }
- 731. -
- 732. - .ads_unions_list th.first_table_header th,
- 733. - .ads_unions_list td.first_table_column {
- 734. - padding-left: 10px;
- 735. - }
- 736. -
- 737. - .ads_unions_list th.last_table_header th,
- 738. - .ads_unions_list td.last_table_column {
- 739. - padding-right: 10px;
- 740. - }
- 741. -
- 742. - .ads_unions_list td.even_row {
- 743. - background-color: #F0F2F4;
- 744. - }
- 745. -
- 746. - .ads_unions_table {
- 747. - margin-top: 7px;
- 748. - }
- 749. -
- 750. - .paginated_table .ads_unions_table {
- 751. - margin-top: 0px;
- 752. - }
- 753. -
- 754. - .ads_unions_list td.column_day_limit_view a,
- 755. - .ads_unions_list td.column_all_limit_view a,
- 756. - .ads_unions_list td.column_cost_per_click_view a {
- 757. - border-bottom: 1px dashed #2B587A;
- 758. - text-decoration: none;
- 759. - }
- 760. -
- 761. - tr.ads_union_empty_row td.ads_union_empty_cell {
- 762. - height: auto;
- 763. - }
- 764. -
- 765. - tr.ads_union_empty_row td.ads_union_empty_cell {
- 766. - text-align: center !important;
- 767. - color: #666666;
- 768. - line-height: 150%;
- 769. - background-color: #F7F7F7;
- 770. - padding: 15px 0;
- 771. - }
- 772. -
- 773. - .ads_unions_list_p .paginated_table_cell {
- 774. - text-align: right;
- 775. - }
- 776. -
- 777. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_date_view,
- 778. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_date_view *,
- 779. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_action_view,
- 780. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_action_view *,
- 781. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_access_view,
- 782. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_access_view *,
- 783. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_name_view,
- 784. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_name_view *,
- 785. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_name,
- 786. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_name *,
- 787. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_status,
- 788. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_status * {
- 789. - text-align: left;
- 790. - }
- 791. -
- 792. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_name_view,
- 793. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_name_view *,
- 794. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_name,
- 795. - .ads_unions_list_p .paginated_table .paginated_table_cell.column_name *,
- 796. - .paginated_table .paginated_table_cell.column_client_name,
- 797. - .paginated_table .paginated_table_cell.column_client_name *,
- 798. - .paginated_table .paginated_table_cell.column_campaign_name,
- 799. - .paginated_table .paginated_table_cell.column_campaign_name * {
- 800. - white-space: normal !important;
- 801. - }
- 802. -
- 803. - .ads_unions_list_p td.paginated_table_cell.column_name_view,
- 804. - .ads_unions_list_p td.paginated_table_cell.column_name {
- 805. - max-width: 160px;
- 806. - overflow: visible;
- 807. - }
- 808. - .ads_unions_list_p td.paginated_table_cell.column_date_view {
- 809. - min-width: 20%;
- 810. - }
- 811. - .ads_unions_list_p .paginated_table td.paginated_table_cell.column_day_limit_view a,
- 812. - .ads_unions_list_p .paginated_table td.paginated_table_cell.column_all_limit_view a,
- 813. - .ads_unions_list_p .paginated_table td.paginated_table_cell.column_cost_per_click_view a {
- 814. - border-bottom: 1px dashed #2B587A;
- 815. - text-decoration: none;
- 816. - }
- 817. -
- 818. - .ads_unions_list_p .paginated_table td.column_video_views_count_view {
- 819. - width: 1px;
- 820. - }
- 821. -
- 822. - tr.ads_union_empty_row td.ads_union_empty_cell {
- 823. - height: auto;
- 824. - }
- 825. -
- 826. - tr.ads_union_empty_row td.ads_union_empty_cell {
- 827. - text-align: center !important;
- 828. - color: #666666;
- 829. - line-height: 150%;
- 830. - background-color: #F7F7F7;
- 831. - padding: 15px 0;
- 832. - }
- 833. -
- 834. - /* Some navigation - begin */
- 835. -
- 836. - #ads_graph_navigation a.nav,
- 837. - #ads_demography_navigation a.nav {
- 838. - padding: 6px 6px 7px 11px;
- 839. - display: block;
- 840. - overflow: hidden;
- 841. - }
- 842. - #ads_graph_navigation a.nav:hover,
- 843. - #ads_demography_navigation a.nav:hover {
- 844. - background-color: #DAE1E8;
- 845. - text-decoration: none;
- 846. - }
- 847. - #ads_graph_navigation a.nav_selected,
- 848. - #ads_graph_navigation a.nav_selected:hover,
- 849. - #ads_demography_navigation a.nav_selected,
- 850. - #ads_demography_navigation a.nav_selected:hover {
- 851. - background-color: #6186AD;
- 852. - color: white;
- 853. - }
- 854. -
- 855. - /* Some navigation - end */
- 856. -
- 857. - a.ads_status_link,
- 858. - a.ads_inline_dropdown {
- 859. - background: none !important;
- 860. - border-bottom: 1px dashed #2B587A;
- 861. - padding-right: 0 !important;
- 862. - }
- 863. -
- 864. - .ads_main_notice {
- 865. - background-color: #F6F7F9;
- 866. - border: 1px solid #D8DFEA;
- 867. - padding: 10px;
- 868. - margin-bottom: 15px;
- 869. - line-height: 160%;
- 870. - }
- 871. -
- 872. - .ads_warning {
- 873. - background-color: #F9F6E7;
- 874. - border: 1px solid #D4BC4C;
- 875. - padding: 8px 11px;
- 876. - line-height: 160%;
- 877. - }
- 878. -
- 879. - .ads_warning_light {
- 880. - background-color: #FFFFFF;
- 881. - border: 1px solid #B9C4DA;
- 882. - padding: 8px 11px;
- 883. - }
- 884. -
- 885. - .ads_small_info {
- 886. - background: none repeat scroll 0 0 #F7F7F7;
- 887. - border: 1px solid #DAE1E8;
- 888. - font-size: 0.91em;
- 889. - margin-top: 10px;
- 890. - padding: 5px 10px;
- 891. - vertical-align: top;
- 892. - }
- 893. -
- 894. - #ads_change_budget_box .ads_warning {
- 895. - margin-top: 10px;
- 896. - }
- 897. -
- 898. - #ads_change_budget_box td {
- 899. - padding: 0px;
- 900. - }
- 901. -
- 902. - .ads_union_status_image {
- 903. - background: url("/images/icons/ad_status.gif?3") no-repeat scroll left top transparent;
- 904. - width: 5px;
- 905. - height: 5px;
- 906. - margin: 0 5px 1px 0;
- 907. - display: block;
- 908. -
- 909. - display: -moz-inline-stack;
- 910. - display: inline-block;
- 911. - _overflow: hidden;
- 912. - *zoom: 1;
- 913. - *display: inline;
- 914. - }
- 915. -
- 916. - .ads_union_status_image_on {
- 917. - background-position: left 0;
- 918. - }
- 919. - .ads_union_status_image_off {
- 920. - background-position: left -5px;
- 921. - }
- 922. - .ads_union_status_image_part_on {
- 923. - background-position: left -10px;
- 924. - }
- 925. - .ads_union_status_image_part_off {
- 926. - background-position: left -15px;
- 927. - }
- 928. - .ads_union_status_image_disapproved {
- 929. - background-position: left -20px;
- 930. - }
- 931. - .ads_union_status_image_deleted {
- 932. - background-position: left -25px;
- 933. - }
- 934. -
- 935. - .ads_status_image_span {
- 936. - background: url("/images/icons/ad_status_new.gif") no-repeat scroll left top transparent;
- 937. - width: 11px;
- 938. - height: 11px;
- 939. - margin: 5px 0px 3px 2px;
- 940. - display: block;
- 941. -
- 942. - display: -moz-inline-stack;
- 943. - display: inline-block;
- 944. - _overflow: hidden;
- 945. - *zoom: 1;
- 946. - *display: inline;
- 947. - }
- 948. -
- 949. - .dd_menu_header.ads_dd_header_popup .ads_status_image_span.status_on,
- 950. - .ads_status_image_span.status_on {
- 951. - background-position: left -0px;
- 952. - }
- 953. - .dd_menu_header.ads_dd_header_popup .ads_status_image_span.status_off,
- 954. - .ads_status_image_span.status_off {
- 955. - background-position: left -170px;
- 956. - }
- 957. - .dd_menu_header.ads_dd_header_popup .ads_status_image_span.status_pending,
- 958. - .ads_status_image_span.status_pending {
- 959. - background-position: left -157px;
- 960. - }
- 961. - .dd_menu_header.ads_dd_header_popup .ads_status_image_span.status_off_red,
- 962. - .ads_status_image_span.status_off_red {
- 963. - background-position: left -128px;
- 964. - }
- 965. - .dd_menu_header.ads_dd_header_popup .ads_status_image_span.status_deleted,
- 966. - .ads_status_image_span.status_deleted {
- 967. - background-position: left -183px;
- 968. - }
- 969. - .dd_menu_header.ads_dd_header_popup .ads_status_image_span.status_cross,
- 970. - .ads_status_image_span.status_cross {
- 971. - background-position: left -141px;
- 972. - }
- 973. -
- 974. - .dd_menu_header .ads_status_image_span.status_on {
- 975. - background-position: left -16px;
- 976. - }
- 977. - .dd_menu_header .ads_status_image_span.status_off {
- 978. - background-position: left -29px;
- 979. - }
- 980. - .dd_menu_header .ads_status_image_span.status_pending {
- 981. - background-position: left -69px;
- 982. - }
- 983. - .dd_menu_header .ads_status_image_span.status_off_red {
- 984. - background-position: left -29px;
- 985. - }
- 986. - .dd_menu_header .ads_status_image_span.status_deleted {
- 987. - background-position: left -41px;
- 988. - }
- 989. - .dd_menu_header .ads_status_image_span.status_cross {
- 990. - background-position: left -55px;
- 991. - }
- 992. -
- 993. - .dd_menu_body.ads_dd_wide .dd_menu_rows a .ads_status_image_span.status_on {
- 994. - background-position: left -85px;
- 995. - }
- 996. - .dd_menu_body.ads_dd_wide .dd_menu_rows a .ads_status_image_span.status_off {
- 997. - background-position: left -98px;
- 998. - }
- 999. - .dd_menu_body.ads_dd_wide .dd_menu_rows a .ads_status_image_span.status_deleted {
- 1000. - background-position: left -111px;
- 1001. - }
- 1002. -
- 1003. - .ads_unions_list tr.ads_table_header th.paginated_table td.paginated_table_cell.column_commit_date,
- 1004. - .ads_unions_list tr.ads_table_header th.paginated_table td.paginated_table_cell.column_commit_date * {
- 1005. - border-left: 0 none;
- 1006. - }
- 1007. -
- 1008. - #ads_unions_budget * {
- 1009. - text-align: left;
- 1010. - }
- 1011. -
- 1012. - #ads_general_info_status_selector {
- 1013. - border-bottom: 1px dashed #2B587A;
- 1014. - }
- 1015. -
- 1016. - table.ads_unions_content_label {
- 1017. - border-collapse: collapse;
- 1018. - }
- 1019. -
- 1020. - #ads_unions_content .ads_export_prefs .ads_export_date_row .table_label {
- 1021. - padding-top: 4px;
- 1022. - }
- 1023. - .ads_export_prefs .table_value {
- 1024. - width: 300px;
- 1025. - }
- 1026. -
- 1027. - #ads_unions_content .export_prefs_web .summary td {
- 1028. - padding-top: 10px !important;
- 1029. - }
- 1030. -
- 1031. - .ads_export_stats .ads_unions_table th.paginated_table td.paginated_table_cell.column_checked {
- 1032. - width: 34px;
- 1033. - }
- 1034. -
- 1035. - .ads_unions_list .checkbox_container table {
- 1036. - border: 0px;
- 1037. - }
- 1038. -
- 1039. - .ads_unions_table .hovered_header,
- 1040. - .ads_unions_table .hovered_header_hover {
- 1041. - cursor: pointer;
- 1042. - }
- 1043. - .ads_unions_table .hovered_header_hover {
- 1044. - background-color: #EFF2F5;
- 1045. - }
- 1046. -
- 1047. - .ads_inline_edit_remove_value {
- 1048. - margin-left: 5px;
- 1049. - white-space: nowrap;
- 1050. - }
- 1051. -
- 1052. - .ads_inline_edit_table {
- 1053. - border-collapse: collapse;
- 1054. - }
- 1055. - table.ads_inline_edit_table td {
- 1056. - padding: 0;
- 1057. - }
- 1058. - .ads_inline_fast_error_row {
- 1059. - display: none;
- 1060. - }
- 1061. - .ads_inline_fast_error {
- 1062. - background-color: #F9F6E7;
- 1063. - border: 1px solid #D4BC4C;
- 1064. - padding: 8px 11px;
- 1065. - margin-top: 5px;
- 1066. - }
- 1067. -
- 1068. - .ads_inline_recommended_cost_text {
- 1069. - font-size: 0.91em;
- 1070. - color: #777777;
- 1071. - display: none;
- 1072. - }
- 1073. -
- 1074. - .ads_moder_comment_rules_wrap ul {
- 1075. - list-style: square outside none;
- 1076. - color: #758EAC;
- 1077. - margin: 11px 0 0 0;
- 1078. - }
- 1079. - .ads_moder_comment_rules_wrap span {
- 1080. - color: black;
- 1081. - }
- 1082. - .ads_moder_comment_rules_separator {
- 1083. - height: 11px;
- 1084. - }
- 1085. -
- 1086. - #ads_admin_box_wrapper a:hover {
- 1087. - text-decoration: underline;
- 1088. - }
- 1089. -
- 1090. - .ads_admin_table_cell {
- 1091. - border-bottom: 1px solid #DAE2E8;
- 1092. - }
- 1093. -
- 1094. - .admin_table_cell_last {
- 1095. - border-bottom: none;
- 1096. - }
- 1097. -
- 1098. - .ads_admin_box_label {
- 1099. - color: #777777;
- 1100. - text-align: right;
- 1101. - width: 125px;
- 1102. - padding-right: 10px;
- 1103. - }
- 1104. - .ads_admin_box_labeled {
- 1105. - width: 270px;
- 1106. - }
- 1107. -
- 1108. - .ads_general_info_hidden {
- 1109. - display: none;
- 1110. - }
- 1111. -
- 1112. - .ads_general_info .table_large_text {
- 1113. - width: 400px;
- 1114. - }
- 1115. -
- 1116. - #ads_unions_content h4 span {
- 1117. - font-weight: bold
- 1118. - }
- 1119. -
- 1120. - .ads_users_stats_dark {
- 1121. - background-color: #597DA3;
- 1122. - }
- 1123. -
- 1124. - .ads_users_stats_light {
- 1125. - background-color: #DAE1E8;
- 1126. - }
- 1127. -
- 1128. - .ads_users_stats_bars_title {
- 1129. - padding-bottom: 16px;
- 1130. - color: #45688E;
- 1131. - font-weight: bold;
- 1132. - }
- 1133. -
- 1134. - .ads_users_stats_bar_label {
- 1135. - height: 30px;
- 1136. - text-align: right;
- 1137. - padding-right: 16px;
- 1138. - padding-top: 2px;
- 1139. - vertical-align: top;
- 1140. - color: #45688E;
- 1141. - font-weight: bold;
- 1142. - }
- 1143. - .ads_users_stats_bar_wrap table {
- 1144. - border: 0px;
- 1145. - border-collapse: collapse;
- 1146. - }
- 1147. - .ads_users_stats_bar_wrap table td {
- 1148. - padding: 0px;
- 1149. - }
- 1150. - .ads_users_stats_bar_wrap {
- 1151. - height: 30px;
- 1152. - vertical-align: top;
- 1153. - }
- 1154. - .ads_users_stats_bar_wrap table td.ads_users_stats_bar_value {
- 1155. - padding-left: 11px;
- 1156. - }
- 1157. - .ads_users_stats_bar {
- 1158. - -moz-border-radius: 0 3px 3px 0;
- 1159. - -webkit-border-radius: 0 3px 3px 0;
- 1160. - -khtml-border-radius: 0 3px 3px 0;
- 1161. - border-radius: 0 3px 3px 0;
- 1162. - height: 17px;
- 1163. - }
- 1164. -
- 1165. - #ads_demography_wrap .summary_right .summary_tab2 {
- 1166. - background-color: transparent;
- 1167. - }
- 1168. -
- 1169. - .ads_dropdown_menu_scrollbar {
- 1170. - position: absolute;
- 1171. - z-index: 1500;
- 1172. - background-color: #000;
- 1173. -
- 1174. - opacity: 0.4;
- 1175. - -moz-opacity: 0.4;
- 1176. - filter: alpha(opacity=40);
- 1177. -
- 1178. - border-radius: 3px;
- 1179. - -webkit-border-radius: 3px;
- 1180. - -moz-border-radius: 3px;
- 1181. - -khtml-border-radius: 3px;
- 1182. - }
- 1183. - .ads_dropdown_menu_scrollbar:hover,
- 1184. - .ads_dropdown_menu_scrollbar.hovered {
- 1185. - opacity: 0.6;
- 1186. - -moz-opacity: 0.6;
- 1187. - filter: alpha(opacity=60);
- 1188. - }
- 1189. -
- 1190. - #ads_admin_box_wrapper h2 {
- 1191. - padding: 0;
- 1192. - margin: 0;
- 1193. - border: none;
- 1194. - }
- 1195. -
- 1196. - #ads_reqs_edit td.ads_req_label {
- 1197. - color: #666666;
- 1198. - text-align: right;
- 1199. - vertical-align: top;
- 1200. - padding-top: 5px;
- 1201. - }
- 1202. -
- 1203. - #ads_reqs_edit td.ads_req_right {
- 1204. - width: 100px;
- 1205. - }
- 1206. -
- 1207. - #ads_reqs_edit_form input.ads_req_edit,
- 1208. - #ads_reqs_edit_form textarea.ads_req_edit {
- 1209. - margin: 0px;
- 1210. - width: 250px;
- 1211. - }
- 1212. -
- 1213. - #ads_legal_info_box div {
- 1214. - padding: 8px 11px;
- 1215. - border: 1px solid #C0CAD5;
- 1216. - }
- 1217. -
- 1218. - /*
- 1219. - * About section
- 1220. - */
- 1221. -
- 1222. - .ads_help_section.section_wrap {
- 1223. - padding: 20px 25px 25px 26px;
- 1224. - line-height: 130%;
- 1225. - }
- 1226. -
- 1227. - .ads_help_section .header {
- 1228. - font-size: 1.09em;
- 1229. - margin: 0px 0px 20px 1px;
- 1230. - border: none;
- 1231. - }
- 1232. - .ads_help_section .sub_header {
- 1233. - border-bottom: 1px solid #DAE1E8;
- 1234. - font-size: 1em;
- 1235. - margin-bottom: 10px;
- 1236. - padding-bottom: 2px;
- 1237. - }
- 1238. - .ads_help_section .sub_header,
- 1239. - .ads_help_section .header {
- 1240. - color: #45688E;
- 1241. - font-weight: bold;
- 1242. - }
- 1243. -
- 1244. - .ads_help_section .listing li {
- 1245. - padding-top: 2px;
- 1246. - }
- 1247. -
- 1248. - .ads_help_section .listing,
- 1249. - .ads_help_section ol {
- 1250. - padding-bottom: 0px;
- 1251. - margin-bottom: 0px;
- 1252. - }
- 1253. -
- 1254. - .ads_help_section .par_divider {
- 1255. - margin-bottom: 31px;
- 1256. - }
- 1257. -
- 1258. - .ads_help_section .emph_link {
- 1259. - margin-left: 26px;
- 1260. - }
- 1261. -
- 1262. - #unions_navigation {
- 1263. - vertical-align: top;
- 1264. - }
- 1265. -
- 1266. - #unions_navigation {
- 1267. - width: 150px;
- 1268. - padding: 12px 12px 12px 0;
- 1269. - }
- 1270. -
- 1271. - #unions_navigation .edit_button_wrap {
- 1272. - padding-bottom: 10px;
- 1273. - }
- 1274. -
- 1275. - #unions_navigation .nav_separator {
- 1276. - border-bottom: 1px solid rgb(211, 219, 225);
- 1277. - height: 1px;
- 1278. - overflow: hidden;
- 1279. - margin: 7px 0px 8px 0;
- 1280. - }
- 1281. -
- 1282. - #unions_navigation a.nav {
- 1283. - padding: 6px 6px 7px 11px;
- 1284. - display: block;
- 1285. - overflow: hidden;
- 1286. - max-width: 133px;
- 1287. - word-wrap: break-word;
- 1288. - }
- 1289. - #unions_navigation a.nav:hover {
- 1290. - background-color: #E1E7ED;
- 1291. - text-decoration: none;
- 1292. - }
- 1293. - #unions_navigation a.nav_selected,
- 1294. - #unions_navigation a.nav_selected:hover {
- 1295. - background-color: #6186AD;
- 1296. - color: white;
- 1297. - }
- 1298. -
- 1299. -
- 1300. - #unions_navigation.ads_unions_navigation_about {
- 1301. - background-color: #F7F7F7;
- 1302. - border-left: 1px solid #DAE1E8;
- 1303. - padding: 14px 10px;
- 1304. - }
- 1305. -
- 1306. - #unions_navigation.ads_unions_navigation_about .nav {
- 1307. - border-color: #F7F7F7;
- 1308. - }
- 1309. -
- 1310. - #unions_navigation.ads_unions_navigation_about .nav_selected {
- 1311. - border-color: #517295;
- 1312. - }
- 1313. -
- 1314. - .ads_unions_navigation_about .ad_box_preview {
- 1315. - border: 1px solid #DCE3E9
- 1316. - }
- 1317. -
- 1318. - #ads_contacts_form {
- 1319. - margin: 20px 0 0 0;
- 1320. - }
- 1321. - #ads_contacts_form .label_slide {
- 1322. - vertical-align: top;
- 1323. - }
- 1324. - #ads_contacts_form .label {
- 1325. - width: 100px;
- 1326. - color: #555;
- 1327. - padding: 4px 10px 0 0;
- 1328. - text-align: right;
- 1329. - vertical-align: top;
- 1330. - }
- 1331. - #ads_contacts_form .labeled {
- 1332. - padding-bottom: 10px;
- 1333. - }
- 1334. - #ads_contacts_form .row_checkbox .labeled {
- 1335. - padding-bottom: 6px;
- 1336. - }
- 1337. - #ads_contacts_form .row_checkbox_prev .labeled {
- 1338. - padding-bottom: 8px;
- 1339. - }
- 1340. - #ads_contacts_form .row_checkbox_last .labeled {
- 1341. - padding-bottom: 8px;
- 1342. - }
- 1343. - #ads_contacts_form td.label_slide {
- 1344. - overflow: hidden;
- 1345. - }
- 1346. - #ads_contacts_form div.label_slide {
- 1347. - height: 0;
- 1348. - }
- 1349. - #ads_contacts_form .checkbox_wrap {
- 1350. - margin: -5px 0;
- 1351. - }
- 1352. - #ads_contacts_form input.txt {
- 1353. - width: 242px;
- 1354. - }
- 1355. - #ads_contacts_form textarea.txt {
- 1356. - width: 242px;
- 1357. - height: 40px;
- 1358. - }
- 1359. - #ads_contacts_form textarea.txt#message {
- 1360. - height: 90px;
- 1361. - }
- 1362. - #ads_contacts_form .msg {
- 1363. - background-color: #f9f6e7;
- 1364. - border-color: #c3b988;
- 1365. - font-weight: normal;
- 1366. - }
- 1367. -
- 1368. - .ads_contacts_nonresident_message {
- 1369. - padding: 7px 0 20px 0;
- 1370. - }
- 1371. -
- 1372. - .wk_ads_intro .wk_wiki_content {
- 1373. - font-size: 1em;
- 1374. - line-height: 100%;
- 1375. - }
- 1376. - .wk_ads_intro #wk_content {
- 1377. - width: 564px;
- 1378. - }
- 1379. - .wk_ads_intro #wk_summary {
- 1380. - width: 400px;
- 1381. - }
- 1382. -
- 1383. - .wk_ads_intro #ads_contacts_form .label {
- 1384. - width: 140px;
- 1385. - padding-top: 9px;
- 1386. - }
- 1387. -
- 1388. - .wk_ads_intro #ads_contacts_form input.txt,
- 1389. - .wk_ads_intro #ads_contacts_form textarea.txt {
- 1390. - width: 254px;
- 1391. - height: 17px;
- 1392. - line-height: 17px;
- 1393. - padding: 5px 6px 6px 10px;
- 1394. - }
- 1395. - @-moz-document url-prefix() {
- 1396. - .wk_ads_intro #ads_contacts_form input.txt,
- 1397. - .wk_ads_intro #ads_contacts_form textarea.txt {
- 1398. - padding-left: 9px;
- 1399. - width: 255px;
- 1400. - }
- 1401. - }
- 1402. - .wk_ads_intro #ads_contacts_form textarea.txt {
- 1403. - height: 52px;
- 1404. - }
- 1405. - .wk_ads_intro #ads_contacts_form textarea.txt#message {
- 1406. - height: 90px;
- 1407. - }
- 1408. -
- 1409. - .wk_ads_intro .ads_contacts_nonresident_message {
- 1410. - line-height: 160%;
- 1411. - }
- 1412. -
- 1413. -
- 1414. - /* Multi dropdown menu - begin */
- 1415. -
- 1416. - a.ads_dd_menu_item_checkbox_on,
- 1417. - a.ads_dd_menu_item_checkbox_off {
- 1418. - padding-left: 22px !important;
- 1419. - background-image: none !important;
- 1420. - background-position: 4px 2px !important;
- 1421. - }
- 1422. - a.ads_dd_menu_item_checkbox_on {
- 1423. - background-image: url("/images/dropdead_check.gif") !important;
- 1424. - }
- 1425. -
- 1426. - /* Multi dropdown menu - end */
- 1427. -
- 1428. - .ads_paginated_table_name {
- 1429. - overflow: hidden;
- 1430. - white-space: nowrap;
- 1431. - }
- 1432. -
- 1433. - .ad_new_user td.label {
- 1434. - text-align: right;
- 1435. - padding: 6px 15px 6px 0;
- 1436. - width: 120px;
- 1437. - color: gray;
- 1438. - }
- 1439. - .ad_new_user td.labeled input {
- 1440. - width: 160px;
- 1441. - }
- 1442. -
- 1443. - #ads_page_simple .ads_reg_row {
- 1444. - height: 30px;
- 1445. - }
- 1446. - #ads_page_simple .ads_reg_label {
- 1447. - width: 231px;
- 1448. - float: left;
- 1449. - text-align: right;
- 1450. - color: #777777;
- 1451. - padding: 4px 10px 0 0;
- 1452. - }
- 1453. - #ads_page_simple .ads_reg_labeled {
- 1454. - float: left;
- 1455. - }
- 1456. - #ads_page_simple .ads_reg_labeled_input {
- 1457. - margin: 0;
- 1458. - }
- 1459. - #ads_page_simple .ads_reg_labeled input#first_name,
- 1460. - #ads_page_simple .ads_reg_labeled input#last_name,
- 1461. - #ads_page_simple .ads_reg_labeled input#regemail,
- 1462. - #ads_page_simple .ads_reg_labeled input#regpass {
- 1463. - width: 217px;
- 1464. - }
- 1465. -
- 1466. - .box_body .ads_disapproved_message {
- 1467. - line-height: 150%;
- 1468. - }
- 1469. -
- 1470. - .ads_wiki_wrap {
- 1471. - line-height: 160%;
- 1472. - }
- 1473. -
- 1474. - .ads_wiki_bonus {
- 1475. - padding-bottom: 10px;
- 1476. - }
- 1477. -
- 1478. - #ads_bonus_activation_form .ads_unions_content_label td {
- 1479. - padding: 0 0 4px 0;
- 1480. - }
- 1481. -
- 1482. - #ads_unions_content .payments_systems_container {
- 1483. - padding: 7px 102px 0 50px;
- 1484. - }
- 1485. -
- 1486. - #ads_unions_content .payments_systems_container .ps_desc_short {
- 1487. - padding-right: 120px;
- 1488. - }
- 1489. -
- 1490. - #ads_unions_content .payments_systems_container .term_info {
- 1491. - min-height: 24px;
- 1492. - }
- 1493. -
- 1494. - #ads_unions_content .payments_landing div {
- 1495. - margin-bottom: 20px;
- 1496. - }
- 1497. -
- 1498. - #ads_retargeting_groups_table {
- 1499. - margin-top: 15px;
- 1500. - }
- 1501. - #ads_retargeting_groups_table .column_action_view {
- 1502. - width: 100px;
- 1503. - white-space: nowrap;
- 1504. - }
- 1505. - #ads_retargeting_groups .ads_retargeting_controls {
- 1506. - padding-top: 15px;
- 1507. - }
- 1508. - .ads_retargeting_box {
- 1509. - line-height: 160%;
- 1510. - }
- 1511. - .ads_retargeting_box_text {
- 1512. - padding-bottom: 10px;
- 1513. - }
- 1514. - .ads_retargeting_box td.label {
- 1515. - color: #777;
- 1516. - padding: 5px 10px 5px 0px;
- 1517. - text-align: right;
- 1518. - width: 100px;
- 1519. - }
- 1520. - .ads_retargeting_box td.labeled {
- 1521. - padding: 2px 0;
- 1522. - }
- 1523. - .ads_retargeting_box td.labeled_info {
- 1524. - padding: 2px 0 2px 5px;
- 1525. - }
- 1526. - .ads_retargeting_box input {
- 1527. - width: 190px;
- 1528. - }
- 1529. - #ads_retargeting_box_error {
- 1530. - margin-bottom: 10px;
- 1531. - display: none;
- 1532. - }
- 1533. - .ads_retargeting_box .box_msg {
- 1534. - margin-bottom: 10px;
- 1535. - font-weight: normal;
- 1536. - }
- 1537. - .ads_retargeting_box_notice {
- 1538. - font-size: 0.91em;
- 1539. - color: #777;
- 1540. - }
- 1541. - #retargeting_group_pixel {
- 1542. - background-color: #F2F2F2;
- 1543. - height: 110px;
- 1544. - width: 245px;
- 1545. - }
- 1546. - .ads_retargeting_text {
- 1547. - line-height: 150%;
- 1548. - }
- 1549. -
- 1550. - .ads_settings_notifacations {
- 1551. - margin: 10px 0 0 10px;
- 1552. - border-collapse: collapse;
- 1553. - }
- 1554. - .ads_settings_notifacations th,
- 1555. - .ads_settings_notifacations td {
- 1556. - padding: 0 5px;
- 1557. - text-align: center;
- 1558. - }
- 1559. - td.ads_settings_notifacations_label {
- 1560. - padding: 0 30px 0 0;
- 1561. - text-align: left;
- 1562. - }
- 1563. - .ads_settings_notifacations .checkbox_container {
- 1564. - margin: 0 auto;
- 1565. - }
- ------
- Файл - ads.js (Старый размер - 89391 | Новый - 0):
- 0. - var Ads = {};
- 1. -
- 2. - Ads.init = function() {
- 3. - showBackLink();
- 4. - }
- 5. -
- 6. - Ads.initOfficesMenu = function(event) {
- 7. -
- 8. - if (!window.DropdownMenu || !cur.mainNavigationOfficesItems) {
- 9. - return;
- 10. - }
- 11. -
- 12. - if (cur.navigationOficesMenu) {
- 13. - return;
- 14. - }
- 15. -
- 16. - ge('ads_navigation_offices_menu').removeAttribute('onmouseover');
- 17. -
- 18. - function hideMenu() {
- 19. - cur.navigationOficesMenu.hide();
- 20. - }
- 21. -
- 22. - var realLocation = '';
- 23. - if (location.hash.indexOf('#/') != -1 || location.hash.indexOf('#!') != -1) {
- 24. - realLocation = location.hash.replace('#/', '').replace('#!', '');
- 25. - } else {
- 26. - realLocation = location.pathname + location.search;
- 27. - }
- 28. -
- 29. - var unionId;
- 30. - var unionIdReal;
- 31. - var unionIdParam = '';
- 32. - var curItems = [];
- 33. - for (var i in cur.mainNavigationOfficesItems) {
- 34. - curItems[i] = {};
- 35. - curItems[i].onClick = hideMenu;
- 36. - for (var j in cur.mainNavigationOfficesItems[i]) {
- 37. - curItems[i][j] = cur.mainNavigationOfficesItems[i][j];
- 38. - }
- 39. - if (curItems[i].i == 'all') {
- 40. - curItems[i].h = "/ads?act=offices_list";
- 41. - } else {
- 42. - unionId = '';
- 43. - unionIdReal = intval(curItems[i].i);
- 44. - unionIdParam = '';
- 45. - if (curItems[i].i.indexOf('default') == -1) {
- 46. - unionId = unionIdReal;
- 47. - unionIdParam = "&union_id=" + unionIdReal;
- 48. - }
- 49. -
- 50. - var link = "/ads?act=office" + unionIdParam;
- 51. - if (!unionIdReal) {
- 52. - link = "/ads?act=no_office";
- 53. - } else if (cur.getOfficeLink) {
- 54. - link = cur.getOfficeLink(unionId);
- 55. - } else if (realLocation.match(/act=budget(&|$)/)) {
- 56. - link = "/ads?act=budget" + unionIdParam;
- 57. - } else if (realLocation.match(/act=export_stats(&|$)/)) {
- 58. - link = "/ads?act=export_stats" + unionIdParam;
- 59. - } else if (realLocation.match(/act=settings(&|$)/)) {
- 60. - link = "/ads?act=settings" + unionIdParam;
- 61. - }
- 62. -
- 63. - curItems[i].h = link;
- 64. - }
- 65. - }
- 66. -
- 67. - var options = {
- 68. - title: '<span id="ads_navigation_dd_menu_header_text">' + ge('ads_navigation_offices_menu_text').innerHTML + '</span>',
- 69. - containerClass: 'ads_navigation_dd_menu_header_wrap',
- 70. - target: ge('ads_navigation_offices_menu'),
- 71. - showHover: false,
- 72. - updateTarget: false,
- 73. - onSelect: function(e) {
- 74. - }
- 75. - };
- 76. - cur.navigationOficesMenu = new DropdownMenu(curItems, options);
- 77. - cur.destroy.push(function(){ cur.navigationOficesMenu.destroy(); });
- 78. - }
- 79. -
- 80. - Ads.lock = function(lockKey, onLock, onUnlock) {
- 81. - if (!cur.locks) {
- 82. - cur.locks = {};
- 83. - }
- 84. - if (cur.locks[lockKey]) {
- 85. - return false;
- 86. - }
- 87. - cur.locks[lockKey] = {onLock: onLock, onUnlock: onUnlock};
- 88. - if (isFunction(cur.locks[lockKey].onLock)) {
- 89. - cur.locks[lockKey].onLock();
- 90. - }
- 91. - return true;
- 92. - }
- 93. -
- 94. - Ads.unlock = function(lockKey) {
- 95. - if (!cur.locks) {
- 96. - cur.locks = {};
- 97. - }
- 98. - if (cur.locks[lockKey] && isFunction(cur.locks[lockKey].onUnlock)) {
- 99. - cur.locks[lockKey].onUnlock();
- 100. - }
- 101. - delete cur.locks[lockKey];
- 102. - }
- 103. -
- 104. - Ads.simpleAjax = function(url, elem) {
- 105. - if (elem) {
- 106. - var elemRect = elem.getBoundingClientRect();
- 107. - var imgTop = (elemRect.bottom - elemRect.top - 8) / 2;
- 108. - var span = ce('span', {}, {position: 'relative'})
- 109. - var img = ce('img', {src:'/images/upload.gif'}, {position: 'absolute', top: imgTop + 'px'});
- 110. - span.appendChild(img);
- 111. - elem.appendChild(span);
- 112. - }
- 113. -
- 114. - ajax.post(url, {}, {onDone: onComplete, onFail: onComplete});
- 115. - function onComplete(response) {
- 116. - if (elem) {
- 117. - elem.removeChild(span);
- 118. - }
- 119. - if (response && response.html) {
- 120. - var boxOptions = {};
- 121. - boxOptions.title = '���������';
- 122. - boxOptions.onHide = nav.reload;
- 123. - showFastBox(boxOptions, response.html);
- 124. - } else {
- 125. - nav.reload();
- 126. - }
- 127. - return true;
- 128. - }
- 129. - }
- 130. -
- 131. - Ads.escapeValue = function(value) {
- 132. - return value.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
- 133. - }
- 134. -
- 135. - Ads.onInputEvent = function(event, func) {
- 136. - if (event.keyCode == KEY.RETURN) {
- 137. - func();
- 138. - return false;
- 139. - }
- 140. - return true;
- 141. - }
- 142. -
- 143. - Ads.onSubLinkEvent = function(event) {
- 144. - event = normEvent(event);
- 145. - var elem = event.target
- 146. - var newLink = elem.getAttribute('href_');
- 147. - if (!newLink) {
- 148. - return;
- 149. - }
- 150. - var linkElem = elem;
- 151. - while (linkElem && linkElem.nodeName !== 'A') {
- 152. - linkElem = linkElem.parentNode;
- 153. - }
- 154. - if (!linkElem) {
- 155. - return;
- 156. - }
- 157. - if (event.type === 'mouseover') {
- 158. - elem.setAttribute('href_old', linkElem.href);
- 159. - linkElem.href = newLink;
- 160. - } else if (event.type === 'mouseout') {
- 161. - var oldLink = elem.getAttribute('href_old');
- 162. - if (oldLink) {
- 163. - linkElem.href = oldLink;
- 164. - } else {
- 165. - linkElem.removeAttribute('href');
- 166. - }
- 167. - }
- 168. - }
- 169. -
- 170. - Ads.onBoxFail = function(message) {
- 171. - if (!message) {
- 172. - message = getLang('global_unknown_error');
- 173. - }
- 174. - setTimeout(function(){
- 175. - showFastBox(getLang('ads_error_box_title'), message);
- 176. - }, 1);
- 177. - return true;
- 178. - }
- 179. -
- 180. - Ads.setLoginHandlers = function(onLoginDoneNew, onLoginFailedNew) {
- 181. - var restoreOnLoginDone = function(handler) {
- 182. - if (cur.onLoginDoneWindowOld && window.onLoginDone == handler) {
- 183. - window.onLoginDone = cur.onLoginDoneWindowOld;
- 184. - delete cur.onLoginDoneWindowOld;
- 185. - }
- 186. - }
- 187. - var restoreOnLoginFailed = function(handler) {
- 188. - if (cur.onLoginFailedWindowOld && window.onLoginFailed == handler) {
- 189. - window.onLoginFailed = cur.onLoginFailedWindowOld;
- 190. - delete cur.onLoginFailedWindowOld;
- 191. - }
- 192. - }
- 193. -
- 194. - if (onLoginDoneNew) {
- 195. - if (window.onLoginDone != onLoginDoneNew) {
- 196. - cur.onLoginDoneWindowOld = window.onLoginDone;
- 197. - window.onLoginDone = onLoginDoneNew;
- 198. - cur.destroy.push(restoreOnLoginDone.pbind(onLoginDoneNew));
- 199. - }
- 200. - } else {
- 201. - restoreOnLoginDone(window.onLoginDone);
- 202. - }
- 203. -
- 204. - if (onLoginFailedNew) {
- 205. - if (window.onLoginFailed != onLoginFailedNew) {
- 206. - cur.onLoginFailedWindowOld = window.onLoginFailed;
- 207. - window.onLoginFailed = onLoginFailedNew;
- 208. - cur.destroy.push(restoreOnLoginFailed.pbind(onLoginFailedNew));
- 209. - }
- 210. - } else {
- 211. - restoreOnLoginFailed(window.onLoginFailed);
- 212. - }
- 213. - }
- 214. -
- 215. - Ads.scrollToError = function(errorElem) {
- 216. - errorElem = ge(errorElem);
- 217. - var scrollY = scrollGetY();
- 218. - var errorY = getXY(errorElem)[1];
- 219. - if (errorY < scrollY || errorY > (scrollY + lastWindowHeight / 2)) {
- 220. - errorY -= 15;
- 221. - scrollToY(errorY);
- 222. - }
- 223. - }
- 224. -
- 225. - Ads.initFixed = function(elemWrap) {
- 226. - elemWrap = ge(elemWrap);
- 227. - if (!elemWrap) return;
- 228. - var elemFixed = elemWrap.firstChild;
- 229. - if (!elemFixed) return;
- 230. -
- 231. - var scrolledNode = browser.msie6 ? pageNode : window;
- 232. - addEvent(scrolledNode, 'scroll', onScroll);
- 233. - cur.destroy.push(function() { removeEvent(scrolledNode, 'scroll', onScroll); });
- 234. -
- 235. - var poistionTop = 20;
- 236. -
- 237. - var elemWrapSize = getSize(elemWrap);
- 238. - setStyle(elemWrap, {width: elemWrapSize[0] + 'px', height: elemWrapSize[1] + 'px'});
- 239. -
- 240. - onScroll();
- 241. -
- 242. - function onScroll() {
- 243. - var elemWrapXY = getXY(elemWrap);
- 244. - var scrollY = scrollGetY();
- 245. - if (scrollY + poistionTop < elemWrapXY[1]) {
- 246. - setStyle(elemFixed, {position: 'static', top: 'auto', left: 'auto'});
- 247. - } else {
- 248. - setStyle(elemFixed, {position: 'fixed', top: poistionTop, left: elemWrapXY[0]});
- 249. - }
- 250. - }
- 251. - }
- 252. -
- 253. - Ads.initIntroPage = function(widgetParamsMore) {
- 254. - var widgetParams = {}
- 255. - widgetParams.mode = 2;
- 256. - widgetParams.width = 212;
- 257. - widgetParams.height = 340;
- 258. - widgetParams.no_head = 1;
- 259. - extend(widgetParams, widgetParamsMore);
- 260. - VK.Widgets.Group('ads_intro_news_widget', widgetParams, 19542789);
- 261. - }
- 262. -
- 263. - //////////////////////////////////////////////////////////////////////
- 264. - // OLD
- 265. - //////////////////////////////////////////////////////////////////////
- 266. -
- 267. - Ads.updateUnionName = function(unionId, unionName) {
- 268. - var elemsTitle = geByClass('title_union_name_' + unionId);
- 269. - for (var i in elemsTitle) {
- 270. - elemsTitle[i].innerHTML = Ads.escapeValue(unionName);
- 271. - }
- 272. -
- 273. - var elemNavigation = ge('ads_navigation_union_' + unionId);
- 274. - if (elemNavigation) {
- 275. - unionName = replaceEntities(unionName);
- 276. - unionName = (unionName.length > 40 ? unionName.substr(0, 40) + '...' : unionName);
- 277. - elemNavigation.innerHTML = Ads.escapeValue(unionName);
- 278. - }
- 279. -
- 280. - var elemGeneralInfoHeader = ge('general_info_header_name_' + unionId);
- 281. - if (elemGeneralInfoHeader) {
- 282. - elemGeneralInfoHeader.innerHTML = Ads.escapeValue(unionName);
- 283. - }
- 284. - }
- 285. -
- 286. - Ads.openUnionsGeneralInfoBox = function(unionId, params) {
- 287. - var ajaxParams = {};
- 288. - ajaxParams.union_id = unionId;
- 289. - ajaxParams = extend({}, ajaxParams, params);
- 290. -
- 291. - var showOptions = {params: {}};
- 292. - showOptions.onFail = Ads.onBoxFail;
- 293. - showOptions.params.width = 300;
- 294. -
- 295. - showBox('/ads?act=a_unions_general_info_box', ajaxParams, showOptions);
- 296. - }
- 297. -
- 298. - Ads.openUnionCreateBox = function(unionId) {
- 299. - var ajaxParams = {}
- 300. - ajaxParams.union_id = unionId;
- 301. -
- 302. - var showOptions = {params: {}};
- 303. - showOptions.onFail = Ads.onBoxFail;
- 304. - showOptions.params.width = 250;
- 305. -
- 306. - showBox('/ads?act=a_union_create_box', ajaxParams, showOptions);
- 307. - }
- 308. -
- 309. - Ads.openDeleteUnionBox = function(unionType, unionId, hash, lock, unlock, updateStatus, newclass) {
- 310. - var boxTitle = '';
- 311. - var boxContent = '';
- 312. - switch (unionType) {
- 313. - case 'ad':
- 314. - boxTitle = getLang('ads_archive_box_ad_title');
- 315. - boxContent = getLang('ads_archive_box_ad_warning');
- 316. - break;
- 317. - case 'campaign':
- 318. - boxTitle = getLang('ads_archive_box_campaign_title');
- 319. - boxContent = getLang('ads_archive_box_campaign_warning');
- 320. - break;
- 321. - case 'client':
- 322. - boxTitle = getLang('ads_archive_box_client_title');
- 323. - boxContent = getLang('ads_archive_box_client_warning');
- 324. - break;
- 325. - }
- 326. -
- 327. - var boxOptions = {};
- 328. - boxOptions.title = boxTitle;
- 329. - boxOptions.bodyStyle = 'line-height: 160%;';
- 330. -
- 331. - cur.deleteConfirmBox = new MessageBox();
- 332. - cur.deleteConfirmBox.setOptions(boxOptions);
- 333. - cur.deleteConfirmBox.content(boxContent);
- 334. - cur.deleteConfirmBox.removeButtons();
- 335. - cur.deleteConfirmBox.addButton(getLang('box_cancel'), false, 'no');
- 336. - cur.deleteConfirmBox.addButton(getLang('ads_archive_box_action'), function() { Ads.deleteUnion(unionType, unionId, hash, lock, unlock, updateStatus, newclass); });
- 337. - cur.deleteConfirmBox.setControlsText('<img id="delete_union_progress" src="/images/upload.gif" style="top: 1px; display: none;">');
- 338. - cur.deleteConfirmBox.show();
- 339. - }
- 340. -
- 341. - Ads.deleteUnion = function(unionType, unionId, hash, lock, unlock, updateStatus, newclass) {
- 342. - if (!lockDeletion()) {
- 343. - return;
- 344. - }
- 345. -
- 346. - var ajaxParams = {};
- 347. - ajaxParams.union_id = unionId;
- 348. - ajaxParams.hash = hash;
- 349. - if (newclass) ajaxParams.newclass = 1;
- 350. -
- 351. - ajax.post('/ads?act=a_union_delete', ajaxParams, {onDone: onRequestComplete, onFail: onRequestComplete});
- 352. -
- 353. - function onRequestComplete(response) {
- 354. - unlockDeletion();
- 355. - if (!isObject(response) || response.error) {
- 356. - if (!isObject(response)) {
- 357. - showMessage(getLang('ads_error_unexpected_error_try_later'));
- 358. - } else {
- 359. - showMessage(response.error);
- 360. - }
- 361. - return true;
- 362. - }
- 363. - if (response && (response.ok || newclass == 2)) {
- 364. - var completeMessage = '';
- 365. - switch (unionType) {
- 366. - case 'ad': completeMessage = getLang('ads_archive_box_ad_complete'); break;
- 367. - case 'campaign': completeMessage = getLang('ads_archive_box_campaign_complete'); break;
- 368. - case 'client': completeMessage = getLang('ads_archive_box_client_complete'); break;
- 369. - }
- 370. - if (updateStatus) {
- 371. - if (newclass == 2) {
- 372. - updateStatus(response);
- 373. - } else {
- 374. - updateStatus(response.status, response.status_class, response.status_type, response.status_variants);
- 375. - }
- 376. - } else {
- 377. - showMessage(completeMessage, true, function() { nav.reload(); }, unionType);
- 378. - }
- 379. - }
- 380. - return true;
- 381. - }
- 382. -
- 383. - function showMessage(message, isSuccess, onHide, unionType) {
- 384. - var boxTitle = '';
- 385. - switch (unionType) {
- 386. - case 'ad': boxTitle = getLang('ads_archive_box_ad_title'); break;
- 387. - case 'campaign': boxTitle = getLang('ads_archive_box_campaign_title'); break;
- 388. - case 'client': boxTitle = getLang('ads_archive_box_client_title'); break;
- 389. - }
- 390. -
- 391. - var boxOptions = {};
- 392. - boxOptions.title = (isSuccess ? boxTitle : '������');
- 393. - boxOptions.width = 350;
- 394. - boxOptions.onHide = onHide;
- 395. - showFastBox(boxOptions, message);
- 396. - }
- 397. -
- 398. - function lockDeletion() {
- 399. - if (lock) {
- 400. - if (!lock()) {
- 401. - return false;
- 402. - }
- 403. - cur.deleteConfirmBox.hide();
- 404. - } else {
- 405. - if (cur.deleteUnionLocked) {
- 406. - return false;
- 407. - }
- 408. - cur.deleteUnionLocked = true;
- 409. - show('delete_union_progress');
- 410. - }
- 411. - return true;
- 412. - }
- 413. - function unlockDeletion() {
- 414. - if (unlock) {
- 415. - unlock()
- 416. - } else {
- 417. - cur.deleteUnionLocked = false;
- 418. - hide('delete_union_progress');
- 419. - }
- 420. - }
- 421. - }
- 422. -
- 423. - Ads.openHelpBox = function(type, unionId) {
- 424. - var ajaxParams = {}
- 425. - ajaxParams.type = type;
- 426. - ajaxParams.union_id = unionId;
- 427. -
- 428. - var showOptions = {params: {}};
- 429. - showOptions.onFail = Ads.onBoxFail;
- 430. - showOptions.cache = 1;
- 431. - showOptions.params.width = 450;
- 432. -
- 433. - showBox('/ads?act=a_help_text', ajaxParams, showOptions);
- 434. - }
- 435. -
- 436. - Ads.openCreateOfficeBox = function() {
- 437. - var ajaxParams = {};
- 438. -
- 439. - var showOptions = {params: {}};
- 440. - showOptions.onFail = Ads.onBoxFail;
- 441. - showOptions.params.width = 350;
- 442. -
- 443. - showBox('/ads?act=a_create_office_box', ajaxParams, showOptions);
- 444. - }
- 445. -
- 446. - Ads.openDisableOfficeBox = function(unionId, hash, isCompany) {
- 447. - cur.lang.ads_disable_office_box_title = '�������� ���������� ��������';
- 448. - cur.lang.ads_disable_office_box_button = '������� �������';
- 449. - cur.lang.ads_disable_office_confirm_message = '�� ������� ��� ������ ������� ��������� �������?<br><br>����� �������� �������� � ��� ��������� ������ � ����������, �� ����� �������� �������� ����� ����������.';
- 450. - if (isCompany) {
- 451. - cur.lang.ads_disable_office_confirm_message += '<br><br>������ ����� �������� �������� ���� �������� ������ ���������� �����, ������������ � ����� ��������.';
- 452. - }
- 453. - var messageBox = showFastBox(getLang('ads_disable_office_box_title'), getLang('ads_disable_office_confirm_message'), getLang('ads_disable_office_box_button'), function() { Ads.disableOffice(unionId, hash, messageBox); }, getLang('box_cancel'));
- 454. - }
- 455. -
- 456. - Ads.disableOffice = function(unionId, hash, box) {
- 457. - var ajaxParams = {};
- 458. - ajaxParams.union_id = unionId;
- 459. - ajaxParams.hash = hash;
- 460. -
- 461. - ajax.post('/adsmoder?act=a_disable_office', ajaxParams, {onDone: onRequestComplete, onFail: onRequestComplete});
- 462. -
- 463. - function onRequestComplete(response) {
- 464. - if (response && response.redirect) {
- 465. - nav.reload();
- 466. - } else {
- 467. - box.hide();
- 468. - showFastBox(getLang('ads_error_box_title'), getLang('ads_error_text'));
- 469. - }
- 470. - return true;
- 471. - }
- 472. - }
- 473. -
- 474. - Ads.createExportSubmitButton = function(elem, bindingId, topUnionId) {
- 475. - var postIframe = ce((browser.msie && browser.version < 9.0) ? '<iframe name="secret_iframe">' : 'iframe', {name: 'secret_iframe', id: 'secret_iframe'});
- 476. - postIframe.style.display = 'none';
- 477. - document.body.appendChild(postIframe);
- 478. - var topUnionIdParam = (topUnionId ? '&union_id=' + topUnionId : '');
- 479. - var postForm = ce('form', {method: 'post', action: '/ads?act=get_export_stats' + topUnionIdParam, target: 'secret_iframe'});
- 480. - document.body.appendChild(postForm);
- 481. - var valueNames = [
- 482. - 'group_time',
- 483. - 'group_ads',
- 484. - 'method',
- 485. - 'stats_type',
- 486. - 'from_day',
- 487. - 'from_month',
- 488. - 'from_year',
- 489. - 'to_day',
- 490. - 'to_month',
- 491. - 'to_year',
- 492. - 'Ids'
- 493. - ];
- 494. - var valueContainers = {};
- 495. - for (var i = 0; i < valueNames.length; i++) {
- 496. - var curName = valueNames[i];
- 497. - valueContainers[curName] = ce('input', {
- 498. - type: 'hidden',
- 499. - id: curName + '_container_' + bindingId,
- 500. - name: curName
- 501. - });
- 502. - postForm.appendChild(valueContainers[curName]);
- 503. - }
- 504. -
- 505. - var errorBox;
- 506. - var action = function() {
- 507. - var postData = {}, elem, day;
- 508. - elem = geByClass('grouping_time_' + bindingId)[0];
- 509. - if (!elem) return;
- 510. - valueContainers.group_time.value = elem.getIndex();
- 511. -
- 512. - elem = geByClass('grouping_ads_' + bindingId)[0];
- 513. - if (!elem) return;
- 514. - valueContainers.group_ads.value = elem.getIndex();
- 515. -
- 516. - elem = geByClass('client_choose_' + bindingId);
- 517. - if (elem.length > 0) {
- 518. - elem = elem[0];
- 519. - var curClientId = elem.getIndex();
- 520. - }
- 521. -
- 522. - elem = geByClass('export_method_' + bindingId)[0];
- 523. - if (!elem) return;
- 524. - valueContainers.method.value = elem.getIndex();
- 525. - if (valueContainers.method.value == 3/*Web-interface*/) {
- 526. - postForm.target = '';
- 527. - }
- 528. -
- 529. - elem = geByClass('stats_type_' + bindingId)[0];
- 530. - if (!elem) return;
- 531. - valueContainers.stats_type.value = elem.getIndex();
- 532. -
- 533. - day = cur.exportParamsData.start_time;
- 534. - valueContainers.from_day.value = day.day;
- 535. - valueContainers.from_month.value = day.month;
- 536. - valueContainers.from_year.value = day.year;
- 537. -
- 538. - day = cur.exportParamsData.stop_time;
- 539. - valueContainers.to_day.value = day.day;
- 540. - valueContainers.to_month.value = day.month;
- 541. - valueContainers.to_year.value = day.year;
- 542. -
- 543. - if ((new Date(valueContainers.to_year.value, valueContainers.to_month.value, valueContainers.to_day.value)) <
- 544. - (new Date(valueContainers.from_year.value, valueContainers.from_month.value, valueContainers.from_day.value))) {
- 545. - showFastBox(getLang('ads_error_box_title'), getLang('ads_error_export_stat_invalid_period'));
- 546. - return;
- 547. - }
- 548. -
- 549. - var ids = [];
- 550. -
- 551. - elem = ge('paginated_table');
- 552. - var pt = elem.tableObj;
- 553. - var selection = pt.getSelection(0);
- 554. - switch (parseInt(valueContainers.group_ads.value)) {
- 555. - case 0:
- 556. - ids.push(elem.topId);
- 557. - break;
- 558. - case 1:
- 559. - for (var j = 0; j < selection.length; j++) {
- 560. - var clId = pt.content.extra['union_id'][selection[j]];
- 561. - ids.push(clId);
- 562. - }
- 563. - break;
- 564. - case 2:
- 565. - if (curClientId == 'aca') {
- 566. - for (var p in elem.contentDep) {
- 567. - if (!isNaN(Number(p))) {
- 568. - for (var i in elem.contentDep[p].extra['union_id']) {
- 569. - ids.push(elem.contentDep[p].extra['union_id'][i]);
- 570. - }
- 571. - }
- 572. - }
- 573. - } else {
- 574. - for (var i = 0; i < selection.length; i++) {
- 575. - ids.push(pt.content.extra['union_id'][selection[i]]);
- 576. - }
- 577. - }
- 578. - break;
- 579. - case 3:
- 580. - for (var i = 0; i < selection.length; i++) {
- 581. - ids.push(pt.content.extra['union_id'][selection[i]]);
- 582. - }
- 583. - break;
- 584. - default:
- 585. - return;
- 586. - }
- 587. -
- 588. - if (ids.length == 0) {
- 589. - showFastBox(getLang('ads_error_box_title'), getLang('ads_error_export_stat_no_campaigns_selected'));
- 590. - return;
- 591. -
- 592. - }
- 593. -
- 594. - valueContainers.Ids.value = '' + ids.join(',');
- 595. -
- 596. - postForm.submit();
- 597. - };
- 598. -
- 599. - createButton(elem, action);
- 600. - }
- 601. -
- 602. - Ads.createStaticDatePicker = function(elem, bindingId, classid, defaultDate) {
- 603. - elem = ge(elem);
- 604. - if (classid) elem.className = classid + '_' + bindingId;
- 605. -
- 606. - var spanDay = ce('span', {id: elem.id + '_day'}),
- 607. - spanMonth = ce('span', {id: elem.id + '_month'});
- 608. -
- 609. - if (!cur.exportParamsData) {
- 610. - cur.exportParamsData = {};
- 611. - }
- 612. - cur.exportParamsData[classid] = defaultDate;
- 613. -
- 614. - var params = {
- 615. - mode: 'd',
- 616. - day: defaultDate.day,
- 617. - month: defaultDate.month,
- 618. - year: defaultDate.year,
- 619. - width: 124,
- 620. - pastActive: true,
- 621. - onUpdate: function(d, m) {
- 622. - if (m == 'h') {
- 623. - cur.exportParamsData[classid].day = defaultDate.day;
- 624. - cur.exportParamsData[classid].month = defaultDate.month;
- 625. - cur.exportParamsData[classid].year = defaultDate.year;
- 626. - return;
- 627. - }
- 628. - if (m == 'd') {
- 629. - cur.exportParamsData[classid].day = d.d;
- 630. - } else if (m == 'm') {
- 631. - cur.exportParamsData[classid].day = 1;
- 632. - }
- 633. - cur.exportParamsData[classid].month = d.m;
- 634. - cur.exportParamsData[classid].year = d.y;
- 635. - }
- 636. - };
- 637. -
- 638. - if (!cur.exportUi) {
- 639. - cur.exportUi = {};
- 640. - }
- 641. - cur.exportUi[classid] = new Datepicker(elem, params);
- 642. - }
- 643. -
- 644. - Ads.openInnerTable = function(id, bindingId) {
- 645. - if (!id) id = 'acl';
- 646. -
- 647. - var tab = ge('paginated_table');
- 648. -
- 649. - var newOptions;
- 650. - switch (id) {
- 651. - case 'cli':
- 652. - newOptions = tab.optionsDep['cli'];
- 653. - break;
- 654. - case 'aca':
- 655. - case 'acl':
- 656. - newOptions = tab.optionsDep['default'];
- 657. - break;
- 658. - default:
- 659. - newOptions = tab.optionsDep['cam'];
- 660. - break;
- 661. - }
- 662. -
- 663. - if (id in tab.contentDep && tab.contentDep[id]) {
- 664. - var newContent = tab.contentDep[id];
- 665. - tab.tableObj.setOptions(newOptions);
- 666. - tab.tableObj.setContent(newContent);
- 667. - tab.tableObj.applyData();
- 668. - } else {
- 669. - function onDone(data) {
- 670. - var newContent = data;
- 671. - tab.contentDep[id] = newContent;
- 672. - tab.tableObj.setOptions(newOptions);
- 673. - tab.tableObj.setContent(newContent);
- 674. - tab.tableObj.applyData();
- 675. - hide('getting_campaigns_upload');
- 676. - }
- 677. - function onFail() {
- 678. - hide('getting_campaigns_upload');
- 679. - return true;
- 680. - };
- 681. - show('getting_campaigns_upload');
- 682. - ajax.post('/ads?act=a_get_client_children', {client_id: id}, {onDone: onDone, onFail: onFail});
- 683. - }
- 684. - }
- 685. -
- 686. - Ads.createStaticDropdownMenuAds = function(elem, bindingId, values, params) {
- 687. - elem = ge(elem);
- 688. -
- 689. - if (params.classname) elem.className = params.classname + '_' + bindingId;
- 690. - elem.className = elem.className + ' dd_link';
- 691. -
- 692. - elem.valueList = values;
- 693. - elem.getValue = function() {return elem.value;}
- 694. - elem.getIndex = function() {
- 695. - if (elem.index !== undefined) return elem.index;
- 696. -
- 697. - for (var i = 0; i < elem.valueList.length; i++) {
- 698. - if (elem.valueList[i][1] == elem.value) {
- 699. - return elem.valueList[i][0];
- 700. - }
- 701. - }
- 702. - return -1;
- 703. - }
- 704. -
- 705. - if (params.classname == 'client_choose') {
- 706. - onDomReady(function() {
- 707. - hide(geByClass('client_choose_row_' + bindingId)[0]);
- 708. - });
- 709. - }
- 710. - params.updateHeader = function(i, t) {
- 711. - if (!i) i = 'aca';
- 712. - Ads.openInnerTable(i, bindingId);
- 713. - elem.index = i;
- 714. - elem.value = t;
- 715. - return t;
- 716. - }
- 717. - params.onSelect = function(value) {
- 718. - if (value === undefined) value = uiDropdown.val();
- 719. - elem.value = value;
- 720. - elem.innerHTML = value;
- 721. - };
- 722. - params.target = elem;
- 723. - params.showHover = true;
- 724. - //params.alwaysMenuToUp = true;
- 725. -
- 726. - params.onSelect(values[0][1]);
- 727. -
- 728. - elem.uiDropdown = new DropdownMenu(values, params);
- 729. - Ads.makeDDScrollable(elem.uiDropdown);
- 730. - }
- 731. -
- 732. - // threshold is height of container
- 733. - Ads.makeDDScrollable = function(dd, threshold) {
- 734. - if (!dd) return;
- 735. - if (threshold === undefined) {
- 736. - threshold = 300;
- 737. - }
- 738. -
- 739. - var uiBody = dd.body,
- 740. - uiTable = geByClass('dd_menu_rows', uiBody)[0].firstChild,
- 741. - uiTableS = getSize(uiBody),
- 742. - uiTableW = uiTableS[0],
- 743. - uiTableH = uiTableS[1] - 4, // dont understand why
- 744. - barW = 6,
- 745. - barH = Math.max(20, intval(threshold * threshold / uiTableH)),
- 746. - scrollBar = ce('div', {className: 'ads_dropdown_menu_scrollbar'}, {
- 747. - top: barH / 10,
- 748. - right: 3,
- 749. - width: barW,
- 750. - height: barH
- 751. - });
- 752. -
- 753. - if (uiTableH < threshold) {
- 754. - return;
- 755. - }
- 756. -
- 757. - setStyle(uiTable.parentNode, {
- 758. - overflowY: 'hidden',
- 759. - height: threshold
- 760. - });
- 761. - uiBody.appendChild(scrollBar);
- 762. - setStyle(uiTable, 'position', 'relative');
- 763. -
- 764. - var startY = null,
- 765. - startTop = 0,
- 766. - hoverState = 0,
- 767. - hoverTimer = null;
- 768. - var onScroll = function(e) {
- 769. - var oldTop = parseFloat(getStyle(uiTable, 'top'));
- 770. - if (isNaN(oldTop)) {
- 771. - oldTop = 0;
- 772. - }
- 773. -
- 774. - var delta = e.wheelDelta ? e.wheelDelta / 120 : -e.detail / 3;
- 775. - scrollBody(oldTop + delta * 20);
- 776. -
- 777. - if (hoverTimer) {
- 778. - clearTimeout(hoverTimer);
- 779. - } else {
- 780. - doHover(1);
- 781. - }
- 782. - hoverTimer = setTimeout(function() {
- 783. - hoverTimer = null;
- 784. - doHover(-1);
- 785. - }, 200);
- 786. -
- 787. - cancelEvent(e);
- 788. - return false;
- 789. - }
- 790. - var onMouseMove = function(e) {
- 791. - if (startY === null) return;
- 792. - var y = e.pageY;
- 793. - var localD = startY - y,
- 794. - delta = 1.0 * localD * (uiTableH - threshold) / (threshold - barH - 5);
- 795. - scrollBody(startTop + delta);
- 796. - }
- 797. - var scrollBody = function(newTop) {
- 798. - newTop = Math.min(0, newTop);
- 799. - newTop = Math.max(-uiTableH + threshold, newTop);
- 800. -
- 801. - var barTop = 3 - 1.0 * newTop / (uiTableH - threshold) * (threshold - barH - 5);
- 802. - setStyle(uiTable, 'top', newTop);
- 803. - setStyle(scrollBar, 'top', barTop);
- 804. - }
- 805. - var onDown = function(e) {
- 806. - startY = e.pageY;
- 807. - startTop = parseFloat(getStyle(uiTable, 'top'));
- 808. - if (isNaN(startTop)) startTop = 0;
- 809. -
- 810. - doHover(1);
- 811. - cancelEvent(e);
- 812. - }
- 813. - var onUp = function(e) {
- 814. - if (startY !== null) {
- 815. - doHover(-1);
- 816. - }
- 817. - startY = null;
- 818. - }
- 819. - var doHover = function(dh) {
- 820. - hoverState += dh;
- 821. - if (hoverState == 0) removeClass(scrollBar, 'hovered');
- 822. - if (hoverState == 1) addClass(scrollBar, 'hovered');
- 823. - }
- 824. -
- 825. - dd.options.onShow = function() {
- 826. - scrollBody(100000);
- 827. - }
- 828. - addEvent(uiBody, 'mousewheel DOMMouseScroll', onScroll);
- 829. - addEvent(scrollBar, 'mousedown', onDown);
- 830. - addEvent(document.body, 'mouseup dragend', onUp);
- 831. - addEvent(uiBody, 'mousemove', onMouseMove);
- 832. -
- 833. - cur.destroy.push(function() {
- 834. - removeEvent(uiBody, 'mousewheel DOMMouseScroll', onScroll);
- 835. - removeEvent(scrollBar, 'mousedown', onDown);
- 836. - removeEvent(document.body, 'mouseup dragend', onUp);
- 837. - removeEvent(uiBody, 'mousemove', onMouseMove);
- 838. - });
- 839. - }
- 840. -
- 841. - // params must be ready to go to contructor
- 842. - Ads.createStaticDropdown = function(elem, bindingId, values, params) {
- 843. - elem = ge(elem);
- 844. - if (params.classname) elem.className = params.classname + '_' + bindingId;
- 845. - elem.className = elem.className + ' dd_link';
- 846. -
- 847. - elem.valueList = values;
- 848. - elem.getValue = function() {return elem.value;}
- 849. - elem.getIndex = function() {
- 850. - if (elem.index !== undefined) return elem.index;
- 851. -
- 852. - for (var i = 0; i < elem.valueList.length; i++) {
- 853. - if (elem.valueList[i][1] == elem.value) {
- 854. - return elem.valueList[i][0];
- 855. - }
- 856. - }
- 857. - return -1;
- 858. - }
- 859. -
- 860. - if (params.classname == 'client_choose') {
- 861. - onDomReady(function() {
- 862. - hide(geByClass('client_choose_row_' + bindingId)[0]);
- 863. - });
- 864. - }
- 865. -
- 866. - params.updateHeader = function(i, t) {
- 867. - if (!i) i = 0;
- 868. - //
- 869. - // grouping_time
- 870. - //
- 871. - if (elem.className.substring(0, 'grouping_time'.length) == 'grouping_time') {
- 872. - var modes = ['d', 'm', 'h'];
- 873. - cur.exportUi['start_time'].setMode(modes[i]);
- 874. - cur.exportUi['stop_time'].setMode(modes[i]);
- 875. - } else
- 876. - //
- 877. - // client_choose
- 878. - //
- 879. - if (elem.className.substring(0, 'client_choose'.length) == 'client_choose') {
- 880. - if (!i) i = 'aca';
- 881. - Ads.openInnerTable(i, bindingId);
- 882. - } else
- 883. - //
- 884. - // grouping_ads
- 885. - //
- 886. - if (elem.className.substring(0, 'grouping_ads'.length) == 'grouping_ads') {
- 887. - var label_el;
- 888. - switch (i) {
- 889. - case 0:
- 890. - hide(geByClass('client_choose_row_' + bindingId)[0]);
- 891. - Ads.openInnerTable('acl', bindingId);
- 892. -
- 893. - label_el = ge('unions_table_label_' + bindingId);
- 894. - label_el.innerHTML = getLang('ads_export_stat_data_title_campaigns');
- 895. - break;
- 896. - case 1:
- 897. - hide(geByClass('client_choose_row_' + bindingId)[0]);
- 898. - Ads.openInnerTable('cli', bindingId);
- 899. -
- 900. - label_el = ge('unions_table_label_' + bindingId);
- 901. - label_el.innerHTML = getLang('ads_export_stat_data_title_clients');
- 902. - break;
- 903. - case 2:
- 904. - var chser = geByClass('client_choose_' + bindingId)[0];
- 905. - var dd = chser.uiDropdown;
- 906. -
- 907. - var text = dd.options.updateHeader(0, chser.valueList[0][1]);
- 908. - dd.header.innerHTML = '<div>' + text + '</div>';
- 909. - if (dd.options.target) dd.options.target.innerHTML = text;
- 910. -
- 911. - show(geByClass('client_choose_row_' + bindingId)[0]);
- 912. - Ads.openInnerTable('aca', bindingId);
- 913. -
- 914. - label_el = ge('unions_table_label_' + bindingId);
- 915. - label_el.innerHTML = getLang('ads_export_stat_data_title_campaigns');
- 916. - break;
- 917. - case 3:
- 918. - Ads.openInnerTable('cam', bindingId);
- 919. - default:
- 920. - break;
- 921. - }
- 922. - }
- 923. -
- 924. - elem.index = i;
- 925. - elem.value = t;
- 926. - return t;
- 927. - }
- 928. - params.onSelect = function(value) {
- 929. - if (value === undefined) value = uiDropdown.val();
- 930. - elem.value = value;
- 931. - elem.innerHTML = value;
- 932. - };
- 933. - params.target = elem;
- 934. - params.showHover = true;
- 935. - //params.alwaysMenuToUp = true;
- 936. -
- 937. - params.onSelect(values[0][1]);
- 938. -
- 939. - elem.uiDropdown = new DropdownMenu(values, params);
- 940. - }
- 941. -
- 942. - Ads.createInlineStaticEdit = function(editElem, bindingId, params) {
- 943. - if (!params) params = {};
- 944. - editElem = ge(editElem);
- 945. - if (params.classname) editElem.className = params.classname + '_' + bindingId;
- 946. -
- 947. - var uiTimeDay, uiTimeMonth, uiTimeYear, uiAbstractDropdown;
- 948. -
- 949. - if (!params['type'] && !params['values']) return false;
- 950. -
- 951. - var defaultValue;
- 952. - if (params['default']) {
- 953. - defaultValue = params['default'];
- 954. - }
- 955. -
- 956. - var type = params['type'] || 'dropdown';
- 957. -
- 958. - switch (type) {
- 959. - case 'dropdown':
- 960. - if (params['values'] === undefined) {
- 961. - return false;
- 962. - }
- 963. - if (defaultValue === undefined) {
- 964. - defaultValue = 0;
- 965. - }
- 966. - break;
- 967. - case 'time':
- 968. - break;
- 969. - default:
- 970. - break;
- 971. - }
- 972. -
- 973. - monthNames = [
- 974. - getLang('ads_jan'),
- 975. - getLang('ads_feb'),
- 976. - getLang('ads_mar'),
- 977. - getLang('ads_apr'),
- 978. - getLang('ads_may'),
- 979. - getLang('ads_jun'),
- 980. - getLang('ads_jul'),
- 981. - getLang('ads_aug'),
- 982. - getLang('ads_sep'),
- 983. - getLang('ads_oct'),
- 984. - getLang('ads_nov'),
- 985. - getLang('ads_dec')
- 986. - ];
- 987. - saveValue(defaultValue);
- 988. -
- 989. - function saveValue(newValue) {
- 990. - editElem.value = newValue;
- 991. -
- 992. - var newText = '';
- 993. - switch (type) {
- 994. - case 'time':
- 995. - if (newValue && newValue.day && newValue.month && newValue.year) {
- 996. - newText = newValue.day + ' ' + monthNames[newValue.month - 1] + ' ' + newValue.year;
- 997. - }
- 998. - break;
- 999. - case 'dropdown':
- 1000. - if (parseInt(newValue) !== undefined) {
- 1001. - newText = params['values'][parseInt(newValue)];
- 1002. - } else
- 1003. - if (typeof newValue == 'string') {
- 1004. - newText = newValue;
- 1005. - } else {
- 1006. - for (var index in newValue) {
- 1007. - saveValue.call(this, newValue[index]);
- 1008. - return;
- 1009. - }
- 1010. - }
- 1011. - break;
- 1012. - default:
- 1013. - break;
- 1014. - }
- 1015. -
- 1016. - applyNewValue.call(this, newValue, newText);
- 1017. - }
- 1018. - function applyNewValue(newValue, newText) {
- 1019. - editElem.value = newValue;
- 1020. - editElem.innerHTML = newText;
- 1021. - }
- 1022. - function checkValue(value) {
- 1023. - return true;
- 1024. - }
- 1025. - function showLongError(error) {
- 1026. - showFastBox(getLang('ads_error_box_title'), error);
- 1027. - }
- 1028. - function updateTimeDays(month) {
- 1029. - uiTimeDay.setData(getDays(month));
- 1030. - }
- 1031. -
- 1032. - //
- 1033. - // Helpers
- 1034. - //
- 1035. - function getDays(month, year) {
- 1036. - var ret = [], days = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
- 1037. - if (!year) year = (new Date()).getFullYear();
- 1038. - if (month == 2 && year % 4 == 0) {
- 1039. - days[2] = 29
- 1040. - }
- 1041. - for (var i = 1, days = days[month]; i <= days; i++) {
- 1042. - ret.push(i);
- 1043. - }
- 1044. - return ret;
- 1045. - }
- 1046. - function getMonths() {
- 1047. - var months = [];
- 1048. - for (var i = 1; i <= 12; i++) {
- 1049. - months.push([i, monthNames[i - 1]]);
- 1050. - }
- 1051. - return months;
- 1052. - }
- 1053. - function getYears() {
- 1054. - var ret = [];
- 1055. - var curY = (new Date()).getFullYear();
- 1056. - for (var i = curY; i >= curY - 10; i--) {
- 1057. - ret.push(i);
- 1058. - }
- 1059. - return ret;
- 1060. - }
- 1061. - function getAssocFromValues(array) {
- 1062. - var res = [];
- 1063. - for (var i = 0; i < array.length; i++) {
- 1064. - res.push([i, array[i]]);
- 1065. - }
- 1066. - return res;
- 1067. - }
- 1068. -
- 1069. - //
- 1070. - // Events
- 1071. - //
- 1072. - function afterInit() {
- 1073. - var self = this;
- 1074. -
- 1075. - switch (type) {
- 1076. - case 'time':
- 1077. - uiTimeDay = new Dropdown(
- 1078. - geByClass('inline_time_day', this.contentTable)[0],
- 1079. - getDays(1),
- 1080. - {width: 45, height: 150, selectedItem: 1}
- 1081. - );
- 1082. - uiTimeMonth = new Dropdown(
- 1083. - geByClass('inline_time_month', this.contentTable)[0],
- 1084. - getMonths(),
- 1085. - {width: 80, height: 150, selectedItem: 1, onChange: function(value) { updateTimeDays.call(this, value); }}
- 1086. - );
- 1087. - uiTimeYear = new Dropdown(
- 1088. - geByClass('inline_time_year', this.contentTable)[0],
- 1089. - getYears(),
- 1090. - {width: 65, height: 150, selectedItem: (new Date()).getFullYear()}
- 1091. - );
- 1092. - break;
- 1093. -
- 1094. - case 'dropdown':
- 1095. - uiAbstractDropdown = new Dropdown(
- 1096. - geByClass('ads_inline_dropdown', this.contentTable)[0],
- 1097. - getAssocFromValues(params['values']),
- 1098. - {height: 150, selectedItem: 0}
- 1099. - );
- 1100. - break;
- 1101. -
- 1102. - default:
- 1103. - break;
- 1104. - }
- 1105. - }
- 1106. - function onBeforeShow() {
- 1107. - switch (type) {
- 1108. - case 'time':
- 1109. - if (defaultValue && defaultValue.day && defaultValue.month && defaultValue.year) {
- 1110. - uiTimeDay.val(defaultValue.day);
- 1111. - uiTimeMonth.val(defaultValue.month);
- 1112. - uiTimeYear.val(defaultValue.year);
- 1113. - } else {
- 1114. - editElem.innerHTML = "�� ������";
- 1115. - }
- 1116. - break;
- 1117. -
- 1118. - case 'dropdown':
- 1119. - uiAbstractDropdown.val(defaultValue);
- 1120. - break;
- 1121. -
- 1122. - default:
- 1123. - break;
- 1124. - }
- 1125. - }
- 1126. - function onShow() {
- 1127. - }
- 1128. - function onConfirm() {
- 1129. - var newValue;
- 1130. - if (type == 'time') {
- 1131. - newValue = {};
- 1132. - newValue.day = uiTimeDay.val();
- 1133. - newValue.month = uiTimeMonth.val();
- 1134. - newValue.year = uiTimeYear.val();
- 1135. - } else
- 1136. - if (type == 'dropdown') {
- 1137. - newValue = uiAbstractDropdown.val();
- 1138. - }
- 1139. -
- 1140. - saveValue.call(this, newValue);
- 1141. - return true;
- 1142. - }
- 1143. -
- 1144. - var options = {
- 1145. - afterInit: afterInit,
- 1146. - onBeforeShow: onBeforeShow,
- 1147. - onShow: onShow,
- 1148. - onConfirm: onConfirm
- 1149. - };
- 1150. -
- 1151. - switch (type) {
- 1152. - case 'time':
- 1153. - options.contentHTML =
- 1154. - '<tr>' +
- 1155. - '<td colspan="2">' +
- 1156. - '<table class="ads_inline_edit_table">' +
- 1157. - '<tr>' +
- 1158. - '<td style="white-space: nowrap; width: 200px;">' +
- 1159. - '<table class="ads_inline_edit_table">' +
- 1160. - '<tr>' +
- 1161. - '<td style="padding-right: 5px;"><input type="text" class="inline_time_day text" style="width: 30px;" /></td>' +
- 1162. - '<td style="padding-right: 5px;"><input type="text" class="inline_time_month text" style="width: 30px;" /></td>' +
- 1163. - '<td style="padding-right: 5px;"><input type="text" class="inline_time_year text" style="width: 30px;" /></td>' +
- 1164. - '</tr>' +
- 1165. - '</table>' +
- 1166. - '</td>' +
- 1167. - '</tr>' +
- 1168. - '</table>' +
- 1169. - '</td>' +
- 1170. - '</tr>';
- 1171. - break;
- 1172. - case 'dropdown':
- 1173. - options.contentHTML =
- 1174. - '<tr>' +
- 1175. - '<td colspan="2">' +
- 1176. - '<table class="ads_inline_edit_table" style="width: 100%;">' +
- 1177. - '<tr><td><input type="text" class="ads_inline_dropdown text" /></td></tr>' +
- 1178. - '</table>' +
- 1179. - '</td>' +
- 1180. - '</tr>';
- 1181. - break;
- 1182. - default:
- 1183. - break;
- 1184. - }
- 1185. -
- 1186. - new InlineEdit(editElem, options);
- 1187. - }
- 1188. -
- 1189. - Ads.onInlineEditClick = function(elem, callback, rown, coln) {
- 1190. - var _t = this;
- 1191. -
- 1192. - var editElem = elem,
- 1193. - progressElem = _t.content.extra.progress_elem[rown][coln],
- 1194. - unionId = _t.content.extra.union_id[rown][coln],
- 1195. - unionType = _t.content.extra.union_type[rown][coln],
- 1196. - valueType = _t.content.extra.value_type[rown][coln],
- 1197. - initValue = _t.content.extra.init_value[rown][coln],
- 1198. - hash = _t.content.extra.hash[rown][coln],
- 1199. - additionalParams = extend(_t.content.extra.additional_params[rown][coln], {
- 1200. - valCallback: function(val) {
- 1201. - callback({
- 1202. - value: val,
- 1203. - extra: {
- 1204. - init_value: val
- 1205. - }
- 1206. - });
- 1207. - }
- 1208. - });
- 1209. -
- 1210. - var ret = Ads.createInlineEdit(editElem, progressElem, unionType, unionId, valueType, initValue, hash, additionalParams);
- 1211. - ret.obj.show();
- 1212. - }
- 1213. -
- 1214. - Ads.createInlineEdit = function(editElem, progressElem, unionType, unionId, valueType, initValue, hash, additionalParams) {
- 1215. - editElem = ge(editElem);
- 1216. - progressElem = ge(progressElem);
- 1217. - var defaultValue = initValue;
- 1218. - var bad_this = this;
- 1219. -
- 1220. - var uiTimeDay, uiTimeMonth, uiTimeHour;
- 1221. -
- 1222. - var valueGeneralType;
- 1223. - switch (valueType) {
- 1224. - case 'cost_per_click':
- 1225. - valueGeneralType = 'cost_per_click';
- 1226. - break;
- 1227. - case 'day_limit':
- 1228. - case 'month_limit':
- 1229. - case 'all_limit':
- 1230. - case 'contract_limit':
- 1231. - valueGeneralType = 'limit';
- 1232. - break;
- 1233. - case 'start_time':
- 1234. - case 'stop_time':
- 1235. - valueGeneralType = 'time';
- 1236. - break;
- 1237. - default:
- 1238. - valueGeneralType = 'text';
- 1239. - break;
- 1240. - }
- 1241. -
- 1242. - function saveValue(newValue, isRemoveValue) {
- 1243. -
- 1244. - if (valueGeneralType == 'limit') {
- 1245. - if ((!isRemoveValue && defaultValue == newValue) || (isRemoveValue && defaultValue == 0)) {
- 1246. - if (isRemoveValue) {
- 1247. - this.hide();
- 1248. - }
- 1249. - return;
- 1250. - }
- 1251. - } else {
- 1252. - if (defaultValue == newValue) {
- 1253. - return;
- 1254. - }
- 1255. - }
- 1256. -
- 1257. - var unknownError = getLang('ads_error_unexpected_error_try_later');
- 1258. -
- 1259. - var params = {};
- 1260. - params.union_id = unionId;
- 1261. - params.hash = hash;
- 1262. - extend(params, additionalParams);
- 1263. -
- 1264. - if (isRemoveValue) {
- 1265. - params[valueType] = 0;
- 1266. - } else {
- 1267. - if (valueGeneralType == 'time') {
- 1268. - params[valueType + '_day'] = newValue.day;
- 1269. - params[valueType + '_month'] = newValue.month;
- 1270. - params[valueType + '_hour'] = newValue.hour;
- 1271. - } else {
- 1272. - params[valueType] = newValue;
- 1273. - }
- 1274. - }
- 1275. -
- 1276. - var self = this;
- 1277. -
- 1278. - function onAjaxComplete(response) {
- 1279. - if (isObject(response)) {
- 1280. - if (response.error) {
- 1281. - showLongError.call(self, response.error);
- 1282. - } else if (!response.not_changed) {
- 1283. - if ((valueType + '_value') in response) {
- 1284. - applyNewValue.call(self, response[valueType + '_value'], response[valueType + '_text']);
- 1285. - } else if (response[valueType + '_value_day']) {
- 1286. - var newValue = {};
- 1287. - newValue.day = response[valueType + '_value_day'];
- 1288. - newValue.month = response[valueType + '_value_month'];
- 1289. - newValue.hour = response[valueType + '_value_hour'];
- 1290. - applyNewValue.call(self, newValue, response[valueType + '_text']);
- 1291. - } else {
- 1292. - showLongError.call(self, unknownError);
- 1293. - }
- 1294. - }
- 1295. - } else {
- 1296. - showLongError.call(self, unknownError);
- 1297. - }
- 1298. -
- 1299. - hide(progressElem);
- 1300. - show(editElem);
- 1301. -
- 1302. - return true;
- 1303. - }
- 1304. - ajax.post('/ads?act=a_unions_general_info_save', params, {onDone: onAjaxComplete, onFail: onAjaxComplete});
- 1305. -
- 1306. - hide(editElem);
- 1307. - show(progressElem);
- 1308. - if (isRemoveValue) {
- 1309. - this.hide();
- 1310. - }
- 1311. - }
- 1312. - function applyNewValue(newValue, newText) {
- 1313. - if (valueType == 'name') {
- 1314. - Ads.updateUnionName(unionId, newText);
- 1315. - }
- 1316. - defaultValue = newValue;
- 1317. - if (additionalParams.valCallback) {
- 1318. - additionalParams.valCallback(newValue);
- 1319. - } else {
- 1320. - editElem.innerHTML = newText;
- 1321. - }
- 1322. - }
- 1323. - function checkValue(value) {
- 1324. - switch (valueGeneralType) {
- 1325. - case 'cost_per_click':
- 1326. - if (value == '' || value == '0' || value == 0) {
- 1327. - return (additionalParams.is_cost_per_click ? getLang('ads_error_cost_per_click_no_value') : getLang('ads_error_cost_per_views_no_value'));
- 1328. - }
- 1329. - if (!value.match(/[0-9.,]/)) {
- 1330. - return (additionalParams.is_cost_per_click ? getLang('ads_error_cost_per_click_invalid_value') : getLang('ads_error_cost_per_views_invalid_value'));
- 1331. - }
- 1332. - value = value.replace(',', '.');
- 1333. -
- 1334. - var valueFloat = parseFloat(value);
- 1335. - var suffixesAll = '';
- 1336. - suffixesAll += (additionalParams.is_cost_per_click ? '_click' : '_views');
- 1337. - suffixesAll += (additionalParams.is_exclusive_ad ? '_exclusive' : '');
- 1338. - suffixesAll += (additionalParams.is_app_admin ? '_app' : '');
- 1339. - var minValue = cur.unionsLimits['cost_per' + suffixesAll + '_min'];
- 1340. - var maxValue = cur.unionsLimits['cost_per' + suffixesAll + '_max'];
- 1341. - var minErrorLangKey = (additionalParams.is_cost_per_click ? 'ads_error_cost_per_click_min_value' : 'ads_error_cost_per_views_min_value');
- 1342. - var maxErrorLangKey = (additionalParams.is_cost_per_click ? 'ads_error_cost_per_click_max_value' : 'ads_error_cost_per_views_max_value');
- 1343. - if (valueFloat < minValue) {
- 1344. - return getLang(minErrorLangKey).replace('{money}', getLang('global_money_amount_rub', minValue));
- 1345. - }
- 1346. - if (valueFloat > maxValue) {
- 1347. - return getLang(maxErrorLangKey).replace('{money}', getLang('global_money_amount_rub', maxValue));
- 1348. - }
- 1349. -
- 1350. - if (!value.match(cur.unionsLimits.cost_per_click_pattern)) {
- 1351. - return (additionalParams.is_cost_per_click ? getLang('ads_error_cost_per_click_invalid_value') : getLang('ads_error_cost_per_views_invalid_value'));
- 1352. - }
- 1353. - return true;
- 1354. - case 'limit':
- 1355. - if (value == '' || value == '0' || value == 0) {
- 1356. - return getLang('ads_error_limit_no_value');
- 1357. - }
- 1358. - if (!value.match(/[0-9.,]/)) {
- 1359. - return getLang('ads_error_limit_invalid_value');
- 1360. - }
- 1361. - if (value.indexOf('.') != -1 || value.indexOf(',') != -1) {
- 1362. - return getLang('ads_error_limit_integer_value');
- 1363. - }
- 1364. - if (parseInt(value) < cur.unionsLimits.limit_min) {
- 1365. - return getLang('ads_error_limit_min_value').replace('{money}', getLang('global_money_amount_rub', cur.unionsLimits.limit_min));
- 1366. - }
- 1367. - if (parseInt(value) > cur.unionsLimits.limit_max) {
- 1368. - return getLang('ads_error_limit_large_value');
- 1369. - }
- 1370. - if (!value.match(cur.unionsLimits.limit_pattern)) {
- 1371. - return getLang('ads_error_limit_invalid_value');
- 1372. - }
- 1373. - return true;
- 1374. - }
- 1375. - switch (valueType) {
- 1376. - case 'name':
- 1377. - if (value == '') {
- 1378. - if (unionType == 4) { // Top union
- 1379. - // Nothing
- 1380. - } else if (unionType == 2) {
- 1381. - return getLang('ads_error_client_name_no_value');
- 1382. - } else if (unionType == 1) {
- 1383. - return getLang('ads_error_campaign_name_no_value');
- 1384. - }
- 1385. - }
- 1386. - return true;
- 1387. - }
- 1388. - if (additionalParams.server_check) {
- 1389. - return true;
- 1390. - } else {
- 1391. - return false;
- 1392. - }
- 1393. - }
- 1394. -
- 1395. - function showFastError(error) {
- 1396. - geByClass('ads_inline_fast_error', this.fastErrorRow)[0].innerHTML = error;
- 1397. - show(this.fastErrorRow);
- 1398. - }
- 1399. - function hideFastError() {
- 1400. - hide(this.fastErrorRow);
- 1401. - geByClass('ads_inline_fast_error', this.fastErrorRow)[0].innerHTML = '';
- 1402. - }
- 1403. - function showLongError(error) {
- 1404. - showFastBox(getLang('ads_error_box_title'), error);
- 1405. - }
- 1406. - function removeValue() {
- 1407. - saveValue.call(this, false, true);
- 1408. - return true;
- 1409. - }
- 1410. - function updateTimeDays(month) {
- 1411. - uiTimeDay.setData(getDays(month));
- 1412. - }
- 1413. -
- 1414. - //
- 1415. - // Helpers
- 1416. - //
- 1417. - function getDays(month) {
- 1418. - var ret = [], days = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
- 1419. - if (month == 2 && (new Date()).getFullYear() % 4 == 0) {
- 1420. - days[2] = 29
- 1421. - }
- 1422. - for (var i = 1, days = days[month]; i <= days; i++) {
- 1423. - ret.push(i);
- 1424. - }
- 1425. - return ret;
- 1426. - }
- 1427. - function getMonths() {
- 1428. - var months = [];
- 1429. - months.push([1, getLang('ads_jan')]);
- 1430. - months.push([2, getLang('ads_feb')]);
- 1431. - months.push([3, getLang('ads_mar')]);
- 1432. - months.push([4, getLang('ads_apr')]);
- 1433. - months.push([5, getLang('ads_may')]);
- 1434. - months.push([6, getLang('ads_jun')]);
- 1435. - months.push([7, getLang('ads_jul')]);
- 1436. - months.push([8, getLang('ads_aug')]);
- 1437. - months.push([9, getLang('ads_sep')]);
- 1438. - months.push([10, getLang('ads_oct')]);
- 1439. - months.push([11, getLang('ads_nov')]);
- 1440. - months.push([12, getLang('ads_dec')]);
- 1441. - return months;
- 1442. - }
- 1443. - function getHours() {
- 1444. - var ret = [];
- 1445. - for (var i = 0; i < 24; i++) {
- 1446. - ret.push([i, i + ':00']);
- 1447. - }
- 1448. - return ret;
- 1449. - }
- 1450. -
- 1451. - //
- 1452. - // Events
- 1453. - //
- 1454. - function afterInit() {
- 1455. - var self = this;
- 1456. -
- 1457. - if (valueGeneralType == 'limit' || valueGeneralType == 'time') {
- 1458. - this.removeValueAnchor = geByClass('ads_inline_edit_remove_value', this.contentTable)[0];
- 1459. - addEvent(this.removeValueAnchor, 'click', function() { removeValue.call(self); return false; });
- 1460. - }
- 1461. -
- 1462. - if (valueGeneralType == 'time') {
- 1463. - uiTimeDay = new Dropdown(
- 1464. - geByClass('inline_time_day', this.contentTable)[0],
- 1465. - getDays(1),
- 1466. - {width: 45, height: 150, selectedItem: 1}
- 1467. - );
- 1468. - uiTimeMonth = new Dropdown(
- 1469. - geByClass('inline_time_month', this.contentTable)[0],
- 1470. - getMonths(),
- 1471. - {width: 80, height: 150, selectedItem: 1, onChange: function(value) { updateTimeDays.call(this, value); }}
- 1472. - );
- 1473. - uiTimeHour = new Dropdown(
- 1474. - geByClass('inline_time_hour', this.contentTable)[0],
- 1475. - getHours(),
- 1476. - {width: 65, height: 150, selectedItem: 0}
- 1477. - );
- 1478. - }
- 1479. -
- 1480. - this.fastErrorRow = geByClass('ads_inline_fast_error_row', this.contentTable)[0];
- 1481. -
- 1482. - if (this.input) {
- 1483. - this.is_user_action = true;
- 1484. - addEvent(this.input, 'keyup', function(event) {
- 1485. - if (event.keyCode != 13) {
- 1486. - hideFastError.call(self);
- 1487. - }
- 1488. - }
- 1489. - );
- 1490. - }
- 1491. - }
- 1492. - function onBeforeShow() {
- 1493. - if (this.input) {
- 1494. - this.input.value = defaultValue;
- 1495. - }
- 1496. -
- 1497. - if (valueGeneralType == 'time') {
- 1498. - uiTimeDay.val(defaultValue.day);
- 1499. - uiTimeMonth.val(defaultValue.month);
- 1500. - uiTimeHour.val(defaultValue.hour);
- 1501. - }
- 1502. -
- 1503. - hideFastError.call(this);
- 1504. -
- 1505. - var self = this;
- 1506. - if (valueGeneralType == 'cost_per_click' && !this.recommended_cost_loaded) {
- 1507. - var recommendedCostProgress = geByClass('inline_recommended_cost_progress', this.contentTable)[0];
- 1508. - var recommendedCostText = geByClass('ads_inline_recommended_cost_text', this.contentTable)[0];
- 1509. -
- 1510. - function onDone(response) {
- 1511. - if (response && response.recommended_costs && response.recommended_costs.cost_text) {
- 1512. - recommendedCostText.innerHTML = response.recommended_costs.cost_text;
- 1513. - hide(recommendedCostProgress);
- 1514. - show(recommendedCostText);
- 1515. - if (!this.is_user_action && self.input.value == '0') {
- 1516. - self.input.value = response.recommended_costs.cost_value;
- 1517. - }
- 1518. - self.recommended_cost_loaded = true;
- 1519. - }
- 1520. - };
- 1521. - var ajaxParams = {ad_id: unionId};
- 1522. - ajax.post('/ads?act=a_get_recommended_cost', ajaxParams, {onDone: onDone});
- 1523. - }
- 1524. - }
- 1525. - function onShow() {
- 1526. - if (this.input) {
- 1527. - elfocus(this.input);
- 1528. - }
- 1529. - }
- 1530. - function onConfirm() {
- 1531. - var newValue;
- 1532. - if (valueGeneralType == 'time') {
- 1533. - newValue = {};
- 1534. - newValue.day = uiTimeDay.val();
- 1535. - newValue.month = uiTimeMonth.val();
- 1536. - newValue.hour = uiTimeHour.val();
- 1537. - } else {
- 1538. - newValue = this.input.value;
- 1539. -
- 1540. - var checkResult = checkValue.call(this, newValue, valueType);
- 1541. - if (typeof(checkResult) == 'string') {
- 1542. - showFastError.call(this, checkResult);
- 1543. - return false;
- 1544. - }
- 1545. - if (checkResult !== true) {
- 1546. - showFastError.call(this, getLang('ads_error_unknown_error'));
- 1547. - return false;
- 1548. - }
- 1549. - }
- 1550. -
- 1551. - saveValue.call(this, newValue, false);
- 1552. - return true;
- 1553. - }
- 1554. -
- 1555. - var options = {
- 1556. - afterInit: afterInit,
- 1557. - onBeforeShow: onBeforeShow,
- 1558. - onShow: onShow,
- 1559. - onConfirm: onConfirm
- 1560. - };
- 1561. -
- 1562. - switch (valueGeneralType) {
- 1563. - case 'cost_per_click':
- 1564. - options.contentHTML =
- 1565. - '<tr>' +
- 1566. - '<td colspan="2">' +
- 1567. - '<table class="ads_inline_edit_table" style="width: 100%;">' +
- 1568. - '<tr><td><input class="inlInput text" type="text" /></td></tr>' +
- 1569. - '<tr><td style="padding-top: 7px; height: 22px;">' +
- 1570. - '<img class="inline_recommended_cost_progress" src="/images/upload.gif" />' +
- 1571. - '<span class="ads_inline_recommended_cost_text"></span>' +
- 1572. - '<div style="width: 275px; height: 1px;"></div>' +
- 1573. - '</td></tr>' +
- 1574. - '<tr class="ads_inline_fast_error_row"><td><div class="ads_inline_fast_error"></div></td></tr>' +
- 1575. - '</table>' +
- 1576. - '</td>' +
- 1577. - '</tr>';
- 1578. - break;
- 1579. - case 'limit':
- 1580. - options.contentHTML =
- 1581. - '<tr>' +
- 1582. - '<td colspan="2">' +
- 1583. - '<table class="ads_inline_edit_table">' +
- 1584. - '<tr>' +
- 1585. - '<td><input class="inlInput text" type="text" /></td>' +
- 1586. - '<td><a class="ads_inline_edit_remove_value" href="#">' + getLang('ads_inline_edit_remove_limit') + '</a></td>' +
- 1587. - '</tr>' +
- 1588. - '<tr class="ads_inline_fast_error_row"><td colspan="2"><div class="ads_inline_fast_error"></div></td></tr>' +
- 1589. - '</table>' +
- 1590. - '</td>' +
- 1591. - '</tr>';
- 1592. - break;
- 1593. - case 'time':
- 1594. - var removeValueText;
- 1595. - switch (valueType) {
- 1596. - case 'start_time': removeValueText = getLang('ads_inline_edit_remove_start_time'); break;
- 1597. - case 'stop_time': removeValueText = getLang('ads_inline_edit_remove_stop_time'); break;
- 1598. - }
- 1599. - options.contentHTML =
- 1600. - '<tr>' +
- 1601. - '<td colspan="2">' +
- 1602. - '<table class="ads_inline_edit_table">' +
- 1603. - '<tr>' +
- 1604. - '<td style="white-space: nowrap; width: 200px;">' +
- 1605. - '<table class="ads_inline_edit_table">' +
- 1606. - '<tr>' +
- 1607. - '<td style="padding-right: 5px;"><input type="text" class="inline_time_day text" style="width: 30px;" /></td>' +
- 1608. - '<td style="padding-right: 5px;"><input type="text" class="inline_time_month text" style="width: 30px;" /></td>' +
- 1609. - '<td style="padding-right: 5px;"><input type="text" class="inline_time_hour text" style="width: 30px;" /></td>' +
- 1610. - '</tr>' +
- 1611. - '</table>' +
- 1612. - '</td>' +
- 1613. - '</tr>' +
- 1614. - '<tr><td style="padding-top: 7px;"><a class="ads_inline_edit_remove_value" style="padding-left: 0;" href="#">' + removeValueText + '</a></td></tr>' +
- 1615. - '<tr class="ads_inline_fast_error_row"><td colspan="2"><div class="ads_inline_fast_error"></div></td></tr>' +
- 1616. - '</table>' +
- 1617. - '</td>' +
- 1618. - '</tr>';
- 1619. - break;
- 1620. - case 'text':
- 1621. - options.contentHTML =
- 1622. - '<tr>' +
- 1623. - '<td colspan="2">' +
- 1624. - '<table class="ads_inline_edit_table" style="width: 100%;">' +
- 1625. - '<tr><td><input class="inlInput text" type="text" /></td></tr>' +
- 1626. - '<tr class="ads_inline_fast_error_row"><td><div class="ads_inline_fast_error"></div></td></tr>' +
- 1627. - '</table>' +
- 1628. - '</td>' +
- 1629. - '</tr>';
- 1630. - break;
- 1631. - }
- 1632. -
- 1633. - var ret = {
- 1634. - target: editElem,
- 1635. - options: options
- 1636. - };
- 1637. - if (this.getOptionsOnly) { // dirty hack.
- 1638. - return ret;
- 1639. - }
- 1640. - ret.obj = new InlineEdit(editElem, options);
- 1641. -
- 1642. - var accessFunctions = {
- 1643. - applyNewValue: applyNewValue
- 1644. - }
- 1645. -
- 1646. - if (!cur.inlineEditControls) {
- 1647. - cur.inlineEditControls = {};
- 1648. - }
- 1649. - cur.inlineEditControls[valueType + '_' + unionId] = accessFunctions;
- 1650. -
- 1651. - return ret;
- 1652. - }
- 1653. -
- 1654. - Ads.createInlineDropdownMenu = function(menuElem, boxElem, progressElem, unionId, valueType, items, initValue, hash, additionalParams) {
- 1655. - menuElem = ge(menuElem);
- 1656. - boxElem = ge(boxElem);
- 1657. - progressElem = ge(progressElem);
- 1658. - var defaultValue = initValue;
- 1659. -
- 1660. - var self;
- 1661. -
- 1662. - function saveValue(newValue) {
- 1663. -
- 1664. - if (newValue == defaultValue) {
- 1665. - return;
- 1666. - }
- 1667. -
- 1668. - var unknownError = getLang('ads_error_unexpected_error_try_later');
- 1669. -
- 1670. - var params = {};
- 1671. - params.union_id = unionId;
- 1672. - params.hash = hash;
- 1673. - extend(params, additionalParams);
- 1674. - params[valueType] = newValue;
- 1675. -
- 1676. - function onAjaxComplete(response) {
- 1677. - if (isObject(response)) {
- 1678. - if (response.error) {
- 1679. - showLongError.call(self, response.error);
- 1680. - } else if (!response.not_changed) {
- 1681. - if (response[valueType + '_value'] !== undefined) {
- 1682. - applyNewValue(response[valueType + '_value'], response[valueType + '_text']);
- 1683. - if (additionalParams.reload) {
- 1684. - nav.reload();
- 1685. - }
- 1686. - } else {
- 1687. - showLongError.call(self, unknownError);
- 1688. - }
- 1689. - }
- 1690. - } else {
- 1691. - showLongError.call(self, unknownError);
- 1692. - }
- 1693. -
- 1694. - hide(progressElem);
- 1695. - show(boxElem);
- 1696. -
- 1697. - return true;
- 1698. - }
- 1699. - ajax.post('/ads?act=a_unions_general_info_save', params, {onDone: onAjaxComplete, onFail: onAjaxComplete});
- 1700. -
- 1701. - hide(boxElem);
- 1702. - show(progressElem);
- 1703. - }
- 1704. -
- 1705. - function applyNewValue(newValue, newText) {
- 1706. - defaultValue = newValue;
- 1707. - self.setOptions({title: newText});
- 1708. - menuElem.innerHTML = newText;
- 1709. - }
- 1710. - function showLongError(error) {
- 1711. - showFastBox(getLang('ads_error_box_title'), error);
- 1712. - }
- 1713. -
- 1714. - function onMenuChange(event) {
- 1715. - var newValue = event.target.index;
- 1716. - saveValue(newValue);
- 1717. - }
- 1718. -
- 1719. - var options = {};
- 1720. - options.target = menuElem;
- 1721. - options.onSelect = onMenuChange;
- 1722. - options.showHover = false;
- 1723. - options.updateTarget = false;
- 1724. - self = new DropdownMenu(items, options);
- 1725. - }
- 1726. -
- 1727. - Ads.MultiDropdownMenu = function(items, options) {
- 1728. - var dropdownMenu;
- 1729. - var selectedItems = {};
- 1730. - var curItems = [];
- 1731. -
- 1732. - function onItemClick(e) {
- 1733. - if (e.target.className == 'ads_dd_menu_item_checkbox_on') {
- 1734. - selectedItems[e.target.index] = false;
- 1735. - e.target.className = 'ads_dd_menu_item_checkbox_off';
- 1736. - } else {
- 1737. - selectedItems[e.target.index] = true;
- 1738. - e.target.className = 'ads_dd_menu_item_checkbox_on';
- 1739. - }
- 1740. - return false;
- 1741. - }
- 1742. -
- 1743. - for (var i in items) {
- 1744. - curItems[i] = {};
- 1745. - for (var j in items[i]) {
- 1746. - curItems[i][j] = items[i][j];
- 1747. - }
- 1748. - curItems[i].onClick = onItemClick;
- 1749. - curItems[i].c = 'ads_dd_menu_item_checkbox_off';
- 1750. - selectedItems[curItems[i].i] = false;
- 1751. - }
- 1752. -
- 1753. - dropdownMenu = new DropdownMenu(curItems, options);
- 1754. - dropdownMenu.getSelectedItems = function() {
- 1755. - var selectedItemsResult = [];
- 1756. - for (var i in selectedItems) {
- 1757. - if (selectedItems[i]) {
- 1758. - selectedItemsResult.push(i);
- 1759. - }
- 1760. - }
- 1761. - return selectedItemsResult;
- 1762. - }
- 1763. -
- 1764. - return dropdownMenu;
- 1765. - }
- 1766. -
- 1767. - Ads.getCampaignsTotalLabel = function(total) {
- 1768. - var type = this._curFilter;
- 1769. - if (typeof type == 'object') type = type[0];
- 1770. - if (!this._curSearchString || this._curSearchString == '') {
- 1771. - switch (type) {
- 1772. - case 0: return getLang('ads_stopped_campaigns_total', total);
- 1773. - case 1: return getLang('ads_running_campaigns_total', total);
- 1774. - case 3: return getLang('ads_planned_campaigns_total', total);
- 1775. - case 4: return getLang('ads_archived_campaigns_total', total);
- 1776. - default: return getLang('ads_active_campaigns_total', total);
- 1777. - }
- 1778. - } else {
- 1779. - switch (type) {
- 1780. - case 0: return getLang('ads_stopped_campaigns_found', total);
- 1781. - case 1: return getLang('ads_running_campaigns_found', total);
- 1782. - case 3: return getLang('ads_planned_campaigns_found', total);
- 1783. - case 4: return getLang('ads_archived_campaigns_found', total);
- 1784. - default: return getLang('ads_active_campaigns_found', total);
- 1785. - }
- 1786. - }
- 1787. - }
- 1788. -
- 1789. - Ads.getNoCampaignsLabel = function() {
- 1790. - var type = this._curFilter;
- 1791. - if (typeof type == 'object') type = type[0];
- 1792. - if (!this._curSearchString || this._curSearchString == '') {
- 1793. - switch (type) {
- 1794. - case 0: return getLang('ads_no_stopped_campaigns');
- 1795. - case 1: return getLang('ads_no_running_campaigns');
- 1796. - case 3: return getLang('ads_no_planned_campaigns');
- 1797. - case 4: return getLang('ads_no_archived_campaigns');
- 1798. - default: return getLang('ads_no_active_campaigns');
- 1799. - }
- 1800. - } else {
- 1801. - switch (type) {
- 1802. - case 0: return getLang('ads_no_stopped_campaigns_found');
- 1803. - case 1: return getLang('ads_no_running_campaigns_found');
- 1804. - case 3: return getLang('ads_no_planned_campaigns_found');
- 1805. - case 4: return getLang('ads_no_archived_campaigns_found');
- 1806. - default: return getLang('ads_no_active_campaigns_found');
- 1807. - }
- 1808. - }
- 1809. - }
- 1810. -
- 1811. - Ads.getAdsTotalLabel = function(total) {
- 1812. - var type = this._curFilter;
- 1813. - if (typeof type == 'object') type = type[0];
- 1814. - if (!this._curSearchString || this._curSearchString == '') {
- 1815. - switch (type) {
- 1816. - case 0: return getLang('ads_stopped_ads_total', total);
- 1817. - case 1: return getLang('ads_running_ads_total', total);
- 1818. - case 3: return getLang('ads_planned_ads_total', total);
- 1819. - case 4: return getLang('ads_archived_ads_total', total);
- 1820. - default: return getLang('ads_active_ads_total', total);
- 1821. - }
- 1822. - } else {
- 1823. - switch (type) {
- 1824. - case 0: return getLang('ads_stopped_ads_found', total);
- 1825. - case 1: return getLang('ads_running_ads_found', total);
- 1826. - case 3: return getLang('ads_planned_ads_found', total);
- 1827. - case 4: return getLang('ads_archived_ads_found', total);
- 1828. - default: return getLang('ads_active_ads_found', total);
- 1829. - }
- 1830. - }
- 1831. - }
- 1832. -
- 1833. - Ads.getNoAdsLabel = function() {
- 1834. - var type = this._curFilter;
- 1835. - if (typeof type == 'object') type = type[0];
- 1836. - if (!this._curSearchString || this._curSearchString == '') {
- 1837. - switch (type) {
- 1838. - case 0: return getLang('ads_no_stopped_ads');
- 1839. - case 1: return getLang('ads_no_running_ads');
- 1840. - case 3: return getLang('ads_no_planned_ads');
- 1841. - case 4: return getLang('ads_no_archived_ads');
- 1842. - default: return getLang('ads_no_active_ads');
- 1843. - }
- 1844. - } else {
- 1845. - switch (type) {
- 1846. - case 0: return getLang('ads_no_stopped_ads_found');
- 1847. - case 1: return getLang('ads_no_running_ads_found');
- 1848. - case 3: return getLang('ads_no_planned_ads_found');
- 1849. - case 4: return getLang('ads_no_archived_ads_found');
- 1850. - default: return getLang('ads_no_active_ads_found');
- 1851. - }
- 1852. - }
- 1853. - }
- 1854. -
- 1855. - Ads.getClientsTotalLabel = function(total) {
- 1856. - var type = this._curFilter;
- 1857. - if (typeof type == 'object') type = type[0];
- 1858. - if (!this._curSearchString || this._curSearchString == '') {
- 1859. - switch (type) {
- 1860. - case 4: return getLang('ads_archived_clients_total', total);
- 1861. - default: return getLang('ads_active_clients_total', total);
- 1862. - }
- 1863. - } else {
- 1864. - switch (type) {
- 1865. - case 4: return getLang('ads_archived_clients_found', total);
- 1866. - default: return getLang('ads_active_clients_found', total);
- 1867. - }
- 1868. - }
- 1869. - }
- 1870. -
- 1871. - Ads.getNoClientsLabel = function() {
- 1872. - var type = this._curFilter;
- 1873. - if (typeof type == 'object') type = type[0];
- 1874. - if (!this._curSearchString || this._curSearchString == '') {
- 1875. - switch (type) {
- 1876. - case 4: return getLang('ads_no_archived_clients');
- 1877. - default: return getLang('ads_no_active_clients');
- 1878. - }
- 1879. - } else {
- 1880. - switch (type) {
- 1881. - case 4: return getLang('ads_no_archived_clients_found');
- 1882. - default: return getLang('ads_no_active_clients_found');
- 1883. - }
- 1884. - }
- 1885. - }
- 1886. -
- 1887. - Ads.addOfficeFormatFunctions = function(options) {
- 1888. - var arrFind = function(arr, val) {
- 1889. - var i = 0;
- 1890. - for (; i < arr.length; i++) {
- 1891. - if (arr[i] === val) {
- 1892. - return i;
- 1893. - }
- 1894. - }
- 1895. - return -1;
- 1896. - }
- 1897. -
- 1898. - var ind = arrFind(options.columnClasses, 'column_name_view');
- 1899. - options.columnFormatting[ind] = function(data, rown) {
- 1900. - if (rown == -1) return data;
- 1901. - var unionId = this.content.extra.unionId[rown];
- 1902. - return '<div class="ads_paginated_table_name"><a href="/ads?act=office&union_id=' + unionId + '">' + data + '</a></div>';
- 1903. - }
- 1904. -
- 1905. - var limitFormat = function(data, rown, coln) {
- 1906. - if (rown == -1) return data;
- 1907. - var wrap;
- 1908. - try {
- 1909. - var uid = this.content.extra.uid[rown][coln];
- 1910. - if (uid) {
- 1911. - wrap = "<img id=\"inline_edit_progress" + uid + "\" src=\"/images/upload.gif\" style=\"display: none;\" /><a id=\"inline_edit_value" + uid + "\" >{value}</a>";
- 1912. - }
- 1913. - } catch (e) {
- 1914. - // Nothing
- 1915. - }
- 1916. - if (!wrap) {
- 1917. - wrap = '{value}';
- 1918. - }
- 1919. - var value = data;
- 1920. - if (data == 0) {
- 1921. - value = getLang('ads_no_money_limit');
- 1922. - } else {
- 1923. - value = this._formatData(data, 'currency_int');
- 1924. - }
- 1925. - return wrap.replace('{value}', value);
- 1926. - }
- 1927. - ind = arrFind(options.columnClasses, 'column_day_limit_view');
- 1928. - if (ind != -1) options.columnFormatting[ind] = limitFormat;
- 1929. - ind = arrFind(options.columnClasses, 'column_month_limit_view');
- 1930. - if (ind != -1) options.columnFormatting[ind] = limitFormat;
- 1931. - ind = arrFind(options.columnClasses, 'column_all_limit_view');
- 1932. - if (ind != -1) options.columnFormatting[ind] = limitFormat;
- 1933. -
- 1934. - return options;
- 1935. - }
- 1936. -
- 1937. - Ads.createOfficePaginatedTable = function(container, options, content) {
- 1938. - var getButton = function(label, callback) {
- 1939. - var div = ce('div', {className: 'button_blue'});
- 1940. - var butt = ce('button', {innerHTML: label, onclick: callback});
- 1941. - div.appendChild(butt);
- 1942. - return div;
- 1943. - }
- 1944. -
- 1945. - var statusCol = 1;
- 1946. -
- 1947. - var selected;
- 1948. -
- 1949. - var buttons = [],
- 1950. - labels = [getLang('ads_status_do_disable'),
- 1951. - getLang('ads_status_do_enable'),
- 1952. - getLang('ads_status_do_archive')];
- 1953. -
- 1954. -
- 1955. - var changeStatus = function(val) {
- 1956. - return function() {
- 1957. - var unionIds = [],
- 1958. - hashes = [],
- 1959. - hashesDel = [],
- 1960. - enable = val; // 1 - on, 0 - off, 2 - delete
- 1961. - var i;
- 1962. - for (i in selected) {
- 1963. - unionIds.push(pt.content.extra.union_id[selected[i]][statusCol]);
- 1964. - hashes.push(pt.content.extra.hash[selected[i]][statusCol]);
- 1965. - hashesDel.push(pt.content.extra.hash_delete[selected[i]][statusCol]);
- 1966. - }
- 1967. -
- 1968. - unionIds = unionIds.join(',');
- 1969. - hashes = hashes.join(',');
- 1970. - hashesDel = hashesDel.join(',');
- 1971. -
- 1972. - if (val == 2) { // delete
- 1973. - Ads.openDeleteUnionBox(cur.tableUnionTypeForDelete, unionIds, hashesDel, lockChangeStatus, unlockChangeStatus, updateStatusInTable, 2);
- 1974. - return;
- 1975. - }
- 1976. -
- 1977. - var params = {
- 1978. - union_id: unionIds,
- 1979. - hash: hashes,
- 1980. - newclass: 1,
- 1981. - enable: val
- 1982. - };
- 1983. -
- 1984. - lockChangeStatus();
- 1985. -
- 1986. - function lockChangeStatus() {
- 1987. - lockButton(buttons[val]);
- 1988. - return true;
- 1989. - };
- 1990. - function unlockChangeStatus() {
- 1991. - unlockButton(buttons[val]);
- 1992. - }
- 1993. - function updateStatusInTable(ans) {
- 1994. - if (ans['status_class']) ans = [ans];
- 1995. -
- 1996. - var errored = 0;
- 1997. - for (var i in selected) {
- 1998. - if (!ans[i]) continue;
- 1999. - if (!ans[i]['status_class']) {
- 2000. - if (ans[i]['error'] && !errored) {
- 2001. - errored = 1;
- 2002. - showFastBox(getLang('ads_cant_start_ad_box_title'), ans[i]['error']);
- 2003. - }
- 2004. - continue;
- 2005. - }
- 2006. - pt.content.types[selected[i]] = ans[i]['status_type'];
- 2007. - pt.content.extra.status_text[selected[i]][statusCol] = ans[i]['status'];
- 2008. - pt.content.extra.status_variants[selected[i]][statusCol] = ans[i]['status_variants'];
- 2009. - pt._updateValue(selected[i], statusCol, ans[i]['status_class']);
- 2010. - }
- 2011. - updateButtons.apply(pt);
- 2012. - }
- 2013. -
- 2014. - function onRequestComplete(response) {
- 2015. - // response may be object or array
- 2016. -
- 2017. - unlockChangeStatus();
- 2018. -
- 2019. - if (!response || response.error) { // no isObject or isArray check here
- 2020. - debugLog('onFail change status');
- 2021. - var errorMessage = ((response && response.error) ? response.error : getLang('ads_error_unexpected_error_try_later'));
- 2022. - showFastBox(getLang('ads_cant_start_ad_box_title'), errorMessage);
- 2023. - return true;
- 2024. - }
- 2025. -
- 2026. - var info = '';
- 2027. - if (response && response.info) {
- 2028. - info = response.info;
- 2029. - }
- 2030. - debugLog('onDone change status, ' + info);
- 2031. -
- 2032. - updateStatusInTable(response);
- 2033. - return true;
- 2034. - }
- 2035. -
- 2036. - ajax.post('/ads?act=a_union_change_status', params, {onDone: onRequestComplete, onFail: onRequestComplete});
- 2037. - };
- 2038. - }
- 2039. -
- 2040. - var updateButtons = function() {
- 2041. - selected = this.getSelection(0, 1);
- 2042. - var i;
- 2043. - for (i in buttons) {
- 2044. - hide(buttons[i]);
- 2045. - }
- 2046. - if (selected.length == 0) {
- 2047. - } else {
- 2048. - var was = [false, false];
- 2049. - var on = {on: 1, pending: 1},
- 2050. - off = {off: 1, off_red: 1, cross: 1};
- 2051. - for (i in selected) {
- 2052. - var stat = this.content.data[selected[i]][statusCol];
- 2053. - if (on[stat]) was[0] = 1;
- 2054. - if (off[stat]) was[1] = 1;
- 2055. - }
- 2056. - if (was[0]) show(buttons[0]);
- 2057. - if (was[1]) show(buttons[1]);
- 2058. - show(buttons[2]);
- 2059. - }
- 2060. - }
- 2061. -
- 2062. - options.onCheckboxPick = updateButtons;
- 2063. - options.onRefresh = updateButtons;
- 2064. -
- 2065. - options = Ads.addOfficeFormatFunctions(options);
- 2066. -
- 2067. - var i;
- 2068. - for (i = 0; i < 3; i++) {
- 2069. - buttons[i] = getButton(labels[i], changeStatus(i));
- 2070. - }
- 2071. -
- 2072. - var pt = new PaginatedTable(container, options, content);
- 2073. - // pt.getData('/ads?act=a_unions_table&union_id=1000157403&period_key=20111018&sort_key=default_r&offset={offset}&limit={limit}');
- 2074. -
- 2075. - // mass actions
- 2076. - var container = ge('pt_' + pt.globalNum + '_mass_act_default_container');
- 2077. - if (container) {
- 2078. - addClass(container, 'ads_mass_act_container');
- 2079. - container.appendChild(buttons[1]);
- 2080. - container.appendChild(buttons[0]);
- 2081. - container.appendChild(buttons[2]);
- 2082. - for (i in buttons) {
- 2083. - hide(buttons[i]);
- 2084. - }
- 2085. - show(container);
- 2086. - }
- 2087. -
- 2088. - // selecting subclasses
- 2089. - var selectSubclass = function(classes) {
- 2090. - return function() {
- 2091. - var corr = 1;
- 2092. - for (i = 0; i < pt.tableSize; i++) {
- 2093. - if (i < pt.curFrom || i > pt.curTo) continue;
- 2094. - var j = pt.permutation[i];
- 2095. - var curClass = pt.content.data[j][statusCol];
- 2096. - corr &= ((pt.selection[j] == 1) == (classes[curClass] == 1));
- 2097. - }
- 2098. - var checked = 1 ^ corr;
- 2099. - for (i = 0; i < pt.tableSize; i++) {
- 2100. - if (i < pt.curFrom || i > pt.curTo) continue;
- 2101. - var j = pt.permutation[i];
- 2102. - var curClass = pt.content.data[j][statusCol];
- 2103. - var curToggle = classes[curClass] ? checked : 0;
- 2104. - var el = ge('cb_row_' + j + '_' + pt.globalNum);
- 2105. - if (el) {
- 2106. - window[curToggle ? 'addClass' : 'removeClass'](el, 'on');
- 2107. - }
- 2108. - pt.toggleCheckbox(false, j, curToggle);
- 2109. - }
- 2110. - };
- 2111. - }
- 2112. - container = ge('select_all_link');
- 2113. - if (container) {
- 2114. - container.onclick = selectSubclass({on: 1, off: 1, off_red: 1, cross: 1, pending: 1});
- 2115. - }
- 2116. - container = ge('select_running_link');
- 2117. - if (container) {
- 2118. - container.onclick = selectSubclass({on: 1});
- 2119. - }
- 2120. - container = ge('select_stopped_link');
- 2121. - if (container) {
- 2122. - container.onclick = selectSubclass({off: 1, off_red: 1, cross: 1});
- 2123. - }
- 2124. - }
- 2125. -
- 2126. - Ads.onStatusHover = function(elem, callback, rown, coln) {
- 2127. - var _t = this;
- 2128. - var options = {
- 2129. - status: {type: this.content.data[rown][coln], title: this.content.extra.status_text[rown][coln]},
- 2130. - items: this.content.extra.status_variants[rown][coln],
- 2131. - popupTime: -1,
- 2132. - onSelect: function(event) { // copypasted
- 2133. - var index = event.target.index,
- 2134. - unionId = _t.content.extra.union_id[rown][coln],
- 2135. - hash = _t.content.extra.hash[rown][coln],
- 2136. - hashDelete = _t.content.extra.hash_delete[rown][coln];
- 2137. -
- 2138. - if (index == 'archived') {
- 2139. - setTimeout(function(){
- 2140. - Ads.openDeleteUnionBox(cur.tableUnionTypeForDelete, unionId, hashDelete, lockChangeStatus, unlockChangeStatus, updateStatusInTable, 1);
- 2141. - }, 1);
- 2142. - return;
- 2143. - }
- 2144. -
- 2145. - var params = {};
- 2146. - params.union_id = unionId;
- 2147. - params.hash = hash;
- 2148. - params.newclass = 1;
- 2149. -
- 2150. - params.enable = ((index == 'on') ? 1 : 0);
- 2151. -
- 2152. - lockChangeStatus();
- 2153. -
- 2154. - function lockChangeStatus() {
- 2155. - var selectorBox = ge('union_' + unionId + '_status_selector_box');
- 2156. - var progress = ge('union_' + unionId + '_status_progress');
- 2157. - hide(selectorBox);
- 2158. - show(progress);
- 2159. - return true;
- 2160. - };
- 2161. - function unlockChangeStatus() {
- 2162. - var selectorBox = ge('union_' + unionId + '_status_selector_box');
- 2163. - var progress = ge('union_' + unionId + '_status_progress');
- 2164. - hide(progress)
- 2165. - show(selectorBox);
- 2166. - }
- 2167. - function updateStatusInTable(status, status_class, status_type, status_variants) {
- 2168. - if (!status && !status_class) return;
- 2169. -
- 2170. - var ret = {
- 2171. - value: status_class,
- 2172. - extra: {
- 2173. - status_text: status,
- 2174. - status_variants: status_variants
- 2175. - },
- 2176. - type: status_type
- 2177. - };
- 2178. -
- 2179. - if (status_class == 'deleted') {
- 2180. - ret.listeners = false;
- 2181. - ret.extra.link_class = '';
- 2182. - }
- 2183. - callback(ret);
- 2184. - }
- 2185. -
- 2186. - function onRequestComplete(response) {
- 2187. - unlockChangeStatus();
- 2188. -
- 2189. - if (!isObject(response) || response.error) {
- 2190. - debugLog('onFail change status');
- 2191. - var errorMessage = (isObject(response) ? response.error : getLang('ads_error_unexpected_error_try_later'));
- 2192. - showFastBox(getLang('ads_cant_start_ad_box_title'), errorMessage);
- 2193. - return true;
- 2194. - }
- 2195. -
- 2196. - var info = '';
- 2197. - if (response && response.info) {
- 2198. - info = response.info;
- 2199. - }
- 2200. - debugLog('onDone change status, ' + info);
- 2201. -
- 2202. - updateStatusInTable(response.status, response.status_class, response.status_type, response.status_variants);
- 2203. - return true;
- 2204. - }
- 2205. -
- 2206. - ajax.post('/ads?act=a_union_change_status', params, {onDone: onRequestComplete, onFail: onRequestComplete});
- 2207. - }
- 2208. - };
- 2209. -
- 2210. - var sdd;
- 2211. - if (!cur._statusDropdown) {
- 2212. - var handler = elem.getAttribute('onclick');
- 2213. - sdd = cur._statusDropdown = Ads.statusDropdown(elem, options);
- 2214. - elem.setAttribute('onclick', handler);
- 2215. - elem.onclick = function(){eval(handler);};
- 2216. - } else {
- 2217. - sdd = cur._statusDropdown;
- 2218. - sdd.hideHeader();
- 2219. - clearTimeout(sdd.timer);
- 2220. - sdd.setContainer(elem);
- 2221. - sdd.setStatus(options.status);
- 2222. - sdd.setItems(options.items);
- 2223. - sdd.setHandler(options.onSelect);
- 2224. - }
- 2225. -
- 2226. - sdd.onOver();
- 2227. - }
- 2228. -
- 2229. - Ads.statusDropdown = function(container, options) {
- 2230. - container = ge(container);
- 2231. - if (!container) return false;
- 2232. -
- 2233. - options = extend({
- 2234. - popupTime: 200, // -1 means 'always show entire body'
- 2235. - status: {type: 'off', title: 'Disabled'},
- 2236. - onSelect: function() {}
- 2237. - }, options);
- 2238. -
- 2239. - var compareTypes = function(type1, type2) {
- 2240. - var same = {
- 2241. - on: {
- 2242. - on: 1,
- 2243. - pending: 1
- 2244. - },
- 2245. - off: {
- 2246. - off: 1,
- 2247. - off_red: 1,
- 2248. - cross: 1
- 2249. - },
- 2250. - archived: {
- 2251. - deleted: 1
- 2252. - }
- 2253. - };
- 2254. - if (!same[type1]) return 0;
- 2255. - return same[type1][type2] || 0;
- 2256. - }
- 2257. -
- 2258. - var items = clone(options.items);
- 2259. - for (var i in items) {
- 2260. - if (compareTypes(items[i]['i'], options.status.type)) {
- 2261. - delete items[i];
- 2262. - }
- 2263. - }
- 2264. -
- 2265. - var imgSpanFake = {className: geByClass('ads_status_image_span', container)[0].className};
- 2266. - var imgSpanHTML = '<span class="' + imgSpanFake.className + '"></span>';
- 2267. -
- 2268. - var deltaTop = 0, deltaLeft = 0;
- 2269. - if (browser.opera) deltaTop += -1;
- 2270. - if (browser.mozilla) deltaTop += -1;
- 2271. - if (browser.msie) { deltaTop += -1; deltaLeft += 1; }
- 2272. -
- 2273. - var dd = new DropdownMenu(items, {
- 2274. - title: imgSpanHTML + options.status.title,
- 2275. - target: container,
- 2276. - onSelect: options.onSelect,
- 2277. - showHover: false,
- 2278. - updateTarget: false,
- 2279. - offsetTop: -2 + deltaTop,
- 2280. - offsetLeft: -1 + deltaLeft
- 2281. - });
- 2282. - dd.hide();
- 2283. - addClass(dd.header, 'ads_dd_wide');
- 2284. - addClass(dd.body, 'ads_dd_wide');
- 2285. -
- 2286. - var showTimer, hideTimer;
- 2287. - var overListener = function() {
- 2288. - if (hideTimer) {
- 2289. - clearTimeout(hideTimer);
- 2290. - hideTimer = false;
- 2291. - }
- 2292. - if (options.popupTime == -1) {
- 2293. - dd.show();
- 2294. - return true;
- 2295. - }
- 2296. - showTimer = setTimeout(function() {
- 2297. - showTimer = false;
- 2298. - ret.showHeader();
- 2299. - }, options.popupTime);
- 2300. - };
- 2301. - var outListenerSoft = function() {
- 2302. - if (showTimer) {
- 2303. - clearTimeout(showTimer);
- 2304. - showTimer = false;
- 2305. - } else {
- 2306. - hideTimer = setTimeout(function() {
- 2307. - hideTimer = false;
- 2308. - ret.hideHeader();
- 2309. - }, 500);
- 2310. - }
- 2311. - };
- 2312. - var outListenerHard = function() {
- 2313. - hideTimer = setTimeout(function() {
- 2314. - hideTimer = false;
- 2315. - ret.hideHeader();
- 2316. - }, 500);
- 2317. - };
- 2318. -
- 2319. - if (options.popupTime != -1) {
- 2320. - addEvent(dd.header, 'click', function() {removeClass(dd.header, 'ads_dd_header_popup');});
- 2321. - addEvent(container, 'click', function() {ret.showBody();});
- 2322. -
- 2323. - addEvent(container, 'mouseover', overListener);
- 2324. - addEvent(container, 'mouseout', outListenerSoft);
- 2325. - addEvent(dd.header, 'mouseover', overListener);
- 2326. - addEvent(dd.header, 'mouseout', outListenerHard);
- 2327. - addEvent(dd.body, 'mouseover', overListener);
- 2328. - addEvent(dd.body, 'mouseout', outListenerHard);
- 2329. - }
- 2330. -
- 2331. - var clearTimers = function() {
- 2332. - if (showTimer) {
- 2333. - clearTimeout(showTimer);
- 2334. - showTimer = false;
- 2335. - }
- 2336. - if (hideTimer) {
- 2337. - clearTimeout(hideTimer);
- 2338. - hideTimer = false;
- 2339. - }
- 2340. - }
- 2341. -
- 2342. - var ret = {
- 2343. - getStatus: function() {
- 2344. - return options.status;
- 2345. - },
- 2346. - setStatus: function(status) {
- 2347. - removeClass(imgSpanFake, 'status_' + options.status.type);
- 2348. - options.status = status;
- 2349. - addClass(imgSpanFake, 'status_' + options.status.type);
- 2350. - dd.setOptions({title: '<span class="' + imgSpanFake.className + '"></span>' + options.status.title});
- 2351. - },
- 2352. - setContainer: function(newContainer) {
- 2353. - if (!newContainer) return false;
- 2354. - clearTimers();
- 2355. - if (options.popupTime != -1) {
- 2356. - removeEvent(container, 'mouseover', overListener);
- 2357. - removeEvent(container, 'mouseout', outListenerSoft);
- 2358. - removeEvent(dd.header, 'mouseover', overListener);
- 2359. - removeEvent(dd.header, 'mouseout', outListenerHard);
- 2360. - removeEvent(dd.body, 'mouseover', overListener);
- 2361. - removeEvent(dd.body, 'mouseout', outListenerHard);
- 2362. - }
- 2363. - container = newContainer;
- 2364. - dd.setOptions({target: container});
- 2365. - dd.moveToTarget();
- 2366. - if (options.popupTime != -1) {
- 2367. - addEvent(container, 'mouseover', overListener);
- 2368. - addEvent(container, 'mouseout', outListenerSoft);
- 2369. - addEvent(dd.header, 'mouseover', overListener);
- 2370. - addEvent(dd.header, 'mouseout', outListenerHard);
- 2371. - addEvent(dd.body, 'mouseover', overListener);
- 2372. - addEvent(dd.body, 'mouseout', outListenerHard);
- 2373. - }
- 2374. - },
- 2375. - setItems: function(newItems) {
- 2376. - var items = clone(newItems);
- 2377. - for (var i in items) {
- 2378. - if (compareTypes(items[i]['i'], options.status.type)) {
- 2379. - delete items[i];
- 2380. - }
- 2381. - }
- 2382. - dd.setData(items);
- 2383. - },
- 2384. - setHandler: function(handler) {
- 2385. - dd.setOptions({onSelect: handler});
- 2386. - },
- 2387. - showHeader: function() {
- 2388. - if (!dd.visible) {
- 2389. - addClass(dd.header, 'ads_dd_header_popup');
- 2390. - }
- 2391. - dd.moveToTarget();
- 2392. - show(dd.header);
- 2393. - },
- 2394. - hideHeader: function() {
- 2395. - dd.hide();
- 2396. - hide(dd.header);
- 2397. - removeClass(dd.header, 'ads_dd_header_popup');
- 2398. - },
- 2399. - showBody: function() {
- 2400. - removeClass(dd.header, 'ads_dd_header_popup');
- 2401. - dd.show();
- 2402. - },
- 2403. - hideBody: function() {
- 2404. - dd.hide();
- 2405. - },
- 2406. - onOver: overListener,
- 2407. - onOut: outListenerHard
- 2408. - };
- 2409. -
- 2410. - return ret;
- 2411. - }
- 2412. -
- 2413. - Ads.changeDemographyView = function(name, unionId, updateOnly) {
- 2414. -
- 2415. - // Change navigation
- 2416. - var navCur = ge('ads_demography_navigation_tab_' + name);
- 2417. - if (!navCur) {
- 2418. - return;
- 2419. - }
- 2420. - navCur = navCur.parentNode;
- 2421. - var navCurSelected = hasClass(navCur, 'summary_tab_sel');
- 2422. - if (navCurSelected && !updateOnly || !navCurSelected && updateOnly) {
- 2423. - return;
- 2424. - }
- 2425. - var navElems = [
- 2426. - ge('ads_demography_navigation_tab_bars_all').parentNode,
- 2427. - ge('ads_demography_navigation_tab_graphs').parentNode
- 2428. - ];
- 2429. - for (var i in navElems) {
- 2430. - var navElem = navElems[i];
- 2431. - addClass(navElem, 'summary_tab');
- 2432. - removeClass(navElem, 'summary_tab_sel');
- 2433. - }
- 2434. - addClass(navCur, 'summary_tab_sel');
- 2435. - removeClass(navCur, 'summary_tab');
- 2436. -
- 2437. - // Change graph
- 2438. - var bars1 = ge('ads_demography_bars_all_wrap1');
- 2439. - var bars2 = ge('ads_demography_bars_all_wrap2');
- 2440. - var graphs1 = ge('ads_demography_graphs_wrap1');
- 2441. - var graphs2 = ge('ads_demography_graphs_wrap2');
- 2442. -
- 2443. - if (name === 'bars_all') {
- 2444. - setStyle(bars1, {visibility: 'visible', height: getSize(bars2)[1] + 'px'})
- 2445. - setStyle(bars2, {top: '0'})
- 2446. - setStyle(graphs1, {visibility: 'hidden', height: '0'});
- 2447. - } else if (name === 'graphs') {
- 2448. - if (!Ads.loadDemography(unionId)) {
- 2449. - return;
- 2450. - }
- 2451. -
- 2452. - !cur.graphUsersStatsSexEmpty && cur.pageGraphs['ads_graph_users_stats_day_sex'].loadGraph(intval(cur.lastDemographySourceOffset));
- 2453. - !cur.graphUsersStatsAgeEmpty && cur.pageGraphs['ads_graph_users_stats_day_age'].loadGraph(intval(cur.lastDemographySourceOffset) * 3 + intval(cur.lastDemographyAgeOffset));
- 2454. - !cur.graphUsersStatsCitiesEmpty && cur.pageGraphs['ads_graph_users_stats_day_cities'].loadGraph(intval(cur.lastDemographySourceOffset));
- 2455. -
- 2456. - setStyle(graphs2, {width: getSize(graphs1)[0] + 'px'});
- 2457. - setStyle(graphs1, {visibility: 'visible', height: getSize(graphs2)[1] + 'px'});
- 2458. - setStyle(bars1, {visibility: 'hidden', height: '0'});
- 2459. - setStyle(bars2, {position: 'absolute', top: '-100000px'});
- 2460. - }
- 2461. - }
- 2462. -
- 2463. - Ads.changeDemographySource = function(name) {
- 2464. -
- 2465. - // Change navigation
- 2466. - var clicksSideNav = ge('ads_demography_navigation_clicks');
- 2467. - var viewsSideNav = ge('ads_demography_navigation_views');
- 2468. - var clicksTabNav = ge('ads_demography_navigation_tab_clicks');
- 2469. - var viewsTabNav = ge('ads_demography_navigation_tab_views');
- 2470. - if (clicksTabNav) {
- 2471. - clicksTabNav = clicksTabNav.parentNode;
- 2472. - viewsTabNav = viewsTabNav.parentNode;
- 2473. - }
- 2474. - if (name == 'clicks') {
- 2475. - if (clicksSideNav) {
- 2476. - if (hasClass(clicksSideNav, 'nav_selected')) {
- 2477. - return;
- 2478. - }
- 2479. - addClass(clicksSideNav, 'nav_selected');
- 2480. - removeClass(viewsSideNav, 'nav_selected');
- 2481. - }
- 2482. - if (clicksTabNav) {
- 2483. - if (hasClass(clicksTabNav, 'summary_tab_sel')) {
- 2484. - return;
- 2485. - }
- 2486. - addClass(clicksTabNav, 'summary_tab_sel');
- 2487. - addClass(viewsTabNav, 'summary_tab');
- 2488. - removeClass(clicksTabNav, 'summary_tab');
- 2489. - removeClass(viewsTabNav, 'summary_tab_sel');
- 2490. - }
- 2491. - } else {
- 2492. - if (clicksSideNav) {
- 2493. - if (hasClass(viewsSideNav, 'nav_selected')) {
- 2494. - return;
- 2495. - }
- 2496. - addClass(viewsSideNav, 'nav_selected');
- 2497. - removeClass(clicksSideNav, 'nav_selected');
- 2498. - }
- 2499. - if (clicksTabNav) {
- 2500. - if (hasClass(viewsTabNav, 'summary_tab_sel')) {
- 2501. - return;
- 2502. - }
- 2503. - addClass(viewsTabNav, 'summary_tab_sel');
- 2504. - addClass(clicksTabNav, 'summary_tab');
- 2505. - removeClass(viewsTabNav, 'summary_tab');
- 2506. - removeClass(clicksTabNav, 'summary_tab_sel');
- 2507. - }
- 2508. - }
- 2509. -
- 2510. - // Change graph
- 2511. - if (name == 'clicks') {
- 2512. - cur.lastDemographySourceOffset = 0;
- 2513. - if (cur.isDemographySvg) {
- 2514. - each(geByClass('ads_demography_bars_clicks'), function(i, el) { el.style.visibility = 'visible'; el.style.position = 'relative'; });
- 2515. - each(geByClass('ads_demography_bars_views'), function(i, el) { el.style.visibility = 'hidden'; el.style.position = 'absolute'; });
- 2516. - } else {
- 2517. - each(geByClass('ads_demography_bars_clicks'), show);
- 2518. - each(geByClass('ads_demography_bars_views'), hide);
- 2519. - }
- 2520. - try { cur.pageGraphs['ads_graph_users_stats_day_sex'].loadGraph(intval(cur.lastDemographySourceOffset)); } catch(e) {}
- 2521. - try { cur.pageGraphs['ads_graph_users_stats_day_age'].loadGraph(intval(cur.lastDemographySourceOffset) * 3 + intval(cur.lastDemographyAgeOffset)); } catch(e) {}
- 2522. - try { cur.pageGraphs['ads_graph_users_stats_day_cities'].loadGraph(intval(cur.lastDemographySourceOffset)); } catch(e) {}
- 2523. - } else {
- 2524. - cur.lastDemographySourceOffset = 1;
- 2525. - if (cur.isDemographySvg) {
- 2526. - each(geByClass('ads_demography_bars_views'), function(i, el) { el.style.visibility = 'visible'; el.style.position = 'relative'; });
- 2527. - each(geByClass('ads_demography_bars_clicks'), function(i, el) { el.style.visibility = 'hidden'; el.style.position = 'absolute'; });
- 2528. - } else {
- 2529. - each(geByClass('ads_demography_bars_views'), show);
- 2530. - each(geByClass('ads_demography_bars_clicks'), hide);
- 2531. - }
- 2532. - try { cur.pageGraphs['ads_graph_users_stats_day_sex'].loadGraph(intval(cur.lastDemographySourceOffset)); } catch(e) {}
- 2533. - try { cur.pageGraphs['ads_graph_users_stats_day_age'].loadGraph(intval(cur.lastDemographySourceOffset) * 3 + intval(cur.lastDemographyAgeOffset)); } catch(e) {}
- 2534. - try { cur.pageGraphs['ads_graph_users_stats_day_cities'].loadGraph(intval(cur.lastDemographySourceOffset)); } catch(e) {}
- 2535. - }
- 2536. - }
- 2537. -
- 2538. - Ads.changeDemographyAge = function(name) {
- 2539. - // Change navigation
- 2540. - var allNav = ge('ads_demography_navigation_tab_age_all').parentNode;
- 2541. - var femaleNav = ge('ads_demography_navigation_tab_age_female').parentNode;
- 2542. - var maleNav = ge('ads_demography_navigation_tab_age_male').parentNode;
- 2543. - switch (name) {
- 2544. - case 'all':
- 2545. - if (hasClass(allNav, 'summary_tab_sel')) {
- 2546. - return;
- 2547. - }
- 2548. - addClass(allNav, 'summary_tab_sel');
- 2549. - addClass(femaleNav, 'summary_tab');
- 2550. - addClass(maleNav, 'summary_tab');
- 2551. - removeClass(allNav, 'summary_tab');
- 2552. - removeClass(femaleNav, 'summary_tab_sel');
- 2553. - removeClass(maleNav, 'summary_tab_sel');
- 2554. - break;
- 2555. - case 'female':
- 2556. - if (hasClass(femaleNav, 'summary_tab_sel')) {
- 2557. - return;
- 2558. - }
- 2559. - addClass(femaleNav, 'summary_tab_sel');
- 2560. - addClass(allNav, 'summary_tab');
- 2561. - addClass(maleNav, 'summary_tab');
- 2562. - removeClass(femaleNav, 'summary_tab');
- 2563. - removeClass(allNav, 'summary_tab_sel');
- 2564. - removeClass(maleNav, 'summary_tab_sel');
- 2565. - break;
- 2566. - case 'male':
- 2567. - if (hasClass(maleNav, 'summary_tab_sel')) {
- 2568. - return;
- 2569. - }
- 2570. - addClass(maleNav, 'summary_tab_sel');
- 2571. - addClass(allNav, 'summary_tab');
- 2572. - addClass(femaleNav, 'summary_tab');
- 2573. - removeClass(maleNav, 'summary_tab');
- 2574. - removeClass(allNav, 'summary_tab_sel');
- 2575. - removeClass(femaleNav, 'summary_tab_sel');
- 2576. - break;
- 2577. - default:
- 2578. - return;
- 2579. - }
- 2580. -
- 2581. - // Change graph
- 2582. - switch (name) {
- 2583. - case 'all': cur.lastDemographyAgeOffset = 0; break;
- 2584. - case 'female': cur.lastDemographyAgeOffset = 1; break;
- 2585. - case 'male': cur.lastDemographyAgeOffset = 2; break;
- 2586. - default: return;
- 2587. - }
- 2588. - try { cur.pageGraphs['ads_graph_users_stats_day_age'].loadGraph(intval(cur.lastDemographySourceOffset) * 3 + intval(cur.lastDemographyAgeOffset)); } catch(e) {}
- 2589. - }
- 2590. -
- 2591. - Ads.loadDemography = function(unionId) {
- 2592. - if (!cur.demographyDelayed) {
- 2593. - return true;
- 2594. - }
- 2595. - if (!Ads.lock('load_demography', lock, unlock)) {
- 2596. - return false;
- 2597. - }
- 2598. -
- 2599. - var ajaxParams = {};
- 2600. - ajaxParams.union_id = unionId;
- 2601. -
- 2602. - ajax.post('/ads?act=a_users_stats', ajaxParams, {onDone: onComplete, onFail: onComplete});
- 2603. -
- 2604. - function lock() {
- 2605. - setStyle('ads_demography_navigation_tab_progress', {visibility: 'visible'});
- 2606. - }
- 2607. - function unlock() {
- 2608. - setStyle('ads_demography_navigation_tab_progress', {visibility: 'hidden'});
- 2609. - }
- 2610. - function onComplete(response) {
- 2611. - Ads.unlock('load_demography');
- 2612. - if (response && response.graphs_html && response.graphs_js) {
- 2613. - cur.demographyDelayed = false;
- 2614. - ge('ads_demography_graphs_wrap2').innerHTML = response.graphs_html;
- 2615. - eval(response.graphs_js);
- 2616. - Ads.changeDemographyView('graphs', unionId, true);
- 2617. - }
- 2618. - return true;
- 2619. - }
- 2620. -
- 2621. - return false;
- 2622. - }
- 2623. -
- 2624. - Ads.showEditAdminBox = function(event, unionId, userId, userEmail, isRemove) {
- 2625. - if (event && (event.which > 1 || event.button > 1 || event.ctrlKey)) {
- 2626. - return;
- 2627. - }
- 2628. -
- 2629. - userId = intval(userId);
- 2630. -
- 2631. - if (!userId && !userEmail) {
- 2632. - var userLink = ge('ads_user_link').getValue();
- 2633. - if (!userLink) {
- 2634. - showFastBox(getLang('ads_error_box_title'), getLang('ads_edit_admin_no_user_link'));
- 2635. - return;
- 2636. - }
- 2637. - }
- 2638. -
- 2639. - if (isRemove) {
- 2640. - cur.editAdminBoxTitle = getLang('ads_edit_admin_box_title_remove');
- 2641. - } else {
- 2642. - if (userId || userEmail) {
- 2643. - cur.editAdminBoxTitle = getLang('ads_edit_admin_box_title_edit');
- 2644. - } else {
- 2645. - cur.editAdminBoxTitle = getLang('ads_edit_admin_box_title_add');
- 2646. - }
- 2647. - }
- 2648. -
- 2649. - var ajaxParams = {};
- 2650. - ajaxParams.union_id = unionId;
- 2651. - if (isRemove) {
- 2652. - ajaxParams.action = 'remove';
- 2653. - } else {
- 2654. - ajaxParams.action = 'edit';
- 2655. - }
- 2656. - if (userId) {
- 2657. - ajaxParams.user_link = userId;
- 2658. - } else if (userEmail) {
- 2659. - ajaxParams.user_link = userEmail;
- 2660. - } else {
- 2661. - ajaxParams.user_link = userLink;
- 2662. - }
- 2663. -
- 2664. - var showOptions = {params: {}};
- 2665. - showOptions.onFail = Ads.onBoxFail;
- 2666. - showOptions.params.width = 440;
- 2667. -
- 2668. - showBox('/ads?act=a_edit_admin_box', ajaxParams, showOptions);
- 2669. -
- 2670. - return false;
- 2671. - }
- 2672. -
- 2673. - Ads.showRetargetingGroupBox = function(unionId, groupId) {
- 2674. - groupId = intval(groupId);
- 2675. -
- 2676. - var ajaxParams = {};
- 2677. - ajaxParams.union_id = unionId;
- 2678. - if (groupId) {
- 2679. - ajaxParams.group_id = groupId;
- 2680. - }
- 2681. -
- 2682. - var showOptions = {params: {}};
- 2683. - showOptions.onFail = Ads.onBoxFail;
- 2684. - showOptions.params.width = 400;
- 2685. -
- 2686. - showBox('/ads?act=a_retargeting_group_box', ajaxParams, showOptions);
- 2687. -
- 2688. - return false;
- 2689. - }
- 2690. -
- 2691. - Ads.showRetargetingGroupPixel = function(unionId, groupId, hash) {
- 2692. - groupId = intval(groupId);
- 2693. -
- 2694. - var ajaxParams = {};
- 2695. - ajaxParams.union_id = unionId;
- 2696. - ajaxParams.group_id = groupId;
- 2697. - ajaxParams.hash = hash;
- 2698. -
- 2699. - var showOptions = {params: {}};
- 2700. - showOptions.onFail = Ads.onBoxFail;
- 2701. - showOptions.params.width = 400;
- 2702. -
- 2703. - showBox('/ads?act=a_get_retargeting_pixel', ajaxParams, showOptions);
- 2704. -
- 2705. - return false;
- 2706. - }
- 2707. -
- 2708. - Ads.deleteRetargetingGroup = function(unionId, groupId, hash) {
- 2709. - groupId = intval(groupId);
- 2710. -
- 2711. - curBox().hide();
- 2712. - showFastBox(getLang('ads_retargeting_del_confirm_title'), getLang('ads_retargeting_del_confirm_message'), getLang('box_yes'), function() {
- 2713. - ajax.post('/ads', {act: 'a_del_retargeting_group', union_id: unionId, group_id: groupId, hash: hash}, {
- 2714. - onDone: function(html) {
- 2715. - ge('ads_retargeting_groups_table').innerHTML = html;
- 2716. - curBox().hide();
- 2717. - }
- 2718. - });
- 2719. - }, getLang('box_no'));
- 2720. -
- 2721. - return false;
- 2722. - }
- 2723. -
- 2724. - Ads.initContacts = function(selectData, ajaxParams, isBig) {
- 2725. -
- 2726. - if (cur.contacts && cur.contacts.destroy) {
- 2727. - cur.contacts.destroy();
- 2728. - }
- 2729. -
- 2730. - var destroy = [];
- 2731. -
- 2732. - cur.contacts = {};
- 2733. - cur.contacts.ajaxParams = ajaxParams;
- 2734. -
- 2735. - cur.contacts.destroy = function() {
- 2736. - for (var i in destroy) {
- 2737. - destroy[i]();
- 2738. - }
- 2739. - destroy = [];
- 2740. - }
- 2741. - cur.destroy.push(function() { cur.contacts.destroy(); });
- 2742. -
- 2743. - var uiWidth = 250 + (isBig ? 22 : 0);
- 2744. -
- 2745. - var uiCountry = null;
- 2746. - var uiCity = null;
- 2747. -
- 2748. - uiCountry = new Dropdown(ge('country'), selectData.countries, {
- 2749. - selectedItem: [selectData.country_val],
- 2750. -
- 2751. - big: isBig,
- 2752. - width: uiWidth,
- 2753. - multiselect: false,
- 2754. -
- 2755. - onChange: function(value) {
- 2756. - if (value == 1) {
- 2757. - hide('ads_contacts_form_nonresident', 'cis_msg');
- 2758. - show('ads_contacts_form_rus');
- 2759. - } else if (value > 1) {
- 2760. - hide('ads_contacts_form_rus');
- 2761. - show('ads_contacts_form_nonresident');
- 2762. - if (value < 4) show('cis_msg');
- 2763. - else hide('cis_msg');
- 2764. - }
- 2765. - if (value == -1) {
- 2766. - getAllCountries();
- 2767. - return;
- 2768. - } else if (value > 3) {
- 2769. - hide('city_row');
- 2770. - return;
- 2771. - }
- 2772. - uiCity.clear();
- 2773. - uiCity.setURL('/select_ajax.php?act=a_get_cities&country=' + value);
- 2774. - selectsData.getCountryInfo(value, 1, function(response) {
- 2775. - var new_options = {
- 2776. - defaultItems: response.cities,
- 2777. - dropdown: true
- 2778. - };
- 2779. - uiCity.setOptions(new_options);
- 2780. - if (selectData.country == value) {
- 2781. - uiCity.selectItem(selectData.city_val);
- 2782. - }
- 2783. - });
- 2784. - show(ge('city_row'));
- 2785. - }
- 2786. - });
- 2787. - destroy.push(function(){ uiCountry.destroy(); });
- 2788. -
- 2789. - uiCity = new Selector(ge('city'), '/select_ajax.php?act=a_get_cities&country='+selectData.country, {
- 2790. - defaultItems: selectData.cities,
- 2791. - selectedItems: [selectData.city_val],
- 2792. -
- 2793. - big: isBig,
- 2794. - width: uiWidth,
- 2795. - multiselect: false,
- 2796. - dropdown: true,
- 2797. -
- 2798. - placeholder: getLang('select_city_not_selected'),
- 2799. - introText: getLang('select_city_select'),
- 2800. - noResult: getLang('select_city_not_found'),
- 2801. - otherCity: getLang('select_city_other_city')
- 2802. - });
- 2803. - destroy.push(function(){ uiCity.destroy(); });
- 2804. -
- 2805. - var uiAgency = new Checkbox(ge('agency'), {
- 2806. - checked: 1,
- 2807. - width: uiWidth,
- 2808. - label: getLang('ads_help_contacts_agency'),
- 2809. -
- 2810. - onChange: function(state) {
- 2811. - if (state == 1) {
- 2812. - slideDown(ge("agency_fields"), 200);
- 2813. - } else {
- 2814. - if (isVisible('agency_fields')) {
- 2815. - slideUp(ge("agency_fields"), 200);
- 2816. - }
- 2817. - }
- 2818. - }
- 2819. - });
- 2820. - destroy.push(function(){ uiAgency.destroy(); });
- 2821. -
- 2822. - var uiDating = new Checkbox(ge('dating'), {
- 2823. - checked: 0,
- 2824. - width: uiWidth,
- 2825. - label: getLang('ads_help_contacts_dating')
- 2826. - });
- 2827. - destroy.push(function(){ uiDating.destroy(); });
- 2828. -
- 2829. - var uiMedicine = new Checkbox(ge('medicine'), {
- 2830. - checked: 0,
- 2831. - width: uiWidth,
- 2832. - label: getLang('ads_help_contacts_medicine')
- 2833. - });
- 2834. - destroy.push(function(){ uiMedicine.destroy(); });
- 2835. -
- 2836. - var uiBudget = new Dropdown(ge('budget'), selectData.budget, {
- 2837. - selectedItems: '0',
- 2838. - big: isBig,
- 2839. - width: uiWidth,
- 2840. - zeroPlaceholder: true,
- 2841. - multiselect: false
- 2842. - });
- 2843. - destroy.push(function(){ uiBudget.destroy(); });
- 2844. -
- 2845. - var uiBudgetNr = new Dropdown(ge('budget_nr'), selectData.budget, {
- 2846. - selectedItems: '0',
- 2847. - big: isBig,
- 2848. - width: uiWidth,
- 2849. - zeroPlaceholder: true,
- 2850. - multiselect: false
- 2851. - });
- 2852. - destroy.push(function(){ uiBudgetNr.destroy(); });
- 2853. -
- 2854. - if (selectData.offices) {
- 2855. - var uiOffice = new Dropdown(ge('office'), selectData.offices, {
- 2856. - selectedItems: selectData.office,
- 2857. - big: isBig,
- 2858. - width: uiWidth,
- 2859. - multiselect: false
- 2860. - });
- 2861. - destroy.push(function(){ uiOffice.destroy(); });
- 2862. - }
- 2863. -
- 2864. - function getAllCountries() {
- 2865. - function onDone(response) {
- 2866. - if (response && isArray(response.countries)) {
- 2867. - response.countries.splice(0, 1);
- 2868. - uiCountry.setData(response.countries);
- 2869. - uiCountry.val('');
- 2870. - uiCity.clear();
- 2871. - uiCity.setOptions({defaultItems: []});
- 2872. - }
- 2873. - }
- 2874. - ajax.post('/ads?act=a_get_countries', {}, {onDone: onDone});
- 2875. - }
- 2876. - }
- 2877. -
- 2878. - Ads.sendContactsForm = function(button) {
- 2879. - if (!Ads.lock('sendContactsForm', onLock, onUnlock)) {
- 2880. - return false;
- 2881. - }
- 2882. -
- 2883. - var ajaxParams = extend({}, cur.contacts.ajaxParams);
- 2884. - ajaxParams.country = ge('country').value;
- 2885. - ajaxParams.city = ge('city').value;
- 2886. - ajaxParams.agency = ge('agency').value;
- 2887. - ajaxParams.dating = ge('dating').value;
- 2888. - ajaxParams.medicine = ge('medicine').value;
- 2889. - ajaxParams = extend(ajaxParams, serializeForm(ge(ajaxParams.country == 1 ? 'ads_contacts_form_rus' : 'ads_contacts_form_nonresident')));
- 2890. -
- 2891. - ajax.post('/ads?act=a_send_contacts', ajaxParams, {onDone: onDone, onFail: onDone});
- 2892. -
- 2893. - function onDone(response) {
- 2894. - Ads.unlock('sendContactsForm');
- 2895. - if (!response || !response.result) {
- 2896. - if (!response || !response.msg) {
- 2897. - tryErrorBox(getLang('ads_error_unexpected_error_try_later'));
- 2898. - } else {
- 2899. - tryErrorBox(response.msg);
- 2900. - }
- 2901. - return true;
- 2902. - }
- 2903. - ge('ads_contacts_form').innerHTML = response.msg;
- 2904. - }
- 2905. - function tryErrorBox(message) {
- 2906. - showFastBox(getLang('global_error'), message);
- 2907. - }
- 2908. - function onLock() {
- 2909. - lockButton(button);
- 2910. - }
- 2911. - function onUnlock() {
- 2912. - unlockButton(button);
- 2913. - }
- 2914. - }
- 2915. -
- 2916. - try{stManager.done('ads.js');}catch(e){}
- ------
Advertisement
Add Comment
Please, Sign In to add comment