summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjules <jules@okfoc.us>2014-01-25 23:42:19 -0500
committerjules <jules@okfoc.us>2014-01-25 23:42:19 -0500
commite873e6c1b0d2f4e06b94138a22d0d4292c52a037 (patch)
tree13df0be06b562814308e6cfec843f16c3e2fafc3
parent9433b20670a1eada77e1a4372a8f8ccad6f499c3 (diff)
logging, error fix, css
-rw-r--r--js/api/set.js4
-rw-r--r--js/error.highlight.js2
-rw-r--r--shader-api.html10
-rw-r--r--shader-picker.html10
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; }
+
</style>
</head>
<body>
@@ -35,6 +42,7 @@ a { color: #00f; }
-->
<div id="shader-api">
+ <button id="help">help</button>
<button id="new-shader"><b>new shader</b></button>
<input type="text" id="shader-id" disabled><button id="fetch-info" disabled>info</button>
<button id="fetch-history" disabled>history</button>
@@ -74,6 +82,7 @@ a { color: #00f; }
</body>
<script type="text/javascript" src="js/vendor/acorn.js"></script>
<script type="text/javascript" src="js/vendor/jquery/jquery.min.js"></script>
+<script type="text/javascript" src="js/vendor/jquery-ui-1.10.3.custom.min.js"></script>
<script type="text/javascript" src="js/vendor/canvasquery.js"></script>
<script type="text/javascript" src="js/vendor/FileSaver/FileSaver.js"></script>
<script type="text/javascript" src="js/vendor/dataUriToBlob.js"></script>
@@ -122,4 +131,3 @@ function init(){
</script>
</html>
-- \ 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; }
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/help.js"></script>
<script type="text/javascript" src="shaders.json"></script>
+
+<script type="text/html" id="frame-template">
+<button class="remove">x</button>
+<span class="frame"></span>
+</script>
+
<script type="text/javascript">
var cc = cq(0,0).appendTo("#workspace")
@@ -175,9 +181,5 @@ function init(){
}
</script>
-<script type="text/html" id="frame-template">
-<button class="remove">x</button>
-<span class="frame"></span>
-</script>
</html>