added web interface (WIP)
This commit is contained in:
		
							
								
								
									
										41
									
								
								websrc/app/elements/elements.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								websrc/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">
 | 
			
		||||
 | 
			
		||||
<!-- 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="my-greeting/my-greeting.html">
 | 
			
		||||
<link rel="import" href="my-list/my-list.html">
 | 
			
		||||
							
								
								
									
										44
									
								
								websrc/app/elements/my-greeting/my-greeting.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								websrc/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
									
								
								websrc/app/elements/my-list/my-list.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								websrc/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>
 | 
			
		||||
							
								
								
									
										49
									
								
								websrc/app/elements/routing.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								websrc/app/elements/routing.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,49 @@
 | 
			
		||||
<!--
 | 
			
		||||
@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('/users', scrollToTop, function() {
 | 
			
		||||
      app.route = 'users';
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    page('/users/:name', scrollToTop, function(data) {
 | 
			
		||||
      app.route = 'user-info';
 | 
			
		||||
      app.params = data.params;
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    page('/contact', scrollToTop, function() {
 | 
			
		||||
      app.route = 'contact';
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    // add #! before urls
 | 
			
		||||
    page({
 | 
			
		||||
      hashbang: true
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
  });
 | 
			
		||||
</script>
 | 
			
		||||
		Reference in New Issue
	
	Block a user