footer.html 19 KB

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