Added Polymer
This commit is contained in:
21
rpg-docs/public/bower_components/paper-toast/.bower.json
vendored
Normal file
21
rpg-docs/public/bower_components/paper-toast/.bower.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "paper-toast",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"core-media-query": "Polymer/core-media-query#^0.5.0",
|
||||
"core-overlay": "Polymer/core-overlay#^0.5.0",
|
||||
"font-roboto": "Polymer/font-roboto#^0.5.0",
|
||||
"paper-button": "Polymer/paper-button#^0.5.0"
|
||||
},
|
||||
"version": "0.5.1",
|
||||
"homepage": "https://github.com/Polymer/paper-toast",
|
||||
"_release": "0.5.1",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "0.5.1",
|
||||
"commit": "ed7ba7da215140c6e8dae805b87368ae8eb123c2"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/paper-toast.git",
|
||||
"_target": "^0.5.0",
|
||||
"_originalSource": "Polymer/paper-toast"
|
||||
}
|
||||
4
rpg-docs/public/bower_components/paper-toast/README.md
vendored
Normal file
4
rpg-docs/public/bower_components/paper-toast/README.md
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
paper-toast
|
||||
============
|
||||
|
||||
See the [component page](http://www.polymer-project.org/docs/elements/paper-elements.html#paper-toast) for more information.
|
||||
11
rpg-docs/public/bower_components/paper-toast/bower.json
vendored
Normal file
11
rpg-docs/public/bower_components/paper-toast/bower.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "paper-toast",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"core-media-query": "Polymer/core-media-query#^0.5.0",
|
||||
"core-overlay": "Polymer/core-overlay#^0.5.0",
|
||||
"font-roboto": "Polymer/font-roboto#^0.5.0",
|
||||
"paper-button": "Polymer/paper-button#^0.5.0"
|
||||
},
|
||||
"version": "0.5.1"
|
||||
}
|
||||
67
rpg-docs/public/bower_components/paper-toast/demo.html
vendored
Normal file
67
rpg-docs/public/bower_components/paper-toast/demo.html
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>paper-toast</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents.js"></script>
|
||||
|
||||
<link rel="import" href="paper-toast.html">
|
||||
<link rel="import" href="../font-roboto/roboto.html" >
|
||||
<link rel="import" href="../paper-button/paper-button.html" >
|
||||
|
||||
<style>
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
-webkit-touch-callout: none;
|
||||
}
|
||||
|
||||
paper-button {
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body unresolved>
|
||||
|
||||
<paper-button raised onclick="document.querySelector('#toast1').show()">Discard Draft</paper-button>
|
||||
|
||||
<paper-button raised onclick="document.querySelector('#toast2').show()">Get Messages</paper-button>
|
||||
|
||||
<paper-button raised onclick="document.querySelector('#toast3').show()">Send Message</paper-button>
|
||||
|
||||
<paper-toast id="toast1" text="Your draft has been discarded."></paper-toast>
|
||||
|
||||
<paper-toast id="toast2" role="alert" text="Connection timed out. Showing limited messages.">
|
||||
<div style="color: #eeff41;" onclick="console.log('RETRY')">Retry</div>
|
||||
</paper-toast>
|
||||
|
||||
<paper-toast id="toast3" class="capsule" text="Message sent" style="padding-right: 60px;"></paper-toast>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
22
rpg-docs/public/bower_components/paper-toast/index.html
vendored
Normal file
22
rpg-docs/public/bower_components/paper-toast/index.html
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents.js"></script>
|
||||
<link rel="import" href="../core-component-page/core-component-page.html">
|
||||
|
||||
</head>
|
||||
<body unresolved>
|
||||
|
||||
<core-component-page></core-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
20
rpg-docs/public/bower_components/paper-toast/metadata.html
vendored
Normal file
20
rpg-docs/public/bower_components/paper-toast/metadata.html
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<x-meta id="paper-toast" label="Toast" group="Paper" isContainer>
|
||||
|
||||
<template>
|
||||
<paper-toast text="Toast!"></paper-toast>
|
||||
</template>
|
||||
|
||||
<template id="imports">
|
||||
<link rel="import" href="paper-toast.html">
|
||||
</template>
|
||||
|
||||
</x-meta>
|
||||
80
rpg-docs/public/bower_components/paper-toast/paper-toast.css
vendored
Normal file
80
rpg-docs/public/bower_components/paper-toast/paper-toast.css
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
|
||||
:host {
|
||||
display: inline-block;
|
||||
background: #323232;
|
||||
color: #f1f1f1;
|
||||
min-height: 48px;
|
||||
min-width: 288px;
|
||||
padding: 16px 24px 12px;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
|
||||
border-radius: 2px;
|
||||
bottom: 12px;
|
||||
left: 12px;
|
||||
font-size: 14px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
:host(.capsule) {
|
||||
border-radius: 24px;
|
||||
}
|
||||
|
||||
:host(.fit-bottom) {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
:host(.core-transition.dragging) {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
:host(.core-transition.fade-out-down),
|
||||
:host(.core-transition.fade-out-up),
|
||||
:host(.core-transition.fade-out-right),
|
||||
:host(.core-transition.fade-out-left) {
|
||||
opacity: 0;
|
||||
transition: -webkit-transform 0.08s ease-in-out, opacity 0.08s ease-in-out;
|
||||
transition: transform 0.08s ease-in-out, opacity 0.08s ease-in-out;
|
||||
}
|
||||
|
||||
:host(.core-transition.fade-out-down) {
|
||||
-webkit-transform: translate(0, 100%);
|
||||
transform: translate(0, 100%);
|
||||
}
|
||||
|
||||
:host(.core-transition.fade-out-up) {
|
||||
-webkit-transform: translate(0, -100%);
|
||||
transform: translate(0, -100%);
|
||||
}
|
||||
|
||||
:host(.core-transition.fade-out-right) {
|
||||
-webkit-transform: translate(100%, 0);
|
||||
transform: translate(100%, 0);
|
||||
}
|
||||
|
||||
:host(.core-transition.fade-out-left) {
|
||||
-webkit-transform: translate(-100%, 0);
|
||||
transform: translate(-100%, 0);
|
||||
}
|
||||
|
||||
.toast-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.toast-action {
|
||||
padding-left: 24px;
|
||||
cursor: pointer;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
296
rpg-docs/public/bower_components/paper-toast/paper-toast.html
vendored
Normal file
296
rpg-docs/public/bower_components/paper-toast/paper-toast.html
vendored
Normal file
@@ -0,0 +1,296 @@
|
||||
<!--
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<!--
|
||||
`paper-toast` provides lightweight feedback about an operation in a small popup
|
||||
at the base of the screen on mobile and at the lower left on desktop. Toasts are
|
||||
above all other elements on screen, including the FAB.
|
||||
|
||||
Toasts automatically disappear after a timeout or after user interaction
|
||||
elsewhere on the screen, whichever comes first. Toasts can be swiped off
|
||||
screen. There can be only one on the screen at a time.
|
||||
|
||||
Example:
|
||||
|
||||
<paper-toast text="Your draft has been discarded." onclick="discardDraft(el)"></paper-toast>
|
||||
|
||||
<script>
|
||||
function discardDraft(el) {
|
||||
el.show();
|
||||
}
|
||||
</script>
|
||||
|
||||
An action button can be presented in the toast.
|
||||
|
||||
Example (using Polymer's data-binding features):
|
||||
|
||||
<paper-toast id="toast2" text="Connection timed out. Showing limited messages.">
|
||||
<div style="color: blue;" on-tap="{{retry}}">Retry</div>
|
||||
</paper-toast>
|
||||
|
||||
Positioning toast:
|
||||
|
||||
A standard toast appears near the lower left of the screen. You can change the
|
||||
position by overriding bottom and left positions.
|
||||
|
||||
paper-toast {
|
||||
bottom: 40px;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
To position the toast to the right:
|
||||
|
||||
paper-toast {
|
||||
right: 10px;
|
||||
left: auto;
|
||||
}
|
||||
|
||||
To make it fit at the bottom of the screen:
|
||||
|
||||
paper-toast {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
When the screen size is smaller than the `responsiveWidth` (default to 480px),
|
||||
the toast will automatically fits at the bottom of the screen.
|
||||
|
||||
@group Paper Elements
|
||||
@element paper-toast
|
||||
@homepage github.io
|
||||
-->
|
||||
<!--
|
||||
Fired when the `paper-toast`'s `opened` property changes.
|
||||
|
||||
@event core-overlay-open
|
||||
@param {boolean} detail the opened state
|
||||
-->
|
||||
<!--
|
||||
Fired when the `paper-toast` has completely opened.
|
||||
|
||||
@event core-overlay-open-completed
|
||||
-->
|
||||
<!--
|
||||
Fired when the `paper-toast` has completely closed.
|
||||
|
||||
@event core-overlay-close-completed
|
||||
-->
|
||||
<link rel="import" href="../core-overlay/core-overlay.html">
|
||||
<link rel="import" href="../core-transition/core-transition-css.html">
|
||||
<link rel="import" href="../core-media-query/core-media-query.html">
|
||||
|
||||
<polymer-element name="paper-toast" attributes="text duration opened responsiveWidth swipeDisabled autoCloseDisabled" role="status">
|
||||
|
||||
<template>
|
||||
|
||||
<link rel="stylesheet" href="paper-toast.css" >
|
||||
|
||||
<core-overlay id="overlay" autoFocusDisabled autoCloseDisabled="{{autoCloseDisabled}}" opened="{{opened}}" target="{{}}" transition="core-transition-bottom"></core-overlay>
|
||||
|
||||
<div class="toast-container" horizontal layout>
|
||||
|
||||
<div class="toast-text" flex>{{text}}</div>
|
||||
|
||||
<div class="toast-text toast-action" on-tap="{{dismiss}}">
|
||||
<content></content>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<core-media-query query="max-width: {{responsiveWidth}}" queryMatches="{{narrowMode}}"></core-media-query>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
|
||||
(function() {
|
||||
|
||||
var currentToast;
|
||||
|
||||
Polymer('paper-toast', {
|
||||
|
||||
/**
|
||||
* The text shows in a toast.
|
||||
*
|
||||
* @attribute text
|
||||
* @type string
|
||||
* @default ''
|
||||
*/
|
||||
text: '',
|
||||
|
||||
/**
|
||||
* The duration in milliseconds to show the toast.
|
||||
*
|
||||
* @attribute duration
|
||||
* @type number
|
||||
* @default 3000
|
||||
*/
|
||||
duration: 3000,
|
||||
|
||||
/**
|
||||
* Set opened to true to show the toast and to false to hide it.
|
||||
*
|
||||
* @attribute opened
|
||||
* @type boolean
|
||||
* @default false
|
||||
*/
|
||||
opened: false,
|
||||
|
||||
/**
|
||||
* Min-width when the toast changes to narrow layout. In narrow layout,
|
||||
* the toast fits at the bottom of the screen when opened.
|
||||
*
|
||||
* @attribute responsiveWidth
|
||||
* @type string
|
||||
* @default '480px'
|
||||
*/
|
||||
responsiveWidth: '480px',
|
||||
|
||||
/**
|
||||
* If true, the toast can't be swiped.
|
||||
*
|
||||
* @attribute swipeDisabled
|
||||
* @type boolean
|
||||
* @default false
|
||||
*/
|
||||
swipeDisabled: false,
|
||||
|
||||
/**
|
||||
* By default, the toast will close automatically if the user taps
|
||||
* outside it or presses the escape key. Disable this behavior by setting
|
||||
* the `autoCloseDisabled` property to true.
|
||||
*
|
||||
* @attribute autoCloseDisabled
|
||||
* @type boolean
|
||||
* @default false
|
||||
*/
|
||||
autoCloseDisabled: false,
|
||||
|
||||
narrowMode: false,
|
||||
|
||||
eventDelegates: {
|
||||
trackstart: 'trackStart',
|
||||
track: 'track',
|
||||
trackend: 'trackEnd',
|
||||
transitionend: 'transitionEnd'
|
||||
},
|
||||
|
||||
narrowModeChanged: function() {
|
||||
this.classList.toggle('fit-bottom', this.narrowMode);
|
||||
if (this.opened) {
|
||||
this.$.overlay.resizeHandler();
|
||||
}
|
||||
},
|
||||
|
||||
openedChanged: function() {
|
||||
if (this.opened) {
|
||||
this.dismissJob = this.job(this.dismissJob, this.dismiss, this.duration);
|
||||
} else {
|
||||
this.dismissJob && this.dismissJob.stop();
|
||||
this.dismiss();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle the opened state of the toast.
|
||||
* @method toggle
|
||||
*/
|
||||
toggle: function() {
|
||||
this.opened = !this.opened;
|
||||
},
|
||||
|
||||
/**
|
||||
* Show the toast for the specified duration
|
||||
* @method show
|
||||
*/
|
||||
show: function() {
|
||||
if (currentToast) {
|
||||
currentToast.dismiss();
|
||||
}
|
||||
currentToast = this;
|
||||
this.opened = true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Dismiss the toast and hide it.
|
||||
* @method dismiss
|
||||
*/
|
||||
dismiss: function() {
|
||||
if (this.dragging) {
|
||||
this.shouldDismiss = true;
|
||||
} else {
|
||||
this.opened = false;
|
||||
if (currentToast === this) {
|
||||
currentToast = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
trackStart: function(e) {
|
||||
if (!this.swipeDisabled) {
|
||||
e.preventTap();
|
||||
this.vertical = e.yDirection;
|
||||
this.w = this.offsetWidth;
|
||||
this.h = this.offsetHeight;
|
||||
this.dragging = true;
|
||||
this.classList.add('dragging');
|
||||
}
|
||||
},
|
||||
|
||||
track: function(e) {
|
||||
if (this.dragging) {
|
||||
var s = this.style;
|
||||
if (this.vertical) {
|
||||
var y = e.dy;
|
||||
s.opacity = (this.h - Math.abs(y)) / this.h;
|
||||
s.transform = s.webkitTransform = 'translate3d(0, ' + y + 'px, 0)';
|
||||
} else {
|
||||
var x = e.dx;
|
||||
s.opacity = (this.w - Math.abs(x)) / this.w;
|
||||
s.transform = s.webkitTransform = 'translate3d(' + x + 'px, 0, 0)';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
trackEnd: function(e) {
|
||||
if (this.dragging) {
|
||||
this.classList.remove('dragging');
|
||||
this.style.opacity = '';
|
||||
this.style.transform = this.style.webkitTransform = '';
|
||||
var cl = this.classList;
|
||||
if (this.vertical) {
|
||||
cl.toggle('fade-out-down', e.yDirection === 1 && e.dy > 0);
|
||||
cl.toggle('fade-out-up', e.yDirection === -1 && e.dy < 0);
|
||||
} else {
|
||||
cl.toggle('fade-out-right', e.xDirection === 1 && e.dx > 0);
|
||||
cl.toggle('fade-out-left', e.xDirection === -1 && e.dx < 0);
|
||||
}
|
||||
this.dragging = false;
|
||||
}
|
||||
},
|
||||
|
||||
transitionEnd: function() {
|
||||
var cl = this.classList;
|
||||
if (cl.contains('fade-out-right') || cl.contains('fade-out-left') ||
|
||||
cl.contains('fade-out-down') || cl.contains('fade-out-up')) {
|
||||
this.dismiss();
|
||||
cl.remove('fade-out-right', 'fade-out-left',
|
||||
'fade-out-down', 'fade-out-up');
|
||||
} else if (this.shouldDismiss) {
|
||||
this.dismiss();
|
||||
}
|
||||
this.shouldDismiss = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
</script>
|
||||
</polymer-element>
|
||||
Reference in New Issue
Block a user