diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 151e138efef..b7c5876c4f9 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -176,10 +176,10 @@ r##" krate = layout.krate, play_url = layout.playground_url, play_js = if layout.playground_url.is_empty() { - "".to_string() + format!(r#""#, page.root_path) } else { format!(r#""#, page.root_path) - }, + } ) } diff --git a/src/librustdoc/html/static/extra.js b/src/librustdoc/html/static/extra.js new file mode 100644 index 00000000000..d9d97d9b883 --- /dev/null +++ b/src/librustdoc/html/static/extra.js @@ -0,0 +1,25 @@ +// Copyright 2014-2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +/*jslint browser: true, es5: true */ +/*globals $: true, rootPath: true */ + +document.addEventListener('DOMContentLoaded', function() { + 'use strict'; + + if (!window.playgroundUrl) { + var runButtons = document.querySelectorAll(".test-arrow"); + + for (var i = 0; i < runButtons.length; i++) { + runButtons[i].classList.remove("test-arrow"); + } + return; + } +}); diff --git a/src/librustdoc/html/static/playpen.js b/src/librustdoc/html/static/playpen.js index cad97c04e1a..8d8953d56e1 100644 --- a/src/librustdoc/html/static/playpen.js +++ b/src/librustdoc/html/static/playpen.js @@ -15,6 +15,11 @@ document.addEventListener('DOMContentLoaded', function() { 'use strict'; if (!window.playgroundUrl) { + var runButtons = document.querySelectorAll(".test-arrow"); + + for (var i = 0; i < runButtons.length; i++) { + runButtons[i].classList.remove("test-arrow"); + } return; }