Difference between revisions of "Template:Sidebar"
Adelo Vieira (talk | contribs) |
Adelo Vieira (talk | contribs) |
||
Line 348: | Line 348: | ||
} | } | ||
} | } | ||
− | + | ||
− | // Shortkey: https://www.techiedelight.com/create-keyboard-shortcuts-with-javascript-jquery-hotkeys-mousetrap-library/ | + | function removeCSS() { |
+ | $('#menuToggle li').css({'margin-bottom':'','margin-top':''}) | ||
+ | $('#menuToggle p ').css({'margin-bottom':'','margin-top':''}) | ||
+ | } | ||
+ | |||
+ | function collapseSome() { | ||
+ | $(".mw-collapsible").not('.keep-abierto').addClass("mw-collapsed"); | ||
+ | } | ||
+ | |||
+ | function collapseAll() { | ||
+ | $(".mw-collapsible").addClass("mw-collapsed") | ||
+ | } | ||
+ | |||
+ | // function moveSidebarToBody() { | ||
+ | // $("#MySidebar").appendTo("#pt-userpage"); | ||
+ | // // document.body.appendChild(document.getElementById('MySidebar')) | ||
+ | // } | ||
+ | |||
+ | // Shortkey: https://www.techiedelight.com/create-keyboard-shortcuts-with-javascript-jquery-hotkeys-mousetrap-library/ | ||
// For some reason, in MediaWiki pages, the && operator is not being interpreted by the web browser | // For some reason, in MediaWiki pages, the && operator is not being interpreted by the web browser | ||
// as such in «keydown» functions. The web browser is reading «&», instead of «&&» which generates a systax error. | // as such in «keydown» functions. The web browser is reading «&», instead of «&&» which generates a systax error. | ||
Line 374: | Line 392: | ||
e.preventDefault() | e.preventDefault() | ||
} | } | ||
+ | |||
+ | if ( event.which === 37 ) { | ||
+ | collapseAll() | ||
+ | } | ||
+ | |||
} | } | ||
}); | }); | ||
Line 384: | Line 407: | ||
// } | // } | ||
// }); | // }); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
$(document).ready( function() { | $(document).ready( function() { |
Revision as of 23:16, 12 March 2021