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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
erp5
Commits
b631f7e1
Commit
b631f7e1
authored
Dec 07, 2017
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Handle rezize event in launcher
parent
90c86654
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
45 deletions
+64
-45
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.html
...teItem/web_page_module/rjs_gadget_erp5_launcher_html.html
+1
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.xml
...ateItem/web_page_module/rjs_gadget_erp5_launcher_html.xml
+11
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
...mplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
+34
-4
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
...plateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
+3
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.html
...plateItem/web_page_module/rjs_gadget_erp5_panel_html.html
+0
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
...mplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
+3
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
...hTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
+9
-28
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
...TemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
+3
-3
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.html
View file @
b631f7e1
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<script
src=
"rsvp.js"
></script>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_global.js"
type=
"text/javascript"
></script>
<script
src=
"erp5_launcher_nojqm.js"
></script>
<script
src=
"erp5_launcher_nojqm.js"
></script>
</head>
</head>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_html.xml
View file @
b631f7e1
...
@@ -63,6 +63,14 @@
...
@@ -63,6 +63,14 @@
</tuple>
</tuple>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
classification/collaborative/team
</string>
</tuple>
</value>
</item>
<item>
<item>
<key>
<string>
content_md5
</string>
</key>
<key>
<string>
content_md5
</string>
</key>
<value>
<value>
...
@@ -222,7 +230,7 @@
...
@@ -222,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
vincent
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -236,7 +244,7 @@
...
@@ -236,7 +244,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
1.56670.55511.24746
</string>
</value>
<value>
<string>
96
3.63718.35123.35584
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -254,7 +262,7 @@
...
@@ -254,7 +262,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15
04529272.57
</float>
<float>
15
12644451.26
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
b631f7e1
/*globals window, document, RSVP, rJS,
/*globals window, document, RSVP, rJS,
URI, location, XMLHttpRequest, console, navigator*/
URI, location, XMLHttpRequest, console, navigator
, loopEventListener
*/
/*jslint indent: 2, maxlen: 80*/
/*jslint indent: 2, maxlen: 80*/
(
function
(
window
,
document
,
RSVP
,
rJS
,
(
function
(
window
,
document
,
RSVP
,
rJS
,
XMLHttpRequest
,
location
,
console
,
navigator
)
{
XMLHttpRequest
,
location
,
console
,
navigator
,
loopEventListener
)
{
"
use strict
"
;
"
use strict
"
;
var
MAIN_SCOPE
=
"
m
"
;
var
MAIN_SCOPE
=
"
m
"
;
...
@@ -182,7 +182,8 @@
...
@@ -182,7 +182,8 @@
content_element
:
this
.
element
.
querySelector
(
'
.gadget-content
'
),
content_element
:
this
.
element
.
querySelector
(
'
.gadget-content
'
),
setting_id
:
"
setting/
"
+
document
.
head
.
querySelector
(
setting_id
:
"
setting/
"
+
document
.
head
.
querySelector
(
'
script[data-renderjs-configuration="application_title"]
'
'
script[data-renderjs-configuration="application_title"]
'
).
textContent
).
textContent
,
panel_argument_list
:
{}
};
};
// Configure setting storage
// Configure setting storage
...
@@ -260,6 +261,9 @@
...
@@ -260,6 +261,9 @@
})
})
.
push
(
function
(
router_gadget
)
{
.
push
(
function
(
router_gadget
)
{
return
router_gadget
.
start
();
return
router_gadget
.
start
();
})
.
push
(
function
()
{
return
gadget
.
listenResize
();
});
});
})
})
...
@@ -424,6 +428,7 @@
...
@@ -424,6 +428,7 @@
var
gadget
=
this
;
var
gadget
=
this
;
initPanelOptions
(
gadget
);
initPanelOptions
(
gadget
);
gadget
.
props
.
panel_argument_list
=
param_list
[
0
];
gadget
.
props
.
panel_argument_list
=
param_list
[
0
];
gadget
.
props
.
panel_argument_list
.
desktop
=
gadget
.
props
.
desktop
;
})
})
.
allowPublicAcquisition
(
'
triggerPanel
'
,
function
()
{
.
allowPublicAcquisition
(
'
triggerPanel
'
,
function
()
{
...
@@ -583,6 +588,31 @@
...
@@ -583,6 +588,31 @@
});
});
})
})
.
declareJob
(
'
listenResize
'
,
function
()
{
// resize should be only trigger after the render method
var
result
,
event
,
gadget
=
this
;
function
extractSizeAndDispatch
()
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
var
desktop
=
window
.
matchMedia
(
"
(min-width: 85em)
"
).
matches
,
method
=
desktop
?
'
open
'
:
'
close
'
;
gadget
.
props
.
panel_argument_list
.
desktop
=
desktop
;
gadget
.
props
.
desktop
=
desktop
;
return
route
(
gadget
,
'
panel
'
,
method
);
})
.
push
(
function
()
{
return
updatePanel
(
gadget
);
});
}
result
=
loopEventListener
(
window
,
'
resize
'
,
false
,
extractSizeAndDispatch
);
event
=
document
.
createEvent
(
"
Event
"
);
event
.
initEvent
(
'
resize
'
,
true
,
true
);
window
.
dispatchEvent
(
event
);
return
result
;
})
/////////////////////////////////
/////////////////////////////////
// Handle sub gadgets services
// Handle sub gadgets services
/////////////////////////////////
/////////////////////////////////
...
@@ -601,4 +631,4 @@
...
@@ -601,4 +631,4 @@
});
});
}(
window
,
document
,
RSVP
,
rJS
,
}(
window
,
document
,
RSVP
,
rJS
,
XMLHttpRequest
,
location
,
console
,
navigator
));
XMLHttpRequest
,
location
,
console
,
navigator
,
loopEventListener
));
\ No newline at end of file
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
View file @
b631f7e1
...
@@ -216,7 +216,7 @@
...
@@ -216,7 +216,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
vincent
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
963.
29105.23200.50073
</string>
</value>
<value>
<string>
963.
63870.21758.35942
</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>
151
1971674.78
</float>
<float>
151
2652755.5
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.html
View file @
b631f7e1
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"handlebars.js"
type=
"text/javascript"
></script>
<script
src=
"handlebars.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_global.js"
type=
"text/javascript"
></script>
<script
id=
"panel-template-header"
type=
"text/x-handlebars-template"
>
<script
id=
"panel-template-header"
type=
"text/x-handlebars-template"
>
<
div
data
-
role
=
"
header
"
class
=
"
ui-bar-inherit
"
>
<
div
data
-
role
=
"
header
"
class
=
"
ui-bar-inherit
"
>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_html.xml
View file @
b631f7e1
...
@@ -220,7 +220,7 @@
...
@@ -220,7 +220,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
vincent
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -234,7 +234,7 @@
...
@@ -234,7 +234,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
58.33121.48203.5614
</string>
</value>
<value>
<string>
9
63.43879.9730.43520
</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>
1
491822419.47
</float>
<float>
1
512643569.15
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.js
View file @
b631f7e1
/*jslint nomen: true, indent: 2, maxerr: 3, unparam: true */
/*jslint nomen: true, indent: 2, maxerr: 3, unparam: true */
/*global window, document, rJS, Handlebars, RSVP, Node, loopEventListener */
/*global window, document, rJS, Handlebars, RSVP, Node, loopEventListener */
(
function
(
window
,
document
,
rJS
,
Handlebars
,
RSVP
,
Node
,
loopEventListener
)
{
(
function
(
window
,
document
,
rJS
,
Handlebars
,
RSVP
,
Node
)
{
"
use strict
"
;
"
use strict
"
;
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
@@ -49,6 +49,11 @@
...
@@ -49,6 +49,11 @@
visible
:
false
visible
:
false
});
});
})
})
.
declareMethod
(
'
open
'
,
function
()
{
return
this
.
changeState
({
visible
:
true
});
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
erp5_document
=
options
.
erp5_document
,
var
erp5_document
=
options
.
erp5_document
,
...
@@ -75,7 +80,8 @@
...
@@ -75,7 +80,8 @@
workflow_list
:
workflow_list
,
workflow_list
:
workflow_list
,
view_list
:
view_list
,
view_list
:
view_list
,
global
:
true
,
global
:
true
,
editable
:
options
.
editable
||
editable
||
false
editable
:
options
.
editable
||
editable
||
false
,
desktop
:
options
.
desktop
||
false
});
});
});
});
})
})
...
@@ -132,7 +138,6 @@
...
@@ -132,7 +138,6 @@
.
push
(
function
()
{
.
push
(
function
()
{
context
.
element
.
querySelector
(
"
div
"
).
appendChild
(
tmp_element
);
context
.
element
.
querySelector
(
"
div
"
).
appendChild
(
tmp_element
);
return
context
.
listenResize
();
});
});
}
}
...
@@ -273,30 +278,6 @@
...
@@ -273,30 +278,6 @@
}
}
},
false
,
false
)
},
false
,
false
)
.
declareJob
(
'
listenResize
'
,
function
()
{
// resize should be only trigger after the render method
// as displaying the panel rely on external gadget (for translation for example)
var
result
,
event
,
context
=
this
;
function
extractSizeAndDispatch
()
{
if
(
window
.
matchMedia
(
"
(min-width: 85em)
"
).
matches
)
{
return
context
.
changeState
({
desktop
:
true
});
}
return
context
.
changeState
({
desktop
:
false
});
}
result
=
loopEventListener
(
window
,
'
resize
'
,
false
,
extractSizeAndDispatch
);
event
=
document
.
createEvent
(
"
Event
"
);
event
.
initEvent
(
'
resize
'
,
true
,
true
);
window
.
dispatchEvent
(
event
);
return
result
;
})
.
allowPublicAcquisition
(
'
notifyChange
'
,
function
(
argument_list
,
scope
)
{
.
allowPublicAcquisition
(
'
notifyChange
'
,
function
(
argument_list
,
scope
)
{
if
(
scope
===
'
erp5_checkbox
'
)
{
if
(
scope
===
'
erp5_checkbox
'
)
{
var
context
=
this
;
var
context
=
this
;
...
@@ -359,4 +340,4 @@
...
@@ -359,4 +340,4 @@
},
/*useCapture=*/
false
,
/*preventDefault=*/
true
);
},
/*useCapture=*/
false
,
/*preventDefault=*/
true
);
}(
window
,
document
,
rJS
,
Handlebars
,
RSVP
,
Node
,
loopEventListener
));
}(
window
,
document
,
rJS
,
Handlebars
,
RSVP
,
Node
));
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_panel_js.xml
View file @
b631f7e1
...
@@ -216,7 +216,7 @@
...
@@ -216,7 +216,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
vincent
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
1.1708.1551.12032
</string>
</value>
<value>
<string>
96
3.63751.63771.26828
</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>
15
01231473.84
</float>
<float>
15
12646397.6
</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