From f311062b5a31057a24d337112499fe999b124980 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 29 Nov 2019 20:48:40 +0100 Subject: [PATCH] better function name --- static/js/document.js | 4 ++-- static/js/utils.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/document.js b/static/js/document.js index 1f517fabc..22fee0a0c 100644 --- a/static/js/document.js +++ b/static/js/document.js @@ -66,7 +66,7 @@ pandora.ui.document = function() { ? pandora.user.ui.documents[item.id].position : 1, url: '/documents/' + item.id + '/' - + pandora.safePDFName(item.title + '.' + item.extension), + + pandora.safeDocumentName(item.title) + '.' + item.extension, width: that.width(), zoom: 'fit' }) @@ -80,7 +80,7 @@ pandora.ui.document = function() { imageHeight: item.dimensions[1], imagePreviewURL: pandora.getMediaURL('/documents/' + item.id + '/256p.jpg?' + item.modified), imageURL: pandora.getMediaURL('/documents/' + item.id + '/' - + pandora.safePDFName(item.title) + '.' + item.extension + '?' + item.modified), + + pandora.safeDocumentName(item.title) + '.' + item.extension + '?' + item.modified), imageWidth: item.dimensions[0], width: that.width() }).css({ diff --git a/static/js/utils.js b/static/js/utils.js index c39783457..a4de127da 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -2640,7 +2640,7 @@ pandora.openURL = function(url) { } }; -pandora.safePDFName = function(name) { +pandora.safeDocumentName = function(name) { name = name.replace('?', '_').replace('#', '_'); return name; };