From e873e6c1b0d2f4e06b94138a22d0d4292c52a037 Mon Sep 17 00:00:00 2001 From: jules Date: Sat, 25 Jan 2014 23:42:19 -0500 Subject: logging, error fix, css --- js/api/set.js | 4 ++++ js/error.highlight.js | 2 +- shader-api.html | 10 +++++++++- shader-picker.html | 10 ++++++---- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/js/api/set.js b/js/api/set.js index 92cc071..8732c87 100644 --- a/js/api/set.js +++ b/js/api/set.js @@ -10,14 +10,17 @@ function save_shader(){ } var blob = dataUriToBlob(cc.clone().resize(200,200).canvas.toDataURL("image/png")) + status('saving..') console.log(params) $.post("http://asdf.us/cgi-bin/im/shader/save", params, function(resp){ console.log(resp); data = JSON.parse(resp) if (data.ERROR){ + status('error saving shader') alert(data.ERROR) return false } + status('uploading thumbnail') if (! shader_id_root) { shader_id_root = data.id; } @@ -40,6 +43,7 @@ function save_shader(){ contentType: false, }).done(function(resp){ console.log(resp); + status('') var data = JSON.parse(resp) if (data.success) { $shader.find("img").attr("src", data.url) diff --git a/js/error.highlight.js b/js/error.highlight.js index 0b478e2..f46d0ec 100644 --- a/js/error.highlight.js +++ b/js/error.highlight.js @@ -136,7 +136,7 @@ var init = function(){ create_el_highlight() create_el_textmeasure() scrollbar_width = calc_scrollbar_width() - textarea.addEventListener('scroll', reposition_highlight) + dom.textarea.addEventListener('scroll', reposition_highlight) } // exports diff --git a/shader-api.html b/shader-api.html index 416f21a..b860093 100644 --- a/shader-api.html +++ b/shader-api.html @@ -16,6 +16,13 @@ form { display: inline-block; } #shader-name { width: 75px; } #shader-id { width: 40px; } a { color: #00f; } +#help { float: right; } +.dragging { cursor: -webkit-grabbing !important; } +#instructions { position: absolute;top:20px;right:20px; width:190px;height:465px; box-shadow:5px 5px 10px rgba(0,0,0,0.3); background:rgba(255,255,255,0.8); display: none; cursor: -webkit-grab; } +#instructions iframe {width: 100%;height:100%;margin:0;padding:0;border:0;} +#instructions.dragging iframe { pointer-events: none; } +#instructions .close { position: absolute; top: 5px; right: 5px; color: #f00; padding: 3px; border: 0;background: white; font-size: 10px; line-height: 10px; } + @@ -35,6 +42,7 @@ a { color: #00f; } -->
+ @@ -74,6 +82,7 @@ a { color: #00f; } + @@ -122,4 +131,3 @@ function init(){ -- \ No newline at end of file diff --git a/shader-picker.html b/shader-picker.html index 0896609..7efe39f 100644 --- a/shader-picker.html +++ b/shader-picker.html @@ -130,6 +130,12 @@ a { color: #00f; } + + + - -- cgit v1.2.3-70-g09d2