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
a61a99ec
Commit
a61a99ec
authored
Apr 01, 2019
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Factorise more
parent
834ed3b6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
40 deletions
+51
-40
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_global_js.js
...TemplateItem/web_page_module/rjs_gadget_erp5_global_js.js
+22
-8
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_global_js.xml
...emplateItem/web_page_module/rjs_gadget_erp5_global_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
+5
-9
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.js
...b_page_module/rjs_gadget_erp5_pt_form_view_editable_js.js
+8
-12
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
..._page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
+8
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_global_js.js
View file @
a61a99ec
/*global window, RSVP, Array, isNaN, SimpleQuery, ComplexQuery, Query */
/*global window, RSVP, Array, isNaN, SimpleQuery, ComplexQuery, Query */
/*jslint indent: 2, maxerr: 3, nomen: true, unparam: true */
/*jslint indent: 2, maxerr: 3, nomen: true, unparam: true
, continue: true
*/
(
function
(
window
,
RSVP
,
Array
,
isNaN
,
SimpleQuery
,
ComplexQuery
,
Query
)
{
(
function
(
window
,
RSVP
,
Array
,
isNaN
,
SimpleQuery
,
ComplexQuery
,
Query
)
{
"
use strict
"
;
"
use strict
"
;
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
}
}
if
(
view
===
undefined
)
{
if
(
view
===
undefined
)
{
// Action was not found.
// Action was not found.
return
gadget
.
notifySubmitted
({
return
gadget
.
notifySubmitted
ClipboardAction
({
"
message
"
:
"
Action not handled.
"
"
message
"
:
"
Action not handled.
"
});
});
}
}
...
@@ -99,7 +99,7 @@
...
@@ -99,7 +99,7 @@
if
(
action_name
===
'
paste_document_list
'
)
{
if
(
action_name
===
'
paste_document_list
'
)
{
// Get the list of document uid from the internal clipboard
// Get the list of document uid from the internal clipboard
queue
=
gadget
.
getSetting
(
'
clipboard
'
)
queue
=
gadget
.
getSetting
ClipboardAction
(
'
clipboard
'
)
.
push
(
function
(
uid_list
)
{
.
push
(
function
(
uid_list
)
{
checked_uid_list
=
uid_list
||
[];
checked_uid_list
=
uid_list
||
[];
});
});
...
@@ -114,22 +114,22 @@
...
@@ -114,22 +114,22 @@
// Dialog listbox use catalog method, which may be different from the current select method
// Dialog listbox use catalog method, which may be different from the current select method
// and so, it is mandatory to propagate a list of uid, otherwise, the dialog may display
// and so, it is mandatory to propagate a list of uid, otherwise, the dialog may display
// an unexpected huge list of unrelated documents
// an unexpected huge list of unrelated documents
return
gadget
.
notifySubmitted
({
return
gadget
.
notifySubmitted
ClipboardAction
({
"
message
"
:
"
Nothing selected.
"
"
message
"
:
"
Nothing selected.
"
});
});
}
}
if
(
action_name
===
'
copy_document_list
'
)
{
if
(
action_name
===
'
copy_document_list
'
)
{
return
gadget
.
setSetting
(
'
clipboard
'
,
checked_uid_list
)
return
gadget
.
setSetting
ClipboardAction
(
'
clipboard
'
,
checked_uid_list
)
.
push
(
function
()
{
.
push
(
function
()
{
return
gadget
.
notifySubmitted
({
return
gadget
.
notifySubmitted
ClipboardAction
({
"
message
"
:
"
Copied.
"
,
"
message
"
:
"
Copied.
"
,
"
status
"
:
"
success
"
"
status
"
:
"
success
"
});
});
});
});
}
}
return
gadget
.
redirect
({
return
gadget
.
redirect
ClipboardAction
({
command
:
'
display_dialog_with_history
'
,
command
:
'
display_dialog_with_history
'
,
options
:
{
options
:
{
"
jio_key
"
:
gadget
.
state
.
jio_key
,
"
jio_key
"
:
gadget
.
state
.
jio_key
,
...
@@ -143,7 +143,21 @@
...
@@ -143,7 +143,21 @@
});
});
}
}
window
.
getListboxClipboardActionList
=
getListboxClipboardActionList
;
function
declareGadgetClassCanHandleListboxClipboardAction
(
gadget_klass
)
{
gadget_klass
.
declareAcquiredMethod
(
"
setSettingClipboardAction
"
,
"
setSetting
"
)
.
declareAcquiredMethod
(
"
getSettingClipboardAction
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
redirectClipboardAction
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
notifySubmittedClipboardAction
"
,
"
notifySubmitted
"
)
// Handle listbox custom button
.
allowPublicAcquisition
(
"
getListboxClipboardActionList
"
,
getListboxClipboardActionList
)
.
allowPublicAcquisition
(
"
triggerListboxClipboardAction
"
,
triggerListboxClipboardAction
);
}
window
.
triggerListboxClipboardAction
=
triggerListboxClipboardAction
;
window
.
triggerListboxClipboardAction
=
triggerListboxClipboardAction
;
window
.
declareGadgetClassCanHandleListboxClipboardAction
=
declareGadgetClassCanHandleListboxClipboardAction
;
}(
window
,
RSVP
,
Array
,
isNaN
,
SimpleQuery
,
ComplexQuery
,
Query
));
}(
window
,
RSVP
,
Array
,
isNaN
,
SimpleQuery
,
ComplexQuery
,
Query
));
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_global_js.xml
View file @
a61a99ec
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.483
16.46514.38946
</string>
</value>
<value>
<string>
974.483
73.9942.49254
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
155411
0522.02
</float>
<float>
155411
2759.88
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
View file @
a61a99ec
/*global window, rJS, RSVP, calculatePageTitle, SimpleQuery, ComplexQuery,
/*global window, rJS, RSVP, calculatePageTitle, SimpleQuery, ComplexQuery,
Query, QueryFactory, ensureArray, triggerListboxClipboardAction,
Query, QueryFactory, ensureArray, triggerListboxClipboardAction,
getListboxClipboardActionList
*/
declareGadgetClassCanHandleListboxClipboardAction
*/
/*jslint nomen: true, indent: 2, maxerr: 3, continue: true */
/*jslint nomen: true, indent: 2, maxerr: 3, continue: true */
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
SimpleQuery
,
ComplexQuery
,
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
SimpleQuery
,
ComplexQuery
,
Query
,
QueryFactory
,
ensureArray
,
triggerListboxClipboardAction
,
Query
,
QueryFactory
,
ensureArray
,
triggerListboxClipboardAction
,
getListboxClipboardActionList
)
{
declareGadgetClassCanHandleListboxClipboardAction
)
{
"
use strict
"
;
"
use strict
"
;
function
updateSearchQueryFromSelection
(
extended_search
,
checked_uid_list
,
function
updateSearchQueryFromSelection
(
extended_search
,
checked_uid_list
,
...
@@ -337,14 +337,10 @@
...
@@ -337,14 +337,10 @@
}
}
throw
new
Error
(
'
Unsupported triggerListboxSelectAction action:
'
+
action
);
throw
new
Error
(
'
Unsupported triggerListboxSelectAction action:
'
+
action
);
})
})
;
// Handle listbox custom button
declareGadgetClassCanHandleListboxClipboardAction
(
rJS
(
window
));
.
allowPublicAcquisition
(
"
getListboxClipboardActionList
"
,
getListboxClipboardActionList
)
.
allowPublicAcquisition
(
"
triggerListboxClipboardAction
"
,
triggerListboxClipboardAction
);
}(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
SimpleQuery
,
ComplexQuery
,
Query
,
}(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
SimpleQuery
,
ComplexQuery
,
Query
,
QueryFactory
,
ensureArray
,
triggerListboxClipboardAction
,
QueryFactory
,
ensureArray
,
triggerListboxClipboardAction
,
getListboxClipboardActionList
));
declareGadgetClassCanHandleListboxClipboardAction
));
\ No newline at end of file
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
View file @
a61a99ec
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.483
38.56343.35345
</string>
</value>
<value>
<string>
974.483
75.35929.5939
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
155411
0585.33
</float>
<float>
155411
2783.5
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.js
View file @
a61a99ec
/*global window, rJS, RSVP, calculatePageTitle,
triggerListboxClipboardAction,
/*global window, rJS, RSVP, calculatePageTitle,
getListboxClipboardActionList
*/
declareGadgetClassCanHandleListboxClipboardAction
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
triggerListboxClipboardAction
,
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
getListboxClipboardActionList
)
{
declareGadgetClassCanHandleListboxClipboardAction
)
{
"
use strict
"
;
"
use strict
"
;
rJS
(
window
)
rJS
(
window
)
...
@@ -182,13 +182,9 @@
...
@@ -182,13 +182,9 @@
}
}
});
// page form handles failures well enough
});
// page form handles failures well enough
},
false
,
true
)
},
false
,
true
)
;
// Handle listbox custom button
declareGadgetClassCanHandleListboxClipboardAction
(
rJS
(
window
));
.
allowPublicAcquisition
(
"
getListboxClipboardActionList
"
,
getListboxClipboardActionList
)
.
allowPublicAcquisition
(
"
triggerListboxClipboardAction
"
,
triggerListboxClipboardAction
);
}(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
triggerListboxClipboardAction
,
}(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
getListboxClipboardActionList
));
declareGadgetClassCanHandleListboxClipboardAction
));
\ No newline at end of file
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
View file @
a61a99ec
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.4833
8.34236.46097
</string>
</value>
<value>
<string>
974.4833
9.52946.33450
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
155411
0628.46
</float>
<float>
155411
2591.65
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
View file @
a61a99ec
/*global window, rJS, RSVP, calculatePageTitle, isEmpty */
/*global window, rJS, RSVP, calculatePageTitle, isEmpty,
declareGadgetClassCanHandleListboxClipboardAction */
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
isEmpty
)
{
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
isEmpty
,
declareGadgetClassCanHandleListboxClipboardAction
)
{
"
use strict
"
;
"
use strict
"
;
/** Return true if `field` resembles non-empty and non-editable field. */
/** Return true if `field` resembles non-empty and non-editable field. */
...
@@ -161,4 +163,7 @@
...
@@ -161,4 +163,7 @@
});
});
});
});
}(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
isEmpty
));
declareGadgetClassCanHandleListboxClipboardAction
(
rJS
(
window
));
\ No newline at end of file
}(
window
,
rJS
,
RSVP
,
calculatePageTitle
,
isEmpty
,
declareGadgetClassCanHandleListboxClipboardAction
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
View file @
a61a99ec
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
97
2.58906.44395.12356
</string>
</value>
<value>
<string>
97
4.48369.21631.14967
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15
47195629.34
</float>
<float>
15
54112407.89
</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