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

Side by Side Diff: experimental/webtry/js/webtry.js

Issue 260773002: Fix bug with starting at the home page. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Common JS that talks XHR back to the server and runs the code and receives 2 * Common JS that talks XHR back to the server and runs the code and receives
3 * the results. 3 * the results.
4 */ 4 */
5 5
6 /** 6 /**
7 * A polyfill for HTML Templates. 7 * A polyfill for HTML Templates.
8 * 8 *
9 * This just adds in the content attribute, it doesn't stop scripts 9 * This just adds in the content attribute, it doesn't stop scripts
10 * from running nor does it stop other side-effects. 10 * from running nor does it stop other side-effects.
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 226 }
227 if (body.hasOwnProperty('img')) { 227 if (body.hasOwnProperty('img')) {
228 img.src = 'data:image/png;base64,' + body.img; 228 img.src = 'data:image/png;base64,' + body.img;
229 } else { 229 } else {
230 img.src = ''; 230 img.src = '';
231 } 231 }
232 // Add the image to the history if we are on a workspace page. 232 // Add the image to the history if we are on a workspace page.
233 if (tryHistory) { 233 if (tryHistory) {
234 addToHistory(body.hash, 'data:image/png;base64,' + body.img); 234 addToHistory(body.hash, 'data:image/png;base64,' + body.img);
235 } else { 235 } else {
236 window.history.pushState(null, null, './' + body.hash); 236 window.history.pushState(null, null, '/c/' + body.hash);
237 } 237 }
238 if (permalink) { 238 if (permalink) {
239 permalink.href = '/c/' + body.hash; 239 permalink.href = '/c/' + body.hash;
240 } 240 }
241 if (embed) { 241 if (embed) {
242 var url = document.URL; 242 var url = document.URL;
243 url = url.replace('/c/', '/iframe/'); 243 url = url.replace('/c/', '/iframe/');
244 embed.value = '<iframe src="' + url + '" width="740" height="550" style= "border: solid #00a 5px; border-radius: 5px;"/>' 244 embed.value = '<iframe src="' + url + '" width="740" height="550" style= "border: solid #00a 5px; border-radius: 5px;"/>'
245 } 245 }
246 if (embedButton && embedButton.hasAttribute('disabled')) { 246 if (embedButton && embedButton.hasAttribute('disabled')) {
(...skipping 26 matching lines...) Expand all
273 273
274 274
275 // Add the images to the history if we are on a workspace page. 275 // Add the images to the history if we are on a workspace page.
276 if (tryHistory && history) { 276 if (tryHistory && history) {
277 for (var i=0; i<history.length; i++) { 277 for (var i=0; i<history.length; i++) {
278 addToHistory(history[i].hash, '/i/'+history[i].hash+'.png'); 278 addToHistory(history[i].hash, '/i/'+history[i].hash+'.png');
279 } 279 }
280 } 280 }
281 281
282 })(workspaceName); 282 })(workspaceName);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698