| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488 |
- </div>
- <script src="/js/jquery.finder.js"></script>
- <script type="text/javascript">
- lastScrollTop = 0;
- $(document).ready(function() {
- hover_menu();
- $(window).scroll(function(){hover_menu()});
- $('.l-sort-toolbar .sort-by').click(function(){
- $('.context-menu.sort-order').toggle().css({left: $(this).position().left - 10});
- });
- // CREATE BUTTON
- $('.l-sort__create-btn').hover(function(){
- $(".l-sort__create-btn").append("<div id='add-icon'></div>");
- $(".l-sort__create-btn").append("<div id='tooltip'>"+$('.l-sort__create-btn').attr('title').replace(' ',' ')+"</div>");
- }, function(){
- $("#add-icon").remove();
- $("#tooltip").remove();
- });
- // SEARCH BOX
- $('.l-sort-toolbar__search, .l-sort-toolbar__search-box .search-input').hover(function(){
- clearTimeout(VE.tmp.search_display_interval);
- clearTimeout(VE.tmp.search_hover_interval);
- VE.tmp.search_display_interval = setTimeout(function(){$('.search-input').addClass('activated');}, 150);
- }, function(){
- clearTimeout(VE.tmp.search_display_interval);
- clearTimeout(VE.tmp.search_hover_interval);
- VE.tmp.search_hover_interval = setTimeout(function(){
- if(!VE.tmp.search_activated && !$(".search-input").val().length){
- $(".search-input").removeClass('activated');
- }
- }, 600);
- });
- $('.search-input').focus(function(){
- VE.tmp.search_activated = 1;
- clearTimeout(VE.tmp.search_hover_interval);
- });
- $('.search-input').blur(function(){
- VE.tmp.search_activated = 0;
- clearTimeout(VE.tmp.search_hover_interval);
- VE.tmp.search_hover_interval = setTimeout(function(){
- if(!$(".search-input").val().length){
- $(".search-input").removeClass('activated');
- }
- }, 600);
- });
- // TIMER
- if($('.movement.left').length){
- VE.helpers.refresh_timer.right = $('.movement.right');
- VE.helpers.refresh_timer.left = $('.movement.left');
- VE.helpers.refresh_timer.start();
- $('.pause').click(function(){
- VE.helpers.refresh_timer.stop();
- $('.pause').addClass('hidden');
- $('.play').removeClass('hidden');
- $('.refresh-timer').addClass('paused');
- });
- $('.play').click(function(){
- VE.helpers.refresh_timer.start();
- $('.pause').removeClass('hidden');
- $('.play').addClass('hidden');
- $('.refresh-timer').removeClass('paused');
- });
- }
- // SORTING
- $('#vstobjects input, #vstobjects select, #vstobjects textarea').change(function(){VE.tmp.form_changed=1});
- $('.sort-order span').click(function(){
- $('.context-menu.sort-order').toggle();
- if($(this).hasClass('active'))
- return;
- $('.sort-order span').removeClass('active');
- $(this).addClass('active');
- VE.tmp.sort_par = $(this).parent('li').attr('entity');
- VE.tmp.sort_as_int = $(this).parent('li').attr('sort_as_int');
- VE.tmp.sort_direction = $(this).hasClass('up')*1 || -1;
- $('.l-sort .sort-by span b').html($(this).parent('li').find('.name').html());
- $('.l-sort .sort-by i').removeClass('l-icon-up-arrow l-icon-down-arrow');
- $(this).hasClass('up') ? $('.l-sort .sort-by i').addClass('l-icon-up-arrow') : $('.l-sort .sort-by i').addClass('l-icon-down-arrow');
- $('.units .l-unit').sort(function (a, b) {
- if(VE.tmp.sort_as_int)
- return parseInt($(a).attr(VE.tmp.sort_par)) >= parseInt($(b).attr(VE.tmp.sort_par)) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
- else
- return $(a).attr(VE.tmp.sort_par) <= $(b).attr(VE.tmp.sort_par) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
- }).appendTo(".l-center.units");
- });
- // STARS
- $('.l-unit .l-icon-star').click(function(){
- var l_unit = $(this).parents('.l-unit');
- if(l_unit.hasClass('l-unit--starred')){
- // removing star
- $.ajax({
- method: "POST",
- url: "/delete/favorite/index.php",
- data: { v_section: l_unit.attr('v_section'), v_unit_id: l_unit.attr('v_unit_id') }
- });
- l_unit.attr({'sort-star': 0});
- l_unit.removeClass('l-unit--starred');
- }
- else{
- $.ajax({
- method: "POST",
- url: "/add/favorite/index.php",
- data: { v_unit_id: l_unit.attr('v_unit_id'), v_section: l_unit.attr('v_section') }
- });
- l_unit.attr({'sort-star': 1});
- l_unit.addClass('l-unit--starred');
- }
- });
- // Shortcuts
- shortcut.add("Ctrl+Enter", function(){
- $('form#vstobjects').submit();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': false,
- 'target': document
- }
- );
- shortcut.add("Backspace", function(){
- if(VE.tmp.form_changed && $('form#vstobjects .button.cancel')[0]){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'",""));
- } else if($('form#vstobjects .button.cancel')[0]){
- location.href=$('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'","");
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("f", function(){
- $('.search-input').addClass('activated').focus();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("a", function(evt){
- if (!evt.ctrlKey && !evt.shiftKey) {
- if ($('.l-sort__create-btn')[0]) {
- location.href=$('.l-sort__create-btn').attr('href');
- }
- }
- }, {
- 'type': 'keyup',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("n", function(evt){
- if (!evt.ctrlKey && !evt.shiftKey) {
- if ($('.l-sort__create-btn')[0]) {
- location.href=$('.l-sort__create-btn').attr('href');
- }
- }
- }, {
- 'type': 'keyup',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("Ctrl+m", function(evt){
- console.log('ctrl+m');
- }, {
- 'type': 'keyup',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("m", function(evt){
- console.log('m');
- }, {
- 'type': 'keyup',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("a+1", function(){
- location.href='/add/user/';
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("1", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(1) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(1) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("2", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(2) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(2) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("3", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(3) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(3) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("4", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(4) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(4) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("5", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(5) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(5) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("6", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(6) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(6) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("7", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(7) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(7) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("h", function(){
- $('.shortcuts').toggle();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("Esc", function(){
- $('.shortcuts').hide();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("Left", function(){
- VE.navigation.move_focus_left();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("Right", function(){
- VE.navigation.move_focus_right();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("Enter", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $(VE.navigation.state.menu_selector + '.focus a').attr('href'));
- } else {
- VE.navigation.enter_focused();
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
- shortcut.add("Alt", function(){
- VE.navigation.switch_menu();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': false,
- 'target': document
- }
- );
- $('.shortcuts .close').click(function(){
- $('.shortcuts').hide();
- });
- $('.to-shortcuts').click(function(){
- $('.shortcuts').toggle();
- });
- VE.navigation.init();
- VE.core.register();
- if (location.href.search(/list/) != -1) {
- var shift_select_ref = $('body').finderSelect({
- children: '.l-unit',
- 'onFinish': function(evt) {
- var ref = $(evt.target);
- $('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
- $('.l-content').find('.l-unit.selected .ch-toggle').attr('checked', true);
- if ($('.l-content').find('.l-unit.selected').length == $('.l-content').find('.l-unit').length) {
- $('.toggle-all').addClass('clicked-on');
- }
- },
- 'toggleAllHook': function() {
- if ($('.l-unit').length == $('.ch-toggle:checked').length) {
- $('.l-unit.selected').removeClass('selected');
- $('.ch-toggle').attr('checked', false);
- $('#toggle-all').attr('checked', false);
- }
- else {
- $('.ch-toggle').attr('checked', true);
- $('#toggle-all').attr('checked', true);
- }
- }
- });
- $('table').on('mousedown', 'td', function(e) {
- if (e.ctrlKey) {
- e.preventDefault();
- }
- });
- }
- });
- </script>
- <div title="Confirmation" class="confirmation-text-redirect hidden">
- <p class="confirmation"><?=__('LEAVE_PAGE_CONFIRMATION')?></p>
- </div>
- <div class="shortcuts" style="display:none">
- <div class="header">
- <div class="title">Shortcuts</div>
- <div class="close"></div>
- </div>
- <ul>
- <li><span class="key">n</span><?=__('Add New object')?></li>
- <li><span class="key"><Ctrl> + Enter</span><?=__('Save Form')?></li>
- <li><span class="key">Backspace</span><?=__('Cancel saving form')?></li>
- <li class="step-top"><span class="key">1</span><?=__('Go to USER list')?></li>
- <li><span class="key">2</span><?=__('Go to WEB list')?></li>
- <li><span class="key">3</span><?=__('Go to DNS list')?></li>
- <li><span class="key">4</span><?=__('Go to MAIL list')?></li>
- <li><span class="key">5</span><?=__('Go to DB list')?></li>
- <li><span class="key">6</span><?=__('Go to CRON list')?></li>
- <li><span class="key">7</span><?=__('Go to BACKUP list')?></li>
- </ul>
- <ul>
- <li><span class="key">f</span><?=__('Focus on search')?></li>
- <li class="step-top"><span class="key">h</span><?=__('Display/Close shortcuts')?></li>
- <li class="step-top"><span class="key bigger">←</span><?=__('Move backward through top menu')?></li>
- <li><span class="key bigger">→</span><?=__('Move forward through top menu')?></li>
- <li><span class="key"><Alt></span><?=__('Switch active menu')?></li>
- <li><span class="key"><Enter></span><?=__('Enter focused element')?></li>
- </ul>
- </div>
- </body>
- </html>
|