OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html i18n-values="dir:textdirection"> | 2 <html i18n-values="dir:textdirection"> |
3 <head> | 3 <head> |
4 <link rel="stylesheet" href="dialog.css"> | 4 <link rel="stylesheet" href="dialog.css"> |
5 <style> | 5 <style> |
6 body { | 6 body { |
7 -webkit-user-select: none; | 7 -webkit-user-select: none; |
8 margin: 10px 10px 0 10px; | 8 margin: 10px 10px 0 10px; |
9 } | 9 } |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 function handleKeyDown(e) { | 47 function handleKeyDown(e) { |
48 if (e.keyCode == 27) { // Escape | 48 if (e.keyCode == 27) { // Escape |
49 e.preventDefault(); | 49 e.preventDefault(); |
50 cancel(); | 50 cancel(); |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 function load() { | 54 function load() { |
55 i18nTemplate.process(document, JSON.parse(chrome.dialogArguments)); | 55 i18nTemplate.process(document, JSON.parse( |
| 56 chrome.getVariableValue('dialogArguments'))); |
56 document.addEventListener('keydown', handleKeyDown); | 57 document.addEventListener('keydown', handleKeyDown); |
57 $('form').onsubmit = handleSubmit; | 58 $('form').onsubmit = handleSubmit; |
58 $('cancel').onclick = cancel; | 59 $('cancel').onclick = cancel; |
59 $('cancel').focus(); | 60 $('cancel').focus(); |
60 } | 61 } |
61 | 62 |
62 document.addEventListener('DOMContentLoaded', load); | 63 document.addEventListener('DOMContentLoaded', load); |
63 </script> | 64 </script> |
64 </head> | 65 </head> |
65 <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> | 66 <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> |
66 <div id="explanation" i18n-content="message"></div> | 67 <div id="explanation" i18n-content="message"></div> |
67 <form id="form"> | 68 <form id="form"> |
68 <div id="buttons"> | 69 <div id="buttons"> |
69 <input id="cancel" type="reset" i18n-values="value:cancel" autofocus> | 70 <input id="cancel" type="reset" i18n-values="value:cancel" autofocus> |
70 <input id="accept" type="submit" i18n-values="value:accept"> | 71 <input id="accept" type="submit" i18n-values="value:accept"> |
71 </div> | 72 </div> |
72 </form> | 73 </form> |
73 </body> | 74 </body> |
74 </html> | 75 </html> |
OLD | NEW |