1(function ($) { 2 $.fn.dnnControlPanel = function (options) { 3 var opts = $.extend({}, $.fn.dnnControlPanel.defaultOptions, options), 4 $wrap = this; 5 6 return $wrap.each(function () { 7 8 var $controlPanel = $(this); 9 10 $controlPanel.wrap(function () { 11 return opts.wrappingHtml; 12 }); 13 14 $('[id$="CommonTasksPanel"]').detach().appendTo('#dnnCommonTasks .megaborder'); 15 $('[id$="CurrentPagePanel"]').detach().appendTo('#dnnCurrentPage .megaborder'); 16 $('[id$="AdminPanel"]').detach().appendTo('#dnnOtherTools .megaborder'); 17 18 var $wrapper = $('#dnnCPWrap'); 19 if ($wrapper.hasClass('Pinned')) { 20 $wrapper.parent().css({ paddingBottom: '0' }); 21 } 22 else { 23 $(document.body).css({ marginTop: $wrapper.outerHeight() }); 24 } 25 26 $.fn.dnnControlPanel.show = function () { 27 $controlPanel.parents(opts.controlPanelWrapper).slideDown(); 28 } 29 30 $.fn.dnnControlPanel.hide = function () { 31 $controlPanel.parents(opts.controlPanelWrapper).slideUp(); 32 } 33 34 35 var canHide = false, 36 forceShow = false, 37 $controlPanel = $(this); 38 39 function EnableHide() { 40 if (!forceShow) canHide = true; 41 } 42 43 function megaHoverOver() { 44 hideAll(); 45 $(this).parent().find(opts.menuBorderSelector).stop().fadeTo('fast', 1).show(); //Find sub and fade it in 46 } 47 48 function hideAll() { 49 $controlPanel.find(opts.menuBorderSelector).stop().fadeTo('fast', 0, function () { //Fade to 0 opacity 50 $(this).hide(); //after fading, hide it 51 }); 52 } 53 54 //Set custom configurations 55 //This is the config used for showing the menue 56 var config = { 57 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher) 58 interval: 200, // number = milliseconds for onMouseOver polling interval 59 over: megaHoverOver, // function = onMouseOver callback (REQUIRED) 60 timeout: 100, // number = milliseconds delay before onMouseOut 61 out: function () { return null; } // function = onMouseOut callback (REQUIRED) 62 }; 63 64 //This is the config used for hiding the menue 65 var hideConfig = { 66 sensitivity: 2, // number = sensitivity threshold (must be 1 or higher) 67 interval: 1, // number = milliseconds for onMouseOver polling interval 68 over: function () { return; }, // function = onMouseOver callback (REQUIRED) 69 timeout: 300, // number = milliseconds delay before onMouseOut 70 out: function () { 71 if (canHide) hideAll(); 72 } // function = onMouseOut callback (REQUIRED) 73 }; 74 75 $controlPanel.find(opts.menuBorderSelector).css({ 'opacity': '0' }); //Fade sub nav to 0 opacity on default 76 $controlPanel.find(opts.menuBorderSelector).find(opts.primaryActionSelector).css({ opacity: 1 }); //Compact IE7 77 78 $controlPanel.find(opts.menuItemSelector).mouseenter(EnableHide); //Hovering over CP will re-enable hiding. 79 80 //hide menu if user double clicks while they are outside of the 81 //control panel 82 $(document).dblclick(function () { 83 if (!canHide) 84 hideAll(); 85 }); 86 87 $controlPanel.dblclick(function (e) { 88 e.stopPropagation(); 89 }); 90 91 //Hide menu if Esc key is pressed 92 $(document).keyup(function (e) { 93 if (e.keyCode == 27) { 94 hideAll(); 95 } 96 }); 97 98 $controlPanel.find(opts.menuItemActionSelector).hoverIntent(config); //Trigger Hover intent with custom configurations 99 $controlPanel.find(opts.menuItemSelector).hoverIntent(hideConfig); 100 101 //Hovering over a the dropdown will re-enable autohide 102 $controlPanel.find(opts.enableAutohideOnFocusSelector).focus(function () { 103 canHide = true; 104 }); 105 106 //Hovering over a telerik dropdown will disable autohide 107 //need this to disable hide when the drop down expands beyond the menu body 108 $controlPanel.find(opts.persistOnMouseoverSelector).live('mouseover', function () { 109 canHide = false; 110 }); 111 112 $controlPanel.find(opts.persistOnWaitForChangeSelector).live('click', function () { 113 forceShow = true; 114 canHide = false; 115 116 setTimeout(function () { 117 $(document).one("click", function() { 118 forceShow = false; 119 canHide = true; 120 });
121 }, 0); 122 }); 123 124 $controlPanel.find(opts.persistOnFocusSelector).live('focus', function () { 125 canHide = false; 126 }); 127 128 }); 129 }; 130 131 $.fn.dnnControlPanel.defaultOptions = { 132 wrappingHtml: '<div id="dnnCPWrap"><div id="dnnCPWrapLeft"><div id="dnnCPWrapRight"></div></div></div>', 133 persistOnFocusSelector: 'select, input', 134 persistOnMouseoverSelector: '.rcbSlide li', 135 persistOnWaitForChangeSelector: '.RadComboBox', 136 enableAutohideOnFocusSelector: '.dnnadminmega .megaborder', 137 menuItemActionSelector: '.dnnadminmega > li > a', 138 menuItemSelector: '.dnnadminmega > li', 139 menuBorderSelector: '.megaborder', 140 primaryActionSelector: '.dnnPrimaryAction', 141 controlPanelWrapper: '#dnnCPWrap' 142 }; 143 144 $(document).ready(function () { 145 $('.dnnControlPanel').dnnControlPanel(); 146 }); 147 148})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.