Skip to content

Commit

Permalink
auto-converted by polymer-modulizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliott Marquez committed Jun 23, 2018
1 parent 530cddb commit e92c8ea
Show file tree
Hide file tree
Showing 22 changed files with 741 additions and 719 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
bower_components*
bower-1.x.json

node_modules
17 changes: 6 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@ node_js: '9'
addons:
firefox: latest
chrome: stable
before_script:
- npm install -g polymer-cli
- polymer install --variants
before_script: npm install -g polymer-cli
script:
- xvfb-run polymer test
- >-
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test -s 'default';
fi
- xvfb-run polymer test --module-resolution=node --npm
- 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test --module-resolution=node --npm -s ''default''; fi'
env:
global:
- secure: >-
ePo0qYMYIoL/NaxC1hUPaHdjjNoQKzfHtJeo9GcgBI4dN7IT4N2W6soMdWFWLFD7e9grlUYHVpeo809BIyI4J+b7Iqds+0cqD6aFYOaOMARmLYG3dwZK0GlGxiziiPFPbAPL98T0ruvdLoFD+drtILqS1voMnAwnDhoRyUOIXoTuTWful30Kh8lpc0NaMn+S2mT8oNYXxb8aQo04pFxSV4r0fafaKH2B5LB4nmDpzBfcVnhqFGVMUhaACFo5lB1z39BtcXU7bn1HUTOG0s7QzM/Ugz5qd8QXf8vcFE0MAHc1zdxGwSPT+1+jzfoVhWPkAhBaT7ygh4G0MEBqGz+bdk+pgAaB2TSkhxsZQoI4BPcmCd7hDyFpyCqEz8slmdzS1G7cZKgtAWrXcyGgnmeaMSxjAcNqi/5vv8Z1Ni+A43y8f1S5/V5H/D/2f4C2bih3stoZLsgVQVKlDMsX8eDE3G6HwEEJZQedVlVlN6267y8fkedwpjYSCNduAQmpNR+B1/D35b1squcD0R9/HxQMCI7LmvoW4tmvGcAnF4vDX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sxOwrOqNdcGNpTMOhGNZ6ulFt9UQzSChg=
cache:
directories:
- node_modules

18 changes: 6 additions & 12 deletions app-localize-behavior.html → app-localize-behavior.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<!--
/**
@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">
<link rel="import" href="../iron-ajax/iron-ajax.html">
<script src="../intl-messageformat/dist/intl-messageformat.min.js"></script>
*/
import '@polymer/polymer/polymer-legacy.js';

<script>
(function() {
import '@polymer/iron-ajax/iron-ajax.js';
import 'intl-messageformat/dist/intl-messageformat.min.js';

// This isn't a complete `Object.assign` polyfill, but this element expects
// JSON and doesn't provide more than one source object.
Expand Down Expand Up @@ -133,7 +130,7 @@
* @demo demo/index.html
* @polymerBehavior Polymer.AppLocalizeBehavior
*/
Polymer.AppLocalizeBehavior = {
export const AppLocalizeBehavior = {
/**
* Internal singleton cache. This is the private implementation of the
* behaviour; don't interact with it directly.
Expand Down Expand Up @@ -344,6 +341,3 @@
}
}
};

})();
</script>
62 changes: 0 additions & 62 deletions bower.json

This file was deleted.

42 changes: 26 additions & 16 deletions demo/common-styles.html → demo/common-styles.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
<!--
@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
-->
import '@polymer/polymer/polymer-legacy.js';
import '@polymer/paper-styles/shadow.js';
import '@polymer/paper-styles/typography.js';
import '@polymer/iron-demo-helpers/demo-snippet.js';
const $_documentContainer = document.createElement('template');
$_documentContainer.setAttribute('style', 'display: none;');

<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../../paper-styles/shadow.html">
<link rel="import" href="../../paper-styles/typography.html">
<link rel="import" href="../../iron-demo-helpers/demo-snippet.html">

<dom-module id="common-styles">
$_documentContainer.innerHTML = `<dom-module id="common-styles">
<template>
<style include="demo-snippet">
:host {
Expand Down Expand Up @@ -47,4 +39,22 @@
}
</style>
</template>
</dom-module>
</dom-module>`;

document.head.appendChild($_documentContainer.content);

/**
@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
*/
/*
FIXME(polymer-modulizer): the above comments were extracted
from HTML and may be out of place here. Review them and
then delete this comment!
*/
;
14 changes: 7 additions & 7 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">

<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../../paper-styles/typography.html">
<link rel="import" href="x-translate.html">
<link rel="import" href="x-local-translate.html">
<script src="../../../@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script type="module" src="../../paper-styles/typography.js"></script>
<script type="module" src="./x-translate.js"></script>
<script type="module" src="./x-local-translate.js"></script>

<!-- Intl polyfill -->
<script src="../../intl/dist/Intl.min.js"></script>
<script src="../../intl/locale-data/jsonp/en.js"></script>
<script src="../../intl/locale-data/jsonp/fr.js"></script>
<script src="../../../intl/dist/Intl.min.js"></script>
<script src="../../../intl/locale-data/jsonp/en.js"></script>
<script src="../../../intl/locale-data/jsonp/fr.js"></script>
</head>

<body unresolved>
Expand Down
84 changes: 0 additions & 84 deletions demo/x-local-translate.html

This file was deleted.

81 changes: 81 additions & 0 deletions demo/x-local-translate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/**
@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
*/
import '@polymer/polymer/polymer-legacy.js';

import '@polymer/paper-toggle-button/paper-toggle-button.js';
import { AppLocalizeBehavior } from '../app-localize-behavior.js';
import './common-styles.js';
import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js';
import { html } from '@polymer/polymer/lib/utils/html-tag.js';
Polymer({
_template: html`
<style include="common-styles"></style>
<div class="lang">
<span title="english">🇬🇧 EN</span>
<paper-toggle-button on-change="_toggle" id="switch"></paper-toggle-button>
<span title="french">FR 🇫🇷</span>
</div>
<h4>This demo's resources are loaded statically, not from an external file.</h4>
<div class="snippet">
<div class="demo">
<div>{{localize('greeting')}}</div>
</div>
<div class="code-container">
<code>localize('greeting')</code>
</div>
</div>
`,

is: "x-local-translate",

behaviors: [
AppLocalizeBehavior
],

properties: {
/* Overriden from AppLocalizeBehavior */
language: {
value: 'en',
type: String
},

/* Overriden from AppLocalizeBehavior */
formats: {
type: Object,
value: function() {
return {
number: { USD: { style: 'currency', currency: 'USD' } }
};
}
},

/* Overriden from AppLocalizeBehavior */
resources: {
type: Object,
value: function() {
return {
'en': {
'greeting': 'Hello!'
},
'fr' : {
'greeting': 'Bonjour!'
}
};
}
}
},

_toggle: function() {
this.language = this.$.switch.checked ? 'fr' : 'en';
}
});
Loading

0 comments on commit e92c8ea

Please sign in to comment.