From 4105bf75ab0b68f2a9a117cca2e52ac01fb12f77 Mon Sep 17 00:00:00 2001 From: "kalman@chromium.org" Date: Fri, 19 Jul 2013 20:44:04 +0000 Subject: 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 --- .../extensions/docs/static/js/platform_chooser.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 chrome/common/extensions/docs/static/js/platform_chooser.js (limited to 'chrome/common/extensions/docs/static/js/platform_chooser.js') 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(); + }); +}); + +})() -- cgit v1.1