💦 FULL SET: Changeset/ - Uncensored 2025

Changeset 1582595


Ignore:
Timestamp:
01/26/2017 01:08:06 PM (9 years ago)
Author:
illuminea
Message:

Adding first version of my plugin

Location:
simple-google-docs-viewer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simple-google-docs-viewer/trunk/readme.txt

    r689731 r1582595  
    11=== Simple Google Docs Viewer ===
    22Contributors: maor, illuminea
    3 Tags: google-docs, embed-pdf, documents
     3Tags: google-docs, embed-pdf, documents, pdf-viewer
    44Requires at least: 3.0
    5 Tested up to: 3.5
    6 Stable tag: 1.0
     5Tested up to: 4.7.1
     6Stable tag: 1.1
    77License: GPLv2 or later
    88
    9 Enables you to easily embed documents with Google Docs Viewer - that are supported by Google Docs (PDF/DOC/DOCX/PPTX/etc).
    10 
     9Easily embed documents like PDFs, Word documents, and Powerpoint in your site using Google Docs Viewer.
    1110== Description ==
    1211
    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]`
     12Easily embed documents supported by Google Docs (PDF/DOC/DOCX/PPTX/etc)with a simple shortcode `[gviewer]`
     13 
     14Ex. [gviewer file=”https://example.com/thisismyfile.pdf”]
    1415
    1516A full list of attributes:
    1617
    1718* `file` -- __Required__. The URL of the file you wish to show
    18 * `width` -- Optional. The desired width of the viewer in pixels. If nothing 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-left settings.
     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.
    2122
    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.
     23Another way to embed a Google Document is by using the template tag provided by the plugin in the source code. Here's an example:
    2324
    2425`
    2526<?php
    2627
    27 echo simple_gviewer_embed( 'http://.../file.pdf', $args );
     28echo simple_gviewer_embed( 'https://.../file.pdf', $args );
    2829`
    2930
     
    4041== Screenshots ==
    4142
    42 1. What the shortcode translates to on the front-end
    43 2. A sample use of the "gviewer" shortcode
     431. How an embedded document looks in the front-end.
     442. A sample use of the "gviewer" shortcode.
    4445
    4546== Changelog ==
    4647
     48= 1.1 =
     49 
     50* Added support for https
     51* iframes are now responsive out of the box
     52 
     53 
    4754= 1.0 =
    4855
    4956* Initial release
     57
  • simple-google-docs-viewer/trunk/simple-google-docs-viewer.php

    r689522 r1582595  
    22/*
    33 Plugin Name: Simple Google Docs Viewer
    4  Plugin URI: http://www.illuminea.com/plugins
     4 Plugin URI: http://www.illuminea.com/
    55 Description: Enables you to easily embed documents with Google Docs Viewer - that are supported by Google Docs (PDF/DOC/DOCX/PPTX/etc).
    66 Author: illuminea
     
    7171
    7272        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>';
    7474           
    7575            return sprintf( $embed_format,
Note: See