Source: js/system_simcard_dialog.js

  1. /* global SimPinDialog */
  2. 'use strict';
  3. (function(exports) {
  4. /**
  5. * @class SimPinSystemDialog
  6. * @param {options} object for attributes `onShow`, `onHide` callback.
  7. * @extends SystemDialog
  8. */
  9. var SimPinSystemDialog = function SimPinSystemDialog(options) {
  10. if (options) {
  11. this.options = options;
  12. }
  13. /**
  14. * render the dialog
  15. */
  16. this.render();
  17. this.publish('created');
  18. };
  19. SimPinSystemDialog.prototype = Object.create(window.SystemDialog.prototype);
  20. SimPinSystemDialog.prototype.customID = 'simpin-dialog';
  21. SimPinSystemDialog.prototype.DEBUG = false;
  22. SimPinSystemDialog.prototype.focus = function() {
  23. // We will combine SimPinDialog and SimPinSystemDialog in
  24. // mobile connection subsystem
  25. SimPinDialog.focus();
  26. };
  27. SimPinSystemDialog.prototype.requestFocus = function() {
  28. this.publish('requestfocus');
  29. };
  30. SimPinSystemDialog.prototype.view = function spd_view() {
  31. return `<div id="${this.instanceID}" role="dialog"
  32. class="generic-dialog" data-z-index-level="system-dialog" hidden>
  33. <section role="region">
  34. <gaia-header>
  35. <h1></h1>
  36. </gaia-header>
  37. <div class="container">
  38. <div id="errorMsg" class="error" hidden>
  39. <div id="messageHeader"></div>
  40. <span id="messageBody"></span>
  41. </div>
  42. <!-- tries left -->
  43. <div id="triesLeft" data-l10n-id="inputCodeRetriesLeft" hidden>
  44. </div>
  45. <!-- sim pin input field -->
  46. <div id="pinArea" hidden>
  47. <div data-l10n-id="simPin"></div>
  48. <div class="input-wrapper">
  49. <input name="simpin" type="password" x-inputmode="digit"
  50. size="8" maxlength="8" />
  51. </div>
  52. </div>
  53. <!-- sim puk input field -->
  54. <div id="pukArea" hidden>
  55. <div data-l10n-id="pukCode"></div>
  56. <div class="input-wrapper">
  57. <input name="simpuk" type="password" x-inputmode="digit"
  58. size="8" maxlength="8" />
  59. </div>
  60. </div>
  61. <!-- sim nck/cck/spck input field -->
  62. <div id="xckArea" hidden>
  63. <div name="xckDesc" data-l10n-id="nckCode"></div>
  64. <div class="input-wrapper">
  65. <input name="xckpin" type="number" size="16"
  66. maxlength="16" />
  67. </div>
  68. </div>
  69. <!-- new sim pin input field -->
  70. <div id="newPinArea" hidden>
  71. <div data-l10n-id="newSimPinMsg"></div>
  72. <div class="input-wrapper">
  73. <input name="newSimpin" type="password"
  74. x-inputmode="digit" size="8" maxlength="8" />
  75. </div>
  76. </div>
  77. <!-- confirm new sim pin input field -->
  78. <div id="confirmPinArea" hidden>
  79. <div data-l10n-id="confirmNewSimPinMsg"></div>
  80. <div class="input-wrapper">
  81. <input name="confirmNewSimpin" type="password"
  82. x-inputmode="digit" size="8" maxlength="8" />
  83. </div>
  84. </div>
  85. </div>
  86. </section>
  87. <menu data-items="2">
  88. <button type="reset" data-l10n-id="skip"></button>
  89. <button data-l10n-id="ok" type="submit"></button>
  90. </menu>
  91. </div>`;
  92. };
  93. // Get all elements when inited.
  94. SimPinSystemDialog.prototype._fetchElements =
  95. function spd__fetchElements() {
  96. };
  97. // Register events when all elements are got.
  98. SimPinSystemDialog.prototype._registerEvents =
  99. function spd__registerEvents() {
  100. };
  101. exports.SimPinSystemDialog = SimPinSystemDialog;
  102. }(window));