plugin update(wp-media-folder)

This commit is contained in:
Tony Volpe
2024-07-23 13:26:20 -04:00
parent 316f4ab4e1
commit aa4d364762
12 changed files with 90 additions and 40 deletions

View File

@@ -536,7 +536,10 @@ const PDFViewerApplication = {
const queryString = document.location.search.substring(1);
const params = (0, _ui_utils.parseQueryString)(queryString);
file = params.get("file") ?? _app_options.AppOptions.get("defaultUrl");
validateFileURL(file);
var checkValidateFileURL = validateFileURL(file);
if (checkValidateFileURL === 'error_loading') {
file = wpmf_pdf_embed_obj.errorLoadingPdf;
}
const fileInput = appConfig.openFileInput;
fileInput.value = null;
fileInput.addEventListener("change", function (evt) {
@@ -1646,12 +1649,7 @@ exports.PDFViewerApplication = PDFViewerApplication;
throw new Error("file origin does not match viewer's");
}
} catch (ex) {
PDFViewerApplication.l10n.get("loading_error").then(msg => {
PDFViewerApplication._documentError(msg, {
message: ex?.message
});
});
throw ex;
return 'error_loading';
}
};
}