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

Unified Diff: third_party/polymer/components-chromium/core-overlay/demo.html

Issue 592593002: Inline scripts were extracted from Polymer elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/echo ""/echo/ Created 6 years, 3 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
Index: third_party/polymer/components-chromium/core-overlay/demo.html
diff --git a/third_party/polymer/components-chromium/core-overlay/demo.html b/third_party/polymer/components-chromium/core-overlay/demo.html
new file mode 100644
index 0000000000000000000000000000000000000000..fda6207ddcbd628bb9a423fd966cec4bfa36fb4b
--- /dev/null
+++ b/third_party/polymer/components-chromium/core-overlay/demo.html
@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>core-overlay</title>
+ <meta name="viewport" content="width=device-width, user-scalable=no">
+ <script src="../platform/platform.js"></script>
+ <link rel="import" href="../core-transition/core-transition-css.html">
+ <link rel="import" href="core-overlay.html">
+ <style>
+ body {
+ margin: 0;
+ }
+
+ section {
+ padding: 24px;
+ }
+ </style>
+</head>
+<body unresolved>
+ <section>
+ <x-container></x-container>
+ </section>
+
+ <!-- a simple dialog element made with core-overlay -->
+ <polymer-element name="x-dialog" attributes="opened autoCloseDisabled">
+ <template>
+ <style>
+
+ :host {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 13px;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ overflow: hidden;
+ background: white;
+ padding:30px 42px;
+ outline: 1px solid rgba(0,0,0,0.2);
+ box-shadow: 0 4px 16px rgba(0,0,0,0.2);
+ }
+ </style>
+ <core-overlay id="overlay" layered backdrop opened="{{opened}}" autoCloseDisabled="{{autoCloseDisabled}}" transition="core-transition-center"></core-overlay>
+ <content></content>
+ </template>
+ <script>
+
+ Polymer('x-dialog', {
+
+ ready: function() {
+ this.$.overlay.target = this;
+ },
+
+ toggle: function() {
+ this.$.overlay.toggle();
+ }
+
+ });
+
+ </script>
+ </polymer-element>
+
+
+ <!-- an element that uses the x-dialog element and core-overlay -->
+ <polymer-element name="x-container">
+ <template>
+ <x-dialog id="dialog" class="dialog">
+ <!-- place all overlay styles inside the overlay target -->
+ <style no-shim>
+ .dialog {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 13px;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ overflow: hidden;
+ background: white;
+ padding:30px 42px;
+ outline: 1px solid rgba(0,0,0,0.2);
+ box-shadow: 0 4px 16px rgba(0,0,0,0.2);
+ }
+
+ #dialog {
+ width: 500px;
+ }
+ </style>
+ <h2>Dialog</h2>
+ <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed fringilla sapien sed enim sollicitudin laoreet. Suspendisse suscipit, metus ac volutpat sodales, libero magna semper lacus, molestie fringilla massa orci ut arcu. Nullam sodales urna sit amet odio vehicula mattis.</div><br><br>
+ <div>Ut aliquam vulputate congue. Vestibulum pretium pretium nulla quis sollicitudin. Praesent lacinia congue erat nec mattis. Fusce commodo lacus est. Duis turpis eros, ultrices sed aliquet non, blandit egestas velit. Integer a augue nec lorem tristique hendrerit. Curabitur imperdiet risus id enim bibendum vestibulum. Integer id magna at arcu faucibus fermentum vel a augue. Sed fringilla venenatis dolor, in blandit magna molestie luctus. Vestibulum dignissim posuere ultrices. Aenean urna nisl, tincidunt vitae iaculis ut, pharetra nec eros.</div><br><br>
+
+ <div>
+ <input placeholder="say something..." autofocus on-input="{{inputHandler}}" /><br>
+ I agree with this wholeheartedly.
+ <core-overlay layered id="confirmation" class="dialog" backdrop transition="core-transition-top">
+ <!-- place all overlay styles inside the overlay target -->
+ <style no-shim>
+ .dialog {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 13px;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ overflow: hidden;
+ background: white;
+ padding:30px 42px;
+ outline: 1px solid rgba(0,0,0,0.2);
+ box-shadow: 0 4px 16px rgba(0,0,0,0.2);
+ }
+
+ #confirmation {
+ box-sizing: border-box;
+ text-align: center;
+ width: 150px;
+ }
+ </style>
+ Thank you.
+ </core-overlay>
+ </div><br><br>
+ <button core-overlay-toggle>OK</button>
+ </x-dialog>
+
+ <button on-tap="{{tapHandler}}">Toggle Dialog</button>
+ </template>
+ <script>
+
+ Polymer('x-container', {
+
+ inputHandler: function(e) {
+ if (e.target.value === 'something') {
+ this.$.confirmation.toggle();
+ }
+ },
+
+ tapHandler: function() {
+ this.$.dialog.toggle();
+ }
+
+ });
+
+ </script>
+ </polymer-element>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698