Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasemu committed Jan 6, 2015
0 parents commit 70c2509
Show file tree
Hide file tree
Showing 13 changed files with 234 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "../"
}
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.sass-cache
.tmp
28 changes: 28 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"jquery": true,
"globals": {
"wrap": true,
"unwrap": true,
"Polymer": true,
"Platform": true
}
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bacon-ipsum
================

See the [component page](http://Tasemu.github.io/bacon-ipsum) for more information.

## Getting Started

We've put together a [guide for bacon-ipsum](http://www.polymer-project.org/docs/start/reusableelements.html) to help get you rolling.
3 changes: 3 additions & 0 deletions bacon-ipsum.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:host {

}
52 changes: 52 additions & 0 deletions bacon-ipsum.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<link rel="import" href="../polymer/polymer.html">

<!--
Element providing solution to no problem in particular.
##### Example
<bacon-ipsum></bacon-ipsum>
@element bacon-ipsum
@blurb Element providing solution to no problem in particular.
@status alpha
@homepage http://polymerlabs.github.io/bacon-ipsum
-->
<polymer-element name="bacon-ipsum" attributes="words paragraphs">

<link rel="import" href="../core-ajax/core-ajax.html">

<template>
<link rel="stylesheet" href="bacon-ipsum.css" />

<core-ajax
auto
method="GET"
url="http://baconipsum.com/api/"
params='{"type":"all-meat", "paras":"{{paragraphs}}"}'
handleAs="json"
on-core-response="{{handleResponse}}"></core-ajax>

<p id="thebacon"></p>

</template>

<script>

Polymer({
author: 'Montague Monro',
words: 5,
paragraphs: 2,
theBacon: '',

handleResponse: function (res) {
var scope = this;
res.detail.response.forEach(function (element) {
scope.$.thebacon.innerHTML += (element + "<br><br>");
});
},
});

</script>

</polymer-element>
17 changes: 17 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "bacon-ipsum",
"version": "0.0.0",
"keywords": [
"seed",
"polymer",
"web-components"
],
"main": "bacon-ipsum.html",
"dependencies": {
"polymer": "Polymer/polymer#^0.5.1",
"core-ajax": "Polymer/core-ajax#~0.5.2"
},
"devDependencies": {
"web-component-tester": "Polymer/web-component-tester#^2.0.0"
}
}
16 changes: 16 additions & 0 deletions demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>bacon-ipsum Demo</title>

<script src="../webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="bacon-ipsum.html">

</head>
<body unresolved>

<bacon-ipsum paragraphs="6"></bacon-ipsum>

</body>
</html>
15 changes: 15 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="../webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../core-component-page/core-component-page.html">

</head>
<body unresolved>

<core-component-page></core-component-page>

</body>
</html>
45 changes: 45 additions & 0 deletions test/bacon-ipsum-basic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>bacon-ipsum</title>

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

<!-- Step 1: import the element to test -->
<link rel="import" href="../bacon-ipsum.html">

</head>
<body>

<bacon-ipsum id="fixture"></bacon-ipsum>

<script>
var myEl = document.getElementById('fixture');

suite('<bacon-ipsum>', function() {

test('defines the "author" property', function() {
assert.equal(myEl.author, 'Dimitri Glazkov');
});

test('says hello', function() {
assert.equal(myEl.sayHello(), 'bacon-ipsum says, Hello World!');
var greetings = myEl.sayHello('greetings Earthlings');
assert.equal(greetings, 'bacon-ipsum says, greetings Earthlings');
});

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

});
</script>

</body>
</html>
21 changes: 21 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html>

<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>Core Elements Test Runner</title>
<meta charset="UTF-8">

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

<body>

<script>
WCT.loadSuites(['seed-element-basic.html']);
</script>

</body>

</html>

0 comments on commit 70c2509

Please sign in to comment.