Version Description
Now translation-ready! Your language contributions are welcome. Compatibility with WordPress 4.4
Contains information about new features in Premium version: Functioning hyperlinks Jump to page number
Download this release
Release Info
Developer | danlester |
Plugin | PDF Embedder |
Version | 2.4 |
Comparing to | |
See all releases |
Code changes from version 2.2.5 to 2.4
- core/core_pdf_embedder.php +75 -38
- css/pdfemb-admin.css +10 -0
- css/pdfemb-embed-pdf.css +83 -1
- js/all-pdfemb-basic.min.js +20 -17
- js/pdfemb-embed-pdf.js +141 -61
- lang/deploy_make_lang.sh +11 -0
- lang/pdf-embedder.pot +390 -0
- pdf_embedder.php +50 -16
- readme.txt +34 -2
core/core_pdf_embedder.php
CHANGED
@@ -32,7 +32,23 @@ class core_pdf_embedder {
|
|
32 |
|
33 |
protected function get_translation_array() {
|
34 |
return Array('worker_src' => $this->my_plugin_url().'js/pdfjs/pdf.worker'.($this->useminified() ? '.min' : '').'.js',
|
35 |
-
'cmap_url' => $this->my_plugin_url().'js/pdfjs/cmaps/'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
|
38 |
protected function get_extra_js_name() {
|
@@ -49,14 +65,25 @@ class core_pdf_embedder {
|
|
49 |
}
|
50 |
|
51 |
public function pdfemb_post_mime_types($post_mime_types) {
|
52 |
-
$post_mime_types['application/pdf'] = array( __( 'PDFs' ), __( 'Manage PDFs' ), _n_noop( 'PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>' ) );
|
53 |
return $post_mime_types;
|
54 |
}
|
55 |
|
56 |
// Embed PDF shortcode instead of link
|
57 |
public function pdfemb_media_send_to_editor($html, $id, $attachment) {
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
} else {
|
61 |
return $html;
|
62 |
}
|
@@ -146,12 +173,12 @@ class core_pdf_embedder {
|
|
146 |
|
147 |
public function pdfemb_admin_menu() {
|
148 |
if (is_multisite()) {
|
149 |
-
add_submenu_page( 'settings.php', 'PDF Embedder settings', 'PDF Embedder',
|
150 |
'manage_network_options', $this->get_options_menuname(),
|
151 |
array($this, 'pdfemb_options_do_page'));
|
152 |
}
|
153 |
else {
|
154 |
-
add_options_page( 'PDF Embedder settings', 'PDF Embedder',
|
155 |
'manage_options', $this->get_options_menuname(),
|
156 |
array($this, 'pdfemb_options_do_page'));
|
157 |
}
|
@@ -171,11 +198,11 @@ class core_pdf_embedder {
|
|
171 |
|
172 |
<div>
|
173 |
|
174 |
-
<h2
|
175 |
|
176 |
-
<p
|
177 |
-
<p
|
178 |
-
When you insert the PDF into your post, it will automatically embed using the plugin's viewer
|
179 |
|
180 |
|
181 |
<div id="pdfemb-tablewrapper">
|
@@ -183,9 +210,9 @@ class core_pdf_embedder {
|
|
183 |
<div id="pdfemb-tableleft" class="pdfemb-tablecell">
|
184 |
|
185 |
<h2 id="pdfemb-tabs" class="nav-tab-wrapper">
|
186 |
-
<a href="#main" id="main-tab" class="nav-tab nav-tab-active"
|
187 |
-
<a href="#mobile" id="mobile-tab" class="nav-tab"
|
188 |
-
<a href="#secure" id="secure-tab" class="nav-tab"
|
189 |
<?php $this->draw_more_tabs(); ?>
|
190 |
</h2>
|
191 |
|
@@ -212,17 +239,22 @@ class core_pdf_embedder {
|
|
212 |
?>
|
213 |
|
214 |
<p class="submit">
|
215 |
-
<input type="submit" value="Save Changes" class="button button-primary" id="submit" name="submit">
|
216 |
</p>
|
217 |
|
218 |
</form>
|
219 |
</div>
|
220 |
|
|
|
|
|
221 |
</div>
|
222 |
|
223 |
</div> <?php
|
224 |
}
|
225 |
|
|
|
|
|
|
|
226 |
protected function draw_more_tabs() {
|
227 |
}
|
228 |
|
@@ -235,38 +267,38 @@ class core_pdf_embedder {
|
|
235 |
?>
|
236 |
|
237 |
|
238 |
-
<h2
|
239 |
|
240 |
-
<label for="input_pdfemb_width" class="textinput"
|
241 |
<input id='input_pdfemb_width' class='textinput' name='<?php echo $this->get_options_name(); ?>[pdfemb_width]' size='10' type='text' value='<?php echo esc_attr($options['pdfemb_width']); ?>' />
|
242 |
<br class="clear"/>
|
243 |
|
244 |
-
<label for="input_pdfemb_height" class="textinput"
|
245 |
<input id='input_pdfemb_height' class='textinput' name='<?php echo $this->get_options_name(); ?>[pdfemb_height]' size='10' type='text' value='<?php echo esc_attr($options['pdfemb_height']); ?>' />
|
246 |
<br class="clear"/>
|
247 |
|
248 |
-
<p class="desc big"><i
|
249 |
|
250 |
<br class="clear"/>
|
251 |
|
252 |
-
<label for="pdfemb_toolbar" class="textinput"
|
253 |
<select name='<?php echo $this->get_options_name(); ?>[pdfemb_toolbar]' id='pdfemb_toolbar' class='select'>
|
254 |
-
<option value="top" <?php echo $options['pdfemb_toolbar'] == 'top' ? 'selected' : '';
|
255 |
-
<option value="bottom" <?php echo $options['pdfemb_toolbar'] == 'bottom' ? 'selected' : '';
|
256 |
-
<option value="both" <?php echo $options['pdfemb_toolbar'] == 'both' ? 'selected' : '';
|
257 |
</select>
|
258 |
<br class="clear" />
|
259 |
<br class="clear" />
|
260 |
|
261 |
-
<label for="pdfemb_toolbarfixed" class="textinput"
|
262 |
<span>
|
263 |
<input type="radio" name='<?php echo $this->get_options_name(); ?>[pdfemb_toolbarfixed]' id='pdfemb_toolbarfixed_off' class='radio' value="off" <?php echo $options['pdfemb_toolbarfixed'] == 'off' ? 'checked' : ''; ?> />
|
264 |
-
<label for="pdfemb_toolbarfixed_off" class="radio"
|
265 |
</span>
|
266 |
<br/>
|
267 |
<span>
|
268 |
<input type="radio" name='<?php echo $this->get_options_name(); ?>[pdfemb_toolbarfixed]' id='pdfemb_toolbarfixed_on' class='radio' value="on" <?php echo $options['pdfemb_toolbarfixed'] == 'on' ? 'checked' : ''; ?> />
|
269 |
-
<label for="pdfemb_toolbarfixed_on" class="radio"
|
270 |
</span>
|
271 |
|
272 |
<?php
|
@@ -278,7 +310,7 @@ class core_pdf_embedder {
|
|
278 |
|
279 |
|
280 |
|
281 |
-
<p
|
282 |
|
283 |
<?php
|
284 |
}
|
@@ -298,14 +330,13 @@ class core_pdf_embedder {
|
|
298 |
{
|
299 |
?>
|
300 |
|
301 |
-
<h2
|
302 |
-
<p
|
303 |
-
it is difficult for users to download or print the original PDF document
|
304 |
|
305 |
-
<p
|
306 |
|
307 |
-
<p
|
308 |
-
details and purchase options.
|
309 |
</p>
|
310 |
|
311 |
<?php
|
@@ -351,14 +382,14 @@ class core_pdf_embedder {
|
|
351 |
|
352 |
protected function get_error_string($fielderror) {
|
353 |
$local_error_strings = Array(
|
354 |
-
'pdfemb_width|widtherror' => 'Width must be "max" or an integer (number of pixels)',
|
355 |
-
'pdfemb_height|heighterror' => 'Height must be "max" or an integer (number of pixels)'
|
356 |
);
|
357 |
if (isset($local_error_strings[$fielderror])) {
|
358 |
return $local_error_strings[$fielderror];
|
359 |
}
|
360 |
|
361 |
-
return 'Unspecified error';
|
362 |
}
|
363 |
|
364 |
public function pdfemb_save_network_options() {
|
@@ -399,7 +430,7 @@ class core_pdf_embedder {
|
|
399 |
?>
|
400 |
<div id="setting-error-settings_updated" class="updated settings-error">
|
401 |
<p>
|
402 |
-
<strong
|
403 |
</p>
|
404 |
</div>
|
405 |
<?php
|
@@ -486,7 +517,7 @@ class core_pdf_embedder {
|
|
486 |
if ($file == $this->my_plugin_basename()) {
|
487 |
$links = $this->extra_plugin_action_links($links);
|
488 |
|
489 |
-
$settings_link = '<a href="' . $this->get_settings_url() . '">Settings</a>';
|
490 |
array_unshift($links, $settings_link);
|
491 |
}
|
492 |
|
@@ -496,9 +527,15 @@ class core_pdf_embedder {
|
|
496 |
protected function extra_plugin_action_links( $links ) {
|
497 |
return $links;
|
498 |
}
|
499 |
-
|
|
|
|
|
|
|
|
|
500 |
protected function add_actions() {
|
501 |
|
|
|
|
|
502 |
add_action( 'init', array($this, 'pdfemb_init') );
|
503 |
|
504 |
add_action( 'wp_enqueue_scripts', array($this, 'pdfemb_wp_enqueue_scripts'), 5, 0 );
|
32 |
|
33 |
protected function get_translation_array() {
|
34 |
return Array('worker_src' => $this->my_plugin_url().'js/pdfjs/pdf.worker'.($this->useminified() ? '.min' : '').'.js',
|
35 |
+
'cmap_url' => $this->my_plugin_url().'js/pdfjs/cmaps/',
|
36 |
+
'objectL10n' => array(
|
37 |
+
'loading' => esc_html__('Loading...', 'pdf-embedder'),
|
38 |
+
'page' => esc_html__('Page', 'pdf-embedder'),
|
39 |
+
'zoom' => esc_html__('Zoom', 'pdf-embedder'),
|
40 |
+
'prev' => esc_html__('Previous page', 'pdf-embedder'),
|
41 |
+
'next' => esc_html__('Next page', 'pdf-embedder'),
|
42 |
+
'zoomin' => esc_html__('Zoom In', 'pdf-embedder'),
|
43 |
+
'zoomout' => esc_html__('Zoom Out', 'pdf-embedder'),
|
44 |
+
'secure' => esc_html__('Secure', 'pdf-embedder'),
|
45 |
+
'download' => esc_html__('Download PDF', 'pdf-embedder'),
|
46 |
+
'fullscreen' => esc_html__('Full Screen', 'pdf-embedder'),
|
47 |
+
'domainerror' => esc_html__('Error: URL to the PDF file must be on exactly the same domain as the current web page.', 'pdf-embedder'),
|
48 |
+
'clickhereinfo' => esc_html__('Click here for more info', 'pdf-embedder'),
|
49 |
+
'widthheightinvalid' => esc_html__("PDF page width or height are invalid", 'pdf-embedder'),
|
50 |
+
'viewinfullscreen' => esc_html__("View in Full Screen", 'pdf-embedder')
|
51 |
+
));
|
52 |
}
|
53 |
|
54 |
protected function get_extra_js_name() {
|
65 |
}
|
66 |
|
67 |
public function pdfemb_post_mime_types($post_mime_types) {
|
68 |
+
$post_mime_types['application/pdf'] = array( __( 'PDFs' , 'pdf-embedder'), __( 'Manage PDFs' , 'pdf-embedder'), _n_noop( 'PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>' , 'pdf-embedder') );
|
69 |
return $post_mime_types;
|
70 |
}
|
71 |
|
72 |
// Embed PDF shortcode instead of link
|
73 |
public function pdfemb_media_send_to_editor($html, $id, $attachment) {
|
74 |
+
$pdf_url = '';
|
75 |
+
if (isset($attachment['url']) && preg_match( "/\.pdf$/i", $attachment['url'])) {
|
76 |
+
$pdf_url = $attachment['url'];
|
77 |
+
}
|
78 |
+
elseif ($id > 0) {
|
79 |
+
$post = get_post($id);
|
80 |
+
if ($post && isset($post->post_mime_type) && $post->post_mime_type == 'application/pdf') {
|
81 |
+
$pdf_url = wp_get_attachment_url($id);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
if ($pdf_url != '') {
|
86 |
+
return '[pdf-embedder url="' . $pdf_url . '"]';
|
87 |
} else {
|
88 |
return $html;
|
89 |
}
|
173 |
|
174 |
public function pdfemb_admin_menu() {
|
175 |
if (is_multisite()) {
|
176 |
+
add_submenu_page( 'settings.php', __('PDF Embedder settings', 'pdf-embedder'), __('PDF Embedder', 'pdf-embedder'),
|
177 |
'manage_network_options', $this->get_options_menuname(),
|
178 |
array($this, 'pdfemb_options_do_page'));
|
179 |
}
|
180 |
else {
|
181 |
+
add_options_page( __('PDF Embedder settings', 'pdf-embedder'), __('PDF Embedder', 'pdf-embedder'),
|
182 |
'manage_options', $this->get_options_menuname(),
|
183 |
array($this, 'pdfemb_options_do_page'));
|
184 |
}
|
198 |
|
199 |
<div>
|
200 |
|
201 |
+
<h2><?php esc_html_e('PDF Embedder setup', 'pdf-embedder'); ?></h2>
|
202 |
|
203 |
+
<p><?php esc_html_e('To use the plugin, just embed PDFs in the same way as you would normally embed images in your posts/pages - but try with a PDF file instead.', 'pdf-embedder'); ?></p>
|
204 |
+
<p><?php esc_html_e("From the post editor, click Add Media, and then drag-and-drop your PDF file into the media library.
|
205 |
+
When you insert the PDF into your post, it will automatically embed using the plugin's viewer.", 'pdf-embedder'); ?></p>
|
206 |
|
207 |
|
208 |
<div id="pdfemb-tablewrapper">
|
210 |
<div id="pdfemb-tableleft" class="pdfemb-tablecell">
|
211 |
|
212 |
<h2 id="pdfemb-tabs" class="nav-tab-wrapper">
|
213 |
+
<a href="#main" id="main-tab" class="nav-tab nav-tab-active"><?php esc_html_e('Main Settings', 'pdf-embedder'); ?></a>
|
214 |
+
<a href="#mobile" id="mobile-tab" class="nav-tab"><?php esc_html_e('Mobile', 'pdf-embedder'); ?></a>
|
215 |
+
<a href="#secure" id="secure-tab" class="nav-tab"><?php esc_html_e('Secure', 'pdf-embedder'); ?></a>
|
216 |
<?php $this->draw_more_tabs(); ?>
|
217 |
</h2>
|
218 |
|
239 |
?>
|
240 |
|
241 |
<p class="submit">
|
242 |
+
<input type="submit" value="<?php esc_html_e('Save Changes', 'pdf-embedder'); ?>" class="button button-primary" id="submit" name="submit">
|
243 |
</p>
|
244 |
|
245 |
</form>
|
246 |
</div>
|
247 |
|
248 |
+
<?php $this->options_do_sidebar(); ?>
|
249 |
+
|
250 |
</div>
|
251 |
|
252 |
</div> <?php
|
253 |
}
|
254 |
|
255 |
+
protected function options_do_sidebar() {
|
256 |
+
}
|
257 |
+
|
258 |
protected function draw_more_tabs() {
|
259 |
}
|
260 |
|
267 |
?>
|
268 |
|
269 |
|
270 |
+
<h2><?php _e('Default Viewer Settings', 'pdf-embedder'); ?></h2>
|
271 |
|
272 |
+
<label for="input_pdfemb_width" class="textinput"><?php _e('Width', 'pdf-embedder'); ?></label>
|
273 |
<input id='input_pdfemb_width' class='textinput' name='<?php echo $this->get_options_name(); ?>[pdfemb_width]' size='10' type='text' value='<?php echo esc_attr($options['pdfemb_width']); ?>' />
|
274 |
<br class="clear"/>
|
275 |
|
276 |
+
<label for="input_pdfemb_height" class="textinput"><?php _e('Height', 'pdf-embedder'); ?></label>
|
277 |
<input id='input_pdfemb_height' class='textinput' name='<?php echo $this->get_options_name(); ?>[pdfemb_height]' size='10' type='text' value='<?php echo esc_attr($options['pdfemb_height']); ?>' />
|
278 |
<br class="clear"/>
|
279 |
|
280 |
+
<p class="desc big"><i><?php _e('Enter <b>max</b> or an integer number of pixels', 'pdf-embedder'); ?></i></p>
|
281 |
|
282 |
<br class="clear"/>
|
283 |
|
284 |
+
<label for="pdfemb_toolbar" class="textinput"><?php esc_html_e('Toolbar Location', 'pdf-embedder'); ?></label>
|
285 |
<select name='<?php echo $this->get_options_name(); ?>[pdfemb_toolbar]' id='pdfemb_toolbar' class='select'>
|
286 |
+
<option value="top" <?php echo $options['pdfemb_toolbar'] == 'top' ? 'selected' : ''; ?>><?php esc_html_e('Top', 'pdf-embedder'); ?></option>
|
287 |
+
<option value="bottom" <?php echo $options['pdfemb_toolbar'] == 'bottom' ? 'selected' : ''; ?>><?php esc_html_e('Bottom', 'pdf-embedder'); ?></option>
|
288 |
+
<option value="both" <?php echo $options['pdfemb_toolbar'] == 'both' ? 'selected' : ''; ?>><?php esc_html_e('Both', 'pdf-embedder'); ?></option>
|
289 |
</select>
|
290 |
<br class="clear" />
|
291 |
<br class="clear" />
|
292 |
|
293 |
+
<label for="pdfemb_toolbarfixed" class="textinput"><?php esc_html_e('Toolbar Hover', 'pdf-embedder'); ?></label>
|
294 |
<span>
|
295 |
<input type="radio" name='<?php echo $this->get_options_name(); ?>[pdfemb_toolbarfixed]' id='pdfemb_toolbarfixed_off' class='radio' value="off" <?php echo $options['pdfemb_toolbarfixed'] == 'off' ? 'checked' : ''; ?> />
|
296 |
+
<label for="pdfemb_toolbarfixed_off" class="radio"><?php esc_html_e('Toolbar appears only on hover over document', 'pdf-embedder'); ?></label>
|
297 |
</span>
|
298 |
<br/>
|
299 |
<span>
|
300 |
<input type="radio" name='<?php echo $this->get_options_name(); ?>[pdfemb_toolbarfixed]' id='pdfemb_toolbarfixed_on' class='radio' value="on" <?php echo $options['pdfemb_toolbarfixed'] == 'on' ? 'checked' : ''; ?> />
|
301 |
+
<label for="pdfemb_toolbarfixed_on" class="radio"><?php esc_html_e('Toolbar always visible', 'pdf-embedder'); ?></label>
|
302 |
</span>
|
303 |
|
304 |
<?php
|
310 |
|
311 |
|
312 |
|
313 |
+
<p><?php printf( __('You can override these defaults for specific embeds by modifying the shortcodes - see <a href="%s" target="_blank">instructions</a>.', 'pdf-embedder'), $this->get_instructions_url()); ?></p>
|
314 |
|
315 |
<?php
|
316 |
}
|
330 |
{
|
331 |
?>
|
332 |
|
333 |
+
<h2><?php esc_html_e('Protect your PDFs using PDF Embedder Secure', 'pdf-embedder'); ?></h2>
|
334 |
+
<p><?php _e('Our <b>PDF Embedder Premium Secure</b> plugin provides the same simple but elegant viewer for your website visitors, with the added protection that
|
335 |
+
it is difficult for users to download or print the original PDF document.', 'pdf-embedder'); ?></p>
|
336 |
|
337 |
+
<p><?php esc_html_e('This means that your PDF is unlikely to be shared outside your site where you have no control over who views, prints, or shares it.', 'pdf-embedder'); ?></p>
|
338 |
|
339 |
+
<p><?php printf( __('See our website <a href="%s">wp-pdf.com</a> for more details and purchase options.', 'pdf-embedder'), 'http://wp-pdf.com/secure/?utm_source=PDF%20Settings%20Secure&utm_medium=freemium&utm_campaign=Freemium' ); ?>
|
|
|
340 |
</p>
|
341 |
|
342 |
<?php
|
382 |
|
383 |
protected function get_error_string($fielderror) {
|
384 |
$local_error_strings = Array(
|
385 |
+
'pdfemb_width|widtherror' => __('Width must be "max" or an integer (number of pixels)', 'pdf-embedder'),
|
386 |
+
'pdfemb_height|heighterror' => __('Height must be "max" or an integer (number of pixels)', 'pdf-embedder')
|
387 |
);
|
388 |
if (isset($local_error_strings[$fielderror])) {
|
389 |
return $local_error_strings[$fielderror];
|
390 |
}
|
391 |
|
392 |
+
return __('Unspecified error', 'pdf-embedder');
|
393 |
}
|
394 |
|
395 |
public function pdfemb_save_network_options() {
|
430 |
?>
|
431 |
<div id="setting-error-settings_updated" class="updated settings-error">
|
432 |
<p>
|
433 |
+
<strong><?php esc_html_e('Settings saved', 'pdf-embedder'); ?></strong>
|
434 |
</p>
|
435 |
</div>
|
436 |
<?php
|
517 |
if ($file == $this->my_plugin_basename()) {
|
518 |
$links = $this->extra_plugin_action_links($links);
|
519 |
|
520 |
+
$settings_link = '<a href="' . $this->get_settings_url() . '">' . __('Settings', 'pdf-embedder') .'</a>';
|
521 |
array_unshift($links, $settings_link);
|
522 |
}
|
523 |
|
527 |
protected function extra_plugin_action_links( $links ) {
|
528 |
return $links;
|
529 |
}
|
530 |
+
|
531 |
+
public function pdfemb_plugins_loaded() {
|
532 |
+
load_plugin_textdomain( 'pdf-embedder', false, dirname($this->my_plugin_basename()).'/lang/' );
|
533 |
+
}
|
534 |
+
|
535 |
protected function add_actions() {
|
536 |
|
537 |
+
add_action( 'plugins_loaded', array($this, 'pdfemb_plugins_loaded') );
|
538 |
+
|
539 |
add_action( 'init', array($this, 'pdfemb_init') );
|
540 |
|
541 |
add_action( 'wp_enqueue_scripts', array($this, 'pdfemb_wp_enqueue_scripts'), 5, 0 );
|
css/pdfemb-admin.css
CHANGED
@@ -1,4 +1,10 @@
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
.pdfembtab.active {
|
3 |
display: block;
|
4 |
}
|
@@ -89,6 +95,10 @@ a#pdfemb-personalinstrlink {
|
|
89 |
padding: 5px;
|
90 |
}
|
91 |
|
|
|
|
|
|
|
|
|
92 |
.pdfemb-tablecell {
|
93 |
display: table-cell;
|
94 |
height: 500px;
|
1 |
|
2 |
+
#pdfemb-tabs {
|
3 |
+
border-bottom: 1px solid #ccc;
|
4 |
+
padding-bottom: 0;
|
5 |
+
padding-left: 10px;
|
6 |
+
}
|
7 |
+
|
8 |
.pdfembtab.active {
|
9 |
display: block;
|
10 |
}
|
95 |
padding: 5px;
|
96 |
}
|
97 |
|
98 |
+
#pdfemb-tableright div ul li {
|
99 |
+
font-weight: bold;
|
100 |
+
}
|
101 |
+
|
102 |
.pdfemb-tablecell {
|
103 |
display: table-cell;
|
104 |
height: 500px;
|
css/pdfemb-embed-pdf.css
CHANGED
@@ -162,7 +162,7 @@ div.pdfemb-toolbar button {
|
|
162 |
-ms-user-select: none;
|
163 |
cursor: default;
|
164 |
|
165 |
-
margin:
|
166 |
|
167 |
float: left;
|
168 |
|
@@ -251,6 +251,19 @@ div.pdfemb-toolbar div {
|
|
251 |
float: left;
|
252 |
}
|
253 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
div.pdfemb-errormsg {
|
255 |
padding: 5px;
|
256 |
text-align: center;
|
@@ -278,3 +291,72 @@ div.pdfemb-errormsg {
|
|
278 |
top: 0px;
|
279 |
left: 0px;
|
280 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
-ms-user-select: none;
|
163 |
cursor: default;
|
164 |
|
165 |
+
margin: 4px 2px 4px 0;
|
166 |
|
167 |
float: left;
|
168 |
|
251 |
float: left;
|
252 |
}
|
253 |
|
254 |
+
div.pdfemb-toolbar div.pdfemb-poweredby {
|
255 |
+
float: right;
|
256 |
+
}
|
257 |
+
|
258 |
+
div.pdfemb-toolbar div.pdfemb-poweredby a {
|
259 |
+
color: lightgray;
|
260 |
+
text-decoration: none;
|
261 |
+
border-bottom: 1px solid #333;
|
262 |
+
}
|
263 |
+
div.pdfemb-toolbar div.pdfemb-poweredby a:hover {
|
264 |
+
border-bottom: none;
|
265 |
+
}
|
266 |
+
|
267 |
div.pdfemb-errormsg {
|
268 |
padding: 5px;
|
269 |
text-align: center;
|
291 |
top: 0px;
|
292 |
left: 0px;
|
293 |
}
|
294 |
+
|
295 |
+
input.pdfemb-page-num {
|
296 |
+
display: inline;
|
297 |
+
font-family: sans-serif;
|
298 |
+
width: 30px;
|
299 |
+
height: 15px;
|
300 |
+
vertical-align: middle;
|
301 |
+
font-size: 10px;
|
302 |
+
padding: 0px 2px;
|
303 |
+
color: black;
|
304 |
+
text-align: center;
|
305 |
+
margin: 0px;
|
306 |
+
}
|
307 |
+
|
308 |
+
.pdfembAnnotationLayer {
|
309 |
+
position: absolute;
|
310 |
+
}
|
311 |
+
|
312 |
+
.pdfembAnnotationLayer .annotLink > a:hover {
|
313 |
+
opacity: 0.2;
|
314 |
+
background: #ff0;
|
315 |
+
box-shadow: 0px 2px 10px #ff0;
|
316 |
+
}
|
317 |
+
|
318 |
+
.pdfembAnnotationLayer .annotText > img {
|
319 |
+
position: absolute;
|
320 |
+
cursor: pointer;
|
321 |
+
}
|
322 |
+
|
323 |
+
.pdfembAnnotationLayer .annotTextContentWrapper {
|
324 |
+
position: absolute;
|
325 |
+
width: 20em;
|
326 |
+
}
|
327 |
+
|
328 |
+
.pdfembAnnotationLayer .annotTextContent {
|
329 |
+
z-index: 200;
|
330 |
+
float: left;
|
331 |
+
max-width: 20em;
|
332 |
+
background-color: #FFFF99;
|
333 |
+
box-shadow: 0px 2px 5px #333;
|
334 |
+
border-radius: 2px;
|
335 |
+
padding: 0.6em;
|
336 |
+
cursor: pointer;
|
337 |
+
}
|
338 |
+
|
339 |
+
.pdfembAnnotationLayer .annotTextContent > h1 {
|
340 |
+
font-size: 1em;
|
341 |
+
border-bottom: 1px solid #000000;
|
342 |
+
padding-bottom: 0.2em;
|
343 |
+
}
|
344 |
+
|
345 |
+
.pdfembAnnotationLayer .annotTextContent > p {
|
346 |
+
padding-top: 0.2em;
|
347 |
+
}
|
348 |
+
|
349 |
+
.pdfembAnnotationLayer .annotLink > a {
|
350 |
+
position: absolute;
|
351 |
+
font-size: 1em;
|
352 |
+
top: 0;
|
353 |
+
left: 0;
|
354 |
+
width: 100%;
|
355 |
+
height: 100%;
|
356 |
+
border: none;
|
357 |
+
}
|
358 |
+
|
359 |
+
.pdfembAnnotationLayer .annotLink > a /* -ms-a */ {
|
360 |
+
background: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAA\
|
361 |
+
LAAAAAABAAEAAAIBRAA7") 0 0 repeat;
|
362 |
+
}
|
js/all-pdfemb-basic.min.js
CHANGED
@@ -1,20 +1,23 @@
|
|
1 |
-
function pdfembGetPDF(b,a){a(b,!1)}function pdfembWantMobile(b,a,f,c){return!1}function pdfembMakeMobile(b,a,f){}function pdfembAddMoreToolbar(b,a,f){};jQuery(document).ready(function(b){b.fn.pdfEmbedder=function(){this.each(function(a,f){var c=b(f);c.append(b("<div></div>",{"class":"pdfemb-loadingmsg"}).append(document.createTextNode(
|
2 |
-
!1,"on"==c.data("toolbar-fixed"),
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
a.
|
9 |
-
a.
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
b.fn.pdfEmbedder.queueRenderPage(a,a.data("
|
14 |
-
|
|
|
|
|
|
|
15 |
(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}b.prototype={CSS_CLASS_GRAB:"grab-to-pan-grab",activate:function(){if(!this.active&&(this.active=!0,this.element.addEventListener("mousedown",this._onmousedown,!0),this.element.addEventListener("DOMMouseScroll",this._onmousewheel),this.element.addEventListener("mousewheel",this._onmousewheel),this.element.classList.add(this.CSS_CLASS_GRAB),this.onActiveChanged))this.onActiveChanged(!0)},deactivate:function(){if(this.active&&
|
16 |
-
(this.active=!1,this.element.removeEventListener("mousedown",this._onmousedown,!0),this._endPan(),this.element.classList.remove(this.CSS_CLASS_GRAB),this.onActiveChanged))this.onActiveChanged(!1)},toggle:function(){this.active?this.deactivate():this.activate()},ignoreTarget:function(
|
17 |
this.element.scrollTop;this.clientXStart=a.clientX;this.clientYStart=a.clientY;this.document.addEventListener("mousemove",this._onmousemove,!0);this.document.addEventListener("mouseup",this._endPan,!0);this.element.addEventListener("scroll",this._endPan,!0);a.preventDefault();a.stopPropagation();this.document.documentElement.classList.add(this.CSS_CLASS_GRABBING);var b=document.activeElement;b&&!b.contains(a.target)&&b.blur()}},_onmousemove:function(a){this.element.removeEventListener("scroll",this._endPan,
|
18 |
-
!0);var b;b="buttons"in a&&f?!(a.buttons|1):
|
19 |
this.element.scrollTop;this.element.scrollTop=this.scrollTopStart-40*a;this.overlay.parentNode||document.body.appendChild(this.overlay)},_endPan:function(){this.element.removeEventListener("scroll",this._endPan,!0);this.document.removeEventListener("mousemove",this._onmousemove,!0);this.document.removeEventListener("mouseup",this._endPan,!0);this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)}};var a;["webkitM","mozM","msM","oM","m"].some(function(b){b+="atches";b in document.documentElement&&
|
20 |
-
(a=b);b+="Selector";b in document.documentElement&&(a=b);return a});var f=!document.documentMode||9<document.documentMode,c=window.chrome,
|
1 |
+
function pdfembGetPDF(b,a){a(b,!1)}function pdfembWantMobile(b,a,f,c){return!1}function pdfembMakeMobile(b,a,f){}function pdfembAddMoreToolbar(b,a,f){};jQuery(document).ready(function(b){b.fn.pdfEmbedder=function(){this.each(function(a,f){var c=b(f);c.append(b("<div></div>",{"class":"pdfemb-loadingmsg"}).append(document.createTextNode(pdfemb_trans.objectL10n.loading)));var h=function(a,d){c.empty().append(b("<div></div>",{"class":"pdfemb-inner-div"}).append(b("<canvas></canvas>",{"class":"pdfemb-the-canvas"})));c.data("pdfDoc",a);var e=c.data("toolbar");"bottom"!=e&&b.fn.pdfEmbedder.addToolbar(c,!0,"on"==c.data("toolbar-fixed"),d);"top"!=e&&b.fn.pdfEmbedder.addToolbar(c,
|
2 |
+
!1,"on"==c.data("toolbar-fixed"),d);c.on("pdfembGotopage",function(a,d){d>c.data("pdfDoc").numPages||(c.data("pagenum",d),b.fn.pdfEmbedder.queueRenderPage(c,d))});c.on("pdfembGotoHash",function(a,d){var e;"string"===typeof d?(destString=d,e=c.data("pdfDoc").getDestination(d)):e=Promise.resolve(d);e.then(function(a){a instanceof Array&&!(1>a.length)&&c.data("pdfDoc").getPageIndex(a[0]).then(function(a){a+=1;a>c.data("pdfDoc").numPages||0>=a||(c.data("pagenum",a),b.fn.pdfEmbedder.queueRenderPage(c,
|
3 |
+
a))})})});c.data("pageCount",a.numPages);(!c.data("pagenum")||1>c.data("pagenum")||c.data("pagenum")>a.numPages)&&c.data("pagenum",1);c.data("showIsSecure",d);c.data("pageNumPending",null);c.data("zoom",100);b.fn.pdfEmbedder.renderPage(c,c.data("pagenum"));c.find("span.pdfemb-page-count").text(a.numPages);e=new pdfembGrabToPan({element:c.find("div.pdfemb-inner-div")[0]});c.data("grabtopan",e);b(window).resize(function(){setTimeout(function(){b.fn.pdfEmbedder.queueRenderPage(c,c.data("pagenum"))},
|
4 |
+
100)})},e=function(a,d){PDFJS.getDocument(a).then(function(a){h(a,d)},function(a){var d=document.createTextNode(a.message);"UnexpectedResponseException"==a.name&&0==a.status&&(d=b("<span></span>").append(document.createTextNode(pdfemb_trans.objectL10n.domainerror+" ")).append(b('<a href="https://wp-pdf.com/troubleshooting/#unexpected" target="_blank">'+pdfemb_trans.objectL10n.clickhereinfo+"</a>")));c.empty().append(b("<div></div>",{"class":"pdfemb-errormsg"}).append(d))})};if(c.data("pdfDoc"))h(c.data("pdfDoc"),
|
5 |
+
c.data("showIsSecure"));else{var d=c.attr("data-pdf-url");pdfembGetPDF(d,e)}});return this};b.fn.pdfEmbedder.annotationsLayerFactory="undefined"!=typeof pdfembPremiumAnnotationsLayerFactory?new pdfembPremiumAnnotationsLayerFactory:{createAnnotationsLayerBuilder:function(a,b){return null}};b.fn.pdfEmbedder.checkForResize=function(a){var f=b(window).height(),c=b(window).width(),h=a.data("checked-window-height"),e=a.data("checked-window-width");if(!h||!e)a.data("checked-window-height",f),a.data("checked-window-width",
|
6 |
+
c);else if(h!=f||e!=c)b.fn.pdfEmbedder.queueRenderPage(a,a.data("pagenum")),a.data("checked-window-height",f),a.data("checked-window-width",c);"true"!=a.data("fullScreenClosed")&&setTimeout(function(){b.fn.pdfEmbedder.checkForResize(a)},1E3)};b.fn.pdfEmbedder.renderPage=function(a,f,c){a.data("pageRendering",!0);a.data("pdfDoc").getPage(f).then(function(h){var e=a.find(".pdfemb-the-canvas"),d=null,r=null,u=null,v=null;c&&(u=e.width(),v=e.height(),r=e[0].getContext("2d"),d=r.getImageData(0,0,u,v));
|
7 |
+
var n,g=h.getViewport(1),l=g.width,m=g.height;if(0>=l||0>=m)a.empty().append(document.createTextNode(pdfemb_trans.objectL10n.widthheightinvalid));else{var q=a.parent().width(),g=l,p=m;if("max"==a.data("width"))g=q;else if("auto"==a.data("width"))g=l;else if(g=parseInt(a.data("width"),10),isNaN(g)||0>=g)g=q;0>=g&&(g=l);g>q&&0<q&&(g=q);n=g/l;var p=m*n,w=a.find("div.pdfemb-toolbar-fixed"),t=(q=pdfembWantMobile(b,a,g,k))?0:w.length,k=parseInt(a.data("height"),10);if(isNaN(k)||0>=k||k>p)k="auto"==a.data("height")?
|
8 |
+
a.parent().height()-t*w.height():p;var g=Math.floor(g),p=Math.floor(p),x=100,l=g,m=p,y=0,z=0;q||(x=a.data("zoom"),l=g*x/100,m=p*x/100,l<g&&(y=(g-l)/2),m<k&&(z=(k-m)/2));var A=h.getViewport(n*x/100);g!=a.width()&&a.width(g);a.height()!=k&&a.height(k+t*w.height());n=a.find("div.pdfemb-inner-div");var x=n[0].scrollLeft,B=n[0].scrollTop;n.width(g);n.height(k);w=w.filter(".pdfemb-toolbar-top");0<t&&n.css("top",w.height());e[0].width=l;e[0].height=m;e.css("width",l);e.css("height",m);e.css("left",y).css("top",
|
9 |
+
z);(l>g||m>p||m>k)&&!q?(k=a.data("fromZoom"),t=a.data("toZoom"),0<k&&0<t&&(y=B+p/2,n.scrollLeft((x+g/2)*t/k-g/2),n.scrollTop(y*t/k-p/2)),a.data("grabtopan").activate()):("on"==a.data("fullScreen")?a.data("grabtopan").activate():a.data("grabtopan").deactivate(),a.find("div.pdfemb-inner-div").scrollLeft(0).scrollTop(0));a.data("fromZoom",0).data("toZoom",0);pdfembMakeMobile(b,q,a);c?(a.data("pagenum",f),a.data("pageRendering",!1),e=b("<canvas>").attr("width",d.width).attr("height",d.height)[0],e.getContext("2d").putImageData(d,
|
10 |
+
0,0),r.scale(l/u,m/v),r.drawImage(e,0,0)):(d={canvasContext:e[0].getContext("2d"),viewport:A},h.render(d).promise.then(function(){a.data("pagenum",f);a.data("pageRendering",!1);var d=a.find("div.pdfemb-toolbar .pdfemb-page-num");d.is("span")?d.text(f):d.val(f);f<a.data("pageCount")?a.find(".pdfemb-next").removeAttr("disabled").removeClass("pdfemb-btndisabled"):a.find(".pdfemb-next").attr("disabled","disabled").addClass("pdfemb-btndisabled");1<f?a.find(".pdfemb-prev").removeAttr("disabled").removeClass("pdfemb-btndisabled"):
|
11 |
+
a.find(".pdfemb-prev").attr("disabled","disabled").addClass("pdfemb-btndisabled");d=b.fn.pdfEmbedder.annotationsLayerFactory.createAnnotationsLayerBuilder(a.find("div.pdfemb-inner-div")[0],h);null!=d&&(a.find("div.pdfembAnnotationLayer").remove(),d.setupAnnotations(A));null!==a.data("pageNumPending")&&(b.fn.pdfEmbedder.renderPage(a,a.data("pageNumPending")),a.data("pageNumPending",null))}))}})};b.fn.pdfEmbedder.queueRenderPage=function(a,f,c){a.data("pageRendering")?a.data("pageNumPending",f):b.fn.pdfEmbedder.renderPage(a,
|
12 |
+
f,c)};b.fn.pdfEmbedder.goFullScreen=function(a){a=b('<div class="pdfemb-fs-window"></div>');b(document.body).append(a)};b.fn.pdfEmbedder.changeZoom=function(a,f){var c=a.data("zoom"),h=c+f;a.data("zoom",h);a.find("span.pdfemb-zoom").text(h+"%");b.fn.pdfEmbedder.queueRenderPage(a,a.data("pagenum"));a.data("fromZoom",c).data("toZoom",h)};b.fn.pdfEmbedder.magnifyZoom=function(a,f){var c=a.data("zoom"),h=Math.floor(c*f);20>h&&(h=20);500<h&&(h=500);a.data("zoom",h);a.find("span.pdfemb-zoom").text(h+"%");
|
13 |
+
b.fn.pdfEmbedder.queueRenderPage(a,a.data("pagenum"),!0);a.data("fromZoom",c).data("toZoom",h)};b.fn.pdfEmbedder.addToolbar=function(a,f,c,h){var e=b("<div></div>",{"class":"pdfemb-toolbar pdfemb-toolbar"+(c?"-fixed":"-hover")+" "+(f?" pdfemb-toolbar-top":"pdfemb-toolbar-bottom")}),d=b('<button class="pdfemb-prev" title="'+pdfemb_trans.objectL10n.prev+'"></button>');e.append(d);var r=b('<button class="pdfemb-next" title="'+pdfemb_trans.objectL10n.next+'"></button>');e.append(r);e.append(b('<div class="pdfemb-page-area">'+
|
14 |
+
pdfemb_trans.objectL10n.page+' <span class="pdfemb-page-num">0</span> / <span class="pdfemb-page-count"></span></div>'));var u=b('<button class="pdfemb-zoomout" title="'+pdfemb_trans.objectL10n.zoomout+'"></button>');e.append(u);var v=b('<button class="pdfemb-zoomin" title="'+pdfemb_trans.objectL10n.zoomin+'"></button>');e.append(v);e.append(b("<div>"+pdfemb_trans.objectL10n.zoom+' <span class="pdfemb-zoom">100%</span></div>'));h&&e.append(b("<div>"+pdfemb_trans.objectL10n.secure+"</div>"));f?a.prepend(e):
|
15 |
+
a.append(e);d.on("click",function(d){1>=a.data("pagenum")||(a.data("pagenum",a.data("pagenum")-1),b.fn.pdfEmbedder.queueRenderPage(a,a.data("pagenum")))});r.on("click",function(d){a.data("pagenum")>=a.data("pdfDoc").numPages||(a.data("pagenum",a.data("pagenum")+1),b.fn.pdfEmbedder.queueRenderPage(a,a.data("pagenum")))});v.on("click",function(d){500<=a.data("zoom")||b.fn.pdfEmbedder.changeZoom(a,10)});u.on("click",function(d){20>=a.data("zoom")||b.fn.pdfEmbedder.changeZoom(a,-10)});pdfembAddMoreToolbar(b,
|
16 |
+
e,a);c||(a.on("mouseenter",function(d){d=a.find("div.pdfemb-toolbar-hover");!0!==d.data("no-hover")&&d.show()}),a.on("mouseleave",function(d){a.find("div.pdfemb-toolbar-hover").hide()}));pdfemb_trans.poweredby&&e.append(b("<div></div>",{"class":"pdfemb-poweredby"}).append(b('<a href="https://wp-pdf.com/?utm_source=Poweredby&utm_medium=freemium&utm_campaign=Freemium" target="_blank">wp-pdf.com</a>')))};PDFJS.workerSrc=pdfemb_trans.worker_src;PDFJS.cMapUrl=pdfemb_trans.cmap_url;PDFJS.cMapPacked=!0;
|
17 |
+
b(".pdfemb-viewer").pdfEmbedder()});var pdfembGrabToPan=function(){function b(a){this.element=a.element;this.document=a.element.ownerDocument;"function"===typeof a.ignoreTarget&&(this.ignoreTarget=a.ignoreTarget);this.onActiveChanged=a.onActiveChanged;this.activate=this.activate.bind(this);this.deactivate=this.deactivate.bind(this);this.toggle=this.toggle.bind(this);this._onmousedown=this._onmousedown.bind(this);this._onmousemove=this._onmousemove.bind(this);this._onmousewheel=this._onmousewheel.bind(this);this._endPan=this._endPan.bind(this);
|
18 |
(this.overlay=document.createElement("div")).className="grab-to-pan-grabbing"}b.prototype={CSS_CLASS_GRAB:"grab-to-pan-grab",activate:function(){if(!this.active&&(this.active=!0,this.element.addEventListener("mousedown",this._onmousedown,!0),this.element.addEventListener("DOMMouseScroll",this._onmousewheel),this.element.addEventListener("mousewheel",this._onmousewheel),this.element.classList.add(this.CSS_CLASS_GRAB),this.onActiveChanged))this.onActiveChanged(!0)},deactivate:function(){if(this.active&&
|
19 |
+
(this.active=!1,this.element.removeEventListener("mousedown",this._onmousedown,!0),this._endPan(),this.element.classList.remove(this.CSS_CLASS_GRAB),this.onActiveChanged))this.onActiveChanged(!1)},toggle:function(){this.active?this.deactivate():this.activate()},ignoreTarget:function(d){return d[a]("a[href], a[href] *, input, textarea, button, button *, select, option")},_onmousedown:function(a){if(0===a.button&&!this.ignoreTarget(a.target)){this.scrollLeftStart=this.element.scrollLeft;this.scrollTopStart=
|
20 |
this.element.scrollTop;this.clientXStart=a.clientX;this.clientYStart=a.clientY;this.document.addEventListener("mousemove",this._onmousemove,!0);this.document.addEventListener("mouseup",this._endPan,!0);this.element.addEventListener("scroll",this._endPan,!0);a.preventDefault();a.stopPropagation();this.document.documentElement.classList.add(this.CSS_CLASS_GRABBING);var b=document.activeElement;b&&!b.contains(a.target)&&b.blur()}},_onmousemove:function(a){this.element.removeEventListener("scroll",this._endPan,
|
21 |
+
!0);var b;b="buttons"in a&&f?!(a.buttons|1):h||e?0===a.which:void 0;b?this._endPan():(b=a.clientX-this.clientXStart,this.element.scrollTop=this.scrollTopStart-(a.clientY-this.clientYStart),this.element.scrollLeft=this.scrollLeftStart-b,this.overlay.parentNode||document.body.appendChild(this.overlay))},_onmousewheel:function(a){this.element.removeEventListener("scroll",this._endPan,!0);a="DOMMouseScroll"===a.type?-a.detail:a.wheelDelta/40;this.scrollLeftStart=this.element.scrollLeft;this.scrollTopStart=
|
22 |
this.element.scrollTop;this.element.scrollTop=this.scrollTopStart-40*a;this.overlay.parentNode||document.body.appendChild(this.overlay)},_endPan:function(){this.element.removeEventListener("scroll",this._endPan,!0);this.document.removeEventListener("mousemove",this._onmousemove,!0);this.document.removeEventListener("mouseup",this._endPan,!0);this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)}};var a;["webkitM","mozM","msM","oM","m"].some(function(b){b+="atches";b in document.documentElement&&
|
23 |
+
(a=b);b+="Selector";b in document.documentElement&&(a=b);return a});var f=!document.documentMode||9<document.documentMode,c=window.chrome,h=c&&(c.webstore||c.app),e=/Apple/.test(navigator.vendor)&&/Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent);return b}();
|
js/pdfemb-embed-pdf.js
CHANGED
@@ -8,7 +8,7 @@ jQuery(document).ready(function ($) {
|
|
8 |
|
9 |
var divContainer = $(rawDivContainer);
|
10 |
|
11 |
-
divContainer.append($('<div></div>', {'class': 'pdfemb-loadingmsg'}).append(document.createTextNode(
|
12 |
|
13 |
var initPdfDoc = function(pdfDoc_, showIsSecure) {
|
14 |
divContainer.empty().append(
|
@@ -28,18 +28,60 @@ jQuery(document).ready(function ($) {
|
|
28 |
$.fn.pdfEmbedder.addToolbar(divContainer, false, divContainer.data('toolbar-fixed') == 'on', showIsSecure);
|
29 |
}
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
// Initial/first page rendering
|
32 |
|
33 |
divContainer.data('pageCount', pdfDoc_.numPages);
|
34 |
|
35 |
-
if (!divContainer.data('
|
36 |
-
divContainer.data('
|
37 |
}
|
38 |
|
39 |
divContainer.data('showIsSecure', showIsSecure);
|
40 |
divContainer.data('pageNumPending', null);
|
41 |
divContainer.data('zoom', 100);
|
42 |
-
$.fn.pdfEmbedder.renderPage(divContainer, divContainer.data('
|
43 |
|
44 |
divContainer.find('span.pdfemb-page-count').text( pdfDoc_.numPages );
|
45 |
|
@@ -49,7 +91,7 @@ jQuery(document).ready(function ($) {
|
|
49 |
|
50 |
$(window).resize(function() {
|
51 |
setTimeout(function() {
|
52 |
-
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('
|
53 |
}, 100);
|
54 |
});
|
55 |
};
|
@@ -68,8 +110,8 @@ jQuery(document).ready(function ($) {
|
|
68 |
var msgnode = document.createTextNode(e.message);
|
69 |
if (e.name == 'UnexpectedResponseException' && e.status == 0) {
|
70 |
msgnode = $('<span></span>').append(
|
71 |
-
document.createTextNode(
|
72 |
-
.append($('<a href="https://wp-pdf.com/troubleshooting/#unexpected" target="_blank">
|
73 |
}
|
74 |
divContainer.empty().append($('<div></div>', {'class': 'pdfemb-errormsg'}).append(msgnode));
|
75 |
}
|
@@ -90,7 +132,21 @@ jQuery(document).ready(function ($) {
|
|
90 |
|
91 |
};
|
92 |
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
var newheight = $(window).height();
|
95 |
var newwidth = $(window).width();
|
96 |
|
@@ -102,7 +158,7 @@ jQuery(document).ready(function ($) {
|
|
102 |
divContainer.data('checked-window-width', newwidth);
|
103 |
}
|
104 |
else if (oldheight != newheight || oldwidth != newwidth) {
|
105 |
-
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('
|
106 |
divContainer.data('checked-window-height', newheight);
|
107 |
divContainer.data('checked-window-width', newwidth);
|
108 |
}
|
@@ -143,7 +199,7 @@ jQuery(document).ready(function ($) {
|
|
143 |
var pageHeight = vp.height;
|
144 |
|
145 |
if (pageWidth <= 0 || pageHeight <= 0) {
|
146 |
-
divContainer.empty().append(document.createTextNode(
|
147 |
return;
|
148 |
}
|
149 |
|
@@ -293,7 +349,7 @@ jQuery(document).ready(function ($) {
|
|
293 |
pdfembMakeMobile($, wantMobile, divContainer);
|
294 |
|
295 |
if (noredraw) {
|
296 |
-
divContainer.data('
|
297 |
divContainer.data('pageRendering', false);
|
298 |
|
299 |
var newCanvas = $("<canvas>")
|
@@ -309,41 +365,60 @@ jQuery(document).ready(function ($) {
|
|
309 |
}
|
310 |
|
311 |
// Render PDF page into canvas context
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
});
|
348 |
|
349 |
};
|
@@ -367,7 +442,7 @@ jQuery(document).ready(function ($) {
|
|
367 |
divContainer.data('zoom', newzoom);
|
368 |
divContainer.find('span.pdfemb-zoom').text( newzoom + '%' );
|
369 |
|
370 |
-
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('
|
371 |
divContainer.data('fromZoom', oldzoom).data('toZoom', newzoom);
|
372 |
};
|
373 |
|
@@ -384,7 +459,7 @@ jQuery(document).ready(function ($) {
|
|
384 |
divContainer.data('zoom', newzoom);
|
385 |
divContainer.find('span.pdfemb-zoom').text( newzoom + '%' );
|
386 |
|
387 |
-
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('
|
388 |
divContainer.data('fromZoom', oldzoom).data('toZoom', newzoom);
|
389 |
|
390 |
};
|
@@ -392,23 +467,23 @@ jQuery(document).ready(function ($) {
|
|
392 |
$.fn.pdfEmbedder.addToolbar = function(divContainer, atTop, fixed, showIsSecure){
|
393 |
|
394 |
var toolbar = $('<div></div>', {'class': 'pdfemb-toolbar pdfemb-toolbar'+(fixed ? '-fixed' : '-hover')+' '+(atTop ? ' pdfemb-toolbar-top' : 'pdfemb-toolbar-bottom')});
|
395 |
-
var prevbtn = $('<button class="pdfemb-prev" title="
|
396 |
toolbar.append(prevbtn);
|
397 |
-
var nextbtn = $('<button class="pdfemb-next" title="
|
398 |
toolbar.append(nextbtn);
|
399 |
|
400 |
-
toolbar.append($('<div>
|
401 |
|
402 |
-
var zoomoutbtn = $('<button class="pdfemb-zoomout" title="
|
403 |
toolbar.append(zoomoutbtn);
|
404 |
|
405 |
-
var zoominbtn = $('<button class="pdfemb-zoomin" title="
|
406 |
toolbar.append(zoominbtn);
|
407 |
|
408 |
-
toolbar.append($('<div>
|
409 |
|
410 |
if (showIsSecure) {
|
411 |
-
toolbar.append($('<div>
|
412 |
}
|
413 |
|
414 |
if (atTop) {
|
@@ -420,19 +495,19 @@ jQuery(document).ready(function ($) {
|
|
420 |
|
421 |
// Add button functions
|
422 |
prevbtn.on('click', function (e){
|
423 |
-
if (divContainer.data('
|
424 |
return;
|
425 |
}
|
426 |
-
divContainer.data('
|
427 |
-
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('
|
428 |
});
|
429 |
|
430 |
nextbtn.on('click', function (e){
|
431 |
-
if (divContainer.data('
|
432 |
return;
|
433 |
}
|
434 |
-
divContainer.data('
|
435 |
-
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('
|
436 |
});
|
437 |
|
438 |
zoominbtn.on('click', function (e){
|
@@ -467,6 +542,11 @@ jQuery(document).ready(function ($) {
|
|
467 |
}
|
468 |
);
|
469 |
}
|
|
|
|
|
|
|
|
|
|
|
470 |
};
|
471 |
|
472 |
// Apply plugin to relevant divs/};
|
8 |
|
9 |
var divContainer = $(rawDivContainer);
|
10 |
|
11 |
+
divContainer.append($('<div></div>', {'class': 'pdfemb-loadingmsg'}).append(document.createTextNode(pdfemb_trans.objectL10n.loading)));
|
12 |
|
13 |
var initPdfDoc = function(pdfDoc_, showIsSecure) {
|
14 |
divContainer.empty().append(
|
28 |
$.fn.pdfEmbedder.addToolbar(divContainer, false, divContainer.data('toolbar-fixed') == 'on', showIsSecure);
|
29 |
}
|
30 |
|
31 |
+
// React to page jump event
|
32 |
+
|
33 |
+
divContainer.on('pdfembGotopage', function(e, pageNum) {
|
34 |
+
if (pageNum > divContainer.data('pdfDoc').numPages) {
|
35 |
+
return;
|
36 |
+
}
|
37 |
+
|
38 |
+
divContainer.data('pagenum', pageNum);
|
39 |
+
$.fn.pdfEmbedder.queueRenderPage(divContainer, pageNum);
|
40 |
+
|
41 |
+
});
|
42 |
+
|
43 |
+
divContainer.on('pdfembGotoHash', function(e, dest) {
|
44 |
+
|
45 |
+
var destinationPromise;
|
46 |
+
if (typeof dest === 'string') {
|
47 |
+
destString = dest;
|
48 |
+
destinationPromise = divContainer.data('pdfDoc').getDestination(dest);
|
49 |
+
} else {
|
50 |
+
destinationPromise = Promise.resolve(dest);
|
51 |
+
}
|
52 |
+
destinationPromise.then(function(destination) {
|
53 |
+
|
54 |
+
if (!(destination instanceof Array) || destination.length < 1) {
|
55 |
+
return; // invalid destination
|
56 |
+
}
|
57 |
+
|
58 |
+
divContainer.data('pdfDoc').getPageIndex(destination[0]).then(function (pageIndex) {
|
59 |
+
var pageNum = pageIndex + 1;
|
60 |
+
|
61 |
+
if (pageNum > divContainer.data('pdfDoc').numPages || pageNum <= 0) {
|
62 |
+
return;
|
63 |
+
}
|
64 |
+
|
65 |
+
divContainer.data('pagenum', pageNum);
|
66 |
+
$.fn.pdfEmbedder.queueRenderPage(divContainer, pageNum);
|
67 |
+
});
|
68 |
+
|
69 |
+
});
|
70 |
+
|
71 |
+
});
|
72 |
+
|
73 |
// Initial/first page rendering
|
74 |
|
75 |
divContainer.data('pageCount', pdfDoc_.numPages);
|
76 |
|
77 |
+
if (!divContainer.data('pagenum') || divContainer.data('pagenum') < 1 || divContainer.data('pagenum') > pdfDoc_.numPages) {
|
78 |
+
divContainer.data('pagenum', 1);
|
79 |
}
|
80 |
|
81 |
divContainer.data('showIsSecure', showIsSecure);
|
82 |
divContainer.data('pageNumPending', null);
|
83 |
divContainer.data('zoom', 100);
|
84 |
+
$.fn.pdfEmbedder.renderPage(divContainer, divContainer.data('pagenum'));
|
85 |
|
86 |
divContainer.find('span.pdfemb-page-count').text( pdfDoc_.numPages );
|
87 |
|
91 |
|
92 |
$(window).resize(function() {
|
93 |
setTimeout(function() {
|
94 |
+
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('pagenum'));
|
95 |
}, 100);
|
96 |
});
|
97 |
};
|
110 |
var msgnode = document.createTextNode(e.message);
|
111 |
if (e.name == 'UnexpectedResponseException' && e.status == 0) {
|
112 |
msgnode = $('<span></span>').append(
|
113 |
+
document.createTextNode(pdfemb_trans.objectL10n.domainerror+' '))
|
114 |
+
.append($('<a href="https://wp-pdf.com/troubleshooting/#unexpected" target="_blank">'+pdfemb_trans.objectL10n.clickhereinfo+'</a>'));
|
115 |
}
|
116 |
divContainer.empty().append($('<div></div>', {'class': 'pdfemb-errormsg'}).append(msgnode));
|
117 |
}
|
132 |
|
133 |
};
|
134 |
|
135 |
+
|
136 |
+
// Set up annotations layer factory
|
137 |
+
if (typeof(pdfembPremiumAnnotationsLayerFactory) != 'undefined') {
|
138 |
+
$.fn.pdfEmbedder.annotationsLayerFactory = new pdfembPremiumAnnotationsLayerFactory();
|
139 |
+
}
|
140 |
+
else {
|
141 |
+
$.fn.pdfEmbedder.annotationsLayerFactory = {
|
142 |
+
createAnnotationsLayerBuilder: function (pageDiv, pdfPage) {
|
143 |
+
return null;
|
144 |
+
}
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
|
149 |
+
$.fn.pdfEmbedder.checkForResize = function(divContainer) {
|
150 |
var newheight = $(window).height();
|
151 |
var newwidth = $(window).width();
|
152 |
|
158 |
divContainer.data('checked-window-width', newwidth);
|
159 |
}
|
160 |
else if (oldheight != newheight || oldwidth != newwidth) {
|
161 |
+
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('pagenum'));
|
162 |
divContainer.data('checked-window-height', newheight);
|
163 |
divContainer.data('checked-window-width', newwidth);
|
164 |
}
|
199 |
var pageHeight = vp.height;
|
200 |
|
201 |
if (pageWidth <= 0 || pageHeight <= 0) {
|
202 |
+
divContainer.empty().append(document.createTextNode(pdfemb_trans.objectL10n.widthheightinvalid));
|
203 |
return;
|
204 |
}
|
205 |
|
349 |
pdfembMakeMobile($, wantMobile, divContainer);
|
350 |
|
351 |
if (noredraw) {
|
352 |
+
divContainer.data('pagenum', pageNum);
|
353 |
divContainer.data('pageRendering', false);
|
354 |
|
355 |
var newCanvas = $("<canvas>")
|
365 |
}
|
366 |
|
367 |
// Render PDF page into canvas context
|
368 |
+
var ctx = canvas[0].getContext('2d');
|
369 |
+
var renderContext = {
|
370 |
+
canvasContext: ctx,
|
371 |
+
viewport: viewport
|
372 |
+
};
|
373 |
+
var renderTask = page.render(renderContext);
|
374 |
+
|
375 |
+
// Wait for rendering to finish
|
376 |
+
renderTask.promise.then(function () {
|
377 |
+
divContainer.data('pagenum', pageNum);
|
378 |
+
divContainer.data('pageRendering', false);
|
379 |
+
|
380 |
+
// Update page counters
|
381 |
+
var pageNumDisplay = divContainer.find('div.pdfemb-toolbar .pdfemb-page-num');
|
382 |
+
if (pageNumDisplay.is('span')) {
|
383 |
+
// Normal span area
|
384 |
+
pageNumDisplay.text(pageNum);
|
385 |
+
} else {
|
386 |
+
// User-changeable text
|
387 |
+
pageNumDisplay.val(pageNum);
|
388 |
+
}
|
389 |
+
|
390 |
+
if (pageNum < divContainer.data("pageCount")) {
|
391 |
+
divContainer.find('.pdfemb-next').removeAttr('disabled').removeClass('pdfemb-btndisabled');
|
392 |
+
}
|
393 |
+
else {
|
394 |
+
divContainer.find('.pdfemb-next').attr('disabled','disabled').addClass('pdfemb-btndisabled');
|
395 |
+
}
|
396 |
+
|
397 |
+
if (pageNum > 1) {
|
398 |
+
divContainer.find('.pdfemb-prev').removeAttr('disabled').removeClass('pdfemb-btndisabled');
|
399 |
+
}
|
400 |
+
else {
|
401 |
+
divContainer.find('.pdfemb-prev').attr('disabled','disabled').addClass('pdfemb-btndisabled');
|
402 |
+
}
|
403 |
+
|
404 |
+
// Do annotations layer
|
405 |
+
|
406 |
+
var annotationLayer = $.fn.pdfEmbedder.annotationsLayerFactory.createAnnotationsLayerBuilder(divContainer.find('div.pdfemb-inner-div')[0], page);
|
407 |
+
if (annotationLayer != null) {
|
408 |
+
divContainer.find('div.pdfembAnnotationLayer').remove();
|
409 |
+
annotationLayer.setupAnnotations(viewport);
|
410 |
+
}
|
411 |
+
|
412 |
+
// End annotations layer
|
413 |
+
|
414 |
+
if (divContainer.data('pageNumPending') !== null) {
|
415 |
+
// New page rendering is pending
|
416 |
+
$.fn.pdfEmbedder.renderPage(divContainer, divContainer.data('pageNumPending'));
|
417 |
+
divContainer.data('pageNumPending', null);
|
418 |
+
}
|
419 |
+
});
|
420 |
+
|
421 |
+
|
422 |
});
|
423 |
|
424 |
};
|
442 |
divContainer.data('zoom', newzoom);
|
443 |
divContainer.find('span.pdfemb-zoom').text( newzoom + '%' );
|
444 |
|
445 |
+
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('pagenum'));
|
446 |
divContainer.data('fromZoom', oldzoom).data('toZoom', newzoom);
|
447 |
};
|
448 |
|
459 |
divContainer.data('zoom', newzoom);
|
460 |
divContainer.find('span.pdfemb-zoom').text( newzoom + '%' );
|
461 |
|
462 |
+
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('pagenum'), true);
|
463 |
divContainer.data('fromZoom', oldzoom).data('toZoom', newzoom);
|
464 |
|
465 |
};
|
467 |
$.fn.pdfEmbedder.addToolbar = function(divContainer, atTop, fixed, showIsSecure){
|
468 |
|
469 |
var toolbar = $('<div></div>', {'class': 'pdfemb-toolbar pdfemb-toolbar'+(fixed ? '-fixed' : '-hover')+' '+(atTop ? ' pdfemb-toolbar-top' : 'pdfemb-toolbar-bottom')});
|
470 |
+
var prevbtn = $('<button class="pdfemb-prev" title="'+pdfemb_trans.objectL10n.prev+'"></button>');
|
471 |
toolbar.append(prevbtn);
|
472 |
+
var nextbtn = $('<button class="pdfemb-next" title="'+pdfemb_trans.objectL10n.next+'"></button>');
|
473 |
toolbar.append(nextbtn);
|
474 |
|
475 |
+
toolbar.append($('<div class="pdfemb-page-area">'+pdfemb_trans.objectL10n.page+' <span class="pdfemb-page-num">0</span> / <span class="pdfemb-page-count"></span></div>'));
|
476 |
|
477 |
+
var zoomoutbtn = $('<button class="pdfemb-zoomout" title="'+pdfemb_trans.objectL10n.zoomout+'"></button>');
|
478 |
toolbar.append(zoomoutbtn);
|
479 |
|
480 |
+
var zoominbtn = $('<button class="pdfemb-zoomin" title="'+pdfemb_trans.objectL10n.zoomin+'"></button>');
|
481 |
toolbar.append(zoominbtn);
|
482 |
|
483 |
+
toolbar.append($('<div>'+pdfemb_trans.objectL10n.zoom+' <span class="pdfemb-zoom">100%</span></div>'));
|
484 |
|
485 |
if (showIsSecure) {
|
486 |
+
toolbar.append($('<div>'+pdfemb_trans.objectL10n.secure+'</div>'));
|
487 |
}
|
488 |
|
489 |
if (atTop) {
|
495 |
|
496 |
// Add button functions
|
497 |
prevbtn.on('click', function (e){
|
498 |
+
if (divContainer.data('pagenum') <= 1) {
|
499 |
return;
|
500 |
}
|
501 |
+
divContainer.data('pagenum', divContainer.data('pagenum')-1);
|
502 |
+
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('pagenum'));
|
503 |
});
|
504 |
|
505 |
nextbtn.on('click', function (e){
|
506 |
+
if (divContainer.data('pagenum') >= divContainer.data('pdfDoc').numPages) {
|
507 |
return;
|
508 |
}
|
509 |
+
divContainer.data('pagenum', divContainer.data('pagenum')+1);
|
510 |
+
$.fn.pdfEmbedder.queueRenderPage(divContainer, divContainer.data('pagenum'));
|
511 |
});
|
512 |
|
513 |
zoominbtn.on('click', function (e){
|
542 |
}
|
543 |
);
|
544 |
}
|
545 |
+
|
546 |
+
// Powered by
|
547 |
+
if (pdfemb_trans.poweredby) {
|
548 |
+
toolbar.append($('<div></div>',{'class':'pdfemb-poweredby'}).append($('<a href="https://wp-pdf.com/?utm_source=Poweredby&utm_medium=freemium&utm_campaign=Freemium" target="_blank">wp-pdf.com</a>')));
|
549 |
+
}
|
550 |
};
|
551 |
|
552 |
// Apply plugin to relevant divs/};
|
lang/deploy_make_lang.sh
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
cd /Users/dan/git/PDFEmbedder/
|
4 |
+
|
5 |
+
# php ../i18n-tools/add-textdomain.php -i pdf-embedder basic_pdf_embedder.php
|
6 |
+
# php ../i18n-tools/add-textdomain.php -i pdf-embedder premium_mobile_pdf_embedder.php
|
7 |
+
# php ../i18n-tools/add-textdomain.php -i pdf-embedder core/commercial_pdf_embedder.php
|
8 |
+
# php ../i18n-tools/add-textdomain.php -i pdf-embedder core/core_pdf_embedder.php
|
9 |
+
|
10 |
+
php ../i18n-tools/makepot.php wp-plugin . lang/orig_pdf-embedder.pot
|
11 |
+
cat lang/orig_pdf-embedder.pot lang/pot_extra.pot > lang/pdf-embedder.pot
|
lang/pdf-embedder.pot
ADDED
@@ -0,0 +1,390 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2015
|
2 |
+
# This file is distributed under the same license as the package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: \n"
|
6 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/PDFEmbedder\n"
|
7 |
+
"POT-Creation-Date: 2015-11-19 14:40:08+00:00\n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
|
12 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
+
|
15 |
+
#: basic_pdf_embedder.php:63 core/commercial_pdf_embedder.php:60
|
16 |
+
msgid "Download Button"
|
17 |
+
msgstr ""
|
18 |
+
|
19 |
+
#: basic_pdf_embedder.php:65
|
20 |
+
msgid "Check to provide PDF download button on toolbar - only available in premium versions"
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: basic_pdf_embedder.php:74
|
24 |
+
msgid "Mobile-friendly embedding using PDF Embedder Premium"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: basic_pdf_embedder.php:75
|
28 |
+
msgid ""
|
29 |
+
"This free version of the plugin should work on most mobile browsers, but it will be cumbersome for users with small screens - it is difficult to position\n"
|
30 |
+
" the document entirely within the screen, and your users' fingers may catch the entire browser page when\n"
|
31 |
+
" they're trying only to move about the document..."
|
32 |
+
msgstr ""
|
33 |
+
|
34 |
+
#: basic_pdf_embedder.php:79
|
35 |
+
msgid ""
|
36 |
+
"Our <b>PDF Embedder Premium</b> plugin solves this problem with an intelligent 'full screen' mode.\n"
|
37 |
+
" When the document is smaller than a certain width, the document displays only as a 'thumbnail' with a large\n"
|
38 |
+
" 'View in Full Screen' button for the\n"
|
39 |
+
" user to click when they want to study your document.\n"
|
40 |
+
" This opens up the document so it has the full focus of the mobile browser, and the user can move about the\n"
|
41 |
+
" document without hitting other parts of\n"
|
42 |
+
" the web page by mistake. Click Exit to return to the regular web page."
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
#: basic_pdf_embedder.php:88 core/core_pdf_embedder.php:334
|
46 |
+
msgid "See our website <a href=\"%s\">wp-pdf.com</a> for more details and purchase options."
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#: core/EDD_SL_Plugin_Updater.php:248
|
50 |
+
msgid "There is a new version of %1$s available. <a target=\"_blank\" class=\"thickbox\" href=\"%2$s\">View version %3$s details</a>."
|
51 |
+
msgstr ""
|
52 |
+
|
53 |
+
#: core/EDD_SL_Plugin_Updater.php:255
|
54 |
+
msgid "There is a new version of %1$s available. <a target=\"_blank\" class=\"thickbox\" href=\"%2$s\">View version %3$s details</a> or <a href=\"%4$s\">update now</a>."
|
55 |
+
msgstr ""
|
56 |
+
|
57 |
+
#: core/EDD_SL_Plugin_Updater.php:479
|
58 |
+
msgid "You do not have permission to install plugin updates"
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#: core/EDD_SL_Plugin_Updater.php:479
|
62 |
+
msgid "Error"
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: core/commercial_pdf_embedder.php:49
|
66 |
+
msgid "License"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: core/commercial_pdf_embedder.php:63
|
70 |
+
msgid "Check to provide PDF download button in toolbar"
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
#: core/commercial_pdf_embedder.php:72
|
74 |
+
msgid "Default Mobile Settings"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: core/commercial_pdf_embedder.php:74
|
78 |
+
msgid "When the document is smaller than the width specified below, the document displays only as a 'thumbnail' with a large 'View in Full Screen' button for the user to click to open."
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: core/commercial_pdf_embedder.php:76
|
82 |
+
msgid "Mobile Width"
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: core/commercial_pdf_embedder.php:80
|
86 |
+
msgid "Enter an integer number of pixels, or 0 to disable automatic full-screen"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: core/commercial_pdf_embedder.php:90
|
90 |
+
msgid "You should have received a license key when you purchased this premium version of PDF Embedder."
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: core/commercial_pdf_embedder.php:91
|
94 |
+
msgid "Please enter it below to enable automatic updates, or <a href=\"%s\">email us</a> if you do not have one."
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: core/commercial_pdf_embedder.php:93
|
98 |
+
msgid "License Key"
|
99 |
+
msgstr ""
|
100 |
+
|
101 |
+
#: core/commercial_pdf_embedder.php:106
|
102 |
+
msgid "Current License"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#: core/commercial_pdf_embedder.php:109
|
106 |
+
msgid "Status"
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#: core/commercial_pdf_embedder.php:113
|
110 |
+
msgid "Last Checked"
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: core/commercial_pdf_embedder.php:121
|
114 |
+
msgid "License Expires"
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: core/commercial_pdf_embedder.php:133
|
118 |
+
msgid "To renew your license, please <a href=\"%s\" target=\"_blank\">click here</a>."
|
119 |
+
msgstr ""
|
120 |
+
|
121 |
+
#: core/commercial_pdf_embedder.php:136
|
122 |
+
msgid "You will receive a 50% discount if you renew before your license expires."
|
123 |
+
msgstr ""
|
124 |
+
|
125 |
+
#: core/commercial_pdf_embedder.php:252
|
126 |
+
msgid "Mobile width should be an integer number of pixels, or 0 to turn off"
|
127 |
+
msgstr ""
|
128 |
+
|
129 |
+
#: core/commercial_pdf_embedder.php:253
|
130 |
+
msgid "License key is too short"
|
131 |
+
msgstr ""
|
132 |
+
|
133 |
+
#: core/commercial_pdf_embedder.php:255
|
134 |
+
msgid "License key failed to activate"
|
135 |
+
msgstr ""
|
136 |
+
|
137 |
+
#: core/commercial_pdf_embedder.php:256
|
138 |
+
msgid "License key does not exist in our system at all"
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: core/commercial_pdf_embedder.php:257
|
142 |
+
msgid "License key entered is for the wrong product"
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: core/commercial_pdf_embedder.php:258
|
146 |
+
msgid "License key has expired"
|
147 |
+
msgstr ""
|
148 |
+
|
149 |
+
#: core/commercial_pdf_embedder.php:259
|
150 |
+
msgid "License key is not permitted for this website"
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
#: core/commercial_pdf_embedder.php:260
|
154 |
+
msgid "License key is not active for this website"
|
155 |
+
msgstr ""
|
156 |
+
|
157 |
+
#: core/commercial_pdf_embedder.php:261
|
158 |
+
msgid "License key has been disabled"
|
159 |
+
msgstr ""
|
160 |
+
|
161 |
+
#: core/commercial_pdf_embedder.php:262
|
162 |
+
msgid "License key was not provided"
|
163 |
+
msgstr ""
|
164 |
+
|
165 |
+
#: core/core_pdf_embedder.php:37
|
166 |
+
msgid "Loading..."
|
167 |
+
msgstr ""
|
168 |
+
|
169 |
+
#: core/core_pdf_embedder.php:38
|
170 |
+
msgid "Page"
|
171 |
+
msgstr ""
|
172 |
+
|
173 |
+
#: core/core_pdf_embedder.php:39
|
174 |
+
msgid "Zoom"
|
175 |
+
msgstr ""
|
176 |
+
|
177 |
+
#: core/core_pdf_embedder.php:40
|
178 |
+
msgid "Previous page"
|
179 |
+
msgstr ""
|
180 |
+
|
181 |
+
#: core/core_pdf_embedder.php:41
|
182 |
+
msgid "Next page"
|
183 |
+
msgstr ""
|
184 |
+
|
185 |
+
#: core/core_pdf_embedder.php:42
|
186 |
+
msgid "Zoom In"
|
187 |
+
msgstr ""
|
188 |
+
|
189 |
+
#: core/core_pdf_embedder.php:43
|
190 |
+
msgid "Zoom Out"
|
191 |
+
msgstr ""
|
192 |
+
|
193 |
+
#: core/core_pdf_embedder.php:44 core/core_pdf_embedder.php:215
|
194 |
+
msgid "Secure"
|
195 |
+
msgstr ""
|
196 |
+
|
197 |
+
#: core/core_pdf_embedder.php:45
|
198 |
+
msgid "Download PDF"
|
199 |
+
msgstr ""
|
200 |
+
|
201 |
+
#: core/core_pdf_embedder.php:46
|
202 |
+
msgid "Full Screen"
|
203 |
+
msgstr ""
|
204 |
+
|
205 |
+
#: core/core_pdf_embedder.php:47
|
206 |
+
msgid "Error: URL to the PDF file must be on exactly the same domain as the current web page."
|
207 |
+
msgstr ""
|
208 |
+
|
209 |
+
#: core/core_pdf_embedder.php:48
|
210 |
+
msgid "Click here for more info"
|
211 |
+
msgstr ""
|
212 |
+
|
213 |
+
#: core/core_pdf_embedder.php:49
|
214 |
+
msgid "PDF page width or height are invalid"
|
215 |
+
msgstr ""
|
216 |
+
|
217 |
+
#: core/core_pdf_embedder.php:50
|
218 |
+
msgid "View in Full Screen"
|
219 |
+
msgstr ""
|
220 |
+
|
221 |
+
#: core/core_pdf_embedder.php:68
|
222 |
+
msgid "PDFs"
|
223 |
+
msgstr ""
|
224 |
+
|
225 |
+
#: core/core_pdf_embedder.php:68
|
226 |
+
msgid "Manage PDFs"
|
227 |
+
msgstr ""
|
228 |
+
|
229 |
+
#: core/core_pdf_embedder.php:68
|
230 |
+
msgid "PDF <span class=\"count\">(%s)</span>"
|
231 |
+
msgid_plural "PDFs <span class=\"count\">(%s)</span>"
|
232 |
+
msgstr[0] ""
|
233 |
+
msgstr[1] ""
|
234 |
+
|
235 |
+
#: core/core_pdf_embedder.php:176 core/core_pdf_embedder.php:181
|
236 |
+
msgid "PDF Embedder settings"
|
237 |
+
msgstr ""
|
238 |
+
|
239 |
+
#: core/core_pdf_embedder.php:176 core/core_pdf_embedder.php:181
|
240 |
+
msgid "PDF Embedder"
|
241 |
+
msgstr ""
|
242 |
+
|
243 |
+
#: core/core_pdf_embedder.php:201
|
244 |
+
msgid "PDF Embedder setup"
|
245 |
+
msgstr ""
|
246 |
+
|
247 |
+
#: core/core_pdf_embedder.php:203
|
248 |
+
msgid "To use the plugin, just embed PDFs in the same way as you would normally embed images in your posts/pages - but try with a PDF file instead."
|
249 |
+
msgstr ""
|
250 |
+
|
251 |
+
#: core/core_pdf_embedder.php:204
|
252 |
+
msgid ""
|
253 |
+
"From the post editor, click Add Media, and then drag-and-drop your PDF file into the media library.\n"
|
254 |
+
" When you insert the PDF into your post, it will automatically embed using the plugin's viewer."
|
255 |
+
msgstr ""
|
256 |
+
|
257 |
+
#: core/core_pdf_embedder.php:213
|
258 |
+
msgid "Main Settings"
|
259 |
+
msgstr ""
|
260 |
+
|
261 |
+
#: core/core_pdf_embedder.php:214
|
262 |
+
msgid "Mobile"
|
263 |
+
msgstr ""
|
264 |
+
|
265 |
+
#: core/core_pdf_embedder.php:242
|
266 |
+
msgid "Save Changes"
|
267 |
+
msgstr ""
|
268 |
+
|
269 |
+
#: core/core_pdf_embedder.php:265
|
270 |
+
msgid "Default Viewer Settings"
|
271 |
+
msgstr ""
|
272 |
+
|
273 |
+
#: core/core_pdf_embedder.php:267
|
274 |
+
msgid "Width"
|
275 |
+
msgstr ""
|
276 |
+
|
277 |
+
#: core/core_pdf_embedder.php:271
|
278 |
+
msgid "Height"
|
279 |
+
msgstr ""
|
280 |
+
|
281 |
+
#: core/core_pdf_embedder.php:275
|
282 |
+
msgid "Enter <b>max</b> or an integer number of pixels"
|
283 |
+
msgstr ""
|
284 |
+
|
285 |
+
#: core/core_pdf_embedder.php:279
|
286 |
+
msgid "Toolbar Location"
|
287 |
+
msgstr ""
|
288 |
+
|
289 |
+
#: core/core_pdf_embedder.php:281
|
290 |
+
msgid "Top"
|
291 |
+
msgstr ""
|
292 |
+
|
293 |
+
#: core/core_pdf_embedder.php:282
|
294 |
+
msgid "Bottom"
|
295 |
+
msgstr ""
|
296 |
+
|
297 |
+
#: core/core_pdf_embedder.php:283
|
298 |
+
msgid "Both"
|
299 |
+
msgstr ""
|
300 |
+
|
301 |
+
#: core/core_pdf_embedder.php:288
|
302 |
+
msgid "Toolbar Hover"
|
303 |
+
msgstr ""
|
304 |
+
|
305 |
+
#: core/core_pdf_embedder.php:291
|
306 |
+
msgid "Toolbar appears only on hover over document"
|
307 |
+
msgstr ""
|
308 |
+
|
309 |
+
#: core/core_pdf_embedder.php:296
|
310 |
+
msgid "Toolbar always visible"
|
311 |
+
msgstr ""
|
312 |
+
|
313 |
+
#: core/core_pdf_embedder.php:308
|
314 |
+
msgid "You can override these defaults for specific embeds by modifying the shortcodes - see <a href=\"%s\" target=\"_blank\">instructions</a>."
|
315 |
+
msgstr ""
|
316 |
+
|
317 |
+
#: core/core_pdf_embedder.php:328
|
318 |
+
msgid "Protect your PDFs using PDF Embedder Secure"
|
319 |
+
msgstr ""
|
320 |
+
|
321 |
+
#: core/core_pdf_embedder.php:329
|
322 |
+
msgid ""
|
323 |
+
"Our <b>PDF Embedder Premium Secure</b> plugin provides the same simple but elegant viewer for your website visitors, with the added protection that\n"
|
324 |
+
" it is difficult for users to download or print the original PDF document."
|
325 |
+
msgstr ""
|
326 |
+
|
327 |
+
#: core/core_pdf_embedder.php:332
|
328 |
+
msgid "This means that your PDF is unlikely to be shared outside your site where you have no control over who views, prints, or shares it."
|
329 |
+
msgstr ""
|
330 |
+
|
331 |
+
#: core/core_pdf_embedder.php:380
|
332 |
+
msgid "Width must be \"max\" or an integer (number of pixels)"
|
333 |
+
msgstr ""
|
334 |
+
|
335 |
+
#: core/core_pdf_embedder.php:381
|
336 |
+
msgid "Height must be \"max\" or an integer (number of pixels)"
|
337 |
+
msgstr ""
|
338 |
+
|
339 |
+
#: core/core_pdf_embedder.php:387
|
340 |
+
msgid "Unspecified error"
|
341 |
+
msgstr ""
|
342 |
+
|
343 |
+
#: core/core_pdf_embedder.php:428
|
344 |
+
msgid "Settings saved"
|
345 |
+
msgstr ""
|
346 |
+
|
347 |
+
#: core/core_pdf_embedder.php:515
|
348 |
+
msgid "Settings"
|
349 |
+
msgstr ""
|
350 |
+
|
351 |
+
#: premium_secure_pdf_embedder.php:152 premium_secure_pdf_embedder.php:154
|
352 |
+
msgid "Secure PDFs"
|
353 |
+
msgstr ""
|
354 |
+
|
355 |
+
#: premium_secure_pdf_embedder.php:157
|
356 |
+
msgid "Send PDF media uploads to 'securepdfs' folder"
|
357 |
+
msgstr ""
|
358 |
+
|
359 |
+
#: premium_secure_pdf_embedder.php:164
|
360 |
+
msgid ""
|
361 |
+
"If 'Secure PDFs' is checked above, your PDF uploads will be 'secure' by default.\n"
|
362 |
+
" That is, they should be uploaded to a 'securepdfs' sub-folder of your uploads area. These files should not be accessible directly,\n"
|
363 |
+
" and the plugin provides a backdoor method for the embedded viewer to obtain the file contents."
|
364 |
+
msgstr ""
|
365 |
+
|
366 |
+
#: premium_secure_pdf_embedder.php:168
|
367 |
+
msgid ""
|
368 |
+
"This means that your PDF is unlikely to be shared outside your site where you have no control over who views, prints, or shares it.\n"
|
369 |
+
" Please note that it is still always possible for a determined user to obtain the original file. Sensitive information should never be presented to viewers in any form."
|
370 |
+
msgstr ""
|
371 |
+
|
372 |
+
#: premium_secure_pdf_embedder.php:171
|
373 |
+
msgid "See <a href=\"http://wp-pdf.com/premium-instructions/?utm_source=PDF%20Settings%20Secure&utm_medium=premium&utm_campaign=Premium\" target=\"_blank\">Instructions</a> for more details."
|
374 |
+
msgstr ""
|
375 |
+
|
376 |
+
# wordpress plugin description
|
377 |
+
msgid "Embed PDFs straight into your posts and pages, with flexible width and height. No third-party services required."
|
378 |
+
msgstr ""
|
379 |
+
|
380 |
+
# readme description
|
381 |
+
msgid "Embed PDFs straight into your posts and pages, with intelligent resizing of width and height. No third-party services or iframes required."
|
382 |
+
msgstr ""
|
383 |
+
|
384 |
+
# wordpress plugin description
|
385 |
+
msgid "PDF Embedder Premium"
|
386 |
+
msgstr ""
|
387 |
+
|
388 |
+
# wordpress plugin description
|
389 |
+
msgid "PDF Embedder Premium Secure"
|
390 |
+
msgstr ""
|
pdf_embedder.php
CHANGED
@@ -4,17 +4,18 @@
|
|
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.
|
7 |
-
* Version: 2.
|
8 |
* Author: Dan Lester
|
9 |
* Author URI: http://wp-pdf.com/
|
10 |
* License: GPL3
|
|
|
11 |
*/
|
12 |
|
13 |
require_once( plugin_dir_path(__FILE__).'/core/core_pdf_embedder.php' );
|
14 |
|
15 |
class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
|
16 |
|
17 |
-
protected $PLUGIN_VERSION = '2.
|
18 |
|
19 |
protected function useminified() {
|
20 |
/* using-minified */ return true;
|
@@ -31,8 +32,21 @@ class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
|
|
31 |
}
|
32 |
|
33 |
// Basic specific
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
if (!$this->useminified()) {
|
37 |
wp_register_script( 'pdfemb_versionspecific_pdf_js', $this->my_plugin_url().'js/pdfemb-basic.js', array('jquery'));
|
38 |
wp_register_script( 'pdfemb_grabtopan_js', $this->my_plugin_url().'js/grabtopan-basic.js', array('jquery'));
|
@@ -59,9 +73,9 @@ class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
|
|
59 |
<br class="clear" />
|
60 |
<br class="clear" />
|
61 |
|
62 |
-
<label for="pdfemb_download" class="textinput"
|
63 |
<span>
|
64 |
-
<label for="pdfemb_download" class="checkbox plain"
|
65 |
</span>
|
66 |
<?php
|
67 |
}
|
@@ -70,30 +84,45 @@ class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
|
|
70 |
{
|
71 |
?>
|
72 |
|
73 |
-
<h2
|
74 |
-
<p
|
75 |
-
small screens - it is difficult to position
|
76 |
the document entirely within the screen, and your users' fingers may catch the entire browser page when
|
77 |
-
they're trying only to move about the document
|
78 |
|
79 |
-
<p
|
80 |
When the document is smaller than a certain width, the document displays only as a 'thumbnail' with a large
|
81 |
'View in Full Screen' button for the
|
82 |
user to click when they want to study your document.
|
83 |
This opens up the document so it has the full focus of the mobile browser, and the user can move about the
|
84 |
document without hitting other parts of
|
85 |
-
the web page by mistake. Click Exit to return to the regular web page.
|
86 |
</p>
|
87 |
|
88 |
-
<p
|
89 |
-
href="http://wp-pdf.com/premium/?utm_source=PDF%20Settings%20Premium&utm_medium=freemium&utm_campaign=Freemium">wp-pdf.com</a>
|
90 |
-
for more
|
91 |
-
details and purchase options.
|
92 |
</p>
|
93 |
|
94 |
<?php
|
95 |
}
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
protected function extra_plugin_action_links( $links ) {
|
98 |
$secure_link = '<a href="http://wp-pdf.com/secure/?utm_source=Plugins%20Secure&utm_medium=freemium&utm_campaign=Freemium" target="_blank">Secure</a>';
|
99 |
$mobile_link = '<a href="http://wp-pdf.com/premium/?utm_source=Plugins%20Premium&utm_medium=freemium&utm_campaign=Freemium" target="_blank">Mobile</a>';
|
@@ -104,6 +133,11 @@ class pdfemb_basic_pdf_embedder extends core_pdf_embedder {
|
|
104 |
return $links;
|
105 |
}
|
106 |
|
|
|
|
|
|
|
|
|
|
|
107 |
// AUX
|
108 |
|
109 |
protected function my_plugin_basename() {
|
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.
|
7 |
+
* Version: 2.4
|
8 |
* Author: Dan Lester
|
9 |
* Author URI: http://wp-pdf.com/
|
10 |
* License: GPL3
|
11 |
+
* Text Domain: pdf-embedder
|
12 |
*/
|
13 |
|
14 |
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 = '2.4';
|
19 |
|
20 |
protected function useminified() {
|
21 |
/* using-minified */ return true;
|
32 |
}
|
33 |
|
34 |
// Basic specific
|
35 |
+
|
36 |
+
protected static $poweredby_optionname='pdfemb_poweredby';
|
37 |
+
|
38 |
+
public function pdfemb_activation_hook($network_wide) {
|
39 |
+
parent::pdfemb_activation_hook($network_wide);
|
40 |
+
|
41 |
+
// If installed previously, keep 'poweredby' to off since they were used to that
|
42 |
+
$old_options = get_site_option($this->get_options_name());
|
43 |
+
|
44 |
+
if (!$old_options) {
|
45 |
+
update_site_option(self::$poweredby_optionname, true);
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
public function pdfemb_wp_enqueue_scripts() {
|
50 |
if (!$this->useminified()) {
|
51 |
wp_register_script( 'pdfemb_versionspecific_pdf_js', $this->my_plugin_url().'js/pdfemb-basic.js', array('jquery'));
|
52 |
wp_register_script( 'pdfemb_grabtopan_js', $this->my_plugin_url().'js/grabtopan-basic.js', array('jquery'));
|
73 |
<br class="clear" />
|
74 |
<br class="clear" />
|
75 |
|
76 |
+
<label for="pdfemb_download" class="textinput"><?php esc_html_e('Download Button', 'pdf-embedder'); ?></label>
|
77 |
<span>
|
78 |
+
<label for="pdfemb_download" class="checkbox plain"><?php esc_html_e('Check to provide PDF download button on toolbar - only available in premium versions', 'pdf-embedder'); ?></label>
|
79 |
</span>
|
80 |
<?php
|
81 |
}
|
84 |
{
|
85 |
?>
|
86 |
|
87 |
+
<h2><?php esc_html_e('Mobile-friendly embedding using PDF Embedder Premium', 'pdf-embedder'); ?></h2>
|
88 |
+
<p><?php esc_html_e("This free version of the plugin should work on most mobile browsers, but it will be cumbersome for users with small screens - it is difficult to position
|
|
|
89 |
the document entirely within the screen, and your users' fingers may catch the entire browser page when
|
90 |
+
they're trying only to move about the document...", 'pdf-embedder'); ?></p>
|
91 |
|
92 |
+
<p><?php _e("Our <b>PDF Embedder Premium</b> plugin solves this problem with an intelligent 'full screen' mode.
|
93 |
When the document is smaller than a certain width, the document displays only as a 'thumbnail' with a large
|
94 |
'View in Full Screen' button for the
|
95 |
user to click when they want to study your document.
|
96 |
This opens up the document so it has the full focus of the mobile browser, and the user can move about the
|
97 |
document without hitting other parts of
|
98 |
+
the web page by mistake. Click Exit to return to the regular web page.", 'pdf-embedder'); ?>
|
99 |
</p>
|
100 |
|
101 |
+
<p><?php printf( __('See our website <a href="%s">wp-pdf.com</a> for more details and purchase options.', 'pdf-embedder'), 'http://wp-pdf.com/premium/?utm_source=PDF%20Settings%20Premium&utm_medium=freemium&utm_campaign=Freemium'); ?>
|
|
|
|
|
|
|
102 |
</p>
|
103 |
|
104 |
<?php
|
105 |
}
|
106 |
|
107 |
+
protected function options_do_sidebar() {
|
108 |
+
?><div id="pdfemb-tableright" class="pdfemb-tablecell">
|
109 |
+
<div>
|
110 |
+
<h3>Premium Versions</h3>
|
111 |
+
<p>Visit <a href="https://wp-pdf.com/?utm_source=Premium%20Sidebar&utm_medium=freemium&utm_campaign=Freemium" target="_blank">wp-pdf.com</a> for premium features:</p>
|
112 |
+
<ul>
|
113 |
+
<li>Mobile Friendly</li>
|
114 |
+
<li>Download Button</li>
|
115 |
+
<li>Working Hyperlinks</li>
|
116 |
+
<li>Jump to page number</li>
|
117 |
+
<li>Remove link to wp-pdf.com</li>
|
118 |
+
<li>Secure - prevent downloads</li>
|
119 |
+
</ul>
|
120 |
+
<p>More details and demos are <br/> on <a href="https://wp-pdf.com/?utm_source=Premium%20Sidebar&utm_medium=freemium&utm_campaign=Freemium" target="_blank">our website</a>!</p>
|
121 |
+
</div>
|
122 |
+
</div>
|
123 |
+
<?php
|
124 |
+
}
|
125 |
+
|
126 |
protected function extra_plugin_action_links( $links ) {
|
127 |
$secure_link = '<a href="http://wp-pdf.com/secure/?utm_source=Plugins%20Secure&utm_medium=freemium&utm_campaign=Freemium" target="_blank">Secure</a>';
|
128 |
$mobile_link = '<a href="http://wp-pdf.com/premium/?utm_source=Plugins%20Premium&utm_medium=freemium&utm_campaign=Freemium" target="_blank">Mobile</a>';
|
133 |
return $links;
|
134 |
}
|
135 |
|
136 |
+
protected function get_translation_array() {
|
137 |
+
return array_merge(parent::get_translation_array(),
|
138 |
+
Array('poweredby' => get_site_option(self::$poweredby_optionname, false)));
|
139 |
+
}
|
140 |
+
|
141 |
// AUX
|
142 |
|
143 |
protected function my_plugin_basename() {
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: danlester
|
3 |
Tags: doc, docx, pdf, office, powerpoint, google, document, embed, intranet
|
4 |
Requires at least: 3.3
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 2.
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -22,6 +22,9 @@ PDFs are embedded within your existing WordPress pages so we have full control o
|
|
22 |
Even if other plugins use similar technology, they will insert the PDF itself into an 'iframe' which means they do not get the flexibility over sizing.
|
23 |
|
24 |
There is no button for users to download the PDF in the free version of the plugin, but this is available in the Premium versions along with other extra features.
|
|
|
|
|
|
|
25 |
|
26 |
= Usage =
|
27 |
|
@@ -54,6 +57,15 @@ This means that your PDF is unlikely to be shared outside your site where you ha
|
|
54 |
|
55 |
See our website [wp-pdf.com](http://wp-pdf.com/secure/?utm_source=PDF%20Readme%20Secure&utm_medium=freemium&utm_campaign=Freemium) for more details and purchase options.
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
== Screenshots ==
|
59 |
|
@@ -111,6 +123,17 @@ See our website [wp-pdf.com](http://wp-pdf.com/secure/?utm_source=PDF%20Readme%2
|
|
111 |
|
112 |
This is possible only in the Premium version.
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
== Installation ==
|
115 |
|
116 |
Easiest way:
|
@@ -128,6 +151,15 @@ the Plugins section of your Wordpress admin
|
|
128 |
|
129 |
== Changelog ==
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
= 2.2.5 =
|
132 |
|
133 |
Better explanation of some error messages (e.g. attempt to access PDF on a different domain).
|
2 |
Contributors: danlester
|
3 |
Tags: doc, docx, pdf, office, powerpoint, google, document, embed, intranet
|
4 |
Requires at least: 3.3
|
5 |
+
Tested up to: 4.4
|
6 |
+
Stable tag: 2.4
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
22 |
Even if other plugins use similar technology, they will insert the PDF itself into an 'iframe' which means they do not get the flexibility over sizing.
|
23 |
|
24 |
There is no button for users to download the PDF in the free version of the plugin, but this is available in the Premium versions along with other extra features.
|
25 |
+
Hyperlinks in your PDF will only be clickable in the Premium versions.
|
26 |
+
|
27 |
+
**Now translation-ready!** Please contribute your translations.
|
28 |
|
29 |
= Usage =
|
30 |
|
57 |
|
58 |
See our website [wp-pdf.com](http://wp-pdf.com/secure/?utm_source=PDF%20Readme%20Secure&utm_medium=freemium&utm_campaign=Freemium) for more details and purchase options.
|
59 |
|
60 |
+
= Extra Premium Features =
|
61 |
+
|
62 |
+
Download button in the toolbar.
|
63 |
+
|
64 |
+
Hyperlinks are fully functional.
|
65 |
+
|
66 |
+
Edit page number to jump straight to page.
|
67 |
+
|
68 |
+
Removes wp-pdf.com attribution from the toolbar.
|
69 |
|
70 |
== Screenshots ==
|
71 |
|
123 |
|
124 |
This is possible only in the Premium version.
|
125 |
|
126 |
+
= Are Hyperlinks supported? =
|
127 |
+
|
128 |
+
The Premium versions allow functioning hyperlinks - both internal links within the document, and links to external websites.
|
129 |
+
|
130 |
+
= Can I remove the wp-pdf.com link from the viewer toolbar? =
|
131 |
+
|
132 |
+
The easiest way is to upgrade to our Premium version, but if you know how to add entries to your database then you can add a line to the wp_options table
|
133 |
+
with option_name 'pdfemb_poweredby' and option_value '1'.
|
134 |
+
|
135 |
+
For more information on Premium versions visit [wp-pdf.com](http://wp-pdf.com/?utm_source=PDF%20Readme%20FAQ%20Bottom&utm_medium=freemium&utm_campaign=Freemium).
|
136 |
+
|
137 |
== Installation ==
|
138 |
|
139 |
Easiest way:
|
151 |
|
152 |
== Changelog ==
|
153 |
|
154 |
+
= 2.4 =
|
155 |
+
|
156 |
+
Now translation-ready! Your language contributions are welcome.
|
157 |
+
Compatibility with WordPress 4.4
|
158 |
+
|
159 |
+
Contains information about new features in Premium version:
|
160 |
+
Functioning hyperlinks
|
161 |
+
Jump to page number
|
162 |
+
|
163 |
= 2.2.5 =
|
164 |
|
165 |
Better explanation of some error messages (e.g. attempt to access PDF on a different domain).
|