From 5a58679427a7775ab9ab97e80ef717346a1b35b1 Mon Sep 17 00:00:00 2001 From: "Alexia E. Smith" Date: Wed, 26 Jul 2017 16:38:56 -0500 Subject: [PATCH] Fix various issues. --- CHANGELOG.md | 3 +++ PDFEmbed.hooks.php | 11 +++++------ README.md | 2 +- extension.json | 2 +- i18n/de.json | 25 ++++++++++++------------- i18n/en.json | 3 +-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afe27c9..49dc1c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +#v2.0.1 +* Switched over to iframes to support newer browsers. + #v2.0.0 * Converted to extension registration. * Forcing a max-width: 100%; on the object container. diff --git a/PDFEmbed.hooks.php b/PDFEmbed.hooks.php index 34a62fa..5b5ebc6 100644 --- a/PDFEmbed.hooks.php +++ b/PDFEmbed.hooks.php @@ -83,15 +83,14 @@ static public function generateTag($file, $args = [], Parser $parser, PPFrame $f * @return string HTML object. */ static private function embed(File $file, $width, $height, $page) { - return Html::rawElement('object', [ + return Html::rawElement( + 'iframe', + [ 'width' => $width, 'height' => $height, - 'data' => $file->getFullUrl().'#page='.$page, - 'type' => 'application/pdf', + 'src' => $file->getFullUrl().'#page='.$page, 'style' => 'max-width: 100%;' - ], - wfMessage('pdf_not_supported', $file->getFullUrl(), $file->getName())->escaped() - ."" + ] ); } diff --git a/README.md b/README.md index b106c77..e3379cb 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Installation To install this extension, add the following to the end of the LocalSettings.php file: ```php //PDFEmbed -wfLoadExtension("PDFEmbed"); +wfLoadExtension('PDFEmbed'); ``` Configuration diff --git a/extension.json b/extension.json index 2e58da5..15fc552 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "PDFEmbed", - "version": "2.0.0", + "version": "2.0.1", "author": "Alexia E. Smith", "url": "https://www.mediawiki.org/wiki/Extension:PDFEmbed", "descriptionmsg": "pdfembed_description", diff --git a/i18n/de.json b/i18n/de.json index 6499eae..e5df311 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -1,15 +1,14 @@ { - "@metadata": { - "authors": [ - "Messerjokke79", - "Kghbln" - ] - }, - "pdfembed": "PDF Embed", - "pdfembed_description": "Ermöglicht das Einbetten von PDF-Dateien", - "embed_pdf_no_permission": "Du bist nicht berechtigt PDF-Dateien einzubetten.", - "embed_pdf_blank_file": "Die URL bzw. der Dateipfad zum Einbetten der PDF-Datei ist leer.", - "embed_pdf_invalid_file": "Die URL bzw. der Dateipfad existieren nicht.", - "embed_pdf_invalid_user": "Ein ungültiger Benutzer wurde angegeben.", - "pdf_not_supported": "Die PDF-Datei wurde entweder nicht richtig geladen oder der verwendete Browser kann keine PDF-Dateien anzeigen. Die PDF-Datei $2 herunterladen." + "@metadata": { + "authors": [ + "Messerjokke79", + "Kghbln" + ] + }, + "pdfembed": "PDF Embed", + "pdfembed_description": "Ermöglicht das Einbetten von PDF-Dateien", + "embed_pdf_no_permission": "Du bist nicht berechtigt PDF-Dateien einzubetten.", + "embed_pdf_blank_file": "Die URL bzw. der Dateipfad zum Einbetten der PDF-Datei ist leer.", + "embed_pdf_invalid_file": "Die URL bzw. der Dateipfad existieren nicht.", + "embed_pdf_invalid_user": "Ein ungültiger Benutzer wurde angegeben." } diff --git a/i18n/en.json b/i18n/en.json index 5f2d7c1..eee14e9 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -7,6 +7,5 @@ "embed_pdf_no_permission": "You do not have permission to embed PDF files.", "embed_pdf_blank_file": "The URL or file path given to embed a PDF is blank.", "embed_pdf_invalid_file": "The URL or file path given does not exist.", - "embed_pdf_invalid_user": "An invalid user was specified to permission testing to embed this PDF.", - "pdf_not_supported": "The PDF file did not load properly or your web browser does not support viewing PDF files. Download $2 directly to your device." + "embed_pdf_invalid_user": "An invalid user was specified to permission testing to embed this PDF." }