File: add_password_dialog.html

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (124 lines) | stat: -rw-r--r-- 4,241 bytes parent folder | download | duplicates (10)
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
<style include="shared-style cr-shared-style md-select">
  cr-input:not(:first-of-type) {
    margin-top: var(--cr-form-field-bottom-spacing);
  }

  cr-icon-button {
    --cr-icon-button-icon-size: 16px;
    --cr-icon-button-size: 32px;
    --cr-icon-button-margin-start: 0;
    --cr-icon-button-margin-end: 0;
  }

  cr-input {
    --cr-input-error-display: none;
  }

  cr-textarea {
    --settings-textarea-footer-display: flex;
  }

  .md-select {
    --md-select-width: 100%;
    margin-bottom: var(--cr-form-field-bottom-spacing);
    margin-top: 2px; /* Needed to avoid outline cropping */
  }

  #websiteInput[show-error-message] {
    --cr-input-error-display: block;
  }

  #usernameInput[invalid] {
    --cr-input-error-display: block;
  }

  #viewExistingPasswordLink {
    color: var(--cr-link-color);
    display: block;
    font-size: var(--cr-form-field-label-font-size);
    line-height: 1;
    width: fit-content;
  }

  #footnote {
    margin-inline-start: 2px;
    margin-top: 16px;
  }

  .divider {
    border-top: var(--cr-separator-line);
    margin: var(--cr-form-field-bottom-spacing) 0;
  }

  cr-textarea {
    --cr-textarea-footer-display: flex;
    /* The approximation is based on the other elements in the dialog. This
        value should be updated if new rows are added to the dialog. */
    --cr-textarea-autogrow-max-height: 20lh;
  }
</style>
<cr-dialog id="dialog" show-on-attach>
  <div slot="title" id="title" class="dialog-title">
    $i18n{addPasswordTitle}
  </div>
  <div slot="body">
    <select class="md-select" id="storePicker"
        aria-description="$i18n{addPasswordStorePickerA11yDescription}"
        hidden="[[!isAccountStoreUser]]">
      <option value="[[storeOptionAccountValue_]]">
        $i18n{addPasswordStoreOptionAccount}
      </option>
      <option value="[[storeOptionDeviceValue_]]">
        $i18n{addPasswordStoreOptionDevice}
      </option>
    </select>
    <cr-input id="websiteInput" label="$i18n{websiteLabel}" autofocus required
        placeholder="example.com"  value="{{website_}}"
        invalid="[[isWebsiteInputInvalid_(websiteErrorMessage_)]]"
        show-error-message$="[[showWebsiteError_(websiteErrorMessage_)]]"
        error-message="[[websiteErrorMessage_]]" spellcheck="false"
        on-input="validateWebsite_" on-blur="onWebsiteInputBlur_">
    </cr-input>
    <cr-input id="usernameInput" label="$i18n{usernameLabel}"
        value="{{username_}}" spellcheck="false"
        invalid="[[doesUsernameExistAlready_(usernameErrorMessage_)]]"
        error-message="[[usernameErrorMessage_]]">
    </cr-input>
    <a id="viewExistingPasswordLink" is="action-link" href="/"
        on-click="onViewExistingPasswordClick_"
        aria-description="[[getViewExistingPasswordAriaDescription_(
          urlCollection_, username_)]]"
        hidden="[[!doesUsernameExistAlready_(usernameErrorMessage_)]]">
      $i18n{viewExistingPassword}
    </a>
    <cr-input id="passwordInput" label="$i18n{passwordLabel}"
        type="[[getPasswordInputType(isPasswordVisible)]]"
        value="{{password_}}" invalid="[[isPasswordInvalid_]]"
        on-blur="onPasswordInput_" on-input="onPasswordInput_" required
        class="password-input" spellcheck="false">
      <cr-icon-button id="showPasswordButton" slot="inline-suffix"
          class$="[[getShowHideButtonIconClass(isPasswordVisible)]]"
          title="[[getShowHideButtonLabel(isPasswordVisible)]]"
          on-click="onShowHidePasswordButtonClick">
      </cr-icon-button>
    </cr-input>
    <div id="footnote">
      $i18n{addPasswordFooter}
    </div>
    <div class="divider"></div>
    <cr-textarea label="$i18n{noteLabel}" id="noteInput" value="{{note_}}"
        invalid="[[isNoteInputInvalid_(note_)]]" has-max-height autogrow
        first-footer="[[getFirstNoteFooter_(note_)]]"
        second-footer="[[getSecondNoteFooter_(note_)]]">
    </cr-textarea>
  </div>
  <div slot="button-container">
    <cr-button id="cancel" class="cancel-button" on-click="closeDialog_">
      $i18n{cancel}
    </cr-button>
    <cr-button id="addButton" class="action-button"
        disabled="[[!canAddPassword_]]" on-click="onAddClick_">
      $i18n{save}
    </cr-button>
  </div>
</cr-dialog>