Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: elements/viewer-password-screen/viewer-password-screen.html

Issue 213223004: Make all the polymer elements CSP compliant. (Closed) Base URL: https://chromium.googlesource.com/chromium/html-office-public.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: elements/viewer-password-screen/viewer-password-screen.html
diff --git a/elements/viewer-password-screen/viewer-password-screen.html b/elements/viewer-password-screen/viewer-password-screen.html
index bb10cc4ceba82c7465b893342d8c18213f40c616..24a823309870bb63718fff13c7af50b104d03886 100644
--- a/elements/viewer-password-screen/viewer-password-screen.html
+++ b/elements/viewer-password-screen/viewer-password-screen.html
@@ -10,53 +10,5 @@
</form>
</div>
</template>
-<script>
- Polymer('viewer-password-screen', {
- text: 'This document is password protected. Please enter a password.',
- active: false,
- timerId: undefined,
- ready: function () {
- this.activeChanged();
- },
- accept: function() {
- this.successMessage = '&#x2714;' // Tick.
- this.$.successMessage.style.color = 'rgb(0,125,0)';
- this.active = false;
- },
- deny: function() {
- this.successMessage = '&#x2718;'; // Cross.
- this.$.successMessage.style.color = 'rgb(255,0,0)';
- this.$.password.disabled = false;
- this.$.submit.disabled = false;
- this.$.password.focus();
- this.$.password.select();
- },
- submit: function(e) {
- // Prevent the default form submission behavior.
- e.preventDefault();
- if (this.$.password.value.length == 0)
- return;
- this.successMessage = '...';
- this.$.successMessage.style.color = 'rgb(0,0,0)';
- this.$.password.disabled = true;
- this.$.submit.disabled = true;
- this.fire('password-submitted', {password: this.$.password.value});
- },
- activeChanged: function() {
- clearTimeout(this.timerId);
- this.timerId = undefined;
- if (this.active) {
- this.style.visibility = 'visible';
- this.style.opacity = 1;
- this.successMessage = '';
- this.$.password.focus();
- } else {
- this.style.opacity = 0;
- this.timerId = setTimeout(function() {
- this.style.visibility = 'hidden'
- }.bind(this), 400);
- }
- }
- });
-</script>
+<script src="viewer-password-screen.js"></script>
</polymer-element>
« no previous file with comments | « elements/viewer-page-indicator/viewer-page-indicator.js ('k') | elements/viewer-password-screen/viewer-password-screen.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698