summaryrefslogtreecommitdiffstats
path: root/browser/extensions/formautofill/content/editAddress.xhtml
blob: e574bdd7c5ca4e11f97d10c1c5144fc4d70bb4de (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
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html [
  <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
  %globalDTD;
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title data-localization="addNewAddressTitle"/>
  <link rel="stylesheet" href="chrome://formautofill/content/skin/editDialog-shared.css"/>
  <link rel="stylesheet" href="chrome://formautofill/content/skin/editAddress.css"/>
  <link rel="stylesheet" href="chrome://formautofill/content/skin/editDialog.css"/>
  <script src="chrome://formautofill/content/l10n.js"></script>
  <script src="chrome://formautofill/content/editDialog.js"></script>
  <script src="chrome://formautofill/content/autofillEditForms.js"></script>
</head>
<body dir="&locale.dir;">
  <form id="form" class="editAddressForm" autocomplete="off">
    <!--
        The <span class="label-text" …/> needs to be after the form field in the same element in
        order to get proper label styling with :focus and :moz-ui-invalid.
      -->
    <div id="name-container" class="container">
      <label id="given-name-container">
        <input id="given-name" type="text" required="required"/>
        <span data-localization="givenName" class="label-text"/>
      </label>
      <label id="additional-name-container">
        <input id="additional-name" type="text"/>
        <span data-localization="additionalName" class="label-text"/>
      </label>
      <label id="family-name-container">
        <input id="family-name" type="text" required="required"/>
        <span data-localization="familyName" class="label-text"/>
      </label>
    </div>
    <label id="organization-container" class="container">
      <input id="organization" type="text"/>
      <span data-localization="organization2" class="label-text"/>
    </label>
    <label id="street-address-container" class="container">
      <textarea id="street-address" rows="3"/>
      <span data-localization="streetAddress" class="label-text"/>
    </label>
    <label id="address-level3-container" class="container">
      <input id="address-level3" type="text"/>
      <span class="label-text"/>
    </label>
    <label id="address-level2-container" class="container">
      <input id="address-level2" type="text"/>
      <span class="label-text"/>
    </label>
    <label id="address-level1-container" class="container">
      <!-- The address-level1 input will get replaced by a select dropdown
           by autofillEditForms.js when the selected country has provided
           specific options. -->
      <input id="address-level1" type="text"/>
      <span class="label-text"/>
    </label>
    <label id="postal-code-container" class="container">
      <input id="postal-code" type="text"/>
      <span class="label-text"/>
    </label>
    <label id="country-container" class="container">
      <select id="country" required="required">
        <option/>
      </select>
      <span data-localization="country" class="label-text"/>
    </label>
    <label id="tel-container" class="container">
      <input id="tel" type="tel" dir="auto"/>
      <span data-localization="tel" class="label-text"/>
    </label>
    <label id="email-container" class="container">
      <input id="email" type="email" required="required"/>
      <span data-localization="email" class="label-text"/>
    </label>
  </form>
  <div id="controls-container">
    <span id="country-warning-message" data-localization="countryWarningMessage2"/>
    <button id="cancel" data-localization="cancelBtnLabel"/>
    <button id="save" class="primary" data-localization="saveBtnLabel"/>
  </div>
  <script><![CDATA[
    "use strict";

    /* import-globals-from l10n.js */

    let {
      DEFAULT_REGION,
      countries,
    } = FormAutofill;
    let {
      getFormFormat,
      findAddressSelectOption,
    } = FormAutofillUtils;
    let args = window.arguments || [];
    let {
      record,
      noValidate,
    } = args[0] || {};

    /* import-globals-from autofillEditForms.js */
    var fieldContainer = new EditAddress({
      form: document.getElementById("form"),
    }, record, {
      DEFAULT_REGION,
      getFormFormat: getFormFormat.bind(FormAutofillUtils),
      findAddressSelectOption: findAddressSelectOption.bind(FormAutofillUtils),
      countries,
      noValidate,
    });

    /* import-globals-from editDialog.js */
    new EditAddressDialog({
      title: document.querySelector("title"),
      fieldContainer,
      controlsContainer: document.getElementById("controls-container"),
      cancel: document.getElementById("cancel"),
      save: document.getElementById("save"),
    }, record);
  ]]></script>
</body>
</html>