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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
bb044324
Commit
bb044324
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
658ccb01
Changes
4
Show 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 @
bb044324
...
@@ -13,6 +13,5 @@
...
@@ -13,6 +13,5 @@
<script
src=
"gadget_erp5_editor_panel.js"
></script>
<script
src=
"gadget_erp5_editor_panel.js"
></script>
</head>
</head>
<body>
<body>
<div
class=
"jqm-navmenu-panel"
></div>
</body>
</body>
</html>
</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 @
bb044324
...
@@ -234,7 +234,7 @@
...
@@ -234,7 +234,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -252,7 +252,7 @@
...
@@ -252,7 +252,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1476258
673.4
1
</float>
<float>
1476258
994.2
1
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_js.js
View file @
bb044324
/*jslint indent: 2, maxerr: 3, nomen: true */
/*jslint indent: 2, maxerr: 3, nomen: true
, maxlen: 80
*/
/*global window, rJS
, RSVP
*/
/*global window, rJS */
(
function
(
window
,
rJS
,
RSVP
)
{
(
function
(
window
,
rJS
)
{
"
use strict
"
;
"
use strict
"
;
rJS
(
window
)
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
// acquired method
//////////////////////////////////////////////
//////////////////////////////////////////////
//local method
.
allowPublicAcquisition
(
'
trigger
'
,
function
()
{
this
.
element
.
classList
.
toggle
(
'
visible
'
);
})
.
declareMethod
(
'
close
'
,
function
()
{
.
declareMethod
(
'
close
'
,
function
()
{
var
container
=
this
.
props
.
container
;
var
element
=
this
.
element
;
while
(
container
.
firstChild
)
{
while
(
element
.
firstChild
)
{
container
.
removeChild
(
container
.
firstChild
);
element
.
removeChild
(
element
.
firstChild
);
}
}
if
(
this
.
props
.
element
.
classList
.
contains
(
'
visible
'
))
{
if
(
element
.
classList
.
contains
(
'
visible
'
))
{
this
.
props
.
element
.
classList
.
remove
(
'
visible
'
);
element
.
classList
.
remove
(
'
visible
'
);
}
}
})
})
.
declareMethod
(
'
render
'
,
function
(
url
,
options
)
{
.
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
,
var
gadget
=
this
,
declared_gadget
;
declared_gadget
;
if
(
url
&&
JSON
.
stringify
(
gadget
.
props
.
options
)
!==
JSON
.
stringify
(
options
))
{
if
(
gadget
.
state
.
url
&&
modification_dict
.
hasOwnProperty
(
'
options
'
))
{
gadget
.
props
.
options
=
options
;
return
gadget
.
declareGadget
(
gadget
.
state
.
url
,
return
new
RSVP
.
Queue
()
{
scope
:
"
declared_gadget
"
})
.
push
(
function
()
{
return
gadget
.
declareGadget
(
url
,
{
scope
:
"
declared_gadget
"
});
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
declared_gadget
=
result
;
declared_gadget
=
result
;
return
declared_gadget
.
render
(
options
);
return
declared_gadget
.
render
(
JSON
.
parse
(
gadget
.
state
.
options
)
);
})
})
.
push
(
function
()
{
.
push
(
function
()
{
return
RSVP
.
all
([
return
gadget
.
close
();
gadget
.
close
(),
declared_gadget
.
getElement
()
]);
})
})
.
push
(
function
(
result
)
{
.
push
(
function
()
{
var
fragment
=
result
[
1
];
gadget
.
element
.
appendChild
(
declared_gadget
.
element
);
gadget
.
props
.
container
.
appendChild
(
fragment
);
gadget
.
element
.
classList
.
toggle
(
'
visible
'
);
gadget
.
props
.
element
.
classList
.
toggle
(
'
visible
'
);
});
});
}
}
gadget
.
props
.
element
.
classList
.
toggle
(
'
visible
'
);
});
});
}(
window
,
rJS
,
RSVP
));
}(
window
,
rJS
));
\ No newline at end of file
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_editor_panel_js.xml
View file @
bb044324
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
147
2808729.65
</float>
<float>
147
6259803.78
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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