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
41e9c371
Commit
41e9c371
authored
Jun 01, 2017
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] add fast input support
parent
075f68fc
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
832 additions
and
18 deletions
+832
-18
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_appcache.xml
...TemplateItem/web_page_module/rjs_gadget_erp5_appcache.xml
+5
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_addpage_html.html
...Item/web_page_module/rjs_gadget_erp5_pt_addpage_html.html
+40
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_addpage_html.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_addpage_html.xml
+326
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_addpage_js.js
...lateItem/web_page_module/rjs_gadget_erp5_pt_addpage_js.js
+129
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_addpage_js.xml
...ateItem/web_page_module/rjs_gadget_erp5_pt_addpage_js.xml
+320
-0
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
+4
-6
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
+4
-5
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
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_appcache.xml
View file @
41e9c371
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string
encoding=
"cdata"
>
<![CDATA[
CACHE MANIFEST\n
CACHE MANIFEST\n
# generated on
Wed, 01 Mar
2017 15:00:00 GMT\n
# generated on
Thu, 01 Jun
2017 15:00:00 GMT\n
# XXX + fonts\n
# XXX + fonts\n
# images/ajax-loader.gif\n
# images/ajax-loader.gif\n
CACHE:\n
CACHE:\n
...
@@ -175,6 +175,8 @@ gadget_erp5_notification.html\n
...
@@ -175,6 +175,8 @@ gadget_erp5_notification.html\n
gadget_erp5_notification.js\n
gadget_erp5_notification.js\n
gadget_erp5_page_action.html\n
gadget_erp5_page_action.html\n
gadget_erp5_page_action.js\n
gadget_erp5_page_action.js\n
gadget_erp5_page_add.html\n
gadget_erp5_page_add.js\n
gadget_erp5_page_form.html\n
gadget_erp5_page_form.html\n
gadget_erp5_page_form.js\n
gadget_erp5_page_form.js\n
gadget_erp5_page_front.html\n
gadget_erp5_page_front.html\n
...
@@ -371,7 +373,7 @@ NETWORK:\n
...
@@ -371,7 +373,7 @@ NETWORK:\n
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
8.2829.24684.28142
</string>
</value>
<value>
<string>
95
9.49530.43446.36010
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -389,7 +391,7 @@ NETWORK:\n
...
@@ -389,7 +391,7 @@ NETWORK:\n
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
149
0088390.79
</float>
<float>
149
6322885.93
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_addpage_html.html
0 → 100644
View file @
41e9c371
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=Add
data-i18n=Fast Input
-->
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no"
/>
<title>
ERP5 Page Add
</title>
<!-- renderjs -->
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"handlebars.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"gadget_global.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_erp5_global.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_erp5_page_add.js"
type=
"text/javascript"
></script>
<script
id=
"table-template"
type=
"text/x-handlebars-template"
>
<
section
class
=
"
ui-content-header-plain
"
>
<
h3
class
=
"
ui-content-title ui-body-c
"
data
-
i18n
=
"
[last]{{definition_i18n}}
"
>
<
span
class
=
"
ui-icon ui-icon-custom ui-icon-{{definition_icon}}
"
>&
nbsp
;
<
/span
>
{{
definition_title
}}
<
/h3
>
<
/section
>
<
ul
data
-
role
=
"
listview
"
data
-
theme
=
"
c
"
data
-
inset
=
"
true
"
class
=
"
document-listview
"
>
{{
#
each
documentlist
}}
<
li
><
a
data
-
i18n
=
"
{{title}}
"
class
=
"
ui-body-inherit
"
href
=
"
{{link}}
"
>
{{
title
}}
<
/a></
li
>
{{
/
each
}}
<
/ul
>
</script>
</head>
<body>
</body>
</html>
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_addpage_html.xml
0 → 100644
View file @
41e9c371
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_addpage_js.js
0 → 100644
View file @
41e9c371
/*global window, rJS, RSVP, Handlebars, calculatePageTitle */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
,
calculatePageTitle
)
{
"
use strict
"
;
/////////////////////////////////////////////////////////////////
// Handlebars
/////////////////////////////////////////////////////////////////
// Precompile the templates while loading the first gadget instance
var
gadget_klass
=
rJS
(
window
),
table_template
=
Handlebars
.
compile
(
gadget_klass
.
__template_element
.
getElementById
(
"
table-template
"
)
.
innerHTML
);
gadget_klass
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
jio_getAttachment
"
,
"
jio_getAttachment
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
new_content_list
=
[],
fast_input_list
=
[],
new_content_action_list
=
[],
fast_input_action_list
=
[],
gadget
=
this
,
erp5_document
;
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
"
links
"
)
.
push
(
function
(
result
)
{
var
i
,
promise_list
=
[];
erp5_document
=
result
;
new_content_list
=
erp5_document
.
_links
.
action_object_new_content_action
||
[];
fast_input_list
=
erp5_document
.
_links
.
action_object_fast_input_jio
||
[];
if
(
new_content_list
.
constructor
!==
Array
)
{
new_content_list
=
[
new_content_list
];
}
if
(
fast_input_list
.
constructor
!==
Array
)
{
fast_input_list
=
[
fast_input_list
];
}
for
(
i
=
0
;
i
<
new_content_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
new_content_list
[
i
].
href
,
editable
:
true
,
page
:
undefined
}}));
}
for
(
i
=
0
;
i
<
fast_input_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
fast_input_list
[
i
].
href
,
editable
:
true
,
page
:
undefined
}}));
}
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
(
all_result
)
{
// Only one action, directly show it
if
(
all_result
.
length
===
1
)
{
return
gadget
.
redirect
({
command
:
'
raw
'
,
options
:
{
url
:
all_result
[
0
]
}
});
}
var
i
,
j
=
0
;
for
(
i
=
0
;
i
<
new_content_list
.
length
;
i
+=
1
)
{
new_content_action_list
.
push
({
title
:
new_content_list
[
i
].
title
,
i18n
:
new_content_list
[
i
].
title
,
link
:
all_result
[
j
]
});
j
+=
1
;
}
for
(
i
=
0
;
i
<
fast_input_list
.
length
;
i
+=
1
)
{
fast_input_action_list
.
push
({
title
:
fast_input_list
[
i
].
title
,
link
:
all_result
[
j
],
i18n
:
fast_input_list
[
i
].
title
});
j
+=
1
;
}
return
gadget
.
translateHtml
(
table_template
({
definition_title
:
"
Add
"
,
definition_i18n
:
"
Add
"
,
definition_icon
:
"
plus
"
,
documentlist
:
new_content_action_list
})
+
table_template
({
definition_title
:
"
Fast Input
"
,
documentlist
:
fast_input_action_list
,
definition_icon
:
"
exchange
"
,
definition_i18n
:
"
Fast Input
"
}))
.
push
(
function
(
my_translated_html
)
{
gadget
.
element
.
innerHTML
=
my_translated_html
;
return
RSVP
.
all
([
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
undefined
}}),
calculatePageTitle
(
gadget
,
erp5_document
)
]);
})
.
push
(
function
(
url_list
)
{
var
dict
=
{
back_url
:
url_list
[
0
],
page_title
:
url_list
[
1
]
};
return
gadget
.
updateHeader
(
dict
);
});
});
});
}(
window
,
rJS
,
RSVP
,
Handlebars
,
calculatePageTitle
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_addpage_js.xml
0 → 100644
View file @
41e9c371
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
View file @
41e9c371
...
@@ -71,12 +71,10 @@
...
@@ -71,12 +71,10 @@
// render the header
// render the header
.
push
(
function
()
{
.
push
(
function
()
{
var
new_content_action
=
form_gadget
.
state
.
erp5_document
.
_links
.
action_object_new_content_action
;
var
new_content_action
=
""
;
if
((
form_gadget
.
state
.
erp5_document
.
_links
.
hasOwnProperty
(
'
action_object_new_content_action
'
))
||
if
(
new_content_action
!==
undefined
)
{
(
form_gadget
.
state
.
erp5_document
.
_links
.
hasOwnProperty
(
'
action_object_fast_input_jio_action
'
)))
{
new_content_action
=
form_gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
new_content_action
.
href
,
editable
:
true
}});
new_content_action
=
form_gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
"
add
"
}});
}
else
{
new_content_action
=
""
;
}
}
return
RSVP
.
all
([
return
RSVP
.
all
([
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
View file @
41e9c371
...
@@ -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
4.34605.28227.45721
</string>
</value>
<value>
<string>
95
9.49322.65017.42069
</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>
14
76198578.
1
</float>
<float>
14
96310453.3
1
</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 @
41e9c371
...
@@ -61,13 +61,12 @@
...
@@ -61,13 +61,12 @@
// render the header
// render the header
.
push
(
function
()
{
.
push
(
function
()
{
var
new_content_action
=
form_gadget
.
state
.
erp5_document
.
_links
.
action_object_new_content_action
,
var
new_content_action
=
""
,
delete_action
=
form_gadget
.
state
.
erp5_document
.
_links
.
action_object_delete_action
;
delete_action
=
form_gadget
.
state
.
erp5_document
.
_links
.
action_object_delete_action
;
if
(
new_content_action
!==
undefined
)
{
if
((
form_gadget
.
state
.
erp5_document
.
_links
.
hasOwnProperty
(
'
action_object_new_content_action
'
))
||
new_content_action
=
form_gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
new_content_action
.
href
,
editable
:
true
}});
(
form_gadget
.
state
.
erp5_document
.
_links
.
hasOwnProperty
(
'
action_object_fast_input_jio_action
'
)))
{
}
else
{
new_content_action
=
form_gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
"
add
"
}});
new_content_action
=
""
;
}
}
if
(
delete_action
!==
undefined
)
{
if
(
delete_action
!==
undefined
)
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
View file @
41e9c371
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
958.3
1331.40640.10291
</string>
</value>
<value>
<string>
958.3
3121.48203.5614
</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>
149
1385195.38
</float>
<float>
149
6310722.92
</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