footer.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  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("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. }
  124. }, {
  125. 'type': 'keydown',
  126. 'propagate': false,
  127. 'disable_in_input': true,
  128. 'target': document
  129. }
  130. );
  131. shortcut.add("f", function(){
  132. $('.search-input').addClass('activated').focus();
  133. }, {
  134. 'type': 'keydown',
  135. 'propagate': false,
  136. 'disable_in_input': true,
  137. 'target': document
  138. }
  139. );
  140. $(window).bind('keypress', function(evt) {
  141. var tag = evt.target.tagName.toLowerCase();
  142. if (evt.charCode == 97 && tag != 'input' && tag != 'textarea' && tag != 'selectbox') {
  143. evt.preventDefault();
  144. if (!evt.ctrlKey && !evt.shiftKey) {
  145. if ($('.l-sort__create-btn')[0]) {
  146. location.href=$('.l-sort__create-btn').attr('href');
  147. }
  148. }
  149. else {
  150. if ($('.l-unit .ch-toggle:eq(0)').attr('checked')) {
  151. $('.l-unit').removeClass('selected');
  152. $('.l-unit .ch-toggle').attr('checked', false);
  153. }
  154. else {
  155. $('.l-unit').addClass('selected');
  156. $('.l-unit .ch-toggle').attr('checked', true);
  157. }
  158. }
  159. }
  160. });
  161. shortcut.add("n", function(evt){
  162. if (!evt.ctrlKey && !evt.shiftKey) {
  163. if ($('.l-sort__create-btn')[0]) {
  164. location.href=$('.l-sort__create-btn').attr('href');
  165. }
  166. }
  167. }, {
  168. 'type': 'keyup',
  169. 'propagate': false,
  170. 'disable_in_input': true,
  171. 'target': document
  172. }
  173. );
  174. shortcut.add("a+1", function(){
  175. location.href='/add/user/';
  176. }, {
  177. 'type': 'keydown',
  178. 'propagate': false,
  179. 'disable_in_input': true,
  180. 'target': document
  181. }
  182. );
  183. shortcut.add("1", function(){
  184. if(VE.tmp.form_changed){
  185. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(1) a').attr('href'));
  186. } else {
  187. location.href=$('.l-stat .l-stat__col:nth-of-type(1) a').attr('href');
  188. }
  189. }, {
  190. 'type': 'keydown',
  191. 'propagate': false,
  192. 'disable_in_input': true,
  193. 'target': document
  194. }
  195. );
  196. shortcut.add("2", function(){
  197. if(VE.tmp.form_changed){
  198. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(2) a').attr('href'));
  199. } else {
  200. location.href=$('.l-stat .l-stat__col:nth-of-type(2) a').attr('href');
  201. }
  202. }, {
  203. 'type': 'keydown',
  204. 'propagate': false,
  205. 'disable_in_input': true,
  206. 'target': document
  207. }
  208. );
  209. shortcut.add("3", function(){
  210. if(VE.tmp.form_changed){
  211. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(3) a').attr('href'));
  212. } else {
  213. location.href=$('.l-stat .l-stat__col:nth-of-type(3) a').attr('href');
  214. }
  215. }, {
  216. 'type': 'keydown',
  217. 'propagate': false,
  218. 'disable_in_input': true,
  219. 'target': document
  220. }
  221. );
  222. shortcut.add("4", function(){
  223. if(VE.tmp.form_changed){
  224. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(4) a').attr('href'));
  225. } else {
  226. location.href=$('.l-stat .l-stat__col:nth-of-type(4) a').attr('href');
  227. }
  228. }, {
  229. 'type': 'keydown',
  230. 'propagate': false,
  231. 'disable_in_input': true,
  232. 'target': document
  233. }
  234. );
  235. shortcut.add("5", function(){
  236. if(VE.tmp.form_changed){
  237. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(5) a').attr('href'));
  238. } else {
  239. location.href=$('.l-stat .l-stat__col:nth-of-type(5) a').attr('href');
  240. }
  241. }, {
  242. 'type': 'keydown',
  243. 'propagate': false,
  244. 'disable_in_input': true,
  245. 'target': document
  246. }
  247. );
  248. shortcut.add("6", function(){
  249. if(VE.tmp.form_changed){
  250. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(6) a').attr('href'));
  251. } else {
  252. location.href=$('.l-stat .l-stat__col:nth-of-type(6) a').attr('href');
  253. }
  254. }, {
  255. 'type': 'keydown',
  256. 'propagate': false,
  257. 'disable_in_input': true,
  258. 'target': document
  259. }
  260. );
  261. shortcut.add("7", function(){
  262. if(VE.tmp.form_changed){
  263. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(7) a').attr('href'));
  264. } else {
  265. location.href=$('.l-stat .l-stat__col:nth-of-type(7) a').attr('href');
  266. }
  267. }, {
  268. 'type': 'keydown',
  269. 'propagate': false,
  270. 'disable_in_input': true,
  271. 'target': document
  272. }
  273. );
  274. shortcut.add("h", function(){
  275. $('.shortcuts').toggle();
  276. }, {
  277. 'type': 'keydown',
  278. 'propagate': false,
  279. 'disable_in_input': true,
  280. 'target': document
  281. }
  282. );
  283. shortcut.add("Esc", function(){
  284. $('.shortcuts').hide();
  285. }, {
  286. 'type': 'keydown',
  287. 'propagate': false,
  288. 'disable_in_input': true,
  289. 'target': document
  290. }
  291. );
  292. shortcut.add("Left", function(){
  293. VE.navigation.move_focus_left();
  294. }, {
  295. 'type': 'keydown',
  296. 'propagate': false,
  297. 'disable_in_input': true,
  298. 'target': document
  299. }
  300. );
  301. shortcut.add("Right", function(){
  302. VE.navigation.move_focus_right();
  303. }, {
  304. 'type': 'keydown',
  305. 'propagate': false,
  306. 'disable_in_input': true,
  307. 'target': document
  308. }
  309. );
  310. shortcut.add("Enter", function(){
  311. if(VE.tmp.form_changed){
  312. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $(VE.navigation.state.menu_selector + '.focus a').attr('href'));
  313. } else {
  314. VE.navigation.enter_focused();
  315. }
  316. }, {
  317. 'type': 'keydown',
  318. 'propagate': false,
  319. 'disable_in_input': true,
  320. 'target': document
  321. }
  322. );
  323. $('.shortcuts .close').click(function(){
  324. $('.shortcuts').hide();
  325. });
  326. $('.to-shortcuts').click(function(){
  327. $('.shortcuts').toggle();
  328. });
  329. $(document).click(function(evt){
  330. //close notification popup
  331. if(!$(evt.target).hasClass('l-profile__notifications') && $(evt.target).parents('ul.notification-container').length == 0){
  332. $('.notification-container').hide();
  333. $('.l-profile__notifications').removeClass('active');
  334. }
  335. });
  336. // focusing on the first input at form
  337. if(location.href.indexOf('lead=') == -1){
  338. $('#vstobjects .vst-input:not([disabled]), #vstobjects .vst-list:not([disabled])').first().focus();
  339. }
  340. $('.l-profile__notifications').click(function(){
  341. if(!$('.l-profile__notifications').hasClass('active')){
  342. VE.notifications.get_list();
  343. $('.l-profile__notifications').addClass('active');
  344. left = $('.l-profile__notifications').offset().left - $('.notification-container').outerWidth() + 28;
  345. $('.notification-container').css({left: left+'px'});
  346. } else {
  347. $('.notification-container').hide();
  348. $('.l-profile__notifications').removeClass('active');
  349. }
  350. });
  351. VE.navigation.init();
  352. VE.core.register();
  353. if (location.href.search(/list/) != -1) {
  354. var shift_select_ref = $('body').finderSelect({
  355. children: '.l-unit',
  356. 'onFinish': function(evt) {
  357. var ref = $(evt.target);
  358. $('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
  359. $('.l-content').find('.l-unit.selected .ch-toggle').attr('checked', true);
  360. if ($('.l-content').find('.l-unit.selected').length == $('.l-content').find('.l-unit').length) {
  361. $('.toggle-all').addClass('clicked-on');
  362. }
  363. },
  364. 'toggleAllHook': function() {
  365. if ($('.l-unit').length == $('.ch-toggle:checked').length) {
  366. $('.l-unit.selected').removeClass('selected');
  367. $('.ch-toggle').attr('checked', false);
  368. $('#toggle-all').attr('checked', false);
  369. }
  370. else {
  371. $('.ch-toggle').attr('checked', true);
  372. $('#toggle-all').attr('checked', true);
  373. }
  374. }
  375. });
  376. $('table').on('mousedown', 'td', function(e) {
  377. if (e.ctrlKey) {
  378. e.preventDefault();
  379. }
  380. });
  381. }
  382. //
  383. $('form#objects').bind('submit', function(evt) {
  384. $('.l-unit.selected').find('.ch-toggle').attr('checked', true);
  385. });
  386. });
  387. </script>
  388. <div title="Confirmation" class="confirmation-text-redirect hidden">
  389. <p class="confirmation"><?=__('LEAVE_PAGE_CONFIRMATION')?></p>
  390. </div>
  391. <div class="shortcuts" style="display:none">
  392. <div class="header">
  393. <div class="title">Shortcuts</div>
  394. <div class="close"></div>
  395. </div>
  396. <ul>
  397. <li><span class="key">n</span><?=__('Add New object')?></li>
  398. <li><span class="key">Ctrl + Enter</span><?=__('Save Form')?></li>
  399. <li><span class="key">Backspace</span><?=__('Cancel saving form')?></li>
  400. <li class="step-top"><span class="key">1</span><?=__('Go to USER list')?></li>
  401. <li><span class="key">2</span><?=__('Go to WEB list')?></li>
  402. <li><span class="key">3</span><?=__('Go to DNS list')?></li>
  403. <li><span class="key">4</span><?=__('Go to MAIL list')?></li>
  404. <li><span class="key">5</span><?=__('Go to DB list')?></li>
  405. <li><span class="key">6</span><?=__('Go to CRON list')?></li>
  406. <li><span class="key">7</span><?=__('Go to BACKUP list')?></li>
  407. </ul>
  408. <ul>
  409. <li><span class="key">f</span><?=__('Focus on search')?></li>
  410. <li class="step-top"><span class="key">h</span><?=__('Display/Close shortcuts')?></li>
  411. <li class="step-top"><span class="key bigger">&larr;</span><?=__('Move backward through top menu')?></li>
  412. <li><span class="key bigger">&rarr;</span><?=__('Move forward through top menu')?></li>
  413. <li><span class="key">Enter</span><?=__('Enter focused element')?></li>
  414. </ul>
  415. </div>
  416. </body>
  417. </html>