blob: e92df6672ba323c20682d0446466cb88a610a7e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
<html i18n-values="dir:textdirection;">
<head>
<title></title>
<style type="text/css">
body {
line-height: 1.4em;
background: #FFFFFF;
font-size: 11pt;
}
html[os='mac'] body {
line-height: 1.5em;
background: #FFFFFF;
}
form {
-webkit-user-select: none;
}
.sync-header {
font-size: 1.2em;
font-weight: bold;
margin-bottom: 10px;
}
.sync-instructions-start-hidden {
margin-top: 10px;
display: none;
}
.sync-footer {
position: fixed;
right: 0px;
bottom: 0px;
margin-right: 10px;
margin-bottom: 10px;
}
html[dir='rtl'] .sync-footer {
text-align: left;
left: 0px;
bottom: 0px;
margin-left: 20px;
}
input[type='button'],
input[type='submit'] {
min-width: 87px;
min-height: 26px;
}
html[os='mac'] input[type='button'],
html[os='mac'] input[type='submit'] {
font-size: 12pt;
}
#passphrase-input {
margin-top: 20px;
margin-bottom: 20px;
}
#incorrectPassphrase {
margin-top: 5px;
}
.error {
color: red;
}
.overlay-warning {
position: absolute;
display: none;
left: 25px;
right: 25px;
top: 100px;
background: white;
border: 2px solid #888;
border-radius: 8px;
padding: 15px;
box-shadow: 0.2em 0.2em 0.5em #888;
}
#cancel-warning-header {
font-weight: bold;
margin-bottom: 8px;
}
.overlay-warning INPUT {
margin-top: 12px;
float: right;
margin-left: 5px;
}
</style>
<script src="chrome://resources/js/cr.js"></script>
<script>
// Called once, when this html/js is loaded.
function setupPassphraseDialog(args) {
// Allow platform specific rules
if (cr.isMac) {
document.documentElement.setAttribute('os', 'mac');
} else if (!cr.isWindows) {
document.documentElement.setAttribute('os', 'linux');
}
document.getElementById("passphraseRejectedBody").style.display = "none";
document.getElementById("normalBody").style.display = "none";
document.getElementById("incorrectPassphrase").style.display = "none";
if (args["passphrase_creation_rejected"]) {
document.getElementById("passphraseRejectedBody").style.display = "block";
} else {
document.getElementById("normalBody").style.display = "block";
}
if (args["passphrase_setting_rejected"]) {
document.getElementById("incorrectPassphrase").style.display = "block";
}
}
function sendPassphraseAndClose() {
var f = document.getElementById("passphraseForm");
var result = JSON.stringify({"passphrase": f.passphrase.value});
chrome.send("Passphrase", [result]);
}
function showCancelWarning() {
document.getElementById("cancel-warning-box").style.display = "block";
document.getElementById("okButton").disabled = true;
document.getElementById("cancelButton").disabled = true;
}
function hideCancelWarning() {
document.getElementById("cancel-warning-box").style.display = "none";
document.getElementById("okButton").disabled = false;
document.getElementById("cancelButton").disabled = false;
}
function goToDashboard() {
chrome.send("GoToDashboard", [""]);
chrome.send("DialogClose", [""]);
}
</script>
</head>
<body i18n-values=".style.fontFamily:fontfamily"
onload="setupPassphraseDialog(JSON.parse(chrome.dialogArguments));">
<form id="passphraseForm"
onSubmit="sendPassphraseAndClose(); return false;">
<div id="enter-passphrase">
<div class="sync-header" id="enterTitle"
i18n-content="enterPassphraseTitle"></div>
<div class="sync-instructions-start-hidden" id="normalBody"
i18n-content="enterPassphraseBody"></div>
<div class="sync-instructions-start-hidden" id="passphraseRejectedBody"
i18n-content="enterOtherPassphraseBody"></div>
</div>
<div id="passphrase-input">
<label id="passphraseLabel" name="passphraseLabel"
for="passphrase" i18n-content="passphraseLabel">
</label>
<input id="passphrase" name="passphrase" type="password" />
<div class="error" id="incorrectPassphrase"
i18n-content="incorrectPassphrase">
</div>
</div>
<span id="sync-passphrase-warning" i18n-content="passphraseRecover">
</span> <a id="clear-data-link" i18n-content="cleardatalink" href="#"
onclick="goToDashboard(); return false;"></a>
<div class="overlay-warning" id="cancel-warning-box">
<div id="cancel-warning-header" i18n-content="cancelWarningHeader"></div>
<div id="cancel-warning" i18n-content="cancelWarning"></div>
<input id="cancel-no-button" type="submit" i18n-values="value:no"
onclick="hideCancelWarning(); return false;" />
<input id="cancel-yes-button" type="submit" i18n-values="value:yes"
onclick="chrome.send('PassphraseCancel', ['']);" />
</div>
<div class="sync-footer">
<input id="okButton" type="submit" i18n-values="value:ok" />
<input id="cancelButton" type="button" i18n-values="value:cancel"
onclick="showCancelWarning(); return false;" />
</div>
</form>
</body>
</html>
|