diff options
Diffstat (limited to 'pages')
| -rw-r--r-- | pages/exclusions.html | 14 | ||||
| -rw-r--r-- | pages/options.coffee | 13 | ||||
| -rw-r--r-- | pages/options.html | 17 | ||||
| -rw-r--r-- | pages/popup.html | 18 |
4 files changed, 26 insertions, 36 deletions
diff --git a/pages/exclusions.html b/pages/exclusions.html new file mode 100644 index 00000000..0a9e715b --- /dev/null +++ b/pages/exclusions.html @@ -0,0 +1,14 @@ +<table id="exclusionRules"> + <tr> + <td><span class="exclusionHeaderText">Patterns</span></td> + <td><span class="exclusionHeaderText">Keys</span></td> + </tr> +</table> +<template id="exclusionRuleTemplate"> + <tr class="exclusionRuleTemplateInstance"> + <td><input/ type="text" class="pattern" placeholder="URL pattern"></td> + <td class="exclusionRulePassKeys"><input/ type="text" class="passKeys" placeholder="Exclude keys"></td> + <td class="exclusionRemoveButton"> + <input/ type="button" class="exclusionRemoveButtonButton" value="✖"></td> + </tr> +</template> diff --git a/pages/options.coffee b/pages/options.coffee index def67fd7..abbf52c6 100644 --- a/pages/options.coffee +++ b/pages/options.coffee @@ -294,7 +294,14 @@ initPopupPage = -> # # Initialization. document.addEventListener "DOMContentLoaded", -> - switch location.pathname - when "/pages/options.html" then initOptionsPage() - when "/pages/popup.html" then initPopupPage() + xhr = new XMLHttpRequest() + xhr.open 'GET', chrome.extension.getURL('pages/exclusions.html'), true + xhr.onreadystatechange = -> + if xhr.readyState == 4 + $("exclusionScrollBox").innerHTML = xhr.responseText + switch location.pathname + when "/pages/options.html" then initOptionsPage() + when "/pages/popup.html" then initPopupPage() + + xhr.send() diff --git a/pages/options.html b/pages/options.html index 9a0368a3..e54d1c2f 100644 --- a/pages/options.html +++ b/pages/options.html @@ -23,23 +23,8 @@ </div> </div> <div> - <!-- Warning: There is an almost exact copy of exclusionScrollBox in popup.html. Changes here - may have to propagated to there too. --> <div id="exclusionScrollBox"> - <table id="exclusionRules"> - <tr> - <td><span class="exclusionHeaderText">Patterns</span></td> - <td><span class="exclusionHeaderText">Keys</span></td> - </tr> - </table> - <template id="exclusionRuleTemplate"> - <tr class="exclusionRuleTemplateInstance"> - <td><input/ type="text" class="pattern" placeholder="URL pattern"></td> - <td class="exclusionRulePassKeys"><input/ type="text" class="passKeys" placeholder="Exclude keys"></td> - <td class="exclusionRemoveButton"> - <input/ type="button" class="exclusionRemoveButtonButton" value="✖"></td> - </tr> - </template> + <!-- Populated by options.coffee. --> </div> <button id="exclusionAddButton">Add Rule</button> </div> diff --git a/pages/popup.html b/pages/popup.html index b89e2f07..4f36cbfe 100644 --- a/pages/popup.html +++ b/pages/popup.html @@ -53,25 +53,9 @@ <body> <div id="state"></div> - <!-- Copied (almost) directly from options.html - start --> - <!-- The only difference is the column headers. --> <div id="exclusionScrollBox"> - <table id="exclusionRules"> - <tr> - <td><span class="exclusionHeaderText">URL Patterns</span></td> - <td><span class="exclusionHeaderText">Excluded Keys</span></td> - </tr> - </table> - <template id="exclusionRuleTemplate"> - <tr class="exclusionRuleTemplateInstance"> - <td><input/ type="text" class="pattern" placeholder="URL pattern"></td> - <td class="exclusionRulePassKeys"><input/ type="text" class="passKeys" placeholder="Excluded keys"></td> - <td class="exclusionRemoveButton"> - <input/ type="button" class="exclusionRemoveButtonButton" value="✖"></td> - </tr> - </template> + <!-- Populated by options.coffee. --> </div> - <!-- Copied (almost) directly from options.html - end --> <!-- Some extra space which is hidden underneath the footer. --> <div id="endSpace"/> |
