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

Unified Diff: experimental/webtry/templates/index.html

Issue 240773003: First pass at workspaces. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 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/templates/recent.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/webtry/templates/index.html
diff --git a/experimental/webtry/templates/index.html b/experimental/webtry/templates/index.html
index d2ba8592cb08743278868ab1094c82bb15a75a45..c79dc124c027612ecbcb7bd67ea31f68cd841ff5 100644
--- a/experimental/webtry/templates/index.html
+++ b/experimental/webtry/templates/index.html
@@ -6,11 +6,7 @@
<link rel="stylesheet" href="/css/" type="text/css" media="screen">
</head>
<body>
- <section id=title>
- <a href="/">Home</a>
- <a href="/recent">Recent</a>
- <a href="https://github.com/google/skia/tree/master/experimental/webtry">Code</a>
- </section>
+ {{template "titlebar.html"}}
<section id=content>
<pre><code>#include "SkCanvas.h"
@@ -28,57 +24,9 @@ void draw(SkCanvas* canvas) {
</section>
<script type='text/javascript' charset='utf-8'>
- var run = document.getElementById('run');
- var code = document.getElementById('code');
- var output = document.getElementById('output');
- var img = document.getElementById('img');
-
- function beginWait() {
- document.body.classList.add('waiting');
- run.disabled = true;
- }
-
- function endWait() {
- document.body.classList.remove('waiting');
- run.disabled = false;
- }
-
- function codeComplete(e) {
- // The response is JSON of the form:
- // {
- // "message": "you had an error...",
- // "img": "<base64 encoded image but only on success>"
- // }
- //
- // 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.innerText = body.message;
- if (body.hasOwnProperty('img')) {
- img.src = 'data:image/png;base64,' + body.img;
- } else {
- img.src = '';
- }
- window.history.pushState(null, null, "/c/" + body.hash);
- }
-
- function codeError(e) {
- endWait();
- alert('Something bad happened: ' + e);
- }
-
- run.addEventListener('click', onSubmitCode);
- function onSubmitCode() {
- beginWait();
- var req = new XMLHttpRequest();
- req.addEventListener('load', codeComplete);
- req.addEventListener('error', codeError);
- req.overrideMimeType('application/json');
- req.open('POST', '.', true);
- req.send(code.value);
- }
+ // Not running in a workspace.
+ var workspaceName = "";
</script>
+ <script src="/js/run.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
« no previous file with comments | « experimental/webtry/main.cpp ('k') | experimental/webtry/templates/recent.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698