Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: options/other.js

Issue 8493027: Acquired Opera AdBlock code (Closed)
Patch Set: Created Oct. 8, 2012, 5:58 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « options/listsDisplay.js ('k') | options/privacy.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options/other.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/options/other.js
@@ -0,0 +1,57 @@
+var otherParent = document.getElementById('other');
+
+var section = document.createElement('h2');
+section.appendChild(document.createTextNode(translate.get('other_preferences')));
+otherParent.appendChild(section);
+
+//BUTTON
+/*
+var section = document.createElement('h3');
+section.appendChild(document.createTextNode(translate.get('button')));
+otherParent.appendChild(section);
+
+var subsection = document.createElement('div');
+var label = document.createElement('label');
+
+var checkbox = document.createElement('input');
+checkbox.setAttribute('type', 'checkbox');
+checkbox.setAttribute('name', 'button');
+checkbox.setAttribute('id', 'button');
+checkbox.setAttribute('onClick', 'setButton()');
+checkbox.checked = preferences.bool('button');
+label.appendChild(checkbox);
+
+var text = document.createElement('span');
+text.innerHTML = translate.get('button_descript');
+label.appendChild(text);
+
+subsection.appendChild(label);
+otherParent.appendChild(subsection);*/
+
+//INTERVAL
+var subsection = document.createElement('div');
+var intervalTitle = document.createElement('h3');
+intervalTitle.appendChild(document.createTextNode(translate.get('interval_title')));
+subsection.appendChild(intervalTitle);
+var intervals = [43200000, 86400000, 172800000, 604800000, 2592000000];
+intervalInput = document.createElement('select');
+intervalInput.setAttribute('id', 'interval');
+intervalInput.setAttribute('onChange', 'setInterval()');
+for(i in intervals) {
+ var element = document.createElement('option');
+ element.appendChild(document.createTextNode(translate.get('interval_' + intervals[i])));
+ if(preferences.int('interval') == intervals[i])
+ element.setAttribute('selected', 'selected');
+ element.setAttribute('value', intervals[i]);
+ intervalInput.appendChild(element);
+}
+subsection.appendChild(intervalInput);
+otherParent.appendChild(subsection);
+
+
+function setInterval() {
+ preferences.int('interval', document.getElementById('interval').value);
+}
+function setButton() {
+ opera.extension.postMessage({request: 'button', enable: document.getElementById('button').checked});
+}
« no previous file with comments | « options/listsDisplay.js ('k') | options/privacy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld