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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
6bed77f3
Commit
6bed77f3
authored
Jun 12, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make SVG editor work for SVG image portal types as well.
parent
a12c84ec
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
179 additions
and
7 deletions
+179
-7
bt5/erp5_svg_editor/ActionTemplateItem/portal_types/Image/view_editor.xml
...tor/ActionTemplateItem/portal_types/Image/view_editor.xml
+94
-0
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/Base_getSVGTextContent.xml
...m/portal_skins/erp5_svg_editor/Base_getSVGTextContent.xml
+73
-0
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/Base_setSVGTextContent.xml
...m/portal_skins/erp5_svg_editor/Base_setSVGTextContent.xml
+6
-2
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/Base_viewSVGEditor.xml
...eItem/portal_skins/erp5_svg_editor/Base_viewSVGEditor.xml
+1
-1
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/Base_viewSVGEditor/my_text_content.xml
...ns/erp5_svg_editor/Base_viewSVGEditor/my_text_content.xml
+0
-0
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/Base_viewSVGEditor/text_content.xml
...skins/erp5_svg_editor/Base_viewSVGEditor/text_content.xml
+0
-0
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
+3
-3
bt5/erp5_svg_editor/bt/revision
bt5/erp5_svg_editor/bt/revision
+1
-1
bt5/erp5_svg_editor/bt/template_action_path_list
bt5/erp5_svg_editor/bt/template_action_path_list
+1
-0
No files found.
bt5/erp5_svg_editor/ActionTemplateItem/portal_types/Image/view_editor.xml
0 → 100644
View file @
6bed77f3
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_view
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_view
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Allow to edit SVG images.
</string>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
view_editor
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
2.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Edit
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Base_viewSVGEditor
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
python: object is not None and object.getContentType()=="image/svg+xml"
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/Base_getSVGTextContent.xml
0 → 100644
View file @
6bed77f3
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
portal_type = context.getPortalType()\n
if portal_type in ("Web Illustration",):\n
text_content = context.getTextContent()\n
elif portal_type in ("Image",):\n
text_content = context.getData()\n
\n
return text_content\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_getSVGTextContent
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/Base_set
TextContentWrapper
.xml
→
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/Base_set
SVGTextContent
.xml
View file @
6bed77f3
...
@@ -55,7 +55,11 @@
...
@@ -55,7 +55,11 @@
"""\n
"""\n
text_content = context.REQUEST.get("text")\n
text_content = context.REQUEST.get("text")\n
if text_content is not None:\n
if text_content is not None:\n
context.setTextContent(text_content)\n
portal_type = context.getPortalType()\n
if portal_type in ("Web Illustration",):\n
context.setTextContent(text_content)\n
elif portal_type in ("Image",):\n
context.setData(text_content)\n
</string>
</value>
</string>
</value>
</item>
</item>
<item>
<item>
...
@@ -64,7 +68,7 @@ if text_content is not None:\n
...
@@ -64,7 +68,7 @@ if text_content is not None:\n
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_set
TextContentWrapper
</string>
</value>
<value>
<string>
Base_set
SVGTextContent
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/
WebIllustration_view
Editor.xml
→
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/
Base_viewSVG
Editor.xml
View file @
6bed77f3
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebIllustration_view
Editor
</string>
</value>
<value>
<string>
Base_viewSVG
Editor
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
method
</string>
</key>
<key>
<string>
method
</string>
</key>
...
...
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/
WebIllustration_view
Editor/my_text_content.xml
→
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/
Base_viewSVG
Editor/my_text_content.xml
View file @
6bed77f3
File moved
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/
WebIllustration_view
Editor/text_content.xml
→
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/
Base_viewSVG
Editor/text_content.xml
View file @
6bed77f3
File moved
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/svg-editor.erp5.js.xml
View file @
6bed77f3
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
<value>
<unicode>
window.onload = function() {\n
<value>
<unicode>
window.onload = function() {\n
var svg_canvas = window.frames["svgframe"].svgCanvas;\n
var svg_canvas = window.frames["svgframe"].svgCanvas;\n
var text_content = $.ajax({\n
var text_content = $.ajax({\n
url: "
get
TextContent",\n
url: "
Base_getSVG
TextContent",\n
async: false\n
async: false\n
}).responseText;\n
}).responseText;\n
text_content != "" ? svg_canvas.setSvgString(text_content) : null;\n
text_content != "" ? svg_canvas.setSvgString(text_content) : null;\n
...
@@ -53,7 +53,7 @@ $(document).ready(function(){\n
...
@@ -53,7 +53,7 @@ $(document).ready(function(){\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_set
TextContentWrapper
",\n
url: "Base_set
SVGTextContent
",\n
data: "text=" + svg_canvas.getSvgString(),\n
data: "text=" + svg_canvas.getSvgString(),\n
success: function(){\n
success: function(){\n
window.location.reload();\n
window.location.reload();\n
...
@@ -77,7 +77,7 @@ $(document).ready(function(){\n
...
@@ -77,7 +77,7 @@ $(document).ready(function(){\n
</item>
</item>
<item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
<value>
<string>
iso-8859-15
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
...
...
bt5/erp5_svg_editor/bt/revision
View file @
6bed77f3
29
30
\ No newline at end of file
\ No newline at end of file
bt5/erp5_svg_editor/bt/template_action_path_list
0 → 100644
View file @
6bed77f3
Image | view_editor
\ No newline at end of file
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