PDF Embedder - Version 4.2

Version Description

Fixed script problem on some Gutenberg editor installations. Improved compatibility

Download this release

Release Info

Developer levertechadmin
Plugin Icon 128x128 PDF Embedder
Version 4.2
Comparing to
See all releases

Code changes from version 4.1 to 4.2

Files changed (3) hide show
  1. js/pdfemb-blocks.js +12 -12
  2. pdf_embedder.php +2 -2
  3. readme.txt +49 -2
js/pdfemb-blocks.js CHANGED
@@ -1,7 +1,7 @@
1
  /*
2
  * Gutenberg block Javascript code
3
  */
4
- var _ = wp.__nx; // The _() function for internationalization.
5
  var createElement = wp.element.createElement; // The wp.element.createElement() function to create elements.
6
  var registerBlockType = wp.blocks.registerBlockType; // The registerBlockType() function to register blocks.
7
 
@@ -25,7 +25,7 @@
25
  registerBlockType(
26
  'pdfemb/pdf-embedder-viewer', // Block name. Must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
27
  {
28
- title: 'PDF Embedder', // Block title. __() function allows for internationalization.
29
  icon: 'media-document', // Block icon from Dashicons. https://developer.wordpress.org/resource/dashicons/.
30
  category: 'common', // Block category. Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
31
  attributes: {
@@ -55,7 +55,7 @@
55
  edit: function( props ) {
56
 
57
  var {attributes , setAttributes, focus, className} = props;
58
-
59
  var InspectorControls = wp.editor.InspectorControls;
60
  var Button = wp.components.Button;
61
  var RichText = wp.editor.RichText;
@@ -65,7 +65,7 @@
65
  var TextControl = wp.components.TextControl;
66
  var SelectControl = wp.components.SelectControl;
67
  var RadioControl = wp.components.RadioControl;
68
-
69
  var onSelectPDF = function(media) {
70
  return props.setAttributes({
71
  url: media.url,
@@ -112,7 +112,7 @@
112
  createElement(
113
  'p',
114
  {},
115
- 'Change the Height & Width of the PDF',
116
  ),
117
  createElement(
118
  'hr',
@@ -121,12 +121,12 @@
121
  createElement(
122
  'p',
123
  {},
124
- 'Enter max or an integer number of pixels.'
125
  ),
126
  createElement(
127
  TextControl,
128
  {
129
- label: 'Width',
130
  value: attributes.width,
131
  onChange: onChangeWidth
132
  }
@@ -134,7 +134,7 @@
134
  createElement(
135
  TextControl,
136
  {
137
- label: 'Height',
138
  value: attributes.height,
139
  onChange: onChangeHeight
140
  }
@@ -142,7 +142,7 @@
142
  createElement(
143
  SelectControl,
144
  {
145
- label: 'Toolbar Location',
146
  value: attributes.toolbar,
147
  options: [
148
  { label: 'Top', value: 'top' },
@@ -156,11 +156,11 @@
156
  createElement(
157
  RadioControl,
158
  {
159
- label: 'Toolbar Hover',
160
  selected: attributes.toolbarfixed,
161
  options: [
162
- { label: 'Toolbar appears only on hover over document', value: 'off' },
163
- { label: 'Toolbar always visible ', value: 'on' }
164
  ],
165
  onChange: onChangeToolbarfixed
166
  }
1
  /*
2
  * Gutenberg block Javascript code
3
  */
4
+ var __ = wp.i18n.__; // The __() function for internationalization.
5
  var createElement = wp.element.createElement; // The wp.element.createElement() function to create elements.
6
  var registerBlockType = wp.blocks.registerBlockType; // The registerBlockType() function to register blocks.
7
 
25
  registerBlockType(
26
  'pdfemb/pdf-embedder-viewer', // Block name. Must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
27
  {
28
+ title: __( 'PDF Embedder' ), // Block title. __() function allows for internationalization.
29
  icon: 'media-document', // Block icon from Dashicons. https://developer.wordpress.org/resource/dashicons/.
30
  category: 'common', // Block category. Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
31
  attributes: {
55
  edit: function( props ) {
56
 
57
  var {attributes , setAttributes, focus, className} = props;
58
+
59
  var InspectorControls = wp.editor.InspectorControls;
60
  var Button = wp.components.Button;
61
  var RichText = wp.editor.RichText;
65
  var TextControl = wp.components.TextControl;
66
  var SelectControl = wp.components.SelectControl;
67
  var RadioControl = wp.components.RadioControl;
68
+
69
  var onSelectPDF = function(media) {
70
  return props.setAttributes({
71
  url: media.url,
112
  createElement(
113
  'p',
114
  {},
115
+ __('Change the Height & Width of the PDF'),
116
  ),
117
  createElement(
118
  'hr',
121
  createElement(
122
  'p',
123
  {},
124
+ __('Enter max or an integer number of pixels.')
125
  ),
126
  createElement(
127
  TextControl,
128
  {
129
+ label: __('Width'),
130
  value: attributes.width,
131
  onChange: onChangeWidth
132
  }
134
  createElement(
135
  TextControl,
136
  {
137
+ label: __('Height'),
138
  value: attributes.height,
139
  onChange: onChangeHeight
140
  }
142
  createElement(
143
  SelectControl,
144
  {
145
+ label: __('Toolbar Location'),
146
  value: attributes.toolbar,
147
  options: [
148
  { label: 'Top', value: 'top' },
156
  createElement(
157
  RadioControl,
158
  {
159
+ label: __('Toolbar Hover'),
160
  selected: attributes.toolbarfixed,
161
  options: [
162
+ { label: __('Toolbar appears only on hover over document'), value: 'off' },
163
+ { label: __('Toolbar always visible '), value: 'on' }
164
  ],
165
  onChange: onChangeToolbarfixed
166
  }
pdf_embedder.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: PDF Embedder
5
  * Plugin URI: http://wp-pdf.com/
6
  * Description: Embed PDFs straight into your posts and pages, with flexible width and height. No third-party services required. Compatible with Gutenberg Editor WordPress
7
- * Version: 4.1
8
  * Author: Dan Lester
9
  * Author URI: http://wp-pdf.com/
10
  * License: GPL3
@@ -15,7 +15,7 @@ require_once( plugin_dir_path(__FILE__).'/core/core_pdf_embedder.php' );
15
 
16
  class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
17
 
18
- protected $PLUGIN_VERSION = '4.1';
19
 
20
  // Singleton
21
  private static $instance = null;
4
  * Plugin Name: PDF Embedder
5
  * Plugin URI: http://wp-pdf.com/
6
  * Description: Embed PDFs straight into your posts and pages, with flexible width and height. No third-party services required. Compatible with Gutenberg Editor WordPress
7
+ * Version: 4.2
8
  * Author: Dan Lester
9
  * Author URI: http://wp-pdf.com/
10
  * License: GPL3
15
 
16
  class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
17
 
18
+ protected $PLUGIN_VERSION = '4.2';
19
 
20
  // Singleton
21
  private static $instance = null;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: levertechadmin, danlester
3
  Tags: doc, pdf, pdf viewer, office, google, document, embed, intranet
4
  Requires at least: 3.5
5
  Tested up to: 5.2.1
6
- Stable tag: 4.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -203,10 +203,18 @@ the Plugins section of your Wordpress admin
203
 
204
  == Changelog ==
205
 
206
- = 3.2.1 =
 
 
 
 
207
 
208
  Added compatibility for Wordpress 5.2.1
209
 
 
 
 
 
210
  = 3.2 =
211
 
212
  Added compatibility with Gutenberg Editor
@@ -244,6 +252,45 @@ Helps debugging any issues.
244
 
245
  Added NL language.
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  = 2.8.2 =
248
 
249
  Latest version of pdf.js library to include recent rendering developments/fixes by the team.
3
  Tags: doc, pdf, pdf viewer, office, google, document, embed, intranet
4
  Requires at least: 3.5
5
  Tested up to: 5.2.1
6
+ Stable tag: 4.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
203
 
204
  == Changelog ==
205
 
206
+ = 4.2 =
207
+
208
+ Fixed script problem on some Gutenberg editor installations. Improved compatibility
209
+
210
+ = 4.1 =
211
 
212
  Added compatibility for Wordpress 5.2.1
213
 
214
+ = 4.0 =
215
+
216
+ Fixed general bug & added compatibility
217
+
218
  = 3.2 =
219
 
220
  Added compatibility with Gutenberg Editor
252
 
253
  Added NL language.
254
 
255
+ == 3.2.1 ==
256
+
257
+ Added compatibility for WordPress 5.2.1
258
+
259
+ == 3.2 ==
260
+
261
+ Added compatibility with Gutenberg Editor
262
+
263
+ == 3.1.8 ==
264
+
265
+ Updated version of underlying pdf.js library, fixes some rendering bugs.
266
+
267
+ Recalculates fresh viewer size more often in response to resize events. Previous versions attempted to increase performance by only recalculating viewer size when it had changed, but this missed some required resizing after Javascript-based tabs are clicked.
268
+
269
+ Fixed some issues with zoom appearance.
270
+
271
+ Mouse scroll wheel is now more consistent across all browsers (in terms of scroll speed).
272
+
273
+ When scrollbars are always visible, no longer cuts off edge of PDF underneath.
274
+
275
+ == 3.1.2 ==
276
+
277
+ Ready for compatibility with WordPress 4.8.
278
+
279
+ New mouse wheel scrolling in Firefox wasn’t working with some themes.
280
+
281
+ Latest version of pdf.js library, and newest code bringing the free version into line with the premium versions.
282
+
283
+ Mouse wheel scrolling in Firefox no longer also scrolls the window unless at very top or bottom of page.
284
+
285
+ == 3.0.1 ==
286
+
287
+ Latest version of pdf.js library, and newest code bringing the free version into line with the premium versions.
288
+
289
+ Improved responsiveness and redraw of pages.
290
+
291
+ Plugin now respects the SCRIPT_DEBUG flag in wp-config.php and displays non-minified versions of the JS files if this is set to true.
292
+ Helps debugging any issues.
293
+
294
  = 2.8.2 =
295
 
296
  Latest version of pdf.js library to include recent rendering developments/fixes by the team.