summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/docs/static/js/platform_chooser.js
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-19 20:44:04 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-19 20:44:04 +0000
commit4105bf75ab0b68f2a9a117cca2e52ac01fb12f77 (patch)
treee5e7c21a1e51c66b4382aa4da057010c97001894 /chrome/common/extensions/docs/static/js/platform_chooser.js
parentbd931cfa493b88c047e3a0720620331379cd7b4f (diff)
downloadchromium_src-4105bf75ab0b68f2a9a117cca2e52ac01fb12f77.zip
chromium_src-4105bf75ab0b68f2a9a117cca2e52ac01fb12f77.tar.gz
chromium_src-4105bf75ab0b68f2a9a117cca2e52ac01fb12f77.tar.bz2
Docserver: move to a single version served from trunk. Permanently redirect requests
from any channel to the non-channel version (served from trunk). Improve the redirect logic in other ways. Fix a few bugs in caching classes that cause this all not to work. Replace the channel switcher (now moot) with a platform switcher. R=cduvall@chromium.org BUG=233978 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/15087006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/static/js/platform_chooser.js')
-rw-r--r--chrome/common/extensions/docs/static/js/platform_chooser.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/common/extensions/docs/static/js/platform_chooser.js b/chrome/common/extensions/docs/static/js/platform_chooser.js
new file mode 100644
index 0000000..5492cff
--- /dev/null
+++ b/chrome/common/extensions/docs/static/js/platform_chooser.js
@@ -0,0 +1,18 @@
+// Copyright 2013 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.
+
+// Intializes the platform chooser, the widget in the top left corner with the
+// 'Apps...Extensions' dropdown.
+(function() {
+
+var platformChooser = document.getElementById('platform-chooser-popup');
+Array.prototype.forEach.call(platformChooser.getElementsByTagName('button'),
+ function(button) {
+ button.addEventListener('click', function(event) {
+ window.location.assign(button.getAttribute('data-href'));
+ event.stopPropagation();
+ });
+});
+
+})()