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
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Gambier
erp5
Commits
508328e9
Commit
508328e9
authored
Mar 10, 2020
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_core: use renderjs mutex
parent
77089c03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
20 deletions
+12
-20
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_editor.js.js
...inTemplateItem/portal_skins/erp5_core/gadget_editor.js.js
+12
-20
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/gadget_editor.js.js
View file @
508328e9
/*jslint nomen: true, indent: 2 */
/*jslint nomen: true, indent: 2 */
/*global window, rJS, RSVP, document, FileReader, Blob,
/*global window, rJS, RSVP, document, FileReader, Blob*/
lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
(
function
(
window
,
rJS
,
RSVP
,
document
,
FileReader
,
Blob
)
{
(
function
(
window
,
rJS
,
RSVP
,
document
,
FileReader
,
Blob
,
lockGadgetInQueue
,
unlockGadgetInQueue
,
unlockGadgetInFailedQueue
)
{
"
use strict
"
;
"
use strict
"
;
var
editor_dict
=
{
var
editor_dict
=
{
...
@@ -44,8 +42,12 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
...
@@ -44,8 +42,12 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
}
}
});
});
})
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
return
this
.
renderAsynchronously
(
options
);
})
.
declareJob
(
'
renderAsynchronously
'
,
function
(
options
)
{
var
state_dict
=
{
var
state_dict
=
{
value
:
options
.
value
||
""
,
value
:
options
.
value
||
""
,
editor
:
options
.
editor
,
editor
:
options
.
editor
,
...
@@ -62,16 +64,12 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
...
@@ -62,16 +64,12 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
})
})
.
onStateChange
(
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
return
this
.
renderAsynchronously
(
modification_dict
);
})
.
declareJob
(
'
renderAsynchronously
'
,
function
(
modification_dict
)
{
var
element
=
this
.
element
,
var
element
=
this
.
element
,
gadget
=
this
,
gadget
=
this
,
url
,
url
,
div
=
document
.
createElement
(
'
div
'
),
div
=
document
.
createElement
(
'
div
'
),
div_max
=
document
.
createElement
(
'
div
'
),
div_max
=
document
.
createElement
(
'
div
'
),
queue
=
lockGadgetInQueue
(
gadget
)
();
queue
=
new
RSVP
.
Queue
();
if
((
modification_dict
.
hasOwnProperty
(
'
editable
'
))
||
if
((
modification_dict
.
hasOwnProperty
(
'
editable
'
))
||
(
modification_dict
.
hasOwnProperty
(
'
editor
'
))
||
(
modification_dict
.
hasOwnProperty
(
'
editor
'
))
||
...
@@ -179,8 +177,7 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
...
@@ -179,8 +177,7 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
}
else
{
}
else
{
element
.
querySelector
(
'
pre
'
).
textContent
=
gadget
.
state
.
value
;
element
.
querySelector
(
'
pre
'
).
textContent
=
gadget
.
state
.
value
;
}
}
return
queue
return
queue
;
.
push
(
unlockGadgetInQueue
(
gadget
),
unlockGadgetInFailedQueue
(
gadget
));
})
})
.
declareMethod
(
'
getContent
'
,
function
()
{
.
declareMethod
(
'
getContent
'
,
function
()
{
...
@@ -189,14 +186,10 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
...
@@ -189,14 +186,10 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
result
;
result
;
if
(
this
.
state
.
editable
&&
if
(
this
.
state
.
editable
&&
editor_dict
.
hasOwnProperty
(
gadget
.
state
.
editor
))
{
editor_dict
.
hasOwnProperty
(
gadget
.
state
.
editor
))
{
return
lockGadgetInQueue
(
gadget
)()
return
gadget
.
getDeclaredGadget
(
'
editor
'
)
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
'
editor
'
);
})
.
push
(
function
(
editor_gadget
)
{
.
push
(
function
(
editor_gadget
)
{
return
editor_gadget
.
getContent
.
apply
(
editor_gadget
,
argument_list
);
return
editor_gadget
.
getContent
.
apply
(
editor_gadget
,
argument_list
);
})
});
.
push
(
unlockGadgetInQueue
(
gadget
),
unlockGadgetInFailedQueue
(
gadget
));
/*
/*
.push(function (result) {
.push(function (result) {
var value = result[context.state.key] || '';
var value = result[context.state.key] || '';
...
@@ -215,12 +208,11 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
...
@@ -215,12 +208,11 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
return
result
;
return
result
;
}
}
return
{};
return
{};
})
}
,
{
mutex
:
'
changestate
'
}
)
.
declareMethod
(
'
checkValidity
'
,
function
()
{
.
declareMethod
(
'
checkValidity
'
,
function
()
{
// XXX How to implement this for editors?
// XXX How to implement this for editors?
return
true
;
return
true
;
});
});
}(
window
,
rJS
,
RSVP
,
document
,
FileReader
,
Blob
,
}(
window
,
rJS
,
RSVP
,
document
,
FileReader
,
Blob
));
lockGadgetInQueue
,
unlockGadgetInQueue
,
unlockGadgetInFailedQueue
));
\ No newline at end of file
\ 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