Added Polymer
This commit is contained in:
18
rpg-docs/public/bower_components/core-media-query/.bower.json
vendored
Normal file
18
rpg-docs/public/bower_components/core-media-query/.bower.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "core-media-query",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^0.5.0"
|
||||
},
|
||||
"version": "0.5.1",
|
||||
"homepage": "https://github.com/Polymer/core-media-query",
|
||||
"_release": "0.5.1",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "0.5.1",
|
||||
"commit": "c9eb313a8efb925b45644c2866b11228fc36ee84"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/core-media-query.git",
|
||||
"_target": "^0.5.0",
|
||||
"_originalSource": "Polymer/core-media-query"
|
||||
}
|
||||
4
rpg-docs/public/bower_components/core-media-query/README.md
vendored
Normal file
4
rpg-docs/public/bower_components/core-media-query/README.md
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
core-media-query
|
||||
================
|
||||
|
||||
See the [component page](http://polymer-project.org/docs/elements/core-elements.html#core-media-query) for more information.
|
||||
8
rpg-docs/public/bower_components/core-media-query/bower.json
vendored
Normal file
8
rpg-docs/public/bower_components/core-media-query/bower.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "core-media-query",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^0.5.0"
|
||||
},
|
||||
"version": "0.5.1"
|
||||
}
|
||||
87
rpg-docs/public/bower_components/core-media-query/core-media-query.html
vendored
Normal file
87
rpg-docs/public/bower_components/core-media-query/core-media-query.html
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
<!--
|
||||
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
|
||||
-->
|
||||
<!--
|
||||
/**
|
||||
* @group Polymer Core Elements
|
||||
* @element core-media-query
|
||||
* @status beta
|
||||
* @homepage github.io
|
||||
*
|
||||
* core-media-query can be used to data bind to a CSS media query.
|
||||
* The "query" property is a bare CSS media query.
|
||||
* The "queryMatches" property will be a boolean representing if the page matches that media query.
|
||||
*
|
||||
* core-media-query uses media query listeners to dynamically update the "queryMatches" property.
|
||||
* A "core-media-change" event also fires when queryMatches changes.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <core-media-query query="max-width: 640px" queryMatches="{{phoneScreen}}"></core-media-query>
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fired when the media query state changes
|
||||
*
|
||||
* @event core-media-change
|
||||
*/
|
||||
-->
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
|
||||
<polymer-element name="core-media-query" attributes="query queryMatches">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</template>
|
||||
<script>
|
||||
Polymer('core-media-query', {
|
||||
|
||||
/**
|
||||
* The Boolean return value of the media query
|
||||
*
|
||||
* @attribute queryMatches
|
||||
* @type Boolean
|
||||
* @default false
|
||||
*/
|
||||
queryMatches: false,
|
||||
|
||||
/**
|
||||
* The CSS media query to evaulate
|
||||
*
|
||||
* @attribute query
|
||||
* @type string
|
||||
* @default ''
|
||||
*/
|
||||
query: '',
|
||||
ready: function() {
|
||||
this._mqHandler = this.queryHandler.bind(this);
|
||||
this._mq = null;
|
||||
},
|
||||
queryChanged: function() {
|
||||
if (this._mq) {
|
||||
this._mq.removeListener(this._mqHandler);
|
||||
}
|
||||
var query = this.query;
|
||||
if (query[0] !== '(') {
|
||||
query = '(' + this.query + ')';
|
||||
}
|
||||
this._mq = window.matchMedia(query);
|
||||
this._mq.addListener(this._mqHandler);
|
||||
this.queryHandler(this._mq);
|
||||
},
|
||||
queryHandler: function(mq) {
|
||||
this.queryMatches = mq.matches;
|
||||
this.asyncFire('core-media-change', mq);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</polymer-element>
|
||||
44
rpg-docs/public/bower_components/core-media-query/demo.html
vendored
Normal file
44
rpg-docs/public/bower_components/core-media-query/demo.html
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<!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.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
|
||||
-->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Polymer match media</title>
|
||||
<script src="../webcomponentsjs/webcomponents.js"></script>
|
||||
<link rel="import" href="core-media-query.html" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<polymer-element name="match-example">
|
||||
<template>
|
||||
<core-media-query query="{{query}}" queryMatches="{{qMatches}}"></core-media-query>
|
||||
My query of "{{query}}" {{qMatches ? "matches" : "doesn't match"}}
|
||||
</template>
|
||||
<script>
|
||||
Polymer('match-example', {
|
||||
query: 'min-width: 600px'
|
||||
});
|
||||
</script>
|
||||
</polymer-element>
|
||||
|
||||
<match-example id="me"></match-example>
|
||||
<pre id="output">
|
||||
Log of 'mediachange' events on document, from polymer-match-media:
|
||||
</pre>
|
||||
|
||||
<script>
|
||||
var output = document.querySelector('#output');
|
||||
// on-mediachange would give true or false as second param to the handler
|
||||
document.addEventListener('core-media-change', function(e) {
|
||||
output.textContent += '\nevent: ' + e.type + ' query: ' + e.detail.media + ' matches: ' + e.detail.matches;
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
22
rpg-docs/public/bower_components/core-media-query/index.html
vendored
Normal file
22
rpg-docs/public/bower_components/core-media-query/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>
|
||||
Reference in New Issue
Block a user