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
Boris Kocherov
erp5
Commits
6f9869b1
Commit
6f9869b1
authored
Oct 12, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Simplify editor panel implementation
parent
e87fef91
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
49 deletions
+34
-49
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_html.html
...em/web_page_module/rjs_gadget_erp5_editor_panel_html.html
+0
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_html.xml
...tem/web_page_module/rjs_gadget_erp5_editor_panel_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_js.js
...teItem/web_page_module/rjs_gadget_erp5_editor_panel_js.js
+30
-44
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_js.xml
...eItem/web_page_module/rjs_gadget_erp5_editor_panel_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_html.html
View file @
6f9869b1
...
...
@@ -13,6 +13,5 @@
<script
src=
"gadget_erp5_editor_panel.js"
></script>
</head>
<body>
<div
class=
"jqm-navmenu-panel"
></div>
</body>
</html>
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_html.xml
View file @
6f9869b1
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.3
4618.13218.7202
</string>
</value>
<value>
<string>
954.3
5607.14703.35106
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1476258
673.4
1
</float>
<float>
1476258
994.2
1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_js.js
View file @
6f9869b1
/*jslint indent: 2, maxerr: 3, nomen: true */
/*global window, rJS
, RSVP
*/
(
function
(
window
,
rJS
,
RSVP
)
{
/*jslint indent: 2, maxerr: 3, nomen: true
, maxlen: 80
*/
/*global window, rJS */
(
function
(
window
,
rJS
)
{
"
use strict
"
;
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
// Init local properties
.
ready
(
function
(
g
)
{
g
.
props
=
{};
})
.
ready
(
function
(
g
)
{
return
g
.
getElement
()
.
push
(
function
(
element
)
{
g
.
props
.
element
=
element
;
g
.
props
.
container
=
element
.
querySelector
(
"
.jqm-navmenu-panel
"
);
});
})
.
allowPublicAcquisition
(
'
trigger
'
,
function
()
{
this
.
props
.
element
.
classList
.
toggle
(
'
visible
'
);
// return this.props.jelement.panel("toggle");
})
//////////////////////////////////////////////
// acquired method
//////////////////////////////////////////////
//local method
.
allowPublicAcquisition
(
'
trigger
'
,
function
()
{
this
.
element
.
classList
.
toggle
(
'
visible
'
);
})
.
declareMethod
(
'
close
'
,
function
()
{
var
container
=
this
.
props
.
container
;
while
(
container
.
firstChild
)
{
container
.
removeChild
(
container
.
firstChild
);
var
element
=
this
.
element
;
while
(
element
.
firstChild
)
{
element
.
removeChild
(
element
.
firstChild
);
}
if
(
this
.
props
.
element
.
classList
.
contains
(
'
visible
'
))
{
this
.
props
.
element
.
classList
.
remove
(
'
visible
'
);
if
(
element
.
classList
.
contains
(
'
visible
'
))
{
element
.
classList
.
remove
(
'
visible
'
);
}
})
.
declareMethod
(
'
render
'
,
function
(
url
,
options
)
{
this
.
element
.
classList
.
toggle
(
'
visible
'
);
return
this
.
changeState
({
url
:
url
,
options
:
JSON
.
stringify
(
options
)
});
})
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
,
declared_gadget
;
if
(
url
&&
JSON
.
stringify
(
gadget
.
props
.
options
)
!==
JSON
.
stringify
(
options
))
{
gadget
.
props
.
options
=
options
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
declareGadget
(
url
,
{
scope
:
"
declared_gadget
"
});
})
if
(
gadget
.
state
.
url
&&
modification_dict
.
hasOwnProperty
(
'
options
'
))
{
return
gadget
.
declareGadget
(
gadget
.
state
.
url
,
{
scope
:
"
declared_gadget
"
})
.
push
(
function
(
result
)
{
declared_gadget
=
result
;
return
declared_gadget
.
render
(
options
);
return
declared_gadget
.
render
(
JSON
.
parse
(
gadget
.
state
.
options
)
);
})
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
close
(),
declared_gadget
.
getElement
()
]);
return
gadget
.
close
();
})
.
push
(
function
(
result
)
{
var
fragment
=
result
[
1
];
gadget
.
props
.
container
.
appendChild
(
fragment
);
gadget
.
props
.
element
.
classList
.
toggle
(
'
visible
'
);
.
push
(
function
()
{
gadget
.
element
.
appendChild
(
declared_gadget
.
element
);
gadget
.
element
.
classList
.
toggle
(
'
visible
'
);
});
}
gadget
.
props
.
element
.
classList
.
toggle
(
'
visible
'
);
});
}(
window
,
rJS
,
RSVP
));
\ No newline at end of file
}(
window
,
rJS
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_js.xml
View file @
6f9869b1
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
3.42201.31550.52070
</string>
</value>
<value>
<string>
95
4.35625.39214.6929
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
2808729.65
</float>
<float>
147
6259803.78
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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