gradle module and build
4
webapp/app/cache-config.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"README": "This is the cache config for the dev server. The service worker cache is disabled, and it is recommended that you leave this as-is. In the dist environment, this file will be auto-generated based on the contents of your dist/ directory.",
|
||||
"disabled": true
|
||||
}
|
41
webapp/app/elements/elements.html
Normal file
@ -0,0 +1,41 @@
|
||||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<!-- Iron elements -->
|
||||
<link rel="import" href="../bower_components/iron-flex-layout/classes/iron-flex-layout.html">
|
||||
<link rel="import" href="../bower_components/iron-icons/iron-icons.html">
|
||||
<link rel="import" href="../bower_components/iron-pages/iron-pages.html">
|
||||
<link rel="import" href="../bower_components/iron-selector/iron-selector.html">
|
||||
<link rel="import" href="../bower_components/iron-localstorage/iron-localstorage.html">
|
||||
|
||||
<!-- Paper elements -->
|
||||
<link rel="import" href="../bower_components/paper-drawer-panel/paper-drawer-panel.html">
|
||||
<link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html">
|
||||
<link rel="import" href="../bower_components/paper-item/paper-item.html">
|
||||
<link rel="import" href="../bower_components/paper-material/paper-material.html">
|
||||
<link rel="import" href="../bower_components/paper-menu/paper-menu.html">
|
||||
<link rel="import" href="../bower_components/paper-scroll-header-panel/paper-scroll-header-panel.html">
|
||||
<link rel="import" href="../bower_components/paper-styles/paper-styles-classes.html">
|
||||
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
|
||||
<link rel="import" href="../bower_components/paper-toolbar/paper-toolbar.html">
|
||||
|
||||
<!-- Uncomment next block to enable Service Worker Support (2/2) -->
|
||||
<!--
|
||||
<link rel="import" href="../bower_components/platinum-sw/platinum-sw-cache.html">
|
||||
<link rel="import" href="../bower_components/platinum-sw/platinum-sw-register.html">
|
||||
-->
|
||||
|
||||
<!-- Configure your routes here -->
|
||||
<link rel="import" href="routing.html">
|
||||
|
||||
<!-- Add your elements here -->
|
||||
<link rel="import" href="../styles/app-theme.html">
|
||||
<link rel="import" href="../styles/shared-styles.html">
|
||||
<link rel="import" href="message-list/message-list.html">
|
78
webapp/app/elements/message-list/message-list.html
Normal file
@ -0,0 +1,78 @@
|
||||
<!--
|
||||
@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
|
||||
-->
|
||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||
<link rel="import" href="../../bower_components/paper-material/paper-material.html">
|
||||
<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
|
||||
|
||||
<dom-module id="message-list">
|
||||
<template>
|
||||
<link rel="import" href="../../styles/app-theme.html">
|
||||
<style include="shared-styles"></style>
|
||||
<style>
|
||||
.received {
|
||||
float: right;
|
||||
font-size: 60%;
|
||||
}
|
||||
.paper-font-body2 {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
<iron-ajax
|
||||
auto
|
||||
url="{{getUrl(server, address)}}"
|
||||
handle-as="json"
|
||||
last-response="{{broadcasts}}"
|
||||
debounce-duration="300"></iron-ajax>
|
||||
<template is="dom-repeat" items="{{broadcasts.messages}}">
|
||||
<paper-material elevation="1">
|
||||
<h1>{{item.subject}}<span class="received">{{toDate(item.received)}}</span></h1>
|
||||
|
||||
<p class="paper-font-body2">{{item.body}}</p>
|
||||
</paper-material>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
Polymer({
|
||||
is: 'message-list',
|
||||
|
||||
properties: {
|
||||
address: {
|
||||
type: String,
|
||||
value: 'BM-2D9QKN4teYRvoq2fyzpiftPh9WP9qggtzh',
|
||||
notify: true
|
||||
},
|
||||
broadcasts: {
|
||||
type: Object,
|
||||
notify: true
|
||||
},
|
||||
server: {
|
||||
type: String,
|
||||
value: 'http://localhost:8080',
|
||||
notify: true
|
||||
}
|
||||
},
|
||||
|
||||
toDate: function(timestamp) {
|
||||
return new Date(timestamp * 1000).toLocaleString();
|
||||
},
|
||||
getUrl: function(server, address) {
|
||||
return server + '/read/' + address;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
</script>
|
||||
|
||||
</dom-module>
|
44
webapp/app/elements/my-greeting/my-greeting.html
Normal file
@ -0,0 +1,44 @@
|
||||
<!--
|
||||
@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
|
||||
-->
|
||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||
|
||||
<dom-module id="my-greeting">
|
||||
<template>
|
||||
<style include="shared-styles"></style>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<h2 class="page-title"><span>{{greeting}}</span></h2>
|
||||
<span class="paper-font-body2">Update text to change the greeting.</span>
|
||||
<!-- Listens for "input" event and sets greeting to <input>.value -->
|
||||
<input class="paper-font-body2" value="{{greeting::input}}">
|
||||
</template>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
Polymer({
|
||||
is: 'my-greeting',
|
||||
|
||||
properties: {
|
||||
greeting: {
|
||||
type: String,
|
||||
value: 'Welcome!',
|
||||
notify: true
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
</dom-module>
|
52
webapp/app/elements/my-list/my-list.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!--
|
||||
@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
|
||||
-->
|
||||
<link rel="import" href="../../bower_components/polymer/polymer.html">
|
||||
|
||||
<dom-module id="my-list">
|
||||
<template>
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
<ul>
|
||||
<template is="dom-repeat" items="{{items}}">
|
||||
<li><span class="paper-font-body1">{{item}}</span></li>
|
||||
</template>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
Polymer({
|
||||
is: 'my-list',
|
||||
properties: {
|
||||
items: {
|
||||
type: Array,
|
||||
notify: true,
|
||||
}
|
||||
},
|
||||
ready: function() {
|
||||
this.items = [
|
||||
'Responsive Web App boilerplate',
|
||||
'Iron Elements and Paper Elements',
|
||||
'End-to-end Build Tooling (including Vulcanize)',
|
||||
'Unit testing with Web Component Tester',
|
||||
'Routing with Page.js',
|
||||
'Offline support with the Platinum Service Worker Elements'
|
||||
];
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
</dom-module>
|
45
webapp/app/elements/routing.html
Normal file
@ -0,0 +1,45 @@
|
||||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<script src="../bower_components/page/page.js"></script>
|
||||
<script>
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
|
||||
// We use Page.js for routing. This is a Micro
|
||||
// client-side router inspired by the Express router
|
||||
// More info: https://visionmedia.github.io/page.js/
|
||||
|
||||
// Middleware
|
||||
function scrollToTop(ctx, next) {
|
||||
app.scrollPageToTop();
|
||||
next();
|
||||
}
|
||||
|
||||
// Routes
|
||||
page('/', scrollToTop, function() {
|
||||
app.route = 'home';
|
||||
});
|
||||
|
||||
page('/read', scrollToTop, function() {
|
||||
app.route = 'home';
|
||||
});
|
||||
|
||||
page('/read/:address', scrollToTop, function(data) {
|
||||
app.route = 'message-list';
|
||||
app.params = data.params;
|
||||
});
|
||||
|
||||
// add #! before urls
|
||||
page({
|
||||
hashbang: true
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
BIN
webapp/app/favicon.ico
Normal file
After Width: | Height: | Size: 611 B |
BIN
webapp/app/images/touch/apple-touch-icon.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
webapp/app/images/touch/chrome-splashscreen-icon-384x384.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
webapp/app/images/touch/chrome-touch-icon-192x192.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
webapp/app/images/touch/icon-128x128.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
webapp/app/images/touch/ms-icon-144x144.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
webapp/app/images/touch/ms-touch-icon-144x144-precomposed.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
145
webapp/app/index.html
Normal file
@ -0,0 +1,145 @@
|
||||
<!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 lang="">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="generator" content="Polymer Starter Kit" />
|
||||
<title>Bitmessage Broadcasts</title>
|
||||
<!-- Place favicon.ico in the `app/` directory -->
|
||||
|
||||
<!-- Chrome for Android theme color -->
|
||||
<meta name="theme-color" content="#2E3AA1">
|
||||
|
||||
<!-- Web Application Manifest -->
|
||||
<link rel="manifest" href="manifest.json">
|
||||
|
||||
<!-- Tile color for Win8 -->
|
||||
<meta name="msapplication-TileColor" content="#3372DF">
|
||||
|
||||
<!-- Add to homescreen for Chrome on Android -->
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="application-name" content="PSK">
|
||||
<link rel="icon" sizes="192x192" href="images/touch/chrome-touch-icon-192x192.png">
|
||||
|
||||
<!-- Add to homescreen for Safari on iOS -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="apple-mobile-web-app-title" content="Polymer Starter Kit">
|
||||
<link rel="apple-touch-icon" href="images/touch/apple-touch-icon.png">
|
||||
|
||||
<!-- Tile icon for Win8 (144x144) -->
|
||||
<meta name="msapplication-TileImage" content="images/touch/ms-touch-icon-144x144-precomposed.png">
|
||||
|
||||
<!-- build:css styles/main.css -->
|
||||
<link rel="stylesheet" href="styles/main.css">
|
||||
<!-- endbuild-->
|
||||
|
||||
<!-- build:js bower_components/webcomponentsjs/webcomponents-lite.min.js -->
|
||||
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<!-- endbuild -->
|
||||
|
||||
<!-- will be replaced with elements/elements.vulcanized.html -->
|
||||
<link rel="import" href="elements/elements.html">
|
||||
<!-- endreplace-->
|
||||
|
||||
<!-- For shared styles, shared-styles.html import in elements.html -->
|
||||
<style is="custom-style" include="shared-styles"></style>
|
||||
|
||||
</head>
|
||||
|
||||
<body unresolved class="fullbleed layout vertical">
|
||||
<span id="browser-sync-binding"></span>
|
||||
<template is="dom-bind" id="app">
|
||||
|
||||
<paper-drawer-panel id="paperDrawerPanel">
|
||||
<!-- Drawer Scroll Header Panel -->
|
||||
<paper-scroll-header-panel drawer fixed>
|
||||
|
||||
<!-- Drawer Toolbar -->
|
||||
<paper-toolbar id="drawerToolbar">
|
||||
<span class="paper-font-title">Menu</span>
|
||||
</paper-toolbar>
|
||||
|
||||
<!-- Drawer Content -->
|
||||
<paper-menu class="list" attr-for-selected="data-route" selected="[[route]]">
|
||||
<a data-route="home" href="/" on-click="onDataRouteClick">
|
||||
<iron-icon icon="home"></iron-icon>
|
||||
<span>Home</span>
|
||||
</a>
|
||||
|
||||
<iron-localstorage name="my-broadcasts"
|
||||
value="{{broadcasts}}"
|
||||
on-iron-localstorage-load-empty="initializeExamples"></iron-localstorage>
|
||||
<template is="dom-repeat" items="{{broadcasts}}">
|
||||
<a data-route="{{join('message-list/',index)}}" href="{{join('/read/',item.address)}}" on-click="onDataRouteClick">
|
||||
<iron-icon icon="mail"></iron-icon>
|
||||
<span>{{item.alias}}</span>
|
||||
</a>
|
||||
</template>
|
||||
|
||||
</paper-menu>
|
||||
</paper-scroll-header-panel>
|
||||
|
||||
<!-- Main Area -->
|
||||
<paper-scroll-header-panel main condenses keep-condensed-header>
|
||||
|
||||
<!-- Main Toolbar -->
|
||||
<paper-toolbar id="mainToolbar" class="tall">
|
||||
<paper-icon-button id="paperToggle" icon="menu" paper-drawer-toggle></paper-icon-button>
|
||||
<span class="flex"></span>
|
||||
|
||||
<!-- Toolbar icons -->
|
||||
<paper-icon-button icon="refresh"></paper-icon-button>
|
||||
<paper-icon-button icon="search"></paper-icon-button>
|
||||
|
||||
<!-- Application name -->
|
||||
<div class="middle middle-container center horizontal layout">
|
||||
<div class="app-name">Bitmessage Broadcasts</div>
|
||||
</div>
|
||||
|
||||
<!-- Application sub title -->
|
||||
<div class="bottom bottom-container center horizontal layout">
|
||||
<div class="bottom-title paper-font-subhead">Please don't abuse.</div>
|
||||
</div>
|
||||
|
||||
</paper-toolbar>
|
||||
|
||||
<!-- Main Content -->
|
||||
<div class="content">
|
||||
<iron-pages attr-for-selected="data-route" selected="{{route}}">
|
||||
|
||||
<section data-route="home">
|
||||
<paper-material elevation="1">
|
||||
<h1>Welcome.</h1>
|
||||
</paper-material>
|
||||
</section>
|
||||
|
||||
<section data-route="message-list">
|
||||
<message-list address="{{params.address}}"></message-list>
|
||||
</section>
|
||||
|
||||
</iron-pages>
|
||||
</div>
|
||||
</paper-scroll-header-panel>
|
||||
</paper-drawer-panel>
|
||||
|
||||
</template>
|
||||
|
||||
<!-- build:js scripts/app.js -->
|
||||
<script src="scripts/app.js"></script>
|
||||
<!-- endbuild-->
|
||||
</body>
|
||||
|
||||
</html>
|
29
webapp/app/manifest.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "Polymer Starter Kit",
|
||||
"short_name": "Polymer Starter Kit",
|
||||
"icons": [{
|
||||
"src": "images/touch/icon-128x128.png",
|
||||
"sizes": "128x128",
|
||||
"type": "image/png"
|
||||
}, {
|
||||
"src": "images/touch/apple-touch-icon.png",
|
||||
"sizes": "152x152",
|
||||
"type": "image/png"
|
||||
}, {
|
||||
"src": "images/touch/ms-touch-icon-144x144-precomposed.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image/png"
|
||||
}, {
|
||||
"src": "images/touch/chrome-touch-icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},{
|
||||
"src": "images/touch/chrome-splashscreen-icon-384x384.png",
|
||||
"sizes": "384x384",
|
||||
"type": "image/png"
|
||||
}],
|
||||
"start_url": "/?homescreen=1",
|
||||
"background_color": "#3E4EB8",
|
||||
"display": "standalone",
|
||||
"theme_color": "#2E3AA1"
|
||||
}
|
4
webapp/app/robots.txt
Normal file
@ -0,0 +1,4 @@
|
||||
# www.robotstxt.org
|
||||
|
||||
User-agent: *
|
||||
Disallow:
|
105
webapp/app/scripts/app.js
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
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
|
||||
*/
|
||||
|
||||
(function(document) {
|
||||
'use strict';
|
||||
|
||||
// Grab a reference to our auto-binding template
|
||||
// and give it some initial binding values
|
||||
// Learn more about auto-binding templates at http://goo.gl/Dx1u2g
|
||||
var app = document.querySelector('#app');
|
||||
|
||||
app.join = function() {
|
||||
var index = 0;
|
||||
var result = '';
|
||||
for (index = 0; index < arguments.length; index++) {
|
||||
result += arguments[index];
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
app.displayInstalledToast = function() {
|
||||
// Check to make sure caching is actually enabled—it won't be in the dev environment.
|
||||
if (!document.querySelector('platinum-sw-cache').disabled) {
|
||||
document.querySelector('#caching-complete').show();
|
||||
}
|
||||
};
|
||||
|
||||
// Listen for template bound event to know when bindings
|
||||
// have resolved and content has been stamped to the page
|
||||
app.addEventListener('dom-change', function() {
|
||||
console.log('Our app is ready to rock!');
|
||||
});
|
||||
|
||||
// See https://github.com/Polymer/polymer/issues/1381
|
||||
window.addEventListener('WebComponentsReady', function() {
|
||||
// imports are loaded and elements have been registered
|
||||
});
|
||||
|
||||
// Main area's paper-scroll-header-panel custom condensing transformation of
|
||||
// the appName in the middle-container and the bottom title in the bottom-container.
|
||||
// The appName is moved to top and shrunk on condensing. The bottom sub title
|
||||
// is shrunk to nothing on condensing.
|
||||
addEventListener('paper-header-transform', function(e) {
|
||||
var appName = document.querySelector('#mainToolbar .app-name');
|
||||
var middleContainer = document.querySelector('#mainToolbar .middle-container');
|
||||
var bottomContainer = document.querySelector('#mainToolbar .bottom-container');
|
||||
var detail = e.detail;
|
||||
var heightDiff = detail.height - detail.condensedHeight;
|
||||
var yRatio = Math.min(1, detail.y / heightDiff);
|
||||
var maxMiddleScale = 0.50; // appName max size when condensed. The smaller the number the smaller the condensed size.
|
||||
var scaleMiddle = Math.max(maxMiddleScale, (heightDiff - detail.y) / (heightDiff / (1-maxMiddleScale)) + maxMiddleScale);
|
||||
var scaleBottom = 1 - yRatio;
|
||||
|
||||
// Move/translate middleContainer
|
||||
Polymer.Base.transform('translate3d(0,' + yRatio * 100 + '%,0)', middleContainer);
|
||||
|
||||
// Scale bottomContainer and bottom sub title to nothing and back
|
||||
Polymer.Base.transform('scale(' + scaleBottom + ') translateZ(0)', bottomContainer);
|
||||
|
||||
// Scale middleContainer appName
|
||||
Polymer.Base.transform('scale(' + scaleMiddle + ') translateZ(0)', appName);
|
||||
});
|
||||
|
||||
// Close drawer after menu item is selected if drawerPanel is narrow
|
||||
app.onDataRouteClick = function() {
|
||||
var drawerPanel = document.querySelector('#paperDrawerPanel');
|
||||
if (drawerPanel.narrow) {
|
||||
drawerPanel.closeDrawer();
|
||||
}
|
||||
};
|
||||
|
||||
// Scroll page to top and expand header
|
||||
app.scrollPageToTop = function() {
|
||||
document.getElementById('mainContainer').scrollTop = 0;
|
||||
};
|
||||
|
||||
app.initializeExamples = function() {
|
||||
this.value = [
|
||||
{
|
||||
alias: 'General',
|
||||
address: 'BM-2cToDNkgW4KN92vuEjgnT1To3WEyt4r3DK'
|
||||
},
|
||||
{
|
||||
alias: 'DevTalk',
|
||||
address: 'BM-2D9QKN4teYRvoq2fyzpiftPh9WP9qggtzh'
|
||||
},
|
||||
{
|
||||
alias: 'Timeservice',
|
||||
address: 'BM-BcbRqcFFSQUUmXFKsPJgVQPSiFA3Xash'
|
||||
},
|
||||
{
|
||||
alias: 'Q\'s Aktivlist',
|
||||
address: 'BM-GtT7NLCCAu3HrT7dNTUTY9iDns92Z2ND'
|
||||
}
|
||||
];
|
||||
console.log(this.value);
|
||||
};
|
||||
|
||||
})(document);
|
170
webapp/app/styles/app-theme.html
Normal file
@ -0,0 +1,170 @@
|
||||
<!-- Palette generated by Material Palette - materialpalette.com/amber/blue-grey -->
|
||||
<!-- Replace the one that comes in their starter kit -->
|
||||
<!--
|
||||
@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
|
||||
-->
|
||||
|
||||
<style is="custom-style">
|
||||
|
||||
/*
|
||||
Polymer includes a shim for CSS Custom Properties that we can use for application theming.
|
||||
Below, you'll find the default palette for the Polymer Starter Kit layout. Feel free to play
|
||||
with changing the colors used or generate your own palette of colours at MaterialPalette.com.
|
||||
|
||||
See https://www.polymer-project.org/1.0/docs/devguide/styling.html#xscope-styling-details
|
||||
for further information on custom CSS properties.
|
||||
*/
|
||||
|
||||
/* Application theme */
|
||||
|
||||
:root {
|
||||
--dark-primary-color: #FFA000;
|
||||
--default-primary-color: #FFC107;
|
||||
--light-primary-color: #FFECB3;
|
||||
--text-primary-color: #FFFFFF;
|
||||
--accent-color: #607D8B;
|
||||
--primary-background-color: #FFECB3;
|
||||
--primary-text-color: #212121;
|
||||
--secondary-text-color: #727272;
|
||||
--disabled-text-color: #BDBDBD;
|
||||
--divider-color: #B6B6B6;
|
||||
|
||||
|
||||
/* Components */
|
||||
|
||||
/* paper-drawer-panel */
|
||||
--drawer-menu-color: #ffffff;
|
||||
--drawer-border-color: 1px solid #ccc;
|
||||
--drawer-toolbar-border-color: 1px solid rgba(0, 0, 0, 0.22);
|
||||
|
||||
/* paper-menu */
|
||||
--paper-menu-background-color: #fff;
|
||||
--menu-link-color: #111111;
|
||||
|
||||
/* paper-input */
|
||||
--paper-input-container-color: rgba(255, 255, 255, 0.64);
|
||||
--paper-input-container-focus-color: rgba(255, 255, 255, 1);
|
||||
--paper-input-container-input-color: #fff;
|
||||
}
|
||||
|
||||
/* General styles */
|
||||
|
||||
#drawerToolbar {
|
||||
color: var(--secondary-text-color);
|
||||
background-color: var(--drawer-menu-color);
|
||||
border-bottom: var(--drawer-toolbar-border-color);
|
||||
}
|
||||
|
||||
paper-scroll-header-panel {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
paper-menu iron-icon {
|
||||
margin-right: 33px;
|
||||
opacity: 0.54;
|
||||
}
|
||||
|
||||
.paper-menu > .iron-selected {
|
||||
color: var(--default-primary-color);
|
||||
}
|
||||
|
||||
paper-menu a {
|
||||
text-decoration: none;
|
||||
color: var(--menu-link-color);
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-ms-flex-direction: row;
|
||||
-webkit-flex-direction: row;
|
||||
flex-direction: row;
|
||||
-ms-flex-align: center;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
font-family: 'Roboto', 'Noto', sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-rendering: optimizeLegibility;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 24px;
|
||||
min-height: 48px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
paper-toolbar.tall .app-name {
|
||||
font-size: 40px;
|
||||
font-weight: 300;
|
||||
/* Required for main area's paper-scroll-header-panel custom condensing transformation */
|
||||
-webkit-transform-origin: left center;
|
||||
transform-origin: left center;
|
||||
}
|
||||
|
||||
#mainToolbar .middle-container {
|
||||
height: 100%;
|
||||
margin-left: 48px;
|
||||
}
|
||||
|
||||
#mainToolbar:not(.tall) .middle {
|
||||
font-size: 18px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
#mainToolbar .bottom {
|
||||
margin-left: 48px;
|
||||
/* Required for main area's paper-scroll-header-panel custom condensing transformation */
|
||||
-webkit-transform-origin: left center;
|
||||
transform-origin: left center;
|
||||
}
|
||||
|
||||
/* Height of the scroll area */
|
||||
.content {
|
||||
height: 900px;
|
||||
}
|
||||
|
||||
/* Material Design Adaptive Breakpoints */
|
||||
/*
|
||||
Below you'll find CSS media queries based on the breakpoint guidance
|
||||
published by the Material Design team. You can choose to use, customise
|
||||
or remove these breakpoints based on your needs.
|
||||
|
||||
http://www.google.com/design/spec/layout/adaptive-ui.html#adaptive-ui-breakpoints
|
||||
*/
|
||||
|
||||
/* mobile-small */
|
||||
@media all and (min-width: 0) and (max-width: 360px) and (orientation: portrait) { }
|
||||
/* mobile-large */
|
||||
@media all and (min-width: 361px) and (orientation: portrait) { }
|
||||
/* mobile-small-landscape */
|
||||
@media all and (min-width: 0) and (max-width: 480px) and (orientation: landscape) { }
|
||||
/* mobile-large-landscape */
|
||||
@media all and (min-width: 481px) and (orientation: landscape) { }
|
||||
/* tablet-small-landscape */
|
||||
@media all and (min-width: 600px) and (max-width: 960px) and (orientation: landscape) { }
|
||||
/* tablet-large-landscape */
|
||||
@media all and (min-width: 961px) and (orientation: landscape) { }
|
||||
/* tablet-small */
|
||||
@media all and (min-width: 600px) and (orientation: portrait) { }
|
||||
/* tablet-large */
|
||||
@media all and (min-width: 601px) and (max-width: 840px) and (orientation : portrait) { }
|
||||
/* desktop-x-small-landscape */
|
||||
@media all and (min-width: 0) and (max-width: 480px) and (orientation: landscape) { }
|
||||
/* desktop-x-small */
|
||||
@media all and (min-width: 0) and (max-width: 480px) and (max-aspect-ratio: 4/3) { }
|
||||
/* desktop-small-landscape */
|
||||
@media all and (min-width: 481px) and (max-width: 840px) and (orientation: landscape) { }
|
||||
/* desktop-small */
|
||||
@media all and (min-width: 481px) and (max-width: 840px) and (max-aspect-ratio: 4/3) { }
|
||||
/* desktop-medium-landscape */
|
||||
@media all and (min-width: 841px) and (max-width: 1280px) and (orientation: landscape) { }
|
||||
/* desktop-medium */
|
||||
@media all and (min-width: 841px) and (max-width: 1280px) and (max-aspect-ratio: 4/3) { }
|
||||
/* desktop-large */
|
||||
@media all and (min-width: 1281px) and (max-width: 1600px) { }
|
||||
/* desktop-xlarge */
|
||||
@media all and (min-width: 1601px) and (max-width: 1920px) { }
|
||||
</style>
|
14
webapp/app/styles/main.css
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
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
|
||||
*/
|
||||
|
||||
body {
|
||||
background: #fafafa;
|
||||
font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
color: #333;
|
||||
}
|
76
webapp/app/styles/shared-styles.html
Normal file
@ -0,0 +1,76 @@
|
||||
<!-- shared styles for all elements and index.html -->
|
||||
<dom-module id="shared-styles">
|
||||
<template>
|
||||
<style>
|
||||
.page-title {
|
||||
@apply(--paper-font-display2);
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.page-title {
|
||||
font-size: 24px!important;
|
||||
}
|
||||
}
|
||||
|
||||
paper-material {
|
||||
border-radius: 2px;
|
||||
height: 100%;
|
||||
padding: 16px 0 16px 0;
|
||||
width: calc(98.66% - 16px);
|
||||
margin: 16px auto;
|
||||
background: white;
|
||||
}
|
||||
|
||||
/* Breakpoints */
|
||||
|
||||
/* Small */
|
||||
@media (max-width: 600px) {
|
||||
|
||||
paper-material {
|
||||
--menu-container-display: none;
|
||||
width: calc(97.33% - 32px);
|
||||
padding-left: 16px;
|
||||
padding-right: 16px;
|
||||
}
|
||||
|
||||
paper-toolbar.tall .app-name {
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
#drawer .paper-toolbar {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
#overlay {
|
||||
min-width: 360px;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background: white;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Tablet+ */
|
||||
@media (min-width: 601px) {
|
||||
|
||||
paper-material {
|
||||
width: calc(98% - 46px);
|
||||
margin-bottom: 32px;
|
||||
padding-left: 30px;
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
#drawer.paper-drawer-panel > [drawer] {
|
||||
border-right: 1px solid rgba(0, 0, 0, 0.14);
|
||||
}
|
||||
|
||||
iron-pages {
|
||||
padding: 48px 62px;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
</template>
|
||||
</dom-module>
|
10
webapp/app/sw-import.js
Normal file
@ -0,0 +1,10 @@
|
||||
/*
|
||||
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
|
||||
*/
|
||||
|
||||
importScripts('bower_components/platinum-sw/service-worker.js');
|
32
webapp/app/test/index.html
Normal file
@ -0,0 +1,32 @@
|
||||
<!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 name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Elements Test Runner</title>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script src="../../bower_components/webcomponentsjs/webcomponents.min.js"></script>
|
||||
<script src="../../bower_components/web-component-tester/browser.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script>
|
||||
WCT.loadSuites(['my-greeting-basic.html', 'my-list-basic.html']);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
52
webapp/app/test/my-greeting-basic.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!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 name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>my-greeting-basic</title>
|
||||
|
||||
<script src="../../bower_components/webcomponentsjs/webcomponents.min.js"></script>
|
||||
<script src="../../bower_components/web-component-tester/browser.js"></script>
|
||||
<script src="../../bower_components/test-fixture/test-fixture-mocha.js"></script>
|
||||
<link rel="import" href="../../bower_components/test-fixture/test-fixture.html">
|
||||
|
||||
<!-- Import the element to test -->
|
||||
<link rel="import" href="../elements/my-greeting/my-greeting.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<my-greeting></my-greeting>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
suite('my-greeting tests', function() {
|
||||
var greeting, header;
|
||||
|
||||
setup(function() {
|
||||
greeting = fixture('basic');
|
||||
});
|
||||
|
||||
test('Welcome!', function() {
|
||||
header = greeting.querySelector('h2');
|
||||
assert.equal(header.textContent, 'Welcome!');
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
67
webapp/app/test/my-list-basic.html
Normal file
@ -0,0 +1,67 @@
|
||||
<!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 name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>my-list-basic</title>
|
||||
|
||||
<script src="../../bower_components/webcomponentsjs/webcomponents.min.js"></script>
|
||||
<script src="../../bower_components/web-component-tester/browser.js"></script>
|
||||
<script src="../../bower_components/test-fixture/test-fixture-mocha.js"></script>
|
||||
<link rel="import" href="../../bower_components/test-fixture/test-fixture.html">
|
||||
|
||||
<!-- Import the element to test -->
|
||||
<link rel="import" href="../elements/my-list/my-list.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<my-list></my-list>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('my-list tests', function() {
|
||||
var list, listItems;
|
||||
|
||||
setup(function() {
|
||||
list = fixture('basic');
|
||||
});
|
||||
|
||||
test('Item lengths should be equalled', function(done) {
|
||||
// Test a property
|
||||
// TODO: Fix list.items.push('Foo') causing a WeakMap exception
|
||||
// Invalid value used as weak map key
|
||||
list.items = [
|
||||
'Responsive Web App boilerplate',
|
||||
'Iron Elements and Paper Elements',
|
||||
'End-to-end Build Tooling (including Vulcanize)',
|
||||
'Unit testing with Web Component Tester',
|
||||
'Routing with Page.js',
|
||||
'Offline support with the Platinum Service Worker Elements'
|
||||
];
|
||||
|
||||
// Data bindings will stamp out new DOM asynchronously
|
||||
// so wait to check for updates
|
||||
flush(function() {
|
||||
listItems = list.querySelectorAll('li');
|
||||
assert.equal(list.items.length, listItems.length);
|
||||
done();
|
||||
});
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|