Commit f5e12409 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_svg_editor: lint svg-editor.erp5.js + enable async ajax

parent 2c5c9be5
......@@ -38,30 +38,37 @@
</item>
<item>
<key> <string>_text</string> </key>
<value> <unicode>window.onload = function() {\n
var svg_canvas = window.frames["svgframe"].svgCanvas;\n
var text_content = $.ajax({\n
url: "Base_getSVGTextContent",\n
async: false\n
}).responseText;\n
text_content != "" ? svg_canvas.setSvgString(text_content) : null;\n
}\n
<value> <unicode>window.onload = function () {\n
$.ajax({\n
url: "Base_getSVGTextContent",\n
async: true,\n
success: function (text_content) {\n
var svg_canvas, frame = window.frames.svgframe;\n
if (text_content !== "") {\n
svg_canvas = frame.svgCanvas;\n
svg_canvas.ready(function () {\n
svg_canvas.setSvgString(text_content);\n
});\n
}\n
}\n
});\n
};\n
\n
$(document).ready(function(){\n
$("button.save").click(function(event){\n
$(document).ready(function () {\n
$("button.save").click(function (event) {\n
event.preventDefault();\n
var svg_canvas = window.frames["svgframe"].svgCanvas;\n
var svg_canvas = window.frames.svgframe.svgCanvas;\n
$.ajax({\n
type: "POST",\n
url: "Base_setSVGTextContent",\n
data: "text=" + encodeURIComponent(svg_canvas.getSvgString()),\n
success: function(){\n
window.location.reload();\n
}\n
type: "POST",\n
url: "Base_setSVGTextContent",\n
data: "text=" + encodeURIComponent(svg_canvas.getSvgString()),\n
success: function () {\n
window.location.reload();\n
}\n
});\n
});\n
$("iframe#svgframe").css("border", "0px");\n
})</unicode> </value>
});</unicode> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment