Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
da171fd4
Commit
da171fd4
authored
Dec 02, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed display of status loader, added generic JIO POST
parent
19c141a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
12 deletions
+42
-12
js/erp5_loader.js
js/erp5_loader.js
+34
-12
lang/en-EN/dict.json
lang/en-EN/dict.json
+4
-0
lang/zh-CN/dict.json
lang/zh-CN/dict.json
+4
-0
No files found.
js/erp5_loader.js
View file @
da171fd4
...
...
@@ -3595,6 +3595,8 @@
var
property
,
replace
,
i
,
obj
,
value
,
form_elements
,
form_element
,
pass
=
false
,
...
...
@@ -3644,20 +3646,39 @@
// valid form and no spam
if
(
pass
)
{
replace
=
form_to_submit
.
id
.
split
(
"
_
"
)[
0
]
+
"
_
"
;
obj
=
{};
for
(
property
in
valid
)
{
if
(
valid
.
hasOwnProperty
(
property
))
{
formData
.
append
(
property
.
replace
(
replace
,
""
),
valid
[
property
]);
value
=
valid
[
property
];
// prepare for storage
// TODO: check for portal-type in field name and skip if missing
if
(
property
!==
"
undefined
"
)
{
obj
[
property
]
=
value
;
}
// prepare for form submit
formData
.
append
(
property
.
replace
(
replace
,
""
),
value
);
}
}
// report to ERP5
// create ERP5 event
// TODO: remove once normal access is possible
util
.
updateStatus
(
"
show
"
,
""
,
"
global.status_dict.uploading
"
);
util
.
ajax
({
"
url
"
:
"
https://nexedi.erp5.net/
"
+
"
ERP5Site_addApplicationSubmissionRequest
"
,
"
type
"
:
"
POST
"
,
"
data
"
:
formData
})
// .then(function () {
// // TODO: a post should always include all required fields
// // TODO: find a way to set default fields, like timestamp etc
// return app.postDataToStorage({
// "response": [obj],
// "baggage": {"type": config.portal_type_source}
// })
// })
.
then
(
function
()
{
$
.
mobile
.
changePage
(
"
#thanks
"
);
})
...
...
@@ -4129,8 +4150,8 @@
// ===== SAMPLE DATA ========
.
then
(
app
.
testStorageForData
)
.
then
(
app
.
retrieveSampleData
)
.
then
(
app
.
storeSampleDataInStorage
)
// ===== SAMPLE DATA ========
.
then
(
app
.
postDataToStorage
)
.
then
(
app
.
fetchDataTotal
)
.
then
(
app
.
fetchDataQuery
)
.
then
(
app
.
generateGadgetContent
)
...
...
@@ -4355,7 +4376,7 @@
* @param {object} parcel object containing storage, type and baggage
* @return {object} promise object/baggage
*/
app
.
storeSampleDataIn
Storage
=
function
(
reply
)
{
app
.
postDataTo
Storage
=
function
(
reply
)
{
var
i
,
obj
,
key
,
...
...
@@ -4977,20 +4998,21 @@
* @param {string} icon Which icon to display when overriding the loader
*/
util
.
updateStatus
=
function
(
show
,
message
,
msg_i18n
,
icon
)
{
var
text_to_display
=
i18n
?
var
text_to_display
=
i18n
&&
msg_i18n
?
factory
.
map_actions
.
translateLookup
(
msg_i18n
)
:
message
;
//
hm... jQuery...
// hm... jQuery... hm string building
//
TODO: better way?
if
(
app
.
default_dict
.
loader
)
{
$
.
mobile
.
loading
(
show
?
"
show
"
:
"
hide
"
,
"
show
"
,
{
"
text
"
:
""
,
"
textVisible
"
:
true
,
"
theme
"
:
app
.
default_dict
.
loader_theme
,
"
text
"
:
icon
===
undefined
?
message
:
""
,
"
html
"
:
icon
===
undefined
?
""
:
'
<span class="ui-icon-
'
+
icon
+
'
loader_icon> </span>
'
+
'
<h1 class="loader_message">
'
+
text_to_display
+
'
</h1>
'
"
html
"
:
"
<span class='ui-icon-
"
+
(
icon
?
(
icon
+
"
loading_icon
"
)
:
"
loading
"
)
+
"
'> </span>
"
+
"
<h1 class='loader_message'>
"
+
text_to_display
+
"
</h1>
"
}
);
...
...
lang/en-EN/dict.json
View file @
da171fd4
...
...
@@ -21,6 +21,10 @@
"back"
:
"Back"
,
"clear"
:
"Delete"
},
"status_dict"
:
{
"uploading"
:
"Uploading"
,
"sync"
:
"Sychronizing"
},
"form_helpers"
:
{
"secure_blank"
:
"Please do not fill out this field"
,
"secure_filled"
:
"Please leave this value unchanged"
...
...
lang/zh-CN/dict.json
View file @
da171fd4
...
...
@@ -21,6 +21,10 @@
"back"
:
"后退"
,
"clear"
:
"删除"
},
"status_dict"
:
{
"uploading"
:
"Uploading"
,
"sync"
:
"Sychronizing"
},
"form_helpers"
:
{
"secure_blank"
:
"Please do not fill out this field"
,
"secure_filled"
:
"Please leave this value unchanged"
...
...
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