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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
622d3016
Commit
622d3016
authored
May 09, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_svg_editor: update gadget to match new version
parent
9e06f587
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
645 additions
and
465 deletions
+645
-465
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/method-draw/method-draw.gadget.html.zpt
...s/erp5_svg_editor/method-draw/method-draw.gadget.html.zpt
+635
-444
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/method-draw/method-draw.gadget.js.js
...kins/erp5_svg_editor/method-draw/method-draw.gadget.js.js
+10
-21
No files found.
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/method-draw/method-draw.gadget.html.zpt
View file @
622d3016
This diff is collapsed.
Click to expand it.
bt5/erp5_svg_editor/SkinTemplateItem/portal_skins/erp5_svg_editor/method-draw/method-draw.gadget.js.js
View file @
622d3016
/*jslint indent: 2 */
/*jslint indent: 2 */
/*global window, rJS, RSVP,
curConfig,
svgCanvas */
/*global window, rJS, RSVP, svgCanvas */
(
function
(
window
,
rJS
,
RSVP
)
{
(
function
(
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
"
use strict
"
;
curConfig
.
jGraduatePath
=
"
lib/jgraduate/images/
"
;
// XXX images are not loaded at the good place
rJS
(
window
)
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
props
=
{};
var
deferred
=
RSVP
.
defer
();
svgCanvas
.
ready
(
function
()
{
deferred
.
resolve
();
});
return
deferred
.
promise
;
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
[].
forEach
.
call
(
window
.
document
.
head
.
querySelectorAll
(
"
base
"
),
function
(
el
)
{
return
this
.
changeState
({
// XXX GadgetField adds <base> tag to fit to the parent page location, it's BAD to remove them.
key
:
options
.
key
,
// In the case of method-draw, all component are loaded dynamicaly through ajax requests in
value
:
options
.
value
// method-draw "folder". By setting a <base> tag, we change the url resolution behavior, and
// we break all dynamic links. So, deleting <base> is required.
window
.
document
.
head
.
removeChild
(
el
);
});
});
this
.
props
.
key
=
options
.
key
;
})
svgCanvas
.
setSvgString
(
options
.
value
);
.
onStateChange
(
function
()
{
svgCanvas
.
setSvgString
(
this
.
state
.
value
);
})
})
.
declareService
(
function
()
{
.
declareService
(
function
()
{
if
(
/
(?:
^
\?
|&
)
auto_focus=
(
true|1
)(?:
&|$
)
/
.
test
(
window
.
location
.
search
))
{
if
(
/
(?:
^
\?
|&
)
auto_focus=
(
true|1
)(?:
&|$
)
/
.
test
(
window
.
location
.
search
))
{
...
@@ -32,8 +20,9 @@
...
@@ -32,8 +20,9 @@
})
})
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
()
{
var
form_data
=
{};
var
form_data
=
{};
form_data
[
this
.
props
.
key
]
=
svgCanvas
.
getSvgString
();
form_data
[
this
.
state
.
key
]
=
svgCanvas
.
getSvgString
();
this
.
state
.
value
=
form_data
[
this
.
state
.
key
]
return
form_data
;
return
form_data
;
});
}
,
{
mutex
:
'
statechange
'
}
);
}(
window
,
rJS
,
RSVP
));
}(
window
,
rJS
,
RSVP
));
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