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

Unified Diff: sky/examples/widgets/index.sky

Issue 809233002: Add super-basic sky widgets. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix typos Created 6 years 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 | « no previous file | sky/framework/sky-box/sky-box.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/widgets/index.sky
diff --git a/sky/examples/widgets/index.sky b/sky/examples/widgets/index.sky
new file mode 100644
index 0000000000000000000000000000000000000000..eb57271b80b952670f7927ee963440928d055fa1
--- /dev/null
+++ b/sky/examples/widgets/index.sky
@@ -0,0 +1,56 @@
+<!--
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+-->
+<sky>
+<import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" />
+<import src="/sky/framework/sky-button/sky-button.sky" as="SkyButton" />
+<import src="/sky/framework/sky-box/sky-box.sky" as="SkyBox" />
+<import src="/sky/framework/sky-checkbox/sky-checkbox.sky" as="SkyCheckbox" />
+<import src="/sky/framework/sky-radio/sky-radio.sky" as="SkyRadio" />
+<sky-element name="widget-root">
+<template>
+ <style>
+ div { display: paragraph; }
+ </style>
+
+ <sky-box title='Buttons'>
+ <sky-button id='button'>Button</sky-button>
+ <div>highlight: {{ myButton.highlight }}</div>
+ </sky-box>
+
+ <sky-box title='Checkboxes'>
+ <div><sky-checkbox id='checkbox' />Checkbox</div>
+ <div>highlight: {{ myCheckbox.highlight }}</div>
+ <div>checked: {{ myCheckbox.checked }}</div>
+
+ <div><sky-checkbox id='checkbox' checked='true'/>Checkbox, default checked.</div>
+ </sky-box>
+
+ <sky-box title='Radios'>
+ <sky-box title='Group One'>
+ <div><sky-radio group='foo'/>one</div>
+ <div><sky-radio group='foo' selected='true' />two</div>
+ <div><sky-radio group='foo'/>three</div>
+ </sky-box>
+ <sky-box title='Group Two'>
+ <div><sky-radio group='bar'/>A</div>
+ <div><sky-radio group='bar'/>B</div>
+ <div><sky-radio group='bar' selected='true' />C</div>
+ </sky-box>
+ </sky-box>
+
+</template>
+<script>
+module.exports = class extends SkyElement {
+ attached() {
+ this.myButton = this.shadowRoot.getElementById('button');
+ this.myCheckbox = this.shadowRoot.getElementById('checkbox');
+ }
+}.register();
+</script>
+</sky-element>
+
+<widget-root />
+</sky>
« no previous file with comments | « no previous file | sky/framework/sky-box/sky-box.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698