Changeset 1582595
- Timestamp:
- 01/26/2017 01:08:06 PM (9 years ago)
- Location:
- simple-google-docs-viewer/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
simple-google-docs-viewer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-google-docs-viewer/trunk/readme.txt
r689731 r1582595 1 1 === Simple Google Docs Viewer === 2 2 Contributors: maor, illuminea 3 Tags: google-docs, embed-pdf, documents 3 Tags: google-docs, embed-pdf, documents, pdf-viewer 4 4 Requires at least: 3.0 5 Tested up to: 3.56 Stable tag: 1. 05 Tested up to: 4.7.1 6 Stable tag: 1.1 7 7 License: GPLv2 or later 8 8 9 Enables you to easily embed documents with Google Docs Viewer - that are supported by Google Docs (PDF/DOC/DOCX/PPTX/etc). 10 9 Easily embed documents like PDFs, Word documents, and Powerpoint in your site using Google Docs Viewer. 11 10 == Description == 12 11 13 Enables you to easily embed documents with Google Docs Viewer - that are supported by Google Docs (PDF/DOC/DOCX/PPTX/etc) with a simple shortcode. `[gviewer]` 12 Easily embed documents supported by Google Docs (PDF/DOC/DOCX/PPTX/etc)with a simple shortcode `[gviewer]` 13 14 Ex. [gviewer file=”https://example.com/thisismyfile.pdf”] 14 15 15 16 A full list of attributes: 16 17 17 18 * `file` -- __Required__. The URL of the file you wish to show 18 * `width` -- Optional. The desired width of the viewer in pixels. If no thing set, the value of the theme's `$content_width` will be used. If no value set, the height of 600 pixels will be used.19 * `height` -- Optional. The desired height of the viewer in pixels. If nothing set, the height will 1.2 times the width. So for instance, if the width was 100px, the height will be 120px.20 * `language` -- The language of the document. If the document is written in a RTL language (Hebrew, Arabic, etc) then specifying the language will also apply right-to-leftsettings.19 * `width` -- Optional. The desired width of the viewer in pixels. If no width is set, the value of the theme's `$content_width` will be used. If no value is set, the width will default to 600 px. 20 * `height` -- Optional. The desired height of the viewer in pixels. If height is set, the height will 1.2 times the width. For example, if the width is 100 px, the height will be 120 px. 21 * `language` -- The language of the document. If the document is written in a right-to-left (RTL) language (like Hebrew and Arabic), specifying the language will apply RTL settings. 21 22 22 A yet another way to embed a Google Document is possible by using the template tag provided by the plugin. Here's an example.23 Another way to embed a Google Document is by using the template tag provided by the plugin in the source code. Here's an example: 23 24 24 25 ` 25 26 <?php 26 27 27 echo simple_gviewer_embed( 'http ://.../file.pdf', $args );28 echo simple_gviewer_embed( 'https://.../file.pdf', $args ); 28 29 ` 29 30 … … 40 41 == Screenshots == 41 42 42 1. What the shortcode translates to on the front-end43 2. A sample use of the "gviewer" shortcode 43 1. How an embedded document looks in the front-end. 44 2. A sample use of the "gviewer" shortcode. 44 45 45 46 == Changelog == 46 47 48 = 1.1 = 49 50 * Added support for https 51 * iframes are now responsive out of the box 52 53 47 54 = 1.0 = 48 55 49 56 * Initial release 57 -
simple-google-docs-viewer/trunk/simple-google-docs-viewer.php
r689522 r1582595 2 2 /* 3 3 Plugin Name: Simple Google Docs Viewer 4 Plugin URI: http://www.illuminea.com/ plugins4 Plugin URI: http://www.illuminea.com/ 5 5 Description: Enables you to easily embed documents with Google Docs Viewer - that are supported by Google Docs (PDF/DOC/DOCX/PPTX/etc). 6 6 Author: illuminea … … 71 71 72 72 if ( '' != ( $file = apply_filters( 'simple_gviewer_file_url', $file ) ) ) { 73 $embed_format = '<iframe src="http ://docs.google.com/viewer?url=%1$s&embedded=true&hl=%2$s" width="%3$d" height="%4$d" style="border: none;"></iframe>';73 $embed_format = '<iframe src="https://docs.google.com/viewer?url=%1$s&embedded=true&hl=%2$s" width="100%%" height="%4$d" style="border: none; max-width:' . $content_width . 'px;"></iframe>'; 74 74 75 75 return sprintf( $embed_format,