Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
erp5
Commits
3872fb39
Commit
3872fb39
authored
Jan 13, 2015
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Never directly use FormData in erp5 gadget.
This allow the jio gadget to be sandboxed in an iframe.
parent
545f5d8f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
19 deletions
+29
-19
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
...tem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
+11
-11
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_jio_js.xml
...ui/PathTemplateItem/web_page_module/rjs_gadget_jio_js.xml
+18
-8
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
View file @
3872fb39
...
...
@@ -102,8 +102,8 @@
<value>
<string
encoding=
"cdata"
>
<![CDATA[
/*jslint nomen: true, indent: 2, maxerr: 3 */\n
/*global window, rJS, RSVP,
FormData,
URI, loopEventListener, document */\n
(function (window, rJS, RSVP,
FormData,
URI, loopEventListener) {\n
/*global window, rJS, RSVP, URI, loopEventListener, document */\n
(function (window, rJS, RSVP, URI, loopEventListener) {\n
"use strict";\n
\n
/////////////////////////////////////////////////////////////////\n
...
...
@@ -242,17 +242,17 @@
return erp5_form.getContent();\n
})\n
.push(function (content_dict) {\n
var data =
new FormData()
,\n
var data =
{}
,\n
key;\n
\n
data
.append(form_gadget.props.form_id.key,
\n
form_gadget.props.form_id[\'default\']
)
;\n
data
[form_gadget.props.form_id.key] =
\n
form_gadget.props.form_id[\'default\'];\n
// XXX Hardcoded\n
data.
append("dialog_id",
\n
form_gadget.props.form_id[\'default\']
)
;\n
data.
dialog_id =
\n
form_gadget.props.form_id[\'default\'];\n
for (key in content_dict) {\n
if (content_dict.hasOwnProperty(key)) {\n
data
.append(key, content_dict[key])
;\n
data
[key] = content_dict[key]
;\n
}\n
}\n
\n
...
...
@@ -290,7 +290,7 @@
);\n
});\n
\n
}(window, rJS, RSVP,
FormData,
URI, loopEventListener));
}(window, rJS, RSVP, URI, loopEventListener));
]]>
</string>
</value>
</item>
...
...
@@ -427,7 +427,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
940.1
6195.40887.33757
</string>
</value>
<value>
<string>
940.1
7478.1208.10666
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -445,7 +445,7 @@
</tuple>
<state>
<tuple>
<float>
1421
080553.89
</float>
<float>
1421
157982.02
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_jio_js.xml
View file @
3872fb39
...
...
@@ -101,9 +101,9 @@
<key>
<string>
text_content
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
/*global window, rJS, jIO */\n
/*global window, rJS, jIO
, FormData
*/\n
/*jslint indent: 2, maxerr: 3 */\n
(function (window, rJS, jIO) {\n
(function (window, rJS, jIO
, FormData
) {\n
"use strict";\n
\n
rJS(window)\n
...
...
@@ -116,8 +116,18 @@
.declareMethod(\'createJio\', function (jio_options) {\n
this.state_parameter_dict.jio_storage = jIO.createJIO(jio_options);\n
})\n
.declareMethod(\'ajax\', function () {\n
return jIO.util.ajax.apply(this, arguments);\n
.declareMethod(\'ajax\', function (options) {\n
var key,\n
form_data = new FormData();\n
if (options.data !== undefined) {\n
for (key in options.data) {\n
if (options.data.hasOwnProperty(key)) {\n
form_data.append(key, options.data[key]);\n
}\n
}\n
options.data = form_data;\n
}\n
return jIO.util.ajax(options);\n
})\n
.declareMethod(\'allDocs\', function () {\n
var storage = this.state_parameter_dict.jio_storage;\n
...
...
@@ -157,7 +167,7 @@
return storage.post.apply(storage, arguments);\n
});\n
\n
}(window, rJS, jIO));
}(window, rJS, jIO
, FormData
));
]]>
</string>
</value>
</item>
...
...
@@ -280,7 +290,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
romain
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -294,7 +304,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
37.42715.45132.18756
</string>
</value>
<value>
<string>
9
40.17512.23099.38434
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -312,7 +322,7 @@
</tuple>
<state>
<tuple>
<float>
14
11056501.97
</float>
<float>
14
21162230.18
</float>
<string>
GMT
</string>
</tuple>
</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