summaryrefslogtreecommitdiffstats
path: root/ui/webui
diff options
context:
space:
mode:
authorstevenjb <stevenjb@chromium.org>2015-05-16 19:17:53 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-17 02:18:11 +0000
commit8d81ad5028eb4d90348d7c576c28754555d06a76 (patch)
tree01afe6f57c9f80b08f4f78e622b15990ffc796f2 /ui/webui
parent2aa33abccdfce3b56475135a662d4fdd676ba484 (diff)
downloadchromium_src-8d81ad5028eb4d90348d7c576c28754555d06a76.zip
chromium_src-8d81ad5028eb4d90348d7c576c28754555d06a76.tar.gz
chromium_src-8d81ad5028eb4d90348d7c576c28754555d06a76.tar.bz2
Add demo_page.html to cr_elements/v0_8
This CL should facilitate conversion of cr- elements and help debugging them in isolation. To view elements in demo_elements.html, navigate to: chrome://resources/cr_elements/v0_8/demo_page.html BUG=485381 Review URL: https://codereview.chromium.org/1124073007 Cr-Commit-Position: refs/heads/master@{#330297}
Diffstat (limited to 'ui/webui')
-rw-r--r--ui/webui/resources/cr_elements/v0_8/demo_element.html49
-rw-r--r--ui/webui/resources/cr_elements/v0_8/demo_element.js42
-rw-r--r--ui/webui/resources/cr_elements/v0_8/demo_page.html19
-rw-r--r--ui/webui/resources/cr_elements_resources.grdp9
4 files changed, 119 insertions, 0 deletions
diff --git a/ui/webui/resources/cr_elements/v0_8/demo_element.html b/ui/webui/resources/cr_elements/v0_8/demo_element.html
new file mode 100644
index 0000000..5a3810b
--- /dev/null
+++ b/ui/webui/resources/cr_elements/v0_8/demo_element.html
@@ -0,0 +1,49 @@
+<link rel="import" href="chrome://resources/polymer/v0_8/polymer/polymer.html">
+<link rel="import" href="chrome://resources/cr_elements/v0_8/cr_button/cr_button.html">
+<link rel="import" href="chrome://resources/cr_elements/v0_8/cr_checkbox/cr_checkbox.html">
+<link rel="import" href="chrome://resources/cr_elements/v0_8/cr_collapse/cr_collapse.html">
+<link rel="import" href="chrome://resources/cr_elements/v0_8/cr_input/cr_input.html">
+<link rel="import" href="chrome://resources/cr_elements/v0_8/cr_network_icon/cr_network_icon.html">
+<link rel="import" href="chrome://resources/cr_elements/v0_8/cr_toggle_button/cr_toggle_button.html">
+
+<dom-module id="cr-demo-element">
+ <template>
+ <div>
+ <h3>cr-button</h3>
+ <cr-button>Button</cr-button>
+ <cr-button raised>Raised Button</cr-button>
+ </div>
+ <div>
+ <h3>cr-checkbox</h3>
+ <cr-checkbox checked="{{checkboxChecked}}">Checkbox</cr-checkbox>
+ </div>
+ <div>
+ <h3>cr-collapse</h3>
+ <paper-toggle-button checked="{{collapseOpened}}">
+ Toggle Collapse
+ </paper-toggle-button>
+ <cr-collapse opened="{{collapseOpened}}">
+ <div>
+ <span>Collapsable section</span>
+ </div>
+ </cr-collapse>
+ </div>
+ <div>
+ <h3>cr-input</h3>
+ <cr-input label="Input" value="{{inputValue}}"></cr-input>
+ <span>Input.value=</span><span>{{inputValue}}</span>
+ </div>
+ <div>
+ <h3>cr-network-icon</h3>
+ <cr-network-icon></cr-network-icon>
+ </div>
+ <div>
+ <h3>cr-toggle-button</h3>
+ <div horizontal layout>
+ <span>Toggle Button</span>
+ <cr-toggle-button></cr-toggle-button>
+ </div>
+ </div>
+ </template>
+ <script src="demo_element.js"></script>
+</dom-module>
diff --git a/ui/webui/resources/cr_elements/v0_8/demo_element.js b/ui/webui/resources/cr_elements/v0_8/demo_element.js
new file mode 100644
index 0000000..0b3e9ce
--- /dev/null
+++ b/ui/webui/resources/cr_elements/v0_8/demo_element.js
@@ -0,0 +1,42 @@
+// 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.
+
+/**
+ * @fileoverview Polymer element for UI wrapping a list of cr- elements.
+ */
+Polymer({
+ is: 'cr-demo-element',
+
+ properties: {
+ checkboxChecked: {
+ type: Boolean,
+ value: true,
+ observer: 'checkboxCheckedChanged_'
+ },
+
+ collapseOpened: {
+ type: Boolean,
+ value: true,
+ observer: 'collapseOpenedChanged_'
+ },
+
+ inputValue: {
+ type: String,
+ value: '',
+ observer: 'inputValueChanged_'
+ },
+ },
+
+ checkboxCheckedChanged_: function() {
+ console.log('checkboxCheckedChanged=' + this.checkboxChecked);
+ },
+
+ collapseOpenedChanged_: function() {
+ console.log('collapseOpened=' + this.collapseOpened);
+ },
+
+ inputValueChanged_: function() {
+ console.log('inputValue=' + this.inputValue);
+ }
+});
diff --git a/ui/webui/resources/cr_elements/v0_8/demo_page.html b/ui/webui/resources/cr_elements/v0_8/demo_page.html
new file mode 100644
index 0000000..f918666
--- /dev/null
+++ b/ui/webui/resources/cr_elements/v0_8/demo_page.html
@@ -0,0 +1,19 @@
+<!doctype html>
+
+<!-- Demo page for cr-elements. Add new elements to demo_elements.html to -->
+<!-- view them and test their interactions with other elements. -->
+<!-- To view this page, navigate to: -->
+<!-- chrome://resources/cr_elements/v0_8/demo_page.html -->
+
+<html>
+
+<head>
+ <link href="demo_element.html" rel="import" >
+</head>
+
+<body>
+ <h1>cr-elements</h1>
+ <cr-demo-element></cr-demo-element>
+</body>
+
+</html>
diff --git a/ui/webui/resources/cr_elements_resources.grdp b/ui/webui/resources/cr_elements_resources.grdp
index 6bbe17c9..bc5ac36 100644
--- a/ui/webui/resources/cr_elements_resources.grdp
+++ b/ui/webui/resources/cr_elements_resources.grdp
@@ -105,6 +105,15 @@
<!-- Polymer 0.8 Elements -->
<if expr="enable_polymer_v08">
+ <structure name="IDR_CR_ELEMENTS_08_CR_DEMO_ELEMENT_HTML"
+ file="../../webui/resources/cr_elements/v0_8/demo_element.html"
+ type="chrome_html" />
+ <structure name="IDR_CR_ELEMENTS_08_CR_DEMO_ELEMENT_JS"
+ file="../../webui/resources/cr_elements/v0_8/demo_element.js"
+ type="chrome_html" />
+ <structure name="IDR_CR_ELEMENTS_08_CR_DEMO_PAGE_HTML"
+ file="../../webui/resources/cr_elements/v0_8/demo_page.html"
+ type="chrome_html" />
<structure name="IDR_CR_ELEMENTS_08_CR_BUTTON_CSS"
file="../../webui/resources/cr_elements/v0_8/cr_button/cr_button.css"
type="chrome_html" />