footer.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. </div>
  2. <script src="/js/jquery.finder.js"></script>
  3. <script type="text/javascript">
  4. lastScrollTop = 0;
  5. $(document).ready(function() {
  6. hover_menu();
  7. $(window).scroll(function(){hover_menu()});
  8. $('.l-sort-toolbar .sort-by').click(function(){
  9. $('.context-menu.sort-order').toggle().css({left: $(this).position().left - 10});
  10. });
  11. // CREATE BUTTON
  12. $('.l-sort__create-btn').hover(function(){
  13. $(".l-sort__create-btn").append("<div id='add-icon'></div>");
  14. $(".l-sort__create-btn").append("<div id='tooltip'>"+$('.l-sort__create-btn').attr('title').replace(' ','&nbsp;')+"</div>");
  15. }, function(){
  16. $("#add-icon").remove();
  17. $("#tooltip").remove();
  18. });
  19. // SEARCH BOX
  20. $('.l-sort-toolbar__search, .l-sort-toolbar__search-box .search-input').hover(function(){
  21. clearTimeout(VE.tmp.search_display_interval);
  22. clearTimeout(VE.tmp.search_hover_interval);
  23. VE.tmp.search_display_interval = setTimeout(function(){$('.search-input').addClass('activated');}, 150);
  24. }, function(){
  25. clearTimeout(VE.tmp.search_display_interval);
  26. clearTimeout(VE.tmp.search_hover_interval);
  27. VE.tmp.search_hover_interval = setTimeout(function(){
  28. if(!VE.tmp.search_activated && !$(".search-input").val().length){
  29. $(".search-input").removeClass('activated');
  30. }
  31. }, 600);
  32. });
  33. $('.search-input').focus(function(){
  34. VE.tmp.search_activated = 1;
  35. clearTimeout(VE.tmp.search_hover_interval);
  36. });
  37. $('.search-input').blur(function(){
  38. VE.tmp.search_activated = 0;
  39. clearTimeout(VE.tmp.search_hover_interval);
  40. VE.tmp.search_hover_interval = setTimeout(function(){
  41. if(!$(".search-input").val().length){
  42. $(".search-input").removeClass('activated');
  43. }
  44. }, 600);
  45. });
  46. // TIMER
  47. if($('.movement.left').length){
  48. VE.helpers.refresh_timer.right = $('.movement.right');
  49. VE.helpers.refresh_timer.left = $('.movement.left');
  50. VE.helpers.refresh_timer.start();
  51. $('.pause').click(function(){
  52. VE.helpers.refresh_timer.stop();
  53. $('.pause').addClass('hidden');
  54. $('.play').removeClass('hidden');
  55. $('.refresh-timer').addClass('paused');
  56. });
  57. $('.play').click(function(){
  58. VE.helpers.refresh_timer.start();
  59. $('.pause').removeClass('hidden');
  60. $('.play').addClass('hidden');
  61. $('.refresh-timer').removeClass('paused');
  62. });
  63. }
  64. // SORTING
  65. $('#vstobjects input, #vstobjects select, #vstobjects textarea').change(function(){VE.tmp.form_changed=1});
  66. $('.sort-order span').click(function(){
  67. $('.context-menu.sort-order').toggle();
  68. if($(this).hasClass('active'))
  69. return;
  70. $('.sort-order span').removeClass('active');
  71. $(this).addClass('active');
  72. VE.tmp.sort_par = $(this).parent('li').attr('entity');
  73. VE.tmp.sort_as_int = $(this).parent('li').attr('sort_as_int');
  74. VE.tmp.sort_direction = $(this).hasClass('up')*1 || -1;
  75. $('.l-sort .sort-by span b').html($(this).parent('li').find('.name').html());
  76. $('.l-sort .sort-by i').removeClass('l-icon-up-arrow l-icon-down-arrow');
  77. $(this).hasClass('up') ? $('.l-sort .sort-by i').addClass('l-icon-up-arrow') : $('.l-sort .sort-by i').addClass('l-icon-down-arrow');
  78. $('.units .l-unit').sort(function (a, b) {
  79. if(VE.tmp.sort_as_int)
  80. return parseInt($(a).attr(VE.tmp.sort_par)) >= parseInt($(b).attr(VE.tmp.sort_par)) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
  81. else
  82. return $(a).attr(VE.tmp.sort_par) <= $(b).attr(VE.tmp.sort_par) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
  83. }).appendTo(".l-center.units");
  84. });
  85. // STARS
  86. $('.l-unit .l-icon-star').click(function(){
  87. var l_unit = $(this).parents('.l-unit');
  88. if(l_unit.hasClass('l-unit--starred')){
  89. // removing star
  90. $.ajax({
  91. method: "POST",
  92. url: "/delete/favorite/index.php",
  93. data: { v_section: l_unit.attr('v_section'), v_unit_id: l_unit.attr('v_unit_id') }
  94. });
  95. l_unit.attr({'sort-star': 0});
  96. l_unit.removeClass('l-unit--starred');
  97. }
  98. else{
  99. $.ajax({
  100. method: "POST",
  101. url: "/add/favorite/index.php",
  102. data: { v_unit_id: l_unit.attr('v_unit_id'), v_section: l_unit.attr('v_section') }
  103. });
  104. l_unit.attr({'sort-star': 1});
  105. l_unit.addClass('l-unit--starred');
  106. }
  107. });
  108. // Shortcuts
  109. shortcut.add("Ctrl+Enter", function(){
  110. $('form#vstobjects').submit();
  111. }, {
  112. 'type': 'keydown',
  113. 'propagate': false,
  114. 'disable_in_input': false,
  115. 'target': document
  116. }
  117. );
  118. shortcut.add("Ctrl+Backspace", function(){
  119. if(VE.tmp.form_changed && $('form#vstobjects .button.cancel')[0]){
  120. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'",""));
  121. } else if($('form#vstobjects .button.cancel')[0]){
  122. location.href=$('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'","");
  123. } else if($('#vstobjects a.button.cancel')[0]){
  124. location.href=$('#vstobjects a.button.cancel').attr('href');
  125. }
  126. }, {
  127. 'type': 'keydown',
  128. 'propagate': false,
  129. 'disable_in_input': false,
  130. 'target': document
  131. }
  132. );
  133. shortcut.add("f", function(){
  134. $('.search-input').addClass('activated').focus();
  135. }, {
  136. 'type': 'keydown',
  137. 'propagate': false,
  138. 'disable_in_input': true,
  139. 'target': document
  140. }
  141. );
  142. $(window).bind('keypress', function(evt) {
  143. var tag = evt.target.tagName.toLowerCase();
  144. if (evt.charCode == 97 && tag != 'input' && tag != 'textarea' && tag != 'selectbox') {
  145. evt.preventDefault();
  146. if (!evt.ctrlKey && !evt.shiftKey) {
  147. if ($('.l-sort__create-btn')[0]) {
  148. location.href=$('.l-sort__create-btn').attr('href');
  149. }
  150. }
  151. else {
  152. if ($('.l-unit .ch-toggle:eq(0)').attr('checked')) {
  153. $('.l-unit').removeClass('selected');
  154. $('.l-unit .ch-toggle').attr('checked', false);
  155. }
  156. else {
  157. $('.l-unit').addClass('selected');
  158. $('.l-unit .ch-toggle').attr('checked', true);
  159. }
  160. }
  161. }
  162. });
  163. shortcut.add("1", function(){
  164. if(VE.tmp.form_changed){
  165. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(1) a').attr('href'));
  166. } else {
  167. location.href=$('.l-stat .l-stat__col:nth-of-type(1) a').attr('href');
  168. }
  169. }, {
  170. 'type': 'keydown',
  171. 'propagate': false,
  172. 'disable_in_input': true,
  173. 'target': document
  174. }
  175. );
  176. shortcut.add("2", function(){
  177. if(VE.tmp.form_changed){
  178. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(2) a').attr('href'));
  179. } else {
  180. location.href=$('.l-stat .l-stat__col:nth-of-type(2) a').attr('href');
  181. }
  182. }, {
  183. 'type': 'keydown',
  184. 'propagate': false,
  185. 'disable_in_input': true,
  186. 'target': document
  187. }
  188. );
  189. shortcut.add("3", function(){
  190. if(VE.tmp.form_changed){
  191. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(3) a').attr('href'));
  192. } else {
  193. location.href=$('.l-stat .l-stat__col:nth-of-type(3) a').attr('href');
  194. }
  195. }, {
  196. 'type': 'keydown',
  197. 'propagate': false,
  198. 'disable_in_input': true,
  199. 'target': document
  200. }
  201. );
  202. shortcut.add("4", function(){
  203. if(VE.tmp.form_changed){
  204. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(4) a').attr('href'));
  205. } else {
  206. location.href=$('.l-stat .l-stat__col:nth-of-type(4) a').attr('href');
  207. }
  208. }, {
  209. 'type': 'keydown',
  210. 'propagate': false,
  211. 'disable_in_input': true,
  212. 'target': document
  213. }
  214. );
  215. shortcut.add("5", function(){
  216. if(VE.tmp.form_changed){
  217. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(5) a').attr('href'));
  218. } else {
  219. location.href=$('.l-stat .l-stat__col:nth-of-type(5) a').attr('href');
  220. }
  221. }, {
  222. 'type': 'keydown',
  223. 'propagate': false,
  224. 'disable_in_input': true,
  225. 'target': document
  226. }
  227. );
  228. shortcut.add("6", function(){
  229. if(VE.tmp.form_changed){
  230. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(6) a').attr('href'));
  231. } else {
  232. location.href=$('.l-stat .l-stat__col:nth-of-type(6) a').attr('href');
  233. }
  234. }, {
  235. 'type': 'keydown',
  236. 'propagate': false,
  237. 'disable_in_input': true,
  238. 'target': document
  239. }
  240. );
  241. shortcut.add("7", function(){
  242. if(VE.tmp.form_changed){
  243. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(7) a').attr('href'));
  244. } else {
  245. location.href=$('.l-stat .l-stat__col:nth-of-type(7) a').attr('href');
  246. }
  247. }, {
  248. 'type': 'keydown',
  249. 'propagate': false,
  250. 'disable_in_input': true,
  251. 'target': document
  252. }
  253. );
  254. shortcut.add("h", function(){
  255. $('.shortcuts').toggle();
  256. }, {
  257. 'type': 'keydown',
  258. 'propagate': false,
  259. 'disable_in_input': true,
  260. 'target': document
  261. }
  262. );
  263. shortcut.add("Esc", function(){
  264. $('.shortcuts').hide();
  265. $('input, checkbox, textarea, select').blur();
  266. }, {
  267. 'type': 'keydown',
  268. 'propagate': false,
  269. 'disable_in_input': false,
  270. 'target': document
  271. }
  272. );
  273. shortcut.add("Left", function(){
  274. VE.navigation.move_focus_left();
  275. }, {
  276. 'type': 'keydown',
  277. 'propagate': false,
  278. 'disable_in_input': true,
  279. 'target': document
  280. }
  281. );
  282. shortcut.add("Right", function(){
  283. VE.navigation.move_focus_right();
  284. }, {
  285. 'type': 'keydown',
  286. 'propagate': false,
  287. 'disable_in_input': true,
  288. 'target': document
  289. }
  290. );
  291. shortcut.add("down", function(){
  292. VE.navigation.move_focus_down();
  293. }, {
  294. 'type': 'keydown',
  295. 'propagate': false,
  296. 'disable_in_input': true,
  297. 'target': document
  298. }
  299. );
  300. shortcut.add("up", function(){
  301. VE.navigation.move_focus_up();
  302. }, {
  303. 'type': 'keydown',
  304. 'propagate': false,
  305. 'disable_in_input': true,
  306. 'target': document
  307. }
  308. );
  309. shortcut.add("l", function(){
  310. var elm = $('.units.active .l-unit.focus .shortcut-l');
  311. if(elm.length){
  312. VE.navigation.shortcut(elm);
  313. }
  314. }, {
  315. 'type': 'keydown',
  316. 'propagate': false,
  317. 'disable_in_input': true,
  318. 'target': document
  319. }
  320. );
  321. shortcut.add("s", function(){
  322. var elm = $('.units.active .l-unit.focus .shortcut-s');
  323. if(elm.length){
  324. VE.navigation.shortcut(elm);
  325. }
  326. }, {
  327. 'type': 'keydown',
  328. 'propagate': false,
  329. 'disable_in_input': true,
  330. 'target': document
  331. }
  332. );
  333. shortcut.add("w", function(){
  334. var elm = $('.units.active .l-unit.focus .shortcut-w');
  335. if(elm.length){
  336. VE.navigation.shortcut(elm);
  337. }
  338. }, {
  339. 'type': 'keydown',
  340. 'propagate': false,
  341. 'disable_in_input': true,
  342. 'target': document
  343. }
  344. );
  345. shortcut.add("d", function(){
  346. var elm = $('.units.active .l-unit.focus .shortcut-d');
  347. if(elm.length){
  348. VE.navigation.shortcut(elm);
  349. }
  350. }, {
  351. 'type': 'keydown',
  352. 'propagate': false,
  353. 'disable_in_input': true,
  354. 'target': document
  355. }
  356. );
  357. shortcut.add("r", function(){
  358. var elm = $('.units.active .l-unit.focus .shortcut-r');
  359. if(elm.length){
  360. VE.navigation.shortcut(elm);
  361. }
  362. }, {
  363. 'type': 'keydown',
  364. 'propagate': false,
  365. 'disable_in_input': true,
  366. 'target': document
  367. }
  368. );
  369. shortcut.add("n", function(){
  370. var elm = $('.units.active .l-unit.focus .shortcut-n');
  371. if(elm.length){
  372. VE.navigation.shortcut(elm);
  373. }
  374. }, {
  375. 'type': 'keydown',
  376. 'propagate': false,
  377. 'disable_in_input': true,
  378. 'target': document
  379. }
  380. );
  381. shortcut.add("u", function(){
  382. var elm = $('.units.active .l-unit.focus .shortcut-u');
  383. if(elm.length){
  384. VE.navigation.shortcut(elm);
  385. }
  386. }, {
  387. 'type': 'keydown',
  388. 'propagate': false,
  389. 'disable_in_input': true,
  390. 'target': document
  391. }
  392. );
  393. shortcut.add("Delete", function(){
  394. var elm = $('.units.active .l-unit.focus .shortcut-delete');
  395. if(elm.length){
  396. VE.navigation.shortcut(elm);
  397. }
  398. }, {
  399. 'type': 'keydown',
  400. 'propagate': false,
  401. 'disable_in_input': true,
  402. 'target': document
  403. }
  404. );
  405. shortcut.add("Enter", function(){
  406. if(VE.tmp.form_changed){
  407. if(!$('.ui-dialog').is(':visible')){
  408. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect')[0], '', $(VE.navigation.state.menu_selector + '.focus a').attr('href'));
  409. } else { // if dialog is opened - submitting confirm box by "enter" shortcut
  410. $('.ui-dialog button.submit').click();
  411. }
  412. } else {
  413. if(!$('.ui-dialog').is(':visible')){
  414. var elm = $('.units.active .l-unit.focus .shortcut-enter');
  415. if(elm.length){
  416. VE.navigation.shortcut(elm);
  417. } else {
  418. VE.navigation.enter_focused();
  419. }
  420. } else { // if dialog is opened - submitting confirm box by "enter" shortcut
  421. $('.ui-dialog button.submit').click();
  422. }
  423. }
  424. }, {
  425. 'type': 'keydown',
  426. 'propagate': false,
  427. 'disable_in_input': true,
  428. 'target': document
  429. }
  430. );
  431. $('.shortcuts .close').click(function(){
  432. $('.shortcuts').hide();
  433. });
  434. $('.to-shortcuts').click(function(){
  435. $('.shortcuts').toggle();
  436. });
  437. $(document).click(function(evt){
  438. //close notification popup
  439. if(!$(evt.target).hasClass('l-profile__notifications') && $(evt.target).parents('ul.notification-container').length == 0){
  440. $('.notification-container').hide();
  441. $('.l-profile__notifications').removeClass('active');
  442. }
  443. });
  444. // focusing on the first input at form
  445. if( location.href.indexOf('lead=') == -1 && !$('.ui-dialog').is(':visible') ){
  446. $('#vstobjects .vst-input:not([disabled]), #vstobjects .vst-list:not([disabled])').first().focus();
  447. }
  448. $('.l-profile__notifications').click(function(){
  449. if(!$('.l-profile__notifications').hasClass('active')){
  450. VE.notifications.get_list();
  451. $('.l-profile__notifications').addClass('active');
  452. left = $('.l-profile__notifications').offset().left - $('.notification-container').outerWidth() + 28;
  453. $('.notification-container').css({left: left+'px'});
  454. } else {
  455. $('.notification-container').hide();
  456. $('.l-profile__notifications').removeClass('active');
  457. }
  458. });
  459. VE.navigation.init();
  460. VE.core.register();
  461. if (location.href.search(/list/) != -1) {
  462. var shift_select_ref = $('body').finderSelect({
  463. children: '.l-unit',
  464. 'onFinish': function(evt) {
  465. var ref = $(evt.target);
  466. $('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
  467. $('.l-content').find('.l-unit.selected .ch-toggle').attr('checked', true);
  468. if ($('.l-content').find('.l-unit.selected').length == $('.l-content').find('.l-unit').length) {
  469. $('.toggle-all').addClass('clicked-on');
  470. }
  471. },
  472. 'toggleAllHook': function() {
  473. if ($('.l-unit').length == $('.ch-toggle:checked').length) {
  474. $('.l-unit.selected').removeClass('selected');
  475. $('.ch-toggle').attr('checked', false);
  476. $('#toggle-all').attr('checked', false);
  477. }
  478. else {
  479. $('.ch-toggle').attr('checked', true);
  480. $('#toggle-all').attr('checked', true);
  481. }
  482. }
  483. });
  484. $('table').on('mousedown', 'td', function(e) {
  485. if (e.ctrlKey) {
  486. e.preventDefault();
  487. }
  488. });
  489. }
  490. //
  491. $('form#objects').bind('submit', function(evt) {
  492. $('.l-unit.selected').find('.ch-toggle').attr('checked', true);
  493. });
  494. });
  495. </script>
  496. <div title="Confirmation" class="confirmation-text-redirect hidden">
  497. <p class="confirmation"><?=__('LEAVE_PAGE_CONFIRMATION')?></p>
  498. </div>
  499. <div class="shortcuts" style="display:none">
  500. <div class="header">
  501. <div class="title">Shortcuts</div>
  502. <div class="close"></div>
  503. </div>
  504. <ul>
  505. <li><span class="key">n</span><?=__('Add New object')?></li>
  506. <li><span class="key">Ctrl + Enter</span><?=__('Save Form')?></li>
  507. <li><span class="key">Ctrl + Backspace</span><?=__('Cancel saving form')?></li>
  508. <li class="step-top"><span class="key">1</span><?=__('Go to USER list')?></li>
  509. <li><span class="key">2</span><?=__('Go to WEB list')?></li>
  510. <li><span class="key">3</span><?=__('Go to DNS list')?></li>
  511. <li><span class="key">4</span><?=__('Go to MAIL list')?></li>
  512. <li><span class="key">5</span><?=__('Go to DB list')?></li>
  513. <li><span class="key">6</span><?=__('Go to CRON list')?></li>
  514. <li><span class="key">7</span><?=__('Go to BACKUP list')?></li>
  515. </ul>
  516. <ul>
  517. <li><span class="key">f</span><?=__('Focus on search')?></li>
  518. <li class="step-top"><span class="key">h</span><?=__('Display/Close shortcuts')?></li>
  519. <li class="step-top"><span class="key bigger">&larr;</span><?=__('Move backward through top menu')?></li>
  520. <li><span class="key bigger">&rarr;</span><?=__('Move forward through top menu')?></li>
  521. <li><span class="key">Enter</span><?=__('Enter focused element')?></li>
  522. </ul>
  523. </div>
  524. </body>
  525. </html>