footer.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  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. $.removeCookie(l_unit.attr('uniq-id'));
  91. l_unit.removeClass('l-unit--starred');
  92. l_unit.attr({'sort-star': 0});
  93. }
  94. else{
  95. $.cookie(l_unit.attr('uniq-id'), 1, {expires: 3650, path: '/'});
  96. l_unit.addClass('l-unit--starred');
  97. l_unit.attr({'sort-star': 1});
  98. }
  99. });
  100. // Shortcuts
  101. shortcut.add("Ctrl+Enter", function(){
  102. $('form#vstobjects').submit();
  103. }, {
  104. 'type': 'keydown',
  105. 'propagate': false,
  106. 'disable_in_input': false,
  107. 'target': document
  108. }
  109. );
  110. shortcut.add("Ctrl+Backspace", function(){
  111. if($('form#vstobjects button.cancel')[0]){
  112. location.href=$('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'","");
  113. }
  114. }, {
  115. 'type': 'keydown',
  116. 'propagate': false,
  117. 'disable_in_input': false,
  118. 'target': document
  119. }
  120. );
  121. shortcut.add("f", function(){
  122. $('.search-input').addClass('activated').focus();
  123. }, {
  124. 'type': 'keydown',
  125. 'propagate': false,
  126. 'disable_in_input': true,
  127. 'target': document
  128. }
  129. );
  130. shortcut.add("a", function(){
  131. if($('.l-sort__create-btn')[0]){
  132. location.href=$('.l-sort__create-btn').attr('href');
  133. }
  134. }, {
  135. 'type': 'keyup',
  136. 'propagate': false,
  137. 'disable_in_input': true,
  138. 'target': document
  139. }
  140. );
  141. shortcut.add("a+1", function(){
  142. location.href='/add/user/';
  143. }, {
  144. 'type': 'keydown',
  145. 'propagate': false,
  146. 'disable_in_input': true,
  147. 'target': document
  148. }
  149. );
  150. shortcut.add("1", function(){
  151. if(VE.tmp.form_changed){
  152. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(1) a').attr('href'));
  153. } else {
  154. location.href=$('.l-stat .l-stat__col:nth-of-type(1) a').attr('href');
  155. }
  156. }, {
  157. 'type': 'keydown',
  158. 'propagate': false,
  159. 'disable_in_input': true,
  160. 'target': document
  161. }
  162. );
  163. shortcut.add("2", function(){
  164. if(VE.tmp.form_changed){
  165. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(2) a').attr('href'));
  166. } else {
  167. location.href=$('.l-stat .l-stat__col:nth-of-type(2) a').attr('href');
  168. }
  169. }, {
  170. 'type': 'keydown',
  171. 'propagate': false,
  172. 'disable_in_input': true,
  173. 'target': document
  174. }
  175. );
  176. shortcut.add("3", function(){
  177. if(VE.tmp.form_changed){
  178. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(3) a').attr('href'));
  179. } else {
  180. location.href=$('.l-stat .l-stat__col:nth-of-type(3) a').attr('href');
  181. }
  182. }, {
  183. 'type': 'keydown',
  184. 'propagate': false,
  185. 'disable_in_input': true,
  186. 'target': document
  187. }
  188. );
  189. shortcut.add("4", function(){
  190. if(VE.tmp.form_changed){
  191. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(4) a').attr('href'));
  192. } else {
  193. location.href=$('.l-stat .l-stat__col:nth-of-type(4) a').attr('href');
  194. }
  195. }, {
  196. 'type': 'keydown',
  197. 'propagate': false,
  198. 'disable_in_input': true,
  199. 'target': document
  200. }
  201. );
  202. shortcut.add("5", function(){
  203. if(VE.tmp.form_changed){
  204. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(5) a').attr('href'));
  205. } else {
  206. location.href=$('.l-stat .l-stat__col:nth-of-type(5) a').attr('href');
  207. }
  208. }, {
  209. 'type': 'keydown',
  210. 'propagate': false,
  211. 'disable_in_input': true,
  212. 'target': document
  213. }
  214. );
  215. shortcut.add("6", function(){
  216. if(VE.tmp.form_changed){
  217. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(6) a').attr('href'));
  218. } else {
  219. location.href=$('.l-stat .l-stat__col:nth-of-type(6) a').attr('href');
  220. }
  221. }, {
  222. 'type': 'keydown',
  223. 'propagate': false,
  224. 'disable_in_input': true,
  225. 'target': document
  226. }
  227. );
  228. shortcut.add("7", function(){
  229. if(VE.tmp.form_changed){
  230. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(7) a').attr('href'));
  231. } else {
  232. location.href=$('.l-stat .l-stat__col:nth-of-type(7) a').attr('href');
  233. }
  234. }, {
  235. 'type': 'keydown',
  236. 'propagate': false,
  237. 'disable_in_input': true,
  238. 'target': document
  239. }
  240. );
  241. shortcut.add("Ctrl+1", function(){
  242. if(VE.tmp.form_changed){
  243. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(1) a').attr('href'));
  244. } else {
  245. location.href=$('.l-menu .l-menu__item:nth-of-type(1) a').attr('href');
  246. }
  247. }, {
  248. 'type': 'keydown',
  249. 'propagate': false,
  250. 'disable_in_input': true,
  251. 'target': document
  252. }
  253. );
  254. shortcut.add("Ctrl+2", function(){
  255. if(VE.tmp.form_changed){
  256. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(2) a').attr('href'));
  257. } else {
  258. location.href=$('.l-menu .l-menu__item:nth-of-type(2) a').attr('href');
  259. }
  260. }, {
  261. 'type': 'keydown',
  262. 'propagate': false,
  263. 'disable_in_input': true,
  264. 'target': document
  265. }
  266. );
  267. shortcut.add("Ctrl+3", function(){
  268. if(VE.tmp.form_changed){
  269. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(3) a').attr('href'));
  270. } else {
  271. location.href=$('.l-menu .l-menu__item:nth-of-type(3) a').attr('href');
  272. }
  273. }, {
  274. 'type': 'keydown',
  275. 'propagate': false,
  276. 'disable_in_input': true,
  277. 'target': document
  278. }
  279. );
  280. shortcut.add("Ctrl+4", function(){
  281. if(VE.tmp.form_changed){
  282. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(4) a').attr('href'));
  283. } else {
  284. location.href=$('.l-menu .l-menu__item:nth-of-type(4) a').attr('href');
  285. }
  286. }, {
  287. 'type': 'keydown',
  288. 'propagate': false,
  289. 'disable_in_input': true,
  290. 'target': document
  291. }
  292. );
  293. shortcut.add("Ctrl+5", function(){
  294. if(VE.tmp.form_changed){
  295. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(5) a').attr('href'));
  296. } else {
  297. location.href=$('.l-menu .l-menu__item:nth-of-type(5) a').attr('href');
  298. }
  299. }, {
  300. 'type': 'keydown',
  301. 'propagate': false,
  302. 'disable_in_input': true,
  303. 'target': document
  304. }
  305. );
  306. shortcut.add("Ctrl+6", function(){
  307. if(VE.tmp.form_changed){
  308. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(6) a').attr('href'));
  309. } else {
  310. location.href=$('.l-menu .l-menu__item:nth-of-type(6) a').attr('href');
  311. }
  312. }, {
  313. 'type': 'keydown',
  314. 'propagate': false,
  315. 'disable_in_input': true,
  316. 'target': document
  317. }
  318. );
  319. shortcut.add("Ctrl+7", function(){
  320. if(VE.tmp.form_changed){
  321. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(7) a').attr('href'));
  322. } else {
  323. location.href=$('.l-menu .l-menu__item:nth-of-type(7) a').attr('href');
  324. }
  325. }, {
  326. 'type': 'keydown',
  327. 'propagate': false,
  328. 'disable_in_input': true,
  329. 'target': document
  330. }
  331. );
  332. shortcut.add("Ctrl+8", function(){
  333. if(VE.tmp.form_changed){
  334. VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', ('.l-menu .l-menu__item:nth-of-type(8) a').attr('href'));
  335. } else {
  336. location.href=$('.l-menu .l-menu__item:nth-of-type(8) a').attr('href');
  337. }
  338. }, {
  339. 'type': 'keydown',
  340. 'propagate': false,
  341. 'disable_in_input': true,
  342. 'target': document
  343. }
  344. );
  345. shortcut.add("h", function(){
  346. $('.shortcuts').toggle();
  347. }, {
  348. 'type': 'keydown',
  349. 'propagate': false,
  350. 'disable_in_input': true,
  351. 'target': document
  352. }
  353. );
  354. $('.shortcuts .close').click(function(){
  355. $('.shortcuts').hide();
  356. });
  357. /*jQuery('.ch-toggle').bind('change', function(evt) {
  358. evt.stopImmediatePropagation();
  359. console.log(123);
  360. });*/
  361. VE.core.register();
  362. if (location.href.search(/list/) != -1) {
  363. var shift_select_ref = $('body').finderSelect({children: '.l-unit',
  364. 'onFinish': function(evt) {
  365. /*var ref = $(evt.target);
  366. $('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
  367. $('.l-content').find('.l-unit.selected .ch-toggle').attr('checked', true);
  368. if ($('.l-content').find('.l-unit.selected').length == $('.l-content').find('.l-unit').length) {
  369. $('.toggle-all').addClass('clicked-on');
  370. }*/
  371. },
  372. 'toggleAllHook': function() {
  373. /*if ($('.l-unit').length == $('.ch-toggle:checked').length) {
  374. $('.l-unit.selected').removeClass('selected');
  375. $('.ch-toggle').attr('checked', false);
  376. $('#toggle-all').attr('checked', false);
  377. }
  378. else {
  379. $('.ch-toggle').attr('checked', true);
  380. $('#toggle-all').attr('checked', true);
  381. }*/
  382. }
  383. });
  384. $('table').on('mousedown', 'td', function(e) {
  385. if (e.ctrlKey) {
  386. e.preventDefault();
  387. }
  388. });
  389. }
  390. });
  391. </script>
  392. <div title="Confirmation" class="confirmation-text-redirect hidden">
  393. <p class="confirmation"><?=__('LEAVE_PAGE_CONFIRMATION')?></p>
  394. </div>
  395. <div class="shortcuts" style="display:none">
  396. <div class="header">
  397. <div class="title">Shortcuts</div>
  398. <div class="close"></div>
  399. </div>
  400. <ul>
  401. <li><span class="key">a</span>Go to add form</li>
  402. <li><span class="key">&lt;Ctrl&gt; + Enter</span>Save Form</li>
  403. <li class="step-top"><span class="key">&lt;Ctrl&gt; + Backspace</span>Cancel saving form</li>
  404. <li><span class="key">1</span>Go to USER list</li>
  405. <li><span class="key">2</span>Go to WEB list</li>
  406. <li><span class="key">3</span>Go to DNS list</li>
  407. <li><span class="key">4</span>Go to MAIL list</li>
  408. <li><span class="key">5</span>Go to DB list</li>
  409. <li><span class="key">6</span>Go to CRON list</li>
  410. <li class="step-top"><span class="key">7</span>Go to BACKUP list</li>
  411. </ul>
  412. <ul>
  413. <li class="step-top"><span class="key">f</span>Focus on search</li>
  414. <li class="step-top"><span class="key">h</span>Display/Close shortcuts</li>
  415. <li><span class="key">&lt;Ctrl&gt; + 1</span>Go to Packages</li>
  416. <li><span class="key">&lt;Ctrl&gt; + 2</span>Go to IP</li>
  417. <li><span class="key">&lt;Ctrl&gt; + 3</span>Go to Graphs</li>
  418. <li><span class="key">&lt;Ctrl&gt; + 4</span>Go to Statistics</li>
  419. <li><span class="key">&lt;Ctrl&gt; + 5</span>Go to Log</li>
  420. <li><span class="key">&lt;Ctrl&gt; + 6</span>Go to Updates</li>
  421. <li><span class="key">&lt;Ctrl&gt; + 7</span>Go to Firewall</li>
  422. <li><span class="key">&lt;Ctrl&gt; + 8</span>Go to Server</li>
  423. </ul>
  424. </div>
  425. </body>
  426. </html>