Skip to content

Commit

Permalink
Commit integrated polymer 1.0, known problems see index.html vs appli…
Browse files Browse the repository at this point in the history
…cation.hbs
  • Loading branch information
peec committed Jun 17, 2015
1 parent 6fe2905 commit e24e257
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 6 deletions.
30 changes: 29 additions & 1 deletion Brocfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* global require, module */

var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var pickFiles = require('broccoli-static-compiler');
var mergeTrees = require('broccoli-merge-trees');
var vulcanize = require('broccoli-vulcanize');

var app = new EmberApp();

Expand All @@ -17,4 +20,29 @@ var app = new EmberApp();
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.

module.exports = app.toTree();

var inputTree = 'app';
var options = {
input: 'elements.html',
output: 'assets/vulcanized.html',
excludes: [/^data:/, /^http[s]?:/, /^\//],
abspath: '',
stripExcludes: false,
stripComments: false,
inlineScripts: true,
inlineCss: true,
implicitStrip: false
};

var polymer = pickFiles('bower_components/', {
srcDir: '',
files: [
'webcomponentsjs/webcomponents.js',
// 'polymer/polymer.html'
// 'polymer/polymer.js'
],
destDir: '/assets'
});

var polymerVulcanize = vulcanize(inputTree, options);
module.exports = mergeTrees([polymerVulcanize, polymer, app.toTree()]);
14 changes: 14 additions & 0 deletions app/elements.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Paper, Iron and Platinum elements -->
<link rel="import" href="../bower_components/paper-styles/paper-styles-classes.html">
<link rel="import" href="../bower_components/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="../bower_components/paper-drawer-panel/paper-drawer-panel.html">
<link rel="import" href="../bower_components/paper-header-panel/paper-header-panel.html">
<link rel="import" href="../bower_components/iron-icons/iron-icons.html">
<link rel="import" href="../bower_components/paper-toolbar/paper-toolbar.html">
<link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../bower_components/paper-menu/paper-menu.html">
<link rel="import" href="../bower_components/paper-material/paper-material.html">
<link rel="import" href="../bower_components/paper-item/paper-item.html">
<link rel="import" href="../bower_components/iron-selector/iron-selector.html">
<link rel="import" href="../bower_components/iron-pages/iron-pages.html">
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
14 changes: 13 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,25 @@
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for 'head'}}
<script src="assets/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="assets/vulcanized.html">

<link rel="stylesheet" href="assets/vendor.css">
<link rel="stylesheet" href="assets/ember-cli-polymer.css">

{{content-for 'head-footer'}}
</head>
<body>
<body class="fullbleed layout vertical">

<!-- Works. -->
<paper-header-panel class="flex">
<paper-toolbar>
<paper-icon-button icon="menu" on-tap="menuAction"></paper-icon-button>
<div class="title">Polymer</div>
</paper-toolbar>
</paper-header-panel>


{{content-for 'body'}}

<script src="assets/vendor.js"></script>
Expand Down
2 changes: 2 additions & 0 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ var Router = Ember.Router.extend({
});

Router.map(function() {
this.route('test');

});

export default Router;
11 changes: 10 additions & 1 deletion app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<h2 id="title">Welcome to Ember.js</h2>

<!-- Does not work. -->
<paper-header-panel class="flex">
<paper-toolbar>
<paper-icon-button icon="menu" on-tap="menuAction"></paper-icon-button>
<div class="title">Polymer</div>
</paper-toolbar>
</paper-header-panel>



{{outlet}}
9 changes: 7 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ember-cli-polymer",
"dependencies": {
"ember": "1.12.0",
"ember": "1.13.0",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "1.0.0-beta.18",
Expand All @@ -11,6 +11,11 @@
"ember-resolver": "~0.1.15",
"jquery": "^1.11.1",
"loader.js": "ember-cli/loader.js#3.2.0",
"qunit": "~1.17.1"
"qunit": "~1.17.1",
"polymer": "Polymer/polymer#^1.0.0",
"iron-elements": "PolymerElements/iron-elements#~1.0.0",
"paper-elements": "PolymerElements/paper-elements#~1.0.1",
"platinum-elements": "PolymerElements/platinum-elements#1.0.0",
"neon-elements": "PolymerElements/neon-elements#1.0.0"
}
}
10 changes: 10 additions & 0 deletions config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ module.exports = function(environment) {
APP: {
// Here you can pass flags/options to your application instance
// when it is created
},
contentSecurityPolicy: {
'default-src': "'none'",
'script-src': "'self' 'unsafe-inline' 'unsafe-eval'",
'font-src': "'self' http://fonts.gstatic.com",
'connect-src': "'self' 127.0.0.1",
'img-src': "'self' https://avatars.githubusercontent.com",
'report-uri':"'localhost'",
'style-src': "'self' 'unsafe-inline' http://fonts.googleapis.com",
'frame-src': "'none'"
}
};

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
"ember-cli-uglify": "^1.0.1",
"ember-data": "1.0.0-beta.18",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.2"
"ember-export-application-global": "^1.0.2",
"broccoli-merge-trees": "^0.2.1",
"broccoli-static-compiler": "^0.2.1",
"broccoli-vulcanize": "^2.0.2"
}
}

0 comments on commit e24e257

Please sign in to comment.