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