Skip to content
This repository was archived by the owner on Sep 28, 2019. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TimvdLippe committed Mar 26, 2016
0 parents commit eea6526
Show file tree
Hide file tree
Showing 8 changed files with 267 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bower_components
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# iron-lazy-pages

An element providing a starting point for your own reusable Polymer elements.


## Dependencies

Element dependencies are managed via [Bower](http://bower.io/). You can
install that via:

npm install -g bower

Then, go ahead and download the element's dependencies:

bower install


## Playing With Your Element

If you wish to work on your element in isolation, we recommend that you use
[Polyserve](https://github.com/PolymerLabs/polyserve) to keep your element's
bower dependencies in line. You can install it via:

npm install -g polyserve

And you can run it via:

polyserve

Once running, you can preview your element at
`http://localhost:8080/components/iron-lazy-pages/`, where `iron-lazy-pages` is the name of the directory containing it.


## Testing Your Element

Simply navigate to the `/test` directory of your element to run its tests. If
you are using Polyserve: `http://localhost:8080/components/iron-lazy-pages/test/`

### web-component-tester

The tests are compatible with [web-component-tester](https://github.com/Polymer/web-component-tester).
Install it via:

npm install -g web-component-tester

Then, you can run your tests on _all_ of your local browsers via:

wct

#### WCT Tips

`wct -l chrome` will only run tests in chrome.

`wct -p` will keep the browsers alive after test runs (refresh to re-run).

`wct test/some-file.html` will test only the files you specify.
27 changes: 27 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "iron-lazy-pages",
"version": "1.0.1",
"authors": [
"Anonymous <[email protected]>"
],
"description": "An element providing a solution to no problem in particular.",
"keywords": [
"web-component",
"polymer",
"seed"
],
"main": "iron-lazy-pages.html",
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/<USERNAME>/seed-element/",
"ignore": [
"/.*",
"/test/"
],
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"web-component-tester": "*"
}
}
36 changes: 36 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 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>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>iron-lazy-pages Demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../iron-lazy-pages.html">
</head>
<body unresolved>

<p>An example of <code>&lt;iron-lazy-pages&gt;</code>:</p>

<button>Say Something</button>

<iron-lazy-pages author='{"name": "Lord Meowser", "image": "http://placekitten.com/g/200/300"}' fancy>
<h2>Hello iron-lazy-pages</h2>
</iron-lazy-pages>

<script>
document.querySelector('button').addEventListener('click', function() {
alert(document.querySelector('iron-lazy-pages').sayHello('Hallo!'));
});
</script>

</body>
</html>
29 changes: 29 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 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>
<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../iron-component-page/iron-component-page.html">

</head>
<body unresolved>
<!-- Note: if the main element for this repository doesn't
match the folder name, add a src="&lt;main-component&gt;.html" attribute,
where &lt;main-component&gt;.html" is a file that imports all of the
components you want documented. -->
<iron-component-page></iron-component-page>

</body>
</html>
35 changes: 35 additions & 0 deletions iron-lazy-pages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--
@license
Copyright (c) 2016 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
-->
<link rel="import" href="../polymer/polymer.html">

<!--
@group Iron Elements
@element iron-lazy-pages
@demo demo/index.html
@hero hero.svg
-->
<dom-module id="iron-lazy-pages">
<template>
<content></content>
</template>
</dom-module>

<script>

Polymer({

is: 'iron-lazy-pages',

properties: {
}
});

</script>
56 changes: 56 additions & 0 deletions test/basic-test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 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>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">

<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>

<!-- Step 1: import the element to test -->
<link rel="import" href="../iron-lazy-pages.html">
</head>
<body>

<!-- You can use the document as a place to set up your fixtures. -->
<iron-lazy-pages></iron-lazy-pages>

<script>
var myEl = document.querySelector('iron-lazy-pages');

suite('<iron-lazy-pages>', function() {

test('defines the "author" property', function() {
assert.equal(myEl.author.name, 'Dimitri Glazkov');
assert.equal(myEl.author.image, 'http://addyosmani.com/blog/wp-content/uploads/2013/04/unicorn.jpg');
});

test('says hello', function() {
assert.equal(myEl.sayHello(), 'iron-lazy-pages says, Hello World!');

var greetings = myEl.sayHello('greetings Earthlings');
assert.equal(greetings, 'iron-lazy-pages says, greetings Earthlings');
});

test('fires lasers', function(done) {
myEl.addEventListener('iron-lazy-pages-lasers', function(event) {
assert.equal(event.detail.sound, 'Pew pew!');
done();
});
myEl.fireLasers();
});

});
</script>

</body>
</html>
27 changes: 27 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 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>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">

<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
</head>
<body>
<script>
// Load and run all tests (.html, .js):
WCT.loadSuites([
'basic-test.html',
]);
</script>
</body>
</html>

0 comments on commit eea6526

Please sign in to comment.