popup: USO workaround for finding extension styles

This commit is contained in:
tophf 2017-09-30 03:01:07 +03:00
parent 0978308325
commit 7cf27601ae
2 changed files with 7 additions and 6 deletions

View File

@ -114,7 +114,8 @@
<div class="left-gutter"></div> <div class="left-gutter"></div>
<div class="main-controls"> <div class="main-controls">
<div id="find-styles"> <div id="find-styles">
<a id="find-styles-link" href="#" i18n-text="findStylesForSite"></a> <a id="find-styles-link" href="https://userstyles.org/styles/browse/"
i18n-text="findStylesForSite"></a>
</div> </div>
<div id="write-style"> <div id="write-style">
<span id="write-style-for" i18n-text="writeStyleFor"></span> <span id="write-style-for" i18n-text="writeStyleFor"></span>

View File

@ -74,7 +74,6 @@ function initPopup(url) {
}; };
setupLivePrefs(); setupLivePrefs();
$('#find-styles-link').onclick = handleEvent.openURLandHide;
Object.assign($('#popup-manage-button'), { Object.assign($('#popup-manage-button'), {
onclick: handleEvent.openManager, onclick: handleEvent.openManager,
onmouseup: handleEvent.openManager, onmouseup: handleEvent.openManager,
@ -96,10 +95,11 @@ function initPopup(url) {
installed); installed);
} }
// find styles link $('#find-styles-link').onclick = handleEvent.openURLandHide;
$('#find-styles a').href = $('#find-styles-link').href +=
'https://userstyles.org/styles/browse/all/' + url.startsWith(location.protocol) ?
encodeURIComponent(url.startsWith('file:') ? 'file:' : url); '?search_terms=Stylus' :
'all/' + encodeURIComponent(url.startsWith('file:') ? 'file:' : url);
if (!url) { if (!url) {
document.body.classList.add('blocked'); document.body.classList.add('blocked');