OLD | NEW |
1 <html i18n-values="dir:textdirection;"> | 1 <html i18n-values="dir:textdirection;"> |
2 <head> | 2 <head> |
3 <title></title> | 3 <title></title> |
4 <style type="text/css"> | 4 <style type="text/css"> |
5 body { | 5 body { |
6 line-height: 1.4em; | 6 line-height: 1.4em; |
7 background: #FFFFFF; | 7 background: #FFFFFF; |
8 font-size: 11pt; | 8 font-size: 11pt; |
9 } | 9 } |
10 html[os='mac'] body { | 10 html[os='mac'] body { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #passphrase-input { | 48 #passphrase-input { |
49 margin-top: 20px; | 49 margin-top: 20px; |
50 margin-bottom: 20px; | 50 margin-bottom: 20px; |
51 } | 51 } |
52 #incorrectPassphrase { | 52 #incorrectPassphrase { |
53 margin-top: 5px; | 53 margin-top: 5px; |
54 } | 54 } |
55 .error { | 55 .error { |
56 color: red; | 56 color: red; |
57 } | 57 } |
| 58 .overlay-warning { |
| 59 position: absolute; |
| 60 display: none; |
| 61 left: 25px; |
| 62 right: 25px; |
| 63 top: 100px; |
| 64 background: white; |
| 65 border: 2px solid #888; |
| 66 border-radius: 8px; |
| 67 padding: 15px; |
| 68 box-shadow: 0.2em 0.2em 0.5em #888; |
| 69 } |
| 70 #cancel-warning-header { |
| 71 font-weight: bold; |
| 72 margin-bottom: 8px; |
| 73 } |
| 74 .overlay-warning INPUT { |
| 75 margin-top: 12px; |
| 76 float: right; |
| 77 margin-left: 5px; |
| 78 } |
58 </style> | 79 </style> |
59 <script src="chrome://resources/js/cr.js"></script> | 80 <script src="chrome://resources/js/cr.js"></script> |
60 <script> | 81 <script> |
61 // Called once, when this html/js is loaded. | 82 // Called once, when this html/js is loaded. |
62 function setupPassphraseDialog(args) { | 83 function setupPassphraseDialog(args) { |
63 // Allow platform specific rules | 84 // Allow platform specific rules |
64 if (cr.isMac) { | 85 if (cr.isMac) { |
65 document.documentElement.setAttribute('os', 'mac'); | 86 document.documentElement.setAttribute('os', 'mac'); |
66 } else if (!cr.isWindows) { | 87 } else if (!cr.isWindows) { |
67 document.documentElement.setAttribute('os', 'linux'); | 88 document.documentElement.setAttribute('os', 'linux'); |
(...skipping 13 matching lines...) Expand all Loading... |
81 document.getElementById("incorrectPassphrase").style.display = "block"; | 102 document.getElementById("incorrectPassphrase").style.display = "block"; |
82 } | 103 } |
83 } | 104 } |
84 | 105 |
85 function sendPassphraseAndClose() { | 106 function sendPassphraseAndClose() { |
86 var f = document.getElementById("passphraseForm"); | 107 var f = document.getElementById("passphraseForm"); |
87 var result = JSON.stringify({"passphrase": f.passphrase.value}); | 108 var result = JSON.stringify({"passphrase": f.passphrase.value}); |
88 chrome.send("Passphrase", [result]); | 109 chrome.send("Passphrase", [result]); |
89 } | 110 } |
90 | 111 |
| 112 function showCancelWarning() { |
| 113 document.getElementById("cancel-warning-box").style.display = "block"; |
| 114 document.getElementById("okButton").disabled = true; |
| 115 document.getElementById("cancelButton").disabled = true; |
| 116 } |
| 117 |
| 118 function hideCancelWarning() { |
| 119 document.getElementById("cancel-warning-box").style.display = "none"; |
| 120 document.getElementById("okButton").disabled = false; |
| 121 document.getElementById("cancelButton").disabled = false; |
| 122 } |
| 123 |
91 function goToDashboard() { | 124 function goToDashboard() { |
92 chrome.send("GoToDashboard", [""]); | 125 chrome.send("GoToDashboard", [""]); |
93 chrome.send("DialogClose", [""]); | 126 chrome.send("DialogClose", [""]); |
94 } | 127 } |
95 </script> | 128 </script> |
96 </head> | 129 </head> |
97 <body i18n-values=".style.fontFamily:fontfamily" | 130 <body i18n-values=".style.fontFamily:fontfamily" |
98 onload="setupPassphraseDialog(JSON.parse(chrome.dialogArguments));"> | 131 onload="setupPassphraseDialog(JSON.parse(chrome.dialogArguments));"> |
99 <form id="passphraseForm" | 132 <form id="passphraseForm" |
100 onSubmit="sendPassphraseAndClose(); return false;"> | 133 onSubmit="sendPassphraseAndClose(); return false;"> |
(...skipping 11 matching lines...) Expand all Loading... |
112 for="passphrase" i18n-content="passphraseLabel"> | 145 for="passphrase" i18n-content="passphraseLabel"> |
113 </label> | 146 </label> |
114 <input id="passphrase" name="passphrase" type="password" /> | 147 <input id="passphrase" name="passphrase" type="password" /> |
115 <div class="error" id="incorrectPassphrase" | 148 <div class="error" id="incorrectPassphrase" |
116 i18n-content="incorrectPassphrase"> | 149 i18n-content="incorrectPassphrase"> |
117 </div> | 150 </div> |
118 </div> | 151 </div> |
119 | 152 |
120 <span id="sync-passphrase-warning" i18n-content="passphraseRecover"> | 153 <span id="sync-passphrase-warning" i18n-content="passphraseRecover"> |
121 </span> <a id="clear-data-link" i18n-content="cleardatalink" href="#" | 154 </span> <a id="clear-data-link" i18n-content="cleardatalink" href="#" |
122 onclick='goToDashboard(); return false;'></a> | 155 onclick="goToDashboard(); return false;"></a> |
| 156 |
| 157 <div class="overlay-warning" id="cancel-warning-box"> |
| 158 <div id="cancel-warning-header" i18n-content="cancelWarningHeader"></div> |
| 159 <div id="cancel-warning" i18n-content="cancelWarning"></div> |
| 160 <input id="cancel-no-button" type="submit" i18n-values="value:no" |
| 161 onclick="hideCancelWarning(); return false;" /> |
| 162 <input id="cancel-yes-button" type="submit" i18n-values="value:yes" |
| 163 onclick="chrome.send('PassphraseCancel', ['']);" /> |
| 164 </div> |
123 | 165 |
124 <div class="sync-footer"> | 166 <div class="sync-footer"> |
125 <input id="okButton" type="submit" i18n-values="value:ok" /> | 167 <input id="okButton" type="submit" i18n-values="value:ok" /> |
126 <input id="cancelButton" type="button" i18n-values="value:cancel" | 168 <input id="cancelButton" type="button" i18n-values="value:cancel" |
127 onclick='chrome.send("DialogClose", [""])' /> | 169 onclick="showCancelWarning(); return false;" /> |
128 </div> | 170 </div> |
129 </form> | 171 </form> |
130 </body> | 172 </body> |
131 </html> | 173 </html> |
OLD | NEW |