Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vereign Client Library
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
5
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
Vereign Client Library
Merge requests
!25
Ability to upload a document in Dashboard
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Ability to upload a document in Dashboard
422-upload-documents
into
master
Overview
1
Commits
11
Pipelines
0
Changes
5
Merged
Alexey Lunin
requested to merge
422-upload-documents
into
master
6 years ago
Overview
1
Commits
11
Pipelines
0
Changes
3
Expand
ticket
https://code.vereign.com/code/dashboard/issues/422
0
0
Merge request reports
Viewing commit
d7851870
Prev
Next
Show latest version
3 files
+
68
−
44
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
d7851870
Added wopi put file
· d7851870
Alexey Lunin
authored
6 years ago
javascript/src/iframe/viamapi-iframe.js
+
40
−
0
Options
@@ -1074,9 +1074,49 @@ const connection = Penpal.connectToParent({
result
(
res
)
})
},
// Collabora APIs
collaboraDiscovery
()
{
return
collaboraApi
.
discovery
().
then
(
apps
=>
apps
);
},
// WOPI APIs
// TODO rewrite with async await
getPassports
:
function
(
fileID
)
{
return
new
Penpal
.
Promise
(
function
(
result
)
{
const
authenticationPublicKey
=
localStorage
.
getItem
(
"
authenticatedIdentity
"
);
if
(
!
authenticationPublicKey
||
!
window
.
loadedIdentities
[
authenticationPublicKey
]
||
!
extendPinCodeTtl
(
authenticationPublicKey
)
)
{
return
encodeResponse
(
"
400
"
,
""
,
"
Identity not authenticated
"
);
}
wopiAPI
.
getPassports
(
fileID
).
then
(
function
(
response
)
{
result
(
response
.
data
);
});
});
},
// TODO rewrite with async await
wopiPutFile
:
function
(
fileId
,
accessToken
,
file
)
{
return
new
Penpal
.
Promise
(
function
(
result
)
{
const
authenticationPublicKey
=
localStorage
.
getItem
(
"
authenticatedIdentity
"
);
if
(
!
authenticationPublicKey
||
!
window
.
loadedIdentities
[
authenticationPublicKey
]
||
!
extendPinCodeTtl
(
authenticationPublicKey
)
)
{
return
encodeResponse
(
"
400
"
,
""
,
"
Identity not authenticated
"
);
}
wopiAPI
.
putDocument
(
fileId
,
accessToken
,
file
).
then
(
function
(
response
)
{
result
(
response
.
data
);
});
});
},
...
penpalMethods
}
});
Loading