summaryrefslogtreecommitdiff
path: root/cgi-bin/javascript_example.js
diff options
context:
space:
mode:
authorjules <jules@okfoc.us>2014-01-20 19:02:51 -0500
committerjules <jules@okfoc.us>2014-01-20 19:02:51 -0500
commit88e537899767c7b35e9e6f7352345bf15c555278 (patch)
tree8137dba9fe24e41c6735aa49928d763616a09beb /cgi-bin/javascript_example.js
parent2f81c4d9311309ebcf603bec30a7712bd7a75132 (diff)
localstorage fork
Diffstat (limited to 'cgi-bin/javascript_example.js')
-rw-r--r--cgi-bin/javascript_example.js39
1 files changed, 0 insertions, 39 deletions
diff --git a/cgi-bin/javascript_example.js b/cgi-bin/javascript_example.js
deleted file mode 100644
index 1e7e31f..0000000
--- a/cgi-bin/javascript_example.js
+++ /dev/null
@@ -1,39 +0,0 @@
-function save_shader(){
- typeof shader_id_root == 'undefined' ? shader_id_root = "" : shader_id_root
- var params = {
- script : $("#shader").val(),
- image_url : $("#url").val(),
- username : user.username,
- shader_id : shader_id_root
- }
- console.log(params)
- $.post("/cgi-bin/im/shader/save", params, function(resp){
- console.log(resp);
- data = JSON.parse(resp)
- if (data.ERROR ){
- alert(data.ERROR)
- return false
- }
- if (! shader_id_root) {
- shader_id_root = data.id;
- }
-
- var blob = dataUriToBlob(cc.clone().resize(200,200).canvas.toDataURL("image/png"))
- var form = new FormData();
-
- form.append("id", data.id);
- form.append("qqfile", blob);
- $.ajax({
- url: "/cgi-bin/im/shader/thumbnail_upload",
- type: "POST",
- data: form,
- processData: false,
- contentType: false,
- }).done(function(resp){
- console.log(resp);
- });
-
- })
- //maintain the shader_id_root...
- return shader_id_root;
-}