Software: Apache. PHP/5.5.15 uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 SYSTEM Safe-mode: OFF (not secure) E:\nuevo\phpMyAdmin\js\ drwxrwxrwx |
Viewing file: navigation.js (44.62 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * function used in or for navigation panel * * @package phpMyAdmin-Navigation */ /** * Executed on page load */ $(function () { if (! $('#pma_navigation').length) { // Don't bother running any code if the navigation is not even on the page return; } // Do not let the page reload on submitting the fast filter $(document).on('submit', '.fast_filter', function (event) { event.preventDefault(); }); // Fire up the resize handlers new ResizeHandler(); /** * opens/closes (hides/shows) tree elements * loads data via ajax */ $('#pma_navigation_tree a.expander').live('click', function (event) { event.preventDefault(); event.stopImmediatePropagation(); var $icon = $(this).find('img'); if ($icon.is('.ic_b_plus')) { expandTreeNode($(this)); } else { collapseTreeNode($(this)); } }); /** * Register event handler for click on the reload * navigation icon at the top of the panel */ $('#pma_navigation_reload').live('click', function (event) { event.preventDefault(); // reload icon object var $icon = $(this).find('img'); // source of the hidden throbber icon var icon_throbber_src = $('#pma_navigation .throbber').attr('src'); // source of the reload icon var icon_reload_src = $icon.attr('src'); // replace the source of the reload icon with the one for throbber $icon.attr('src', icon_throbber_src); PMA_reloadNavigation(); // after one second, put back the reload icon setTimeout(function () { $icon.attr('src', icon_reload_src); }, 1000); }); /** * Bind all "fast filter" events */ $('#pma_navigation_tree li.fast_filter span') .live('click', PMA_fastFilter.events.clear); $('#pma_navigation_tree li.fast_filter input.searchClause') .live('focus', PMA_fastFilter.events.focus) .live('blur', PMA_fastFilter.events.blur) .live('keyup', PMA_fastFilter.events.keyup); /** * Ajax handler for pagination */ $('#pma_navigation_tree div.pageselector a.ajax').live('click', function (event) { event.preventDefault(); PMA_navigationTreePagination($(this)); }); /** * Node highlighting */ $('#pma_navigation_tree.highlight li:not(.fast_filter)').live( 'mouseover', function () { if ($('li:visible', this).length === 0) { $(this).addClass('activePointer'); } } ); $('#pma_navigation_tree.highlight li:not(.fast_filter)').live( 'mouseout', function () { $(this).removeClass('activePointer'); } ); /** Create a Routine, Trigger or Event */ $('li.new_procedure a.ajax, li.new_function a.ajax').live('click', function (event) { event.preventDefault(); var dialog = new RTE.object('routine'); dialog.editorDialog(1, $(this)); }); $('li.new_trigger a.ajax').live('click', function (event) { event.preventDefault(); var dialog = new RTE.object('trigger'); dialog.editorDialog(1, $(this)); }); $('li.new_event a.ajax').live('click', function (event) { event.preventDefault(); var dialog = new RTE.object('event'); dialog.editorDialog(1, $(this)); }); /** Execute Routines */ $('li.procedure > a.ajax, li.function > a.ajax').live('click', function (event) { event.preventDefault(); var dialog = new RTE.object('routine'); dialog.executeDialog($(this)); }); /** Edit Triggers and Events */ $('li.trigger > a.ajax').live('click', function (event) { event.preventDefault(); var dialog = new RTE.object('trigger'); dialog.editorDialog(0, $(this)); }); $('li.event > a.ajax').live('click', function (event) { event.preventDefault(); var dialog = new RTE.object('event'); dialog.editorDialog(0, $(this)); }); /** Edit Routines */ $('li.procedure div a.ajax img,' + ' li.function div a.ajax img').live('click', function (event) { event.preventDefault(); var dialog = new RTE.object('routine'); dialog.editorDialog(0, $(this).parent()); }); /** Export Triggers and Events */ $('li.trigger div:eq(1) a.ajax img,' + ' li.event div:eq(1) a.ajax img' ).live('click', function (event) { event.preventDefault(); var dialog = new RTE.object(); dialog.exportDialog($(this).parent()); }); /** New index */ $('#pma_navigation_tree li.new_index a.ajax').live('click', function (event) { event.preventDefault(); var url = $(this).attr('href').substr( $(this).attr('href').indexOf('?') + 1 ) + '&ajax_request=true'; var title = PMA_messages.strAddIndex; indexEditorDialog(url, title); }); /** Edit index */ $('li.index a.ajax').live('click', function (event) { event.preventDefault(); var url = $(this).attr('href').substr( $(this).attr('href').indexOf('?') + 1 ) + '&ajax_request=true'; var title = PMA_messages.strEditIndex; indexEditorDialog(url, title); }); /** New view */ $('li.new_view a.ajax').live('click', function (event) { event.preventDefault(); PMA_createViewDialog($(this)); }); /** Hide navigation tree item */ $('a.hideNavItem.ajax').live('click', function (event) { event.preventDefault(); $.ajax({ url: $(this).attr('href') + '&ajax_request=true', success: function (data) { if (data.success === true) { PMA_reloadNavigation(); } else { PMA_ajaxShowMessage(data.error); } } }); }); /** Display a dialog to choose hidden navigation items to show */ $('a.showUnhide.ajax').live('click', function (event) { event.preventDefault(); var $msg = PMA_ajaxShowMessage(); $.get($(this).attr('href') + '&ajax_request=1', function (data) { if (data.success === true) { PMA_ajaxRemoveMessage($msg); var buttonOptions = {}; buttonOptions[PMA_messages.strClose] = function () { $(this).dialog("close"); }; $('') .attr('id', 'unhideNavItemDialog') .append(data.message) .dialog({ width: 400, minWidth: 200, modal: true, buttons: buttonOptions, title: PMA_messages.strUnhideNavItem, close: function () { $(this).remove(); } }); } else { PMA_ajaxShowMessage(data.error); } }); }); /** Show a hidden navigation tree item */ $('a.unhideNavItem.ajax').live('click', function (event) { event.preventDefault(); var $tr = $(this).parents('tr'); var $msg = PMA_ajaxShowMessage(); $.ajax({ url: $(this).attr('href') + '&ajax_request=true', success: function (data) { PMA_ajaxRemoveMessage($msg); if (data.success === true) { $tr.remove(); PMA_reloadNavigation(); } else { PMA_ajaxShowMessage(data.error); } } }); }); // Add/Remove favorite table using Ajax. $(".favorite_table_anchor").live("click", function (event) { event.preventDefault(); $self = $(this); var anchor_id = $self.attr("id"); if($self.data("favtargetn") != null) if($('a[data-favtargets="' + $self.data("favtargetn") + '"]').length > 0) { $('a[data-favtargets="' + $self.data("favtargetn") + '"]').trigger('click'); return; } $.ajax({ url: $self.attr('href'), cache: false, type: 'POST', data: { favorite_tables: (window.localStorage['favorite_tables'] !== undefined) ? window.localStorage['favorite_tables'] : '' }, success: function (data) { if (data.changes) { $('#pma_favorite_list').html(data.list); $('#' + anchor_id).parent().html(data.anchor); PMA_tooltip( $('#' + anchor_id), 'a', $('#' + anchor_id).attr("title") ); // Update localStorage. if (window.localStorage !== undefined) { window.localStorage['favorite_tables'] = data.favorite_tables; } } else { PMA_ajaxShowMessage(data.message); } } }); }); PMA_showCurrentNavigation(); }); /** * Expands a node in navigation tree. * * @param $expandElem expander * @param callback callback function * * @returns void */ function expandTreeNode($expandElem, callback) { var $children = $expandElem.closest('li').children('div.list_container'); var $icon = $expandElem.find('img'); if ($expandElem.hasClass('loaded')) { if ($icon.is('.ic_b_plus')) { $icon.removeClass('ic_b_plus').addClass('ic_b_minus'); $children.slideDown('fast'); } if (callback && typeof callback == 'function') { callback.call(); } } else { var $throbber = $('#pma_navigation .throbber') .first() .clone() .css({visibility: 'visible', display: 'block'}) .click(false); $icon.hide(); $throbber.insertBefore($icon); loadChildNodes($expandElem, function (data) { if (data.success === true) { var $destination = $expandElem.closest('li'); $icon.removeClass('ic_b_plus').addClass('ic_b_minus'); $destination .children('div.list_container') .slideDown('fast'); if ($destination.find('ul > li').length == 1) { $destination.find('ul > li') .find('a.expander.container') .click(); } if (callback && typeof callback == 'function') { callback.call(); } PMA_showFullName($destination); } else { PMA_ajaxShowMessage(data.error, false); } $icon.show(); $throbber.remove(); }); } $expandElem.blur(); } /** * Auto-scrolls the newly chosen database * * @param object $element The element to set to view * @param boolean $forceToTop Whether to force scroll to top * */ function scrollToView($element, $forceToTop) { var $container = $('#pma_navigation_tree_content'); var elemTop = $element.offset().top - $container.offset().top; var textHeight = 20; var scrollPadding = 20; // extra padding from top of bottom when scrolling to view if (elemTop < 0 |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0156 ]-- |