diff options
Diffstat (limited to 'share/frontend/im/js/main.js')
| -rw-r--r-- | share/frontend/im/js/main.js | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/share/frontend/im/js/main.js b/share/frontend/im/js/main.js index ac62ec6..27dbc96 100644 --- a/share/frontend/im/js/main.js +++ b/share/frontend/im/js/main.js @@ -43,31 +43,32 @@ var Main = dispose: $('#dispose').val(), username: $("#img-name").val(), } - if (form.rotate.match(/-/)){ form.rotate=360-parseInt(data.rotate.replace("-","")); }; - $("#img-rotate").val(""); - if (form.username.length > 0) - document.cookie = "imname="+data.username+";path=/;domain=.asdf.us;max-age=1086400" - $.ajax({ - url: '/im/api/generate', - type: 'post', - dataType: 'json', - data: form, - success: function(data){ Main.callback(data) }, - error: function(data){ - switch(data.status){ - case 500: - alert("Problem with server") - console.log(data) - break; - case 410: - alert(JSON.parse(data.responseText).message) - break; - default: - console.log(data) - } - Main.generating = false - } - }); + if (form.rotate.match(/-/)){ form.rotate=360-parseInt(data.rotate.replace("-","")); }; + $("#img-rotate").val(""); + if (form.username.length > 0){ + document.cookie = "imname="+form.username+";path=/;domain=.asdf.us;max-age=1086400" + } + $.ajax({ + url: '/im/api/generate', + type: 'post', + dataType: 'json', + data: form, + success: function(data){ Main.callback(data) }, + error: function(data){ + switch(data.status){ + case 500: + alert("Problem with server") + console.log(data) + break; + case 410: + alert(JSON.parse(data.responseText).message) + break; + default: + console.log(data) + } + Main.generating = false + } + }); }, error: function (s) { |
