Merge branch 'master' of github.com:gorhill/uBlock

This commit is contained in:
gorhill 2015-02-11 14:44:22 -05:00
commit 0a55c3fb20
3 changed files with 34 additions and 23 deletions

View File

@ -15,25 +15,27 @@ code {
margin: 0; margin: 0;
padding: 0.5em 0 0 0; padding: 0.5em 0 0 0;
white-space: nowrap; white-space: nowrap;
font-size: 0; /* otherwise spaces between inline-blocks will be rendered */
} }
#diff > .pane { #diff .pane {
border: 0; border: 0;
box-sizing: box-border; box-sizing: border-box;
display: inline-block; display: inline-block;
font: 12px/1.8 monospace; font: 12px/1.8 monospace;
margin: 0; margin: 0;
padding: 0; padding: 0;
position: relative; position: relative;
white-space: normal; white-space: normal;
width: calc(50% - 2px); width: 50%;
} }
#diff > .pane > div { #diff .pane .rulesContainer {
position: relative;
min-height: 150px; /* too short is confusing */
}
#diff .ruleActions {
padding: 0 0 1em 0; padding: 0 0 1em 0;
text-align: center; text-align: center;
} }
#diff > .pane > div > span {
float: left;
}
body[dir="ltr"] #revertButton:after { body[dir="ltr"] #revertButton:after {
content: '\2009\f061'; content: '\2009\f061';
font-family: FontAwesome; font-family: FontAwesome;
@ -105,27 +107,30 @@ body[dir="rtl"] #commitButton:before {
visibility: hidden; visibility: hidden;
} }
#diff .left { #diff .left {
padding: 0 0 0 0; border-right: 1px solid #eee;
} }
#diff .right > ul { #diff .right > ul {
color: #888; color: #888;
} }
#diff li { #diff li {
background-color: white; background-color: #ddd;
direction: ltr; direction: ltr;
padding: 0; padding: 0;
text-align: left; text-align: left;
white-space: nowrap; white-space: nowrap;
padding-left: 3px; /* a bit of padding; must also be in textarea */
} }
#diff li:nth-of-type(2n+0) { #diff li:nth-child(even) {
background-color: #eee; background-color: #eee;
} }
#diff .right li { #diff .right li {
opacity: 0.5;
} }
#diff .right li:hover { #diff .right li:hover {
} }
#diff .right li.notLeft { #diff .right li.notLeft {
color: #000; color: #000;
opacity: 1;
} }
#diff .right li.notRight { #diff .right li.notRight {
color: #000; color: #000;
@ -133,21 +138,25 @@ body[dir="rtl"] #commitButton:before {
#diff .right li.toRemove { #diff .right li.toRemove {
color: #000; color: #000;
text-decoration: line-through; text-decoration: line-through;
opacity: 1;
} }
#diff textarea { #diff textarea {
background-color: #f8f8ff; background-color: #f8f8ff;
border: 0; border: 0;
margin: 0;
border-top: 1px solid #eee; border-top: 1px solid #eee;
direction: ltr; direction: ltr;
font: 12px monospace; font: 12px monospace;
height: 100%;
left: 0;
line-height: 1.8; line-height: 1.8;
margin: 0;
overflow: hidden; overflow: hidden;
overflow-y: auto; overflow-y: auto;
padding: 1em 0 0 0; padding: 1em 0 0 3px; /* same left and top padding as ul/li */
position: absolute; position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
resize: none; resize: none;
visibility: hidden; visibility: hidden;
white-space: pre; /* this imples nowrap; break only on \n and <br>. white-space: pre; /* this imples nowrap; break only on \n and <br>.
@ -155,7 +164,6 @@ body[dir="rtl"] #commitButton:before {
respect \n's (example: Safari) per the CSS spec: respect \n's (example: Safari) per the CSS spec:
http://www.w3.org/wiki/CSS/Properties/white-space */ http://www.w3.org/wiki/CSS/Properties/white-space */
word-wrap: normal; word-wrap: normal;
width: 100%;
} }
#diff.edit textarea { #diff.edit textarea {
visibility: visible; visibility: visible;

View File

@ -14,22 +14,25 @@
<p data-i18n="rulesFormatHint"></p> <p data-i18n="rulesFormatHint"></p>
<div id="diff"> <div id="diff">
<div class="pane left"> <div class="pane left">
<div> <div class="ruleActions">
<h2 data-i18n="rulesPermanentHeader"></h2> <h2 data-i18n="rulesPermanentHeader"></h2>
<button type="button" id="exportButton" data-i18n="rulesExport"></button> <button type="button" id="exportButton" data-i18n="rulesExport"></button>
<button type="button" id="revertButton" data-i18n="rulesRevert"></button> <button type="button" id="revertButton" data-i18n="rulesRevert"></button>
</div> </div>
<div class="rulesContainer">
<ul></ul> <ul></ul>
</div> </div>
</div>
<div class="pane right"> <div class="pane right">
<div> <div class="ruleActions">
<h2 data-i18n="rulesTemporaryHeader"></h2> <h2 data-i18n="rulesTemporaryHeader"></h2>
<button type="button" id="commitButton" data-i18n="rulesCommit"></button> <button type="button" id="commitButton" data-i18n="rulesCommit"></button>
<button type="button" id="editEnterButton" data-i18n="rulesEdit"></button> <button type="button" id="editEnterButton" data-i18n="rulesEdit"></button>
<button type="button" id="editStopButton" data-i18n="rulesEditSave"></button> <button type="button" id="editStopButton" data-i18n="rulesEditSave"></button>
<button type="button" id="editCancelButton" data-i18n="rulesEditDiscard"></button> <button type="button" id="editCancelButton" data-i18n="rulesEditDiscard"></button>
<button type="button" id="importButton" data-i18n="rulesImport"></button> <button type="button" id="importButton" data-i18n="rulesImport"></button>
</div> </div>
<div class="rulesContainer">
<textarea spellcheck="false"></textarea> <textarea spellcheck="false"></textarea>
<ul></ul> <ul></ul>
</div> </div>

View File

@ -81,10 +81,10 @@ var renderRules = function(details) {
} }
} }
uDom('#diff > .left > ul > li').remove(); uDom('#diff > .left ul > li').remove();
uDom('#diff > .left > ul').html(permanentList.join('')); uDom('#diff > .left ul').html(permanentList.join(''));
uDom('#diff > .right > ul > li').remove(); uDom('#diff > .right ul > li').remove();
uDom('#diff > .right > ul').html(sessionList.join('')); uDom('#diff > .right ul').html(sessionList.join(''));
uDom('#diff').toggleClass('dirty', details.sessionRules !== details.permanentRules); uDom('#diff').toggleClass('dirty', details.sessionRules !== details.permanentRules);
}; };