Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[816152] Adding PUK management to FTU (r=fbsc,kaze,l10n)

  • Loading branch information...
commit 259613afb225a3a36a89b425be323423578f8c70 1 parent fb2f218
authored December 27, 2012
36  apps/communications/ftu/css/style.css
@@ -199,45 +199,54 @@ html, body {
199 199
 /*
200 200
   Pin code screen
201 201
 */
  202
+#unlock-sim-screen {
  203
+  z-index: 2000;
  204
+}
202 205
 
203  
-#pincode-screen .pin_container {
  206
+#unlock-sim-screen .unlock_container {
204 207
   height: calc(100% - 10rem);
205 208
 }
206 209
 
207  
-#pincode-screen section header {
  210
+#unlock-sim-screen section label {
208 211
   padding: 1.5rem 3rem 0.5rem 3rem;
209 212
   color: black;
210 213
   font-size: 1.5rem;
  214
+  width: auto;
  215
+  height: 2rem;
211 216
 }
212 217
 
213  
-#pincode-screen .input-wrapper {
  218
+#unlock-sim-screen .input-wrapper {
214 219
   padding: 0 1.5rem;
215 220
   position: relative;
216 221
 }
217 222
 
218  
-#pincode-screen #pin-error {
  223
+#unlock-sim-screen .info {
  224
+  font-size: 1.5rem;
  225
+  padding: 1rem 1.5rem;
  226
+}
  227
+
  228
+#unlock-sim-screen .error {
219 229
   padding: 1rem 2rem;
220 230
   font-size: 1.5rem;
221 231
   color: red;
222 232
 }
223 233
 
224  
-#pincode-screen #pin-input.onerror {
225  
-  border-color: red;
  234
+#unlock-sim-screen .onerror {
  235
+  border: 0.1rem solid red;
226 236
 }
227 237
 
228  
-#pincode-screen .input-wrapper input {
  238
+#unlock-sim-screen .input-wrapper input {
229 239
   font-size: 2rem;
230 240
   padding-left: 1.5rem;
231  
-  pointer-events: none;
232 241
 }
233 242
 
234  
-#pincode-screen #fake-sim-pin {
  243
+#unlock-sim-screen .fake-input {
235 244
   margin-top: -4rem;
236 245
   opacity: 0;
237  
-  pointer-events: auto;
  246
+
238 247
 }
239 248
 
240  
-#pincode-screen input[type="number"] {
  249
+#unlock-sim-screen input[type="number"] {
241 250
     -moz-box-sizing: border-box;
242 251
     display: block;
243 252
     overflow: hidden;
@@ -245,6 +254,11 @@ html, body {
245 254
     height: 4rem;
246 255
     resize: none;
247 256
     padding: 0 0.8rem;
  257
+    pointer-events: auto;
  258
+}
  259
+
  260
+#unlock-sim-screen input[type="password"] {
  261
+  pointer-events: none;
248 262
 }
249 263
 
250 264
 /*
51  apps/communications/ftu/index.html
@@ -63,24 +63,49 @@
63 63
   <section id="splash-screen" role="region" class="show">
64 64
   </section>
65 65
 
66  
-  <section id="pincode-screen" role="region" class="skin-organic">
  66
+  <section id="unlock-sim-screen" role="region" class="skin-organic">
67 67
     <header>
68  
-      <h1 data-l10n-id="pincode">Pin code</h1>
  68
+      <h1 id="unlock-sim-header" data-l10n-id="pincode2">Enter PIN code</h1>
69 69
     </header>
70  
-    <section class="pin_container">
71  
-      <header data-l10n-id="type_pin">Type your PIN code:</header>
72  
-      <section class="input-wrapper">
73  
-        <input id="pin-input" name="simpin" type="password" size="8" maxlength="8" />
74  
-        <input id="fake-sim-pin" name="fakesimpin" type="number" size="8" maxlength="8" />
75  
-        <div id="pin-error"></div>
  70
+    <article role="main">
  71
+      <section id="pincode-screen" role="region">
  72
+        <label id="pin-label" data-l10n-id="type_pin">Type your PIN code</label>
  73
+        <section class="input-wrapper">
  74
+          <input id="pin-input" name="simpin" type="password" size="8" maxlength="8" />
  75
+          <input id="fake-pin-input" class="fake-input" name="fake-simpin" type="number" size="8" maxlength="8" />
  76
+          <div id="pin-error" class="hidden error"></div>
  77
+        </section>
76 78
       </section>
77  
-    </section>
  79
+
  80
+      <section id="pukcode-screen" role="region">
  81
+        <label id="puk-label" data-l10n-id="simLocked">The SIM card is locked</label>
  82
+        <section class="input-wrapper">
  83
+          <input id="puk-input" name="simpuk" type="password" size="8" maxlength="8" />
  84
+          <input id="fake-puk-input" class="fake-input" name="fake-simpuk" type="number" size="8" maxlength="8" />
  85
+          <div id="puk-info" class="info" data-l10n-id="pukError">You must enter the Personal Unlocking Key (PUK) Code for the SIM card. Refer to your SIM card documentation or contact your carrier for more information.</div>
  86
+          <div id="puk-error" class="hidden error"></div>
  87
+        </section>
  88
+        <label id="newpin" data-l10n-id="create_newpin">Create new PIN (4 to 8 digits)</label>
  89
+        <section class="input-wrapper">
  90
+          <input id="newpin-input" name="newpin" type="password" size="8" maxlength="8" />
  91
+          <input id="fake-newpin-input" class="fake-input" name="fake-newpin" type="number" size="8" maxlength="8" />
  92
+          <div id="newpin-error" class="hidden error"></div>
  93
+        </section>
  94
+        <label id="confirm-newpin" data-l10n-id="confirm_newpin">Confirm new PIN</label>
  95
+        <section class="input-wrapper">
  96
+          <input id="confirm-newpin-input" name="confirm-newpin" type="password" size="8" maxlength="8" />
  97
+          <input id="fake-confirm-newpin-input" class="fake-input" name="fake-confirm-newpin" type="number" size="8" maxlength="8" />
  98
+          <div id="confirm-newpin-error" class="hidden error"></div>
  99
+        </section>
  100
+      </section>
  101
+    </article>
  102
+
78 103
     <nav role="navigation">
79 104
       <button id="skip-pin-button" class="button-left" data-l10n-id="skip">
80 105
         Skip
81 106
       </button>
82  
-      <button id="unlock-sim-button" class="recommend" data-l10n-id="done">
83  
-        Done
  107
+      <button id="unlock-sim-button" class="recommend" data-l10n-id="send">
  108
+        Send
84 109
       </button>
85 110
     </nav>
86 111
   </section>
@@ -510,7 +535,7 @@ <h1 data-l10n-id='offline-newsletter-dialog-title'>You must be connected to the
510 535
       </menu>
511 536
     </section>
512 537
   </form>
513  
-  
  538
+
514 539
   <form role='dialog' data-type='confirm' id='invalid-email-error-dialog'>
515 540
     <section>
516 541
       <h1 data-l10n-id='invalid-email-dialog-title'>Your email is not valid</h1>
@@ -520,7 +545,7 @@ <h1 data-l10n-id='invalid-email-dialog-title'>Your email is not valid</h1>
520 545
       </menu>
521 546
     </section>
522 547
   </form>
523  
-  
  548
+
524 549
   <section id="loading-overlay" role="region" class="view">
525 550
     <article class="loading-container">
526 551
       <header class="loading-header" id="loading-header">
25  apps/communications/ftu/js/app.js
@@ -3,9 +3,10 @@
3 3
 var _ = navigator.mozL10n.get;
4 4
 
5 5
 var AppManager = {
6  
-  thereIsSIM: false,
  6
+
7 7
   init: function init() {
8 8
     this.isLocalized = true;
  9
+    SimManager.init();
9 10
     WifiManager.init();
10 11
     FacebookIntegration.init();
11 12
     TimeManager.init();
@@ -19,9 +20,10 @@ var AppManager = {
19 20
       setTimeout(function() {
20 21
         // For desktop
21 22
         window.location.hash = '#';
22  
-        UIManager.splashScreen.classList.remove('show');
23 23
         UIManager.activationScreen.classList.add('show');
24 24
         window.location.hash = '#languages';
  25
+
  26
+        UIManager.splashScreen.classList.remove('show');
25 27
       }, kSplashTimeout);
26 28
       return;
27 29
     }
@@ -31,23 +33,8 @@ var AppManager = {
31 33
       // TODO Include VIVO SIM Card management
32 34
       // https://bugzilla.mozilla.org/show_bug.cgi?id=801269#c6
33 35
       var self = this;
34  
-      var req = conn.getCardLock('pin');
35  
-      req.onsuccess = function spl_checkSuccess() {
36  
-        AppManager.thereIsSIM = true;
37  
-        if (req.result.enabled) {
38  
-          UIManager.pincodeScreen.classList.add('show');
39  
-          document.getElementById('fake-sim-pin').focus();
40  
-        } else {
41  
-          // Set the unlocked status so we can still import
42  
-          SimManager.unlocked = true;
43  
-          UIManager.activationScreen.classList.add('show');
44  
-          window.location.hash = '#languages';
45  
-        }
46  
-      };
47  
-      req.onerror = function() {
48  
-        UIManager.activationScreen.classList.add('show');
49  
-        window.location.hash = '#languages';
50  
-      };
  36
+      SimManager.handleCardState();
  37
+
51 38
       // Remove the splash
52 39
       UIManager.splashScreen.classList.remove('show');
53 40
     }, kSplashTimeout);
9  apps/communications/ftu/js/navigation.js
@@ -84,7 +84,7 @@ var Navigation = {
84 84
         self.currentStep--;
85 85
         if (self.currentStep > 0) {
86 86
           var followingStep = steps[self.currentStep];
87  
-          if (followingStep.requireSIM && !SimManager.unlocked) {
  87
+          if (followingStep.requireSIM && !SimManager.available()) {
88 88
             goToStep();
89 89
           } else {
90 90
             self.manageStep();
@@ -115,7 +115,7 @@ var Navigation = {
115 115
         return;
116 116
       }
117 117
       var followingStep = steps[self.currentStep];
118  
-      if (followingStep.requireSIM && !SimManager.unlocked) {
  118
+      if (followingStep.requireSIM && !SimManager.available()) {
119 119
         goToStepForward();
120 120
       } else {
121 121
         self.manageStep();
@@ -192,13 +192,14 @@ var Navigation = {
192 192
         var fbOption = document.getElementById('fb_import');
193 193
         var simOption = document.getElementById('sim-import-button');
194 194
         // If there is an unlocked SIM we activate import from SIM
195  
-        if (AppManager.thereIsSIM && SimManager.unlocked) {
  195
+        if (SimManager.available()) {
196 196
           simOption.classList.remove('disabled');
197 197
         } else {
198 198
           simOption.classList.add('disabled');
199 199
         }
200 200
         // If we have 3G or Wifi activate FB import
201  
-        if (WifiManager.api.connection.status === 'connected' || DataMobile.isDataAvailable) {
  201
+        if (WifiManager.api.connection.status === 'connected' ||
  202
+            DataMobile.isDataAvailable) {
202 203
           fbOption.classList.remove('disabled');
203 204
         } else {
204 205
           fbOption.classList.add('disabled');
183  apps/communications/ftu/js/sim_manager.js
... ...
@@ -1,16 +1,83 @@
1 1
 'use strict';
2 2
 
3 3
 var SimManager = {
4  
-  unlocked: false,
5 4
 
6  
-  showScreen: function sm_showScreen() {
  5
+  init: function sm_init() {
  6
+    this.mobConn = window.navigator.mozMobileConnection;
  7
+    if (!this.mobConn)
  8
+      return;
  9
+
  10
+    this.mobConn.addEventListener('icccardlockerror',
  11
+                                  this.handleUnlockError.bind(this));
  12
+    this.mobConn.addEventListener('cardstatechange',
  13
+                                  this.handleCardState.bind(this));
  14
+  },
  15
+
  16
+  handleUnlockError: function sm_handleUnlockError(data) {
  17
+    switch (data.lockType) {
  18
+      case 'pin':
  19
+        UIManager.pinInput.value = '';
  20
+        UIManager.fakePinInput.value = '';
  21
+        UIManager.pinInput.classList.add('onerror');
  22
+        UIManager.pinError.innerHTML = _('pinErrorMsg');
  23
+        UIManager.pinError.classList.remove('hidden');
  24
+        UIManager.pinLabel.innerHTML = _('pinAttemptMsg2', {n: data.retryCount});
  25
+        if (data.retryCount == 1)
  26
+          UIManager.pinError.innerHTML += _('pinLastChanceMsg');
  27
+        break;
  28
+      case 'puk':
  29
+        UIManager.pukInput.value = '';
  30
+        UIManager.fakePukInput.value = '';
  31
+        UIManager.pukInput.classList.add('onerror');
  32
+        UIManager.pukError.innerHTML = _('pukErrorMsg');
  33
+        UIManager.pukError.classList.remove('hidden');
  34
+        UIManager.pukInfo.classList.add('hidden');
  35
+        UIManager.pukLabel.innerHTML = _('pukAttemptMsg', {n: data.retryCount});
  36
+        // TODO what if counter gets to 0 ??
  37
+        break;
  38
+    }
  39
+  },
  40
+
  41
+  available: function sm_available() {
  42
+    if (!this.mobConn)
  43
+      return false;
  44
+    return (this.mobConn.cardState == 'ready');
  45
+  },
  46
+
  47
+  handleCardState: function sm_handleCardState() {
  48
+    switch (this.mobConn.cardState) {
  49
+      case 'pinRequired':
  50
+        this.showPinScreen();
  51
+        break;
  52
+      case 'pukRequired':
  53
+        this.showPukScreen();
  54
+        break;
  55
+      default:
  56
+        this.skip();
  57
+        break;
  58
+    }
  59
+  },
  60
+
  61
+  showPinScreen: function sm_showScreen() {
  62
+    UIManager.activationScreen.classList.remove('show');
  63
+    UIManager.unlockSimScreen.classList.add('show');
7 64
     UIManager.pincodeScreen.classList.add('show');
  65
+    UIManager.fakePinInput.focus();
  66
+  },
  67
+
  68
+  showPukScreen: function sm_showPukScreen() {
  69
+    UIManager.unlockSimScreen.classList.add('show');
8 70
     UIManager.activationScreen.classList.remove('show');
9  
-    UIManager.fakeSimPin.focus();
  71
+    UIManager.pincodeScreen.classList.remove('show');
  72
+    UIManager.pukcodeScreen.classList.add('show');
  73
+    UIManager.unlockSimHeader.innerHTML = _('pukcode');
  74
+    UIManager.fakePukInput.focus();
10 75
   },
11 76
 
12 77
   hideScreen: function sm_hideScreen() {
  78
+    UIManager.unlockSimScreen.classList.remove('show');
13 79
     UIManager.pincodeScreen.classList.remove('show');
  80
+    UIManager.pukcodeScreen.classList.remove('show');
14 81
     UIManager.activationScreen.classList.add('show');
15 82
     window.location.hash = '#languages';
16 83
     Navigation.currentStep = 1;
@@ -21,6 +88,87 @@ var SimManager = {
21 88
     this.hideScreen();
22 89
   },
23 90
 
  91
+  unlock: function sm_unlock() {
  92
+    switch (this.mobConn.cardState) {
  93
+      case 'pinRequired':
  94
+        this.unlockPin();
  95
+        break;
  96
+      case 'pukRequired':
  97
+        this.unlockPuk();
  98
+        break;
  99
+    }
  100
+  },
  101
+
  102
+  unlockPin: function sm_unlockPin() {
  103
+    var pin = UIManager.pinInput.value;
  104
+    if (pin.length < 4 || pin.length > 8) {
  105
+      UIManager.pinError.innerHTML = _('pinValidation');
  106
+      UIManager.pinInput.classList.add('onerror');
  107
+      UIManager.pinError.classList.remove('hidden');
  108
+      return;
  109
+    } else {
  110
+      UIManager.pinInput.classList.remove('onerror');
  111
+      UIManager.pinError.classList.add('hidden');
  112
+    }
  113
+
  114
+    // Unlock SIM
  115
+    var options = {lockType: 'pin', pin: pin };
  116
+    var req = this.mobConn.unlockCardLock(options);
  117
+    req.onsuccess = function sm_unlockSuccess() {
  118
+      this.hideScreen();
  119
+    }.bind(this);
  120
+  },
  121
+
  122
+  clearFields: function sm_clearFields() {
  123
+    UIManager.pukInput.classList.remove('onerror');
  124
+    UIManager.pukError.innerHTML = '';
  125
+    UIManager.pukError.classList.add('hidden');
  126
+
  127
+    UIManager.newpinInput.classList.remove('onerror');
  128
+    UIManager.newpinError.innerHTML = '';
  129
+    UIManager.newpinError.classList.add('hidden');
  130
+
  131
+    UIManager.confirmNewpinInput.classList.remove('onerror');
  132
+    UIManager.confirmNewpinError.innerHTML = '';
  133
+    UIManager.confirmNewpinError.classList.add('hidden');
  134
+  },
  135
+  unlockPuk: function sm_unlockPuk() {
  136
+    this.clearFields();
  137
+    var pukCode = UIManager.pukInput.value;
  138
+    if (pukCode.length !== 8) {
  139
+      UIManager.pukError.innerHTML = _('pukValidation');
  140
+      UIManager.pukError.classList.remove('hidden');
  141
+      UIManager.pukInfo.classList.add('hidden');
  142
+      UIManager.pukInput.classList.add('onerror');
  143
+      UIManager.pukError.focus();
  144
+      return;
  145
+    }
  146
+    var newpinCode = UIManager.newpinInput.value;
  147
+    var confirmNewpin = UIManager.confirmNewpinInput.value;
  148
+    if (newpinCode.length < 4 || newpinCode.length > 8) {
  149
+      UIManager.newpinError.innerHTML = _('pinValidation');
  150
+      UIManager.newpinError.classList.remove('hidden');
  151
+      UIManager.newpinInput.classList.add('onerror');
  152
+      UIManager.newpinError.focus();
  153
+      return;
  154
+    }
  155
+    if (newpinCode != confirmNewpin) {
  156
+      UIManager.confirmNewpinError.innerHTML = _('newpinConfirmation');
  157
+      UIManager.confirmNewpinError.classList.remove('hidden');
  158
+      UIManager.newpinInput.classList.add('onerror');
  159
+      UIManager.confirmNewpinInput.classList.add('onerror');
  160
+      UIManager.confirmNewpinError.focus();
  161
+      return;
  162
+    }
  163
+
  164
+    // Unlock SIM with PUK and new PIN
  165
+    var options = {lockType: 'puk', puk: pukCode, newPin: newpinCode };
  166
+    var req = this.mobConn.unlockCardLock(options);
  167
+    req.onsuccess = function sm_unlockSuccess() {
  168
+      this.hideScreen();
  169
+    }.bind(this);
  170
+  },
  171
+
24 172
   importContacts: function sm_importContacts() {
25 173
     var feedback = UIManager.simImportFeedback;
26 174
     feedback.innerHTML = _('simContacts-importing');
@@ -43,35 +191,6 @@ var SimManager = {
43 191
         UIManager.loadingOverlay.classList.remove('show-overlay');
44 192
         importButton.classList.remove('disabled');
45 193
     }.bind(this));
46  
-  },
47  
-
48  
-  unlock: function sm_unlock() {
49  
-    var pin = UIManager.pinInput.value;
50  
-    if (pin.length < 4 || pin.length > 8) {
51  
-      UIManager.pinError.innerHTML = _('pinValidation');
52  
-      return;
53  
-    }
54  
-
55  
-    // Unlock SIM
56  
-    var options = {lockType: 'pin', pin: pin };
57  
-    var conn = window.navigator.mozMobileConnection;
58  
-
59  
-    conn.addEventListener('icccardlockerror', function(data) {
60  
-      UIManager.pinInput.value = '';
61  
-      UIManager.fakeSimPin.value = '';
62  
-      UIManager.pinInput.classList.add('onerror');
63  
-      UIManager.pinError.innerHTML = _('pinErrorMsg') + ' ' +
64  
-        _('pinAttemptMsg', {n: data.retryCount});
65  
-    });
66  
-
67  
-    var req = conn.unlockCardLock(options);
68  
-
69  
-    req.onsuccess = function sm_unlockSuccess() {
70  
-      this.unlocked = true;
71  
-      UIManager.pincodeScreen.classList.remove('show');
72  
-      UIManager.activationScreen.classList.add('show');
73  
-      window.location.hash = '#languages';
74  
-    }.bind(this);
75 194
   }
76 195
 };
77 196
 
57  apps/communications/ftu/js/ui.js
@@ -15,15 +15,33 @@ var UIManager = {
15 15
     'main-title',
16 16
     'loading-overlay',
17 17
     'loading-header',
  18
+    // Unlock SIM Screen
  19
+    'unlock-sim-screen',
  20
+    'unlock-sim-header',
18 21
     // PIN Screen
19 22
     'pincode-screen',
  23
+    'pin-label',
20 24
     'pin-input',
21  
-    'fake-sim-pin',
  25
+    'fake-pin-input',
22 26
     'pin-error',
23  
-    'sim-import-button',
24  
-    'sim-import-feedback',
25 27
     'skip-pin-button',
26 28
     'unlock-sim-button',
  29
+    // PUK Screen
  30
+    'pukcode-screen',
  31
+    'puk-label',
  32
+    'puk-input',
  33
+    'puk-info',
  34
+    'fake-puk-input',
  35
+    'puk-error',
  36
+    'newpin-input',
  37
+    'fake-newpin-input',
  38
+    'newpin-error',
  39
+    'confirm-newpin-input',
  40
+    'fake-confirm-newpin-input',
  41
+    'confirm-newpin-error',
  42
+    // Import contacts
  43
+    'sim-import-button',
  44
+    'sim-import-feedback',
27 45
     // Wifi
28 46
     'networks',
29 47
     'wifi-refresh-button',
@@ -54,7 +72,6 @@ var UIManager = {
54 72
   ],
55 73
 
56 74
   init: function ui_init() {
57  
-
58 75
     // Initialization of the DOM selectors
59 76
     this.domSelectors.forEach(function createElementRef(name) {
60 77
       this[toCamelCase(name)] = document.getElementById(name);
@@ -67,7 +84,13 @@ var UIManager = {
67 84
     this.dateConfigurationLabel.innerHTML = currentDate.
68 85
       toLocaleFormat('%Y-%m-%d');
69 86
     // Add events to DOM
70  
-    this.fakeSimPin.addEventListener('input', this);
  87
+    this.fakePinInput.addEventListener('keypress', this.fakeInputValues.bind(this));
  88
+    this.fakePukInput.addEventListener('keypress', this.fakeInputValues.bind(this));
  89
+    this.fakeNewpinInput.addEventListener('keypress',
  90
+                                          this.fakeInputValues.bind(this));
  91
+    this.fakeConfirmNewpinInput.addEventListener('keypress',
  92
+                                                 this.fakeInputValues.bind(this));
  93
+
71 94
     this.simImportButton.addEventListener('click', this);
72 95
     this.skipPinButton.addEventListener('click', this);
73 96
     this.unlockSimButton.addEventListener('click', this);
@@ -81,6 +104,7 @@ var UIManager = {
81 104
     this.timeConfiguration.addEventListener('input', this);
82 105
     this.dateConfiguration.addEventListener('input', this);
83 106
     this.initTZ();
  107
+
84 108
     // Prevent form submit in case something tries to send it
85 109
     this.timeForm.addEventListener('submit', function(event) {
86 110
       event.preventDefault();
@@ -150,7 +174,7 @@ var UIManager = {
150 174
     this.sharePerformance.addEventListener('click', this);
151 175
     var button = this.offlineErrorDialog.querySelector('button');
152 176
     button.addEventListener('click',
153  
-        this.onOfflineDialogButtonClick.bind(this));
  177
+                            this.onOfflineDialogButtonClick.bind(this));
154 178
   },
155 179
 
156 180
   initTZ: function ui_initTZ() {
@@ -160,6 +184,23 @@ var UIManager = {
160 184
     tzSelect(tzRegion, tzCity, this.setTimeZone);
161 185
   },
162 186
 
  187
+  fakeInputValues: function ui_fakeInputValues(event) {
  188
+    var fakeInput = event.target;
  189
+    var code = event.charCode;
  190
+    if (code === 0 || (code >= 0x30 && code <= 0x39)) {
  191
+      var displayInput =
  192
+              document.getElementById(fakeInput.id.substr(5, fakeInput.length));
  193
+      var content = displayInput.value;
  194
+      if (code === 0) { // backspace
  195
+        content = content.substr(0, content.length - 1);
  196
+      } else {
  197
+        content += String.fromCharCode(code);
  198
+      }
  199
+      displayInput.value = content;
  200
+    }
  201
+    fakeInput.value = '';
  202
+  },
  203
+
163 204
   handleEvent: function ui_handleEvent(event) {
164 205
     switch (event.target.id) {
165 206
       // SIM
@@ -169,10 +210,6 @@ var UIManager = {
169 210
       case 'unlock-sim-button':
170 211
         SimManager.unlock();
171 212
         break;
172  
-      // workaround for a number-passsword input
173  
-      case 'fake-sim-pin':
174  
-        this.pinInput.value = this.fakeSimPin.value;
175  
-        break;
176 213
       case 'sim-import-button':
177 214
         SimManager.importContacts();
178 215
         break;
38  apps/communications/ftu/locales/ftu.en-US.properties
... ...
@@ -1,19 +1,35 @@
1 1
 #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
2  
-# PIN Code
  2
+# Unlock Codes
3 3
 #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
4 4
 
5  
-pincode=PIN code
6  
-type_pin=Type your pin code
7  
-done=Done
  5
+pincode2=Enter PIN code
  6
+type_pin=Type your PIN code
  7
+skip=Skip
  8
+send=Send
8 9
 pinValidation=PIN must have between 4 and 8 characters.
9 10
 pinErrorMsg=The PIN was incorrect.
10  
-pinAttemptMsg={[ plural(n) ]}
11  
-pinAttemptMsg[zero]=No tries left
12  
-pinAttemptMsg[one]=One last try
13  
-pinAttemptMsg[two]={{n}} tries left
14  
-pinAttemptMsg[few]={{n}} tries left
15  
-pinAttemptMsg[many]={{n}} tries left
16  
-pinAttemptMsg[other]={{n}} tries left
  11
+pinAttemptMsg2        ={[ plural(n) ]}
  12
+pinAttemptMsg2[one]   =Last chance.
  13
+pinAttemptMsg2[two]   ={{n}} tries left.
  14
+pinAttemptMsg2[few]   ={{n}} tries left.
  15
+pinAttemptMsg2[many]  ={{n}} tries left.
  16
+pinAttemptMsg2[other] ={{n}} tries left.
  17
+pinLastChanceMsg=This is your last chance to enter the correct PIN. Otherwise, you must enter the PUK code to use this SIM card.
  18
+pukcode=Enter PUK code
  19
+type_puk=PUK code
  20
+create_newpin=Create new PIN (4 to 8 digits)
  21
+confirm_newpin=Confirm new PIN
  22
+simLocked=The SIM card is locked
  23
+pukError=You must enter the Personal Unlocking Key (PUK) Code for the SIM card. Refer to your SIM card documentation or contact your carrier for more information.
  24
+pukErrorMsg=The PUK was incorrect
  25
+pukAttemptMsg        ={[ plural(n) ]}
  26
+pukAttemptMsg[one]   =Last chance.
  27
+pukAttemptMsg[two]   ={{n}} tries left.
  28
+pukAttemptMsg[few]   ={{n}} tries left.
  29
+pukAttemptMsg[many]  ={{n}} tries left.
  30
+pukAttemptMsg[other] ={{n}} tries left.
  31
+pukValidation=PUK code must have exactly 8 characters.
  32
+newpinConfirmation=PINs don’t match
17 33
 
18 34
 #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
19 35
 # Language
4  apps/settings/js/simcard_dialog.js
@@ -131,9 +131,9 @@ var SimPinDialog = {
131 131
 
132 132
     if (retry !== 1) {
133 133
       var l10nArgs = { n: retry };
134  
-      this.errorMsgBody.dataset.l10nId = type + 'AttemptMsg';
  134
+      this.errorMsgBody.dataset.l10nId = type + 'AttemptMsg2';
135 135
       this.errorMsgBody.dataset.l10nArgs = JSON.stringify(l10nArgs);
136  
-      this.errorMsgBody.textContent = _(type + 'AttemptMsg', l10nArgs);
  136
+      this.errorMsgBody.textContent = _(type + 'AttemptMsg2', l10nArgs);
137 137
     } else {
138 138
       this.errorMsgBody.dataset.l10nId = type + 'LastChanceMsg';
139 139
       this.errorMsgBody.textContent = _(type + 'LastChanceMsg');
16  apps/settings/locales/settings.en-US.properties
@@ -353,17 +353,17 @@ pinTitle=Enter SIM PIN
353 353
 pukTitle=Enter PUK code
354 354
 newpinTitle=New PIN
355 355
 pinErrorMsg=The PIN was incorrect.
356  
-pinAttemptMsg={[ plural(n) ]}
357  
-pinAttemptMsg[one]   = one last try.
358  
-pinAttemptMsg[two]   = {{n}} tries left.
359  
-pinAttemptMsg[few]   = {{n}} tries left.
360  
-pinAttemptMsg[many]  = {{n}} tries left.
361  
-pinAttemptMsg[other] = {{n}} tries left.
  356
+pinAttemptMsg2={[ plural(n) ]}
  357
+pinAttemptMsg2[one]   = Last chance.
  358
+pinAttemptMsg2[two]   = {{n}} tries left.
  359
+pinAttemptMsg2[few]   = {{n}} tries left.
  360
+pinAttemptMsg2[many]  = {{n}} tries left.
  361
+pinAttemptMsg2[other] = {{n}} tries left.
362 362
 pinLastChanceMsg=This is your last chance to enter the correct PIN. Otherwise, you must enter the PUK code to use this SIM card.
363 363
 simCardLockedMsg=The SIM card is locked.
364 364
 enterPukMsg=You must enter the Personal Unlocking Key (PUK) code for the SIM card. Refer to your SIM card documentation or contact your carrier for more information.
365 365
 pukErrorMsg=The PUK code is incorrect.
366  
-pukAttemptMsg=You have {{n}} tries left to enter the correct code before this SIM card will be permanently unusable. Refer to your SIM card documentation or contact your carrier for more information.
  366
+pukAttemptMsg2=You have {{n}} tries left to enter the correct code before this SIM card will be permanently unusable. Refer to your SIM card documentation or contact your carrier for more information.
367 367
 pukLastChanceMsg=Last chance to enter the correct PUK code. Your SIM card will be permanently unusable if you enter in the wrong PUK code. Refer to your SIM card documentation or contact your carrier for more information.
368 368
 newSimPinMsg=Create PIN (must contain 4 to 8 digits)
369 369
 confirmNewSimPinMsg=Confirm new PIN
@@ -516,7 +516,7 @@ crash-reports-description-1=A crash report contains some details about the crash
516 516
 crash-reports-description-2=This may include things like open pages and apps, text typed into forms and the content of open messages, recent browsing history, or geolocation used by an open app.
517 517
 # LOCALIZATION NOTE (crash-reports-description-3-*): these strings are a paragraph, with a "privacy policy"
518 518
 # link in the middle. Include trailing spaces as needed.
519  
-crash-reports-description-3-start=We use crash reports to try to fix problems and improve our products. We handle your information as we describe in our 
  519
+crash-reports-description-3-start=We use crash reports to try to fix problems and improve our products. We handle your information as we describe in our
520 520
 crash-reports-description-3-privacy=privacy policy
521 521
 crash-reports-description-3-end=.
522 522
 

0 notes on commit 259613a

Please sign in to comment.
Something went wrong with that request. Please try again.