diff options
author | gorhill <rhill@raymondhill.net> | 2015-09-12 10:51:11 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-09-12 10:51:11 -0400 |
commit | 4e3fcd576d5fd5c9f3cb57ee2f65f2044681298b (patch) | |
tree | c0ae2c9bbc912d89b9f2100e17b5e0be9af435d9 /src | |
parent | 59bdcbdb7e8ac788ed07c909606b7f9b31be1500 (diff) | |
download | uBlock-4e3fcd576d5fd5c9f3cb57ee2f65f2044681298b.zip uBlock-4e3fcd576d5fd5c9f3cb57ee2f65f2044681298b.tar.gz uBlock-4e3fcd576d5fd5c9f3cb57ee2f65f2044681298b.tar.bz2 |
this addresses #705
Diffstat (limited to 'src')
-rw-r--r-- | src/_locales/en/messages.json | 4 | ||||
-rw-r--r-- | src/document-blocked.html | 12 | ||||
-rw-r--r-- | src/js/document-blocked.js | 22 |
3 files changed, 31 insertions, 7 deletions
diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index cdefc36..0fd7e42 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -571,6 +571,10 @@ "message": "Because of the following filter", "description": "English: Because of the following filter" }, + "docblockedNoParamsPrompt": { + "message": "without parameters", + "description": "label to be used for the parameter-less URL: https://cloud.githubusercontent.com/assets/585534/9832014/bfb1b8f0-593b-11e5-8a27-fba472a5529a.png" + }, "docblockedFoundIn": { "message": "Found in:", "description": "English: List of filter list names follows" diff --git a/src/document-blocked.html b/src/document-blocked.html index a328084..1d2f08a 100644 --- a/src/document-blocked.html +++ b/src/document-blocked.html @@ -67,9 +67,14 @@ select { opacity: 0.5; padding: 0.2em; position: absolute; - right: 0; transform: translate(0, -50%); } +body[dir="ltr"] #theURL > p > span { + right: 0; + } +body[dir="rtl"] #theURL > p > span { + left: 0; + } #theURL > p:hover > span { opacity: 1; } @@ -86,7 +91,7 @@ select { color: gray; font-size: small; overflow-x: hidden; - padding: 0 4px 4px 4px; + padding: 4px; text-align: initial; text-overflow: ellipsis; } @@ -102,9 +107,6 @@ select { #parsed span { display: inline-block; } -#parsed a { - font-weight: bold; - } #parsed span:first-of-type { font-weight: bold; } diff --git a/src/js/document-blocked.js b/src/js/document-blocked.js index a37e3d6..f4d7b4e 100644 --- a/src/js/document-blocked.js +++ b/src/js/document-blocked.js @@ -195,8 +195,16 @@ uDom.nodeFromId('why').textContent = details.fs; if ( url === null || url.search.length === 0 ) { return false; } + + var pos = rawURL.indexOf('?'); + var li = liFromParam( + vAPI.i18n('docblockedNoParamsPrompt'), + rawURL.slice(0, pos) + ); + parentNode.appendChild(li); + var params = url.search.slice(1).split('&'); - var param, pos, name, value, li, ul; + var param, name, value, ul; for ( var i = 0; i < params.length; i++ ) { param = params[i]; pos = param.indexOf('='); @@ -225,8 +233,18 @@ uDom.nodeFromId('why').textContent = details.fs; uDom('#theURL > p').append(toggler); uDom(toggler).on('click', function() { - uDom.nodeFromId('theURL').classList.toggle('collapsed'); + var cl = uDom.nodeFromId('theURL').classList; + cl.toggle('collapsed'); + vAPI.localStorage.setItem( + 'document-blocked-expand-url', + (cl.contains('collapsed') === false).toString() + ); }); + + uDom.nodeFromId('theURL').classList.toggle( + 'collapsed', + vAPI.localStorage.getItem('document-blocked-expand-url') !== 'true' + ); })(); /******************************************************************************/ |