Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
dream
Commits
32c14fc9
Commit
32c14fc9
authored
Jan 29, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix download JSON for IE
parent
8ffffaff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
10 deletions
+18
-10
dream/platform/__init__.py
dream/platform/__init__.py
+8
-0
dream/platform/src/dream/Input_viewDocumentManagement.html
dream/platform/src/dream/Input_viewDocumentManagement.html
+4
-0
dream/platform/src/dream/Input_viewDocumentManagement.js
dream/platform/src/dream/Input_viewDocumentManagement.js
+6
-10
No files found.
dream/platform/__init__.py
View file @
32c14fc9
...
...
@@ -118,6 +118,14 @@ def _runWithTimeout(queue, func, args, kw):
queue
.
put
(
func
(
*
args
,
**
kw
))
@
app
.
route
(
"/postJSONData"
,
methods
=
[
"POST"
,
"OPTIONS"
])
def
postJSONData
():
"""Returns posted JSON data as it is for Export button"""
data
=
json
.
loads
(
request
.
form
.
get
(
'data'
))
response
=
jsonify
(
data
)
response
.
headers
[
'Content-Disposition'
]
=
'attachment; filename=dream.json'
return
response
@
app
.
route
(
"/runSimulation"
,
methods
=
[
"POST"
,
"OPTIONS"
])
def
runSimulation
():
parameter_dict
=
request
.
json
...
...
dream/platform/src/dream/Input_viewDocumentManagement.html
View file @
32c14fc9
...
...
@@ -15,6 +15,10 @@
</head>
<body>
<a
class=
"export_link ui-btn ui-btn-inline ui-icon-action ui-btn-icon-right"
>
Export
</a>
<form
id=
"export_form"
style=
"display:none"
method=
"post"
action=
"../../postJSONData"
>
<textarea
id=
"export_json"
name=
"data"
></textarea>
</form>
<form
class=
"knowledge_form"
>
<button
type=
"submit"
class=
"ui-btn ui-btn-b ui-btn-inline
ui-icon-refresh ui-btn-icon-right"
>
Run Knowledge Extraction Tool
</button>
...
...
dream/platform/src/dream/Input_viewDocumentManagement.js
View file @
32c14fc9
...
...
@@ -4,14 +4,6 @@
initGadgetMixin
)
{
"
use strict
"
;
function
datatouri
(
data
,
mime_type
)
{
var
result
=
"
data:
"
;
if
(
mime_type
!==
undefined
)
{
result
+=
mime_type
;
}
return
result
+
"
;base64,
"
+
window
.
btoa
(
data
);
}
function
disableAllButtons
(
gadget
)
{
// Prevent double click
var
i
,
...
...
@@ -141,8 +133,12 @@
})
.
push
(
function
(
result_list
)
{
var
export_link
=
gadget
.
props
.
element
.
querySelector
(
"
.export_link
"
);
export_link
.
download
=
result_list
[
0
].
data
.
title
;
export_link
.
href
=
datatouri
(
result_list
[
1
],
"
application/json
"
);
// XXX this breaks promise chain
$
(
export_link
).
click
(
function
()
{
$
(
'
#export_json
'
).
val
(
result_list
[
1
]);
return
$
(
'
#export_form
'
).
submit
();
});
});
})
...
...
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