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
1eaef318
Commit
1eaef318
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
e34dcc97
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
45 deletions
+56
-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
+9
-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
+33
-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
+4
-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 @
1eaef318
...
@@ -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 @
1eaef318
...
@@ -63,6 +63,12 @@
...
@@ -63,6 +63,12 @@
</tuple>
</tuple>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<item>
<key>
<string>
content_md5
</string>
</key>
<key>
<string>
content_md5
</string>
</key>
<value>
<value>
...
@@ -222,7 +228,7 @@
...
@@ -222,7 +228,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 +242,7 @@
...
@@ -236,7 +242,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
4.4178.47068.37000
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -254,7 +260,7 @@
...
@@ -254,7 +260,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15
04529272.57
</float>
<float>
15
13004254.36
</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 @
1eaef318
/*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,30 @@
...
@@ -583,6 +588,30 @@
});
});
})
})
.
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
;
gadget
.
props
.
panel_argument_list
.
desktop
=
desktop
;
gadget
.
props
.
desktop
=
desktop
;
return
route
(
gadget
,
'
panel
'
,
'
close
'
);
})
.
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 +630,4 @@
...
@@ -601,4 +630,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 @
1eaef318
...
@@ -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
3.29105.23200.50073
</string>
</value>
<value>
<string>
96
4.5299.35727.23022
</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
3071009.13
</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 @
1eaef318
...
@@ -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 @
1eaef318
...
@@ -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 @
1eaef318
/*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
"
;
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
@@ -75,7 +75,8 @@
...
@@ -75,7 +75,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 +133,6 @@
...
@@ -132,7 +133,6 @@
.
push
(
function
()
{
.
push
(
function
()
{
context
.
element
.
querySelector
(
"
div
"
).
appendChild
(
tmp_element
);
context
.
element
.
querySelector
(
"
div
"
).
appendChild
(
tmp_element
);
return
context
.
listenResize
();
});
});
}
}
...
@@ -273,30 +273,6 @@
...
@@ -273,30 +273,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 +335,4 @@
...
@@ -359,4 +335,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 @
1eaef318
...
@@ -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
4.5689.59241.23961
</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
13094084.97
</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