Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TsaGUI
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patricio Kumagae
TsaGUI
Commits
f193ce97
Commit
f193ce97
authored
6 years ago
by
Patricio Kumagae
Browse files
Options
Downloads
Patches
Plain Diff
Cambios en la extensión del archivo
parent
518f841e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/js/index.js
+30
-56
30 additions, 56 deletions
lib/js/index.js
with
30 additions
and
56 deletions
lib/js/index.js
+
30
−
56
View file @
f193ce97
...
...
@@ -22,10 +22,7 @@ function allowDrop(e) {
}
function
stamp
(
e
){
e
.
preventDefault
();
/*$('#ots_div').html('<img src="' + loader_gif + '">');
$('#ots_div').show();*/
e
.
preventDefault
();
var
file
=
e
.
dataTransfer
.
items
[
0
].
getAsFile
();
...
...
@@ -48,7 +45,7 @@ function stamp(e){
success
:
function
(
response
){
var
ots
=
'
{"file_hash": "
'
+
file_hash
+
'
", "
ots
": "
'
+
response
.
temporay_ots
+
'
"}
'
;
var
ots
=
'
{"file_hash": "
'
+
file_hash
+
'
", "
rd
": "
'
+
response
.
temporay_ots
+
'
"}
'
;
var
saveData
=
(
function
()
{
...
...
@@ -66,8 +63,8 @@ function stamp(e){
};
}());
var
data
=
response
.
temporay_
ots
fileName
=
file
.
name
+
"
.
ots
.temp
"
;
var
data
=
response
.
temporay_
rd
fileName
=
file
.
name
+
"
.
rd
.temp
"
;
saveData
(
data
,
fileName
);
...
...
@@ -76,32 +73,6 @@ function stamp(e){
}
}
function
verify
(
json_ots
){
try
{
var
ots
=
JSON
.
parse
(
json_ots
);
}
catch
(
err
){
$
(
'
#response
'
).
html
(
'
<span class="glyphicon glyphicon-remove text-danger"></span> Parámetros inválidos
'
);
return
;
}
if
(
deadline_date
<
current_date
){
verify_bfa
(
ots
);
}
else
{
a
=
2
;
}
}
function
verify_bfa
(
ots
){
var
pending
=
false
;
...
...
@@ -110,7 +81,7 @@ function verify_bfa(ots){
$
.
ajax
({
url
:
tsa_api
+
"
verify/
"
,
type
:
"
POST
"
,
data
:
{
"
file_hash
"
:
ots
.
file_hash
,
"
ots
"
:
ots
.
ots
},
data
:
{
"
file_hash
"
:
ots
.
file_hash
,
"
rd
"
:
ots
.
rd
},
dataType
:
"
json
"
,
success
:
function
(
response
){
...
...
@@ -130,27 +101,30 @@ function verify_bfa(ots){
$
(
'
#response
'
).
html
(
message
);
var
saveData
=
(
function
()
{
var
a
=
document
.
createElement
(
"
a
"
);
document
.
body
.
appendChild
(
a
);
a
.
style
=
"
display: none
"
;
return
function
(
data
,
fileName
)
{
var
json
=
JSON
.
stringify
(
data
),
blob
=
new
Blob
([
json
],
{
type
:
"
octet/stream
"
}),
url
=
window
.
URL
.
createObjectURL
(
blob
);
a
.
href
=
url
;
a
.
download
=
fileName
;
a
.
click
();
window
.
URL
.
revokeObjectURL
(
url
);
};
}());
var
data
=
response
.
permanent_ots
;
fileName
=
$
(
'
#hidden_original_file_name
'
).
val
()
+
"
.ots
"
;
if
(
$
(
'
#ots_info
'
).
html
().
includes
(
'
.temp
'
)){
saveData
(
data
,
fileName
);
}
if
(
!
pending
){
var
saveData
=
(
function
()
{
var
a
=
document
.
createElement
(
"
a
"
);
document
.
body
.
appendChild
(
a
);
a
.
style
=
"
display: none
"
;
return
function
(
data
,
fileName
)
{
var
json
=
JSON
.
stringify
(
data
),
blob
=
new
Blob
([
json
],
{
type
:
"
octet/stream
"
}),
url
=
window
.
URL
.
createObjectURL
(
blob
);
a
.
href
=
url
;
a
.
download
=
fileName
;
a
.
click
();
window
.
URL
.
revokeObjectURL
(
url
);
};
}());
var
data
=
response
.
permanent_rd
;
fileName
=
$
(
'
#hidden_original_file_name
'
).
val
()
+
"
.rd
"
;
if
(
$
(
'
#ots_info
'
).
html
().
includes
(
'
.temp
'
)){
saveData
(
data
,
fileName
);
}
}
},
error
:
function
(
jqXHR
,
textStatus
,
errorThrown
){
...
...
@@ -210,7 +184,7 @@ function drop_ots(e){
$
(
'
#ots_info
'
).
html
(
file
.
name
);
var
ots
=
{
"
file_hash
"
:
file_hash
,
"
ots
"
:
file_contents
}
var
ots
=
{
"
file_hash
"
:
file_hash
,
"
rd
"
:
file_contents
}
verify_bfa
(
ots
);
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment