Last active
March 7, 2017 08:34
-
-
Save asigner/c5539608e1e9a9eefaa9ca61de74d764 to your computer and use it in GitHub Desktop.
Adds a search box to the AEM WebConsole
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AEM Web Console Search Box | |
// @namespace http://signer.info | |
// @version 0.1 | |
// @description Adds a search box to the AEM WebConsole | |
// @author Andy Signer | |
// @match http://localhost:4502/system/console* | |
// @match http://localhost:4503/system/console* | |
// @grant none | |
// ==/UserScript== | |
window.addEventListener('load', function() { | |
'use strict'; | |
var menu = $('<li class="navMenuItem-0 ui-menu-item" role="presentation"></li>'); | |
var search = $('<input id="search" placeholder="search for..."/>'); | |
var data = [ | |
]; | |
$('.navMenuItem-1 a').each(function (key, value) { | |
data.push({ | |
label: value.text, | |
link: value.href | |
}); | |
}); | |
data.sort((a, b) => a.label.localeCompare(b.label)); | |
search.autocomplete({ | |
delay: 0, | |
source: data, | |
select: function (event, ui) { | |
var url = $(this).val(); | |
if (url) { | |
window.location = ui.item.link; | |
} | |
} | |
}); | |
menu.append(search); | |
$('#navmenu').append(menu); | |
search.focus(); | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is it?
Adds a search box to the AEM WebConsole.
How to install?
Firefox
Install Greasemonkey, restart Firefox and then press the Raw button of this gist. Follow the installation process.
Chrome
Install Tampermonkey. Press Get a new script. Choose Github/Gist and search for aem-console-searchbox.user.js. Choose asigner/aem-console-searchbox.user.js to be installed.