mirror of
https://github.com/24eme/signaturepdf.git
synced 2023-08-25 09:33:08 +02:00
Loading pdf from hash
This commit is contained in:
parent
a41155c950
commit
b6dad1dcf5
@ -947,7 +947,15 @@ var pageSignature = async function(url) {
|
||||
fontCaveat = font;
|
||||
});
|
||||
|
||||
let pdfBlob = await getPDFBlobFromCache(url);
|
||||
if(hash) {
|
||||
var response = await fetch(url);
|
||||
if(response.status != 200) {
|
||||
return;
|
||||
}
|
||||
let pdfBlob = await response.blob();
|
||||
} else {
|
||||
let pdfBlob = await getPDFBlobFromCache(url);
|
||||
}
|
||||
if(!pdfBlob) {
|
||||
document.location = '/signature';
|
||||
return;
|
||||
@ -962,6 +970,11 @@ var pageSignature = async function(url) {
|
||||
};
|
||||
|
||||
(function () {
|
||||
if(hash) {
|
||||
pageSignature('/signature/'+hash+'/pdf');
|
||||
return;
|
||||
}
|
||||
|
||||
if(window.location.hash && window.location.hash.match(/^\#http/)) {
|
||||
let hashUrl = window.location.hash.replace(/^\#/, '');
|
||||
pageUpload();
|
||||
|
@ -157,6 +157,10 @@
|
||||
<script>
|
||||
var maxSize = <?php echo $maxSize ?>;
|
||||
var maxPage = <?php echo $maxPage ?>;
|
||||
var hash = null;
|
||||
<?php if(isset($hash)): ?>
|
||||
hash = "<?php echo $hash ?>";
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
<script src="/js/signature.js?202203261059"></script>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user