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

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

Issue 656463002: add support for skfiddle width/height options (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add new db creation commands to the design documnt 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/main.cpp ('k') | experimental/webtry/res/webtry/css/webtry.css » ('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 2b46c10d8aa83d33d04727f8e2e0f31d08dd3985..b4643ac221af9f52998e7aa53f84fa24c4bfd03f 100644
--- a/experimental/webtry/res/js/webtry.js
+++ b/experimental/webtry/res/js/webtry.js
@@ -26,6 +26,8 @@
var output = document.getElementById('output');
var stdout = document.getElementById('stdout');
var img = document.getElementById('img');
+ var imageWidth = document.getElementById('image-width');
+ var imageHeight = document.getElementById('image-height');
var tryHistory = document.getElementById('tryHistory');
var parser = new DOMParser();
var tryTemplate = document.getElementById('tryTemplate');
@@ -211,6 +213,8 @@
code.value = body.code;
editor.setValue(body.code);
img.src = '/i/'+body.hash+'.png';
+ imageWidth.value = body.width;
+ imageHeight.value = body.height;
sourceSelectByID(body.source);
if (permalink) {
permalink.href = '/c/' + body.hash;
@@ -245,7 +249,6 @@
// The img is optional and only appears if there is a valid
// image to display.
endWait();
- console.log(e.target.response);
body = JSON.parse(e.target.response);
output.textContent = body.message;
if (body.message) {
@@ -290,7 +293,7 @@
req.overrideMimeType('application/json');
req.open('POST', '/', true);
req.setRequestHeader('content-type', 'application/json');
- req.send(JSON.stringify({'code': editor.getValue(), 'name': workspaceName, 'source': sourceId}));
+ req.send(JSON.stringify({'code': editor.getValue(), 'width': parseInt(imageWidth.value), 'height': parseInt(imageHeight.value), 'name': workspaceName, 'source': sourceId}));
}
run.addEventListener('click', onSubmitCode);
« no previous file with comments | « experimental/webtry/main.cpp ('k') | experimental/webtry/res/webtry/css/webtry.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698