Commit a911756a authored by Jared Wein's avatar Jared Wein
Browse files

Bug 1549809 - Stub out LoginFilter custom element. r=MattN,Pike

Differential Revision: https://phabricator.services.mozilla.com/D30753

--HG--
extra : moz-landing-system : lando
parent 20b03783
......@@ -12,6 +12,9 @@
about-logins-page-title = Login Manager
login-filter =
.placeholder = Search Logins
login-list =
.login-list-header = Logins
......
......@@ -9,6 +9,7 @@
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; object-src 'none'; script-src resource: chrome:; connect-src https:; img-src https: data: blob:; style-src 'unsafe-inline';"/>
<title data-l10n-id="about-logins-page-title"></title>
<link rel="localization" href="browser/aboutLogins.ftl">
<script defer="defer" src="chrome://browser/content/aboutlogins/components/login-filter.js"></script>
<script defer="defer" src="chrome://browser/content/aboutlogins/components/login-item.js"></script>
<script defer="defer" src="chrome://browser/content/aboutlogins/components/login-list.js"></script>
<script defer="defer" src="chrome://browser/content/aboutlogins/components/login-list-item.js"></script>
......@@ -16,6 +17,8 @@
<link rel="stylesheet" type="text/css" href="chrome://global/skin/in-content/common.css">
</head>
<body>
<login-filter data-l10n-id="login-filter"
data-l10n-attrs="placeholder"></login-filter>
<login-list data-l10n-id="login-list"
data-l10n-attrs="login-list-header"></login-list>
<login-item data-l10n-id="login-item"
......@@ -65,5 +68,10 @@
<button class="save-changes-button"></button>
<button class="cancel-button"></button>
</template>
<template id="login-filter-template">
<link rel="stylesheet" href="chrome://browser/content/aboutlogins/components/login-filter.css">
<input type="text"/>
</template>
</body>
</html>
/* 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/. */
/* 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/. */
class LoginFilter extends HTMLElement {
connectedCallback() {
if (this.children.length) {
return;
}
let loginFilterTemplate = document.querySelector("#login-filter-template");
this.attachShadow({mode: "open"})
.appendChild(loginFilterTemplate.content.cloneNode(true));
}
static get observedAttributes() {
return ["placeholder"];
}
/* Fluent doesn't handle localizing into Shadow DOM yet so strings
need to get reflected in to their targeted element. */
attributeChangedCallback(attr, oldValue, newValue) {
if (!this.shadowRoot) {
return;
}
switch (attr) {
case "placeholder":
this.shadowRoot.querySelector("input").placeholder = newValue;
break;
}
}
}
customElements.define("login-filter", LoginFilter);
......@@ -3,6 +3,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar:
content/browser/aboutlogins/components/login-filter.css (content/components/login-filter.css)
content/browser/aboutlogins/components/login-filter.js (content/components/login-filter.js)
content/browser/aboutlogins/components/login-item.css (content/components/login-item.css)
content/browser/aboutlogins/components/login-item.js (content/components/login-item.js)
content/browser/aboutlogins/components/login-list.css (content/components/login-list.css)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment