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

Unified Diff: experimental/webtry/res/js/webtry.js

Issue 623173004: rework webtry css with compass and bootstrap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « experimental/webtry/res/img/skia.png ('k') | experimental/webtry/res/webtry/config.rb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/webtry/res/js/webtry.js
diff --git a/experimental/webtry/res/js/webtry.js b/experimental/webtry/res/js/webtry.js
index 30dac5b90afbb0d15e184625f3f5ca0b3b3b3137..2b46c10d8aa83d33d04727f8e2e0f31d08dd3985 100644
--- a/experimental/webtry/res/js/webtry.js
+++ b/experimental/webtry/res/js/webtry.js
@@ -45,6 +45,11 @@
sourceSelectByID(sourceId);
}
+ function setIFrameURL() {
+ var url = document.URL;
+ url = url.replace('/c/', '/iframe/');
+ embed.value = '<iframe src="' + url + '" width="740" height="550" style="border: solid #00a 5px; border-radius: 5px;"/>'
+ }
function beginWait() {
document.body.classList.add('waiting');
@@ -133,6 +138,7 @@
req.send();
} else {
sourceId = 0;
+ chooseSource.classList.remove('show');
}
}
@@ -166,10 +172,14 @@
function clearOutput() {
output.textContent = "";
+ output.style.display='none';
if (stdout) {
stdout.textContent = "";
+ stdout.style.display='none';
+ }
+ if (embed) {
+ embed.style.display='none';
}
- embed.style.display='none';
}
/**
@@ -204,6 +214,7 @@
sourceSelectByID(body.source);
if (permalink) {
permalink.href = '/c/' + body.hash;
+ permalink.style.display='inline-block';
}
}
@@ -237,8 +248,14 @@
console.log(e.target.response);
body = JSON.parse(e.target.response);
output.textContent = body.message;
+ if (body.message) {
+ output.style.display = 'block';
+ }
if (stdout) {
stdout.textContent = body.stdout;
+ if (body.stdout) {
+ stdout.style.display = 'block';
+ }
}
if (body.hasOwnProperty('img')) {
img.src = 'data:image/png;base64,' + body.img;
@@ -253,14 +270,13 @@
}
if (permalink) {
permalink.href = '/c/' + body.hash;
+ permalink.style.display = 'inline-block';
}
if (embed) {
- var url = document.URL;
- url = url.replace('/c/', '/iframe/');
- embed.value = '<iframe src="' + url + '" width="740" height="550" style="border: solid #00a 5px; border-radius: 5px;"/>'
+ setIFrameURL();
}
- if (embedButton && embedButton.hasAttribute('disabled')) {
- embedButton.removeAttribute('disabled');
+ if (embedButton) {
+ embedButton.style.display = 'inline-block';
}
}
@@ -287,6 +303,8 @@
embedButton.addEventListener('click', onEmbedClick);
}
+ setIFrameURL();
+
// Add the images to the history if we are on a workspace page.
if (tryHistory && history_) {
for (var i=0; i<history_.length; i++) {
« no previous file with comments | « experimental/webtry/res/img/skia.png ('k') | experimental/webtry/res/webtry/config.rb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698