From 5187863631f60c17008c4c1dd136662c003f7bd5 Mon Sep 17 00:00:00 2001 From: Pepper Date: Fri, 29 Apr 2016 02:24:35 -0400 Subject: ok fixed a bug --- share/frontend/im/js/main.js | 51 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'share/frontend/im/js/main.js') 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) { -- cgit v1.2.3-70-g09d2