Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Unified Diff: sky/examples/radio.sky

Issue 951673003: Remove outdated examples and framework pieces (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/examples/file-browser.sky ('k') | sky/framework/inspector/console-agent.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/radio.sky
diff --git a/sky/examples/radio.sky b/sky/examples/radio.sky
deleted file mode 100644
index 33a45d54f25416ffbcd46aca7431f4baaee34480..0000000000000000000000000000000000000000
--- a/sky/examples/radio.sky
+++ /dev/null
@@ -1,86 +0,0 @@
-SKY MODULE - radio button and radio button group
-<!-- accessibility handling not implemented yet, pending mojo service -->
-
-<!-- <radio> -->
-<template id="radio-shadow">
- <style>
- :host { width: 1em; height: 1em; border: solid; background: white; }
- :host[checked] { background: black; }
- </style>
-</template>
-<script>
- module.exports.RadioElement = module.registerElement(
- class extends Element {
- static get tagName() { return 'radio'; }
- static get shadow() { return true; }
- constructor (hostModule) {
- super(hostModule);
- this.addEventListener('click', (event) => this.checked = true);
- this.shadowRoot.append(module.document.findId('radio-shadow').content.cloneNode(true));
- }
- get checked () {
- return this.hasAttribute('checked');
- }
- set checked (value) {
- if (value)
- this.setAttribute('checked', '');
- else
- this.removeAttribute('checked');
- }
- get value () {
- return this.getAttribute('name');
- }
- set value (value) {
- this.setAttribute('value', value);
- }
- attributeChanged(name, oldValue, newValue) {
- if ((name == 'checked') && (newValue != null))
- if (this.parentNode instanceof module.exports.RadioGroupElement)
- this.parentNode.setChecked(this);
- }
- }
- );
-</script>
-
-<!-- <radiogroup> -->
-<template id="radiogroup-shadow">
- <style>
- :host { padding: 1em; border: thin solid; }
- </style>
-</template>
-<script>
- module.exports.RadioGroupElement = module.registerElement(
- class extends Element {
- static get tagName() { return 'radiogroup'; }
- static get shadow() { return true; }
- constructor (hostModule) {
- super(hostModule);
- this.shadowRoot.append(module.document.findId('radiogroup-shadow').content.cloneNode(true));
- }
- get value () {
- let children = this.getChildNodes();
- for (let child of children)
- if (child instanceof module.exports.RadioElement)
- if (child.checked)
- return child.name;
- return '';
- }
- set value (name) {
- let children = this.getChildNodes();
- for (let child of children)
- if (child instanceof module.exports.RadioElement)
- if (child.value == name)
- child.checked = true;
- }
- setChecked(radio) {
- if (!((radio instanceof module.exports.Radio) && radio.parentNode == this))
- throw;
- let children = this.getChildNodes();
- for (let child of children)
- if (child instanceof module.exports.RadioElement)
- if (child != radio)
- child.checked = false;
- }
- }
- );
-</script>
« no previous file with comments | « sky/examples/file-browser.sky ('k') | sky/framework/inspector/console-agent.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698