Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
f5e12409
Commit
f5e12409
authored
Jan 15, 2016
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_svg_editor: lint svg-editor.erp5.js + enable async ajax
parent
2c5c9be5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
18 deletions
+25
-18
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/svg-editor.erp5.js.xml
...eItem/portal_skins/erp5_svg_editor/svg-editor.erp5.js.xml
+25
-18
No files found.
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/svg-editor.erp5.js.xml
View file @
f5e12409
...
@@ -38,30 +38,37 @@
...
@@ -38,30 +38,37 @@
</item>
</item>
<item>
<item>
<key>
<string>
_text
</string>
</key>
<key>
<string>
_text
</string>
</key>
<value>
<unicode>
window.onload = function() {\n
<value>
<unicode>
window.onload = function () {\n
var svg_canvas = window.frames["svgframe"].svgCanvas;\n
$.ajax({\n
var text_content = $.ajax({\n
url: "Base_getSVGTextContent",\n
url: "Base_getSVGTextContent",\n
async: false\n
async: true,\n
}).responseText;\n
success: function (text_content) {\n
text_content != "" ? svg_canvas.setSvgString(text_content) : null;\n
var svg_canvas, frame = window.frames.svgframe;\n
}\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
\n
$(document).ready(function
()
{\n
$(document).ready(function
()
{\n
$("button.save").click(function
(event)
{\n
$("button.save").click(function
(event)
{\n
event.preventDefault();\n
event.preventDefault();\n
var svg_canvas = window.frames
["svgframe"]
.svgCanvas;\n
var svg_canvas = window.frames
.svgframe
.svgCanvas;\n
$.ajax({\n
$.ajax({\n
type: "POST",\n
type: "POST",\n
url: "Base_setSVGTextContent",\n
url: "Base_setSVGTextContent",\n
data: "text=" + encodeURIComponent(svg_canvas.getSvgString()),\n
data: "text=" + encodeURIComponent(svg_canvas.getSvgString()),\n
success: function()
{\n
success: function ()
{\n
window.location.reload();\n
window.location.reload();\n
}\n
}\n
});\n
});\n
});\n
});\n
$("iframe#svgframe").css("border", "0px");\n
$("iframe#svgframe").css("border", "0px");\n
})
</unicode>
</value>
})
;
</unicode>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
content_type
</string>
</key>
<key>
<string>
content_type
</string>
</key>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment