| OLD | NEW |
| (Empty) |
| 1 var otherParent = document.getElementById('other'); | |
| 2 | |
| 3 var section = document.createElement('h2'); | |
| 4 section.appendChild(document.createTextNode(translate.get('other_preferences')))
; | |
| 5 otherParent.appendChild(section); | |
| 6 | |
| 7 //BUTTON | |
| 8 /* | |
| 9 var section = document.createElement('h3'); | |
| 10 section.appendChild(document.createTextNode(translate.get('button'))); | |
| 11 otherParent.appendChild(section); | |
| 12 | |
| 13 var subsection = document.createElement('div'); | |
| 14 var label = document.createElement('label'); | |
| 15 | |
| 16 var checkbox = document.createElement('input'); | |
| 17 checkbox.setAttribute('type', 'checkbox'); | |
| 18 checkbox.setAttribute('name', 'button'); | |
| 19 checkbox.setAttribute('id', 'button'); | |
| 20 checkbox.setAttribute('onClick', 'setButton()'); | |
| 21 checkbox.checked = preferences.bool('button'); | |
| 22 label.appendChild(checkbox); | |
| 23 | |
| 24 var text = document.createElement('span'); | |
| 25 text.innerHTML = translate.get('button_descript'); | |
| 26 label.appendChild(text); | |
| 27 | |
| 28 subsection.appendChild(label); | |
| 29 otherParent.appendChild(subsection);*/ | |
| 30 | |
| 31 //INTERVAL | |
| 32 var subsection = document.createElement('div'); | |
| 33 var intervalTitle = document.createElement('h3'); | |
| 34 intervalTitle.appendChild(document.createTextNode(translate.get('interval_title'
))); | |
| 35 subsection.appendChild(intervalTitle); | |
| 36 var intervals = [43200000, 86400000, 172800000, 604800000, 2592000000]; | |
| 37 intervalInput = document.createElement('select'); | |
| 38 intervalInput.setAttribute('id', 'interval'); | |
| 39 intervalInput.setAttribute('onChange', 'setInterval()'); | |
| 40 for(i in intervals) { | |
| 41 var element = document.createElement('option'); | |
| 42 element.appendChild(document.createTextNode(translate.get('interval_' +
intervals[i]))); | |
| 43 if(preferences.int('interval') == intervals[i]) | |
| 44 element.setAttribute('selected', 'selected'); | |
| 45 element.setAttribute('value', intervals[i]); | |
| 46 intervalInput.appendChild(element); | |
| 47 } | |
| 48 subsection.appendChild(intervalInput); | |
| 49 otherParent.appendChild(subsection); | |
| 50 | |
| 51 | |
| 52 function setInterval() { | |
| 53 preferences.int('interval', document.getElementById('interval').value); | |
| 54 } | |
| 55 function setButton() { | |
| 56 opera.extension.postMessage({request: 'button', enable: document.getElem
entById('button').checked}); | |
| 57 } | |
| OLD | NEW |