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

Unified Diff: chrome/browser/resources/about_credits.js

Issue 7215034: Apply CSP to chrome: and about: pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « chrome/browser/net/predictor_api.cc ('k') | chrome/browser/resources/about_credits.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/about_credits.js
===================================================================
--- chrome/browser/resources/about_credits.js (revision 0)
+++ chrome/browser/resources/about_credits.js (revision 0)
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function $(o) {return document.getElementById(o);}
+
+function toggle(o) {
+ var licence = o.nextSibling;
+
+ while (licence.className != 'licence') {
+ if (!licence) return false;
+ licence = licence.nextSibling;
+ }
+
+ if (licence.style && licence.style.display == 'block') {
+ licence.style.display = 'none';
+ o.innerHTML = 'show license';
+ } else {
+ licence.style.display = 'block';
+ o.innerHTML = 'hide license';
+ }
+ return false;
+}
+
+document.body.onload = function () {
+ var links = document.getElementsByTagName("a");
+ for (var i = 0; i < links.length; i++) {
+ if (links[i].className === "show") {
+ links[i].onclick = function () { return toggle(this); };
+ }
+ }
+
+ $("print-link").onclick = function () {
+ window.print();
+ return false;
+ }
+};
+
Property changes on: chrome/browser/resources/about_credits.js
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/net/predictor_api.cc ('k') | chrome/browser/resources/about_credits.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698