Changeset 1066688
- Timestamp:
- 01/13/2015 05:44:20 AM (11 years ago)
- Location:
- post-thumbnail-editor
- Files:
-
- 10 edited
- 9 copied
-
tags/2.4.3 (copied) (copied from post-thumbnail-editor/trunk)
-
tags/2.4.3/README.txt (copied) (copied from post-thumbnail-editor/trunk/README.txt) (2 diffs)
-
tags/2.4.3/html/pte.php (copied) (copied from post-thumbnail-editor/trunk/html/pte.php) (1 diff)
-
tags/2.4.3/js-build/main.js (copied) (copied from post-thumbnail-editor/trunk/js-build/main.js)
-
tags/2.4.3/js-build/main.js.gz (modified) (previous)
-
tags/2.4.3/js/controllers/CropCtrl.coffee (copied) (copied from post-thumbnail-editor/trunk/js/controllers/CropCtrl.coffee)
-
tags/2.4.3/js/controllers/PteCtrl.coffee (copied) (copied from post-thumbnail-editor/trunk/js/controllers/PteCtrl.coffee)
-
tags/2.4.3/js/settings.coffee (copied) (copied from post-thumbnail-editor/trunk/js/settings.coffee)
-
tags/2.4.3/js/snippets/pte_enable_media.js (modified) (3 diffs)
-
tags/2.4.3/php/functions.php (copied) (copied from post-thumbnail-editor/trunk/php/functions.php) (1 diff)
-
tags/2.4.3/php/options.php (modified) (2 diffs)
-
tags/2.4.3/post-thumbnail-editor.php (copied) (copied from post-thumbnail-editor/trunk/post-thumbnail-editor.php) (6 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/html/pte.php (modified) (1 diff)
-
trunk/js-build/main.js.gz (modified) (previous)
-
trunk/js/snippets/pte_enable_media.js (modified) (3 diffs)
-
trunk/php/functions.php (modified) (1 diff)
-
trunk/php/options.php (modified) (2 diffs)
-
trunk/post-thumbnail-editor.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-thumbnail-editor/tags/2.4.3/README.txt
r1001040 r1066688 3 3 Donate link: http://sewpafly.github.io/post-thumbnail-editor/#toc_donations 4 4 Tags: post-thumbnail, post thumbnail, featured image, featured, editor, image, awesome, crop 5 Requires at least: 3.56 Tested up to: 4. 0.x5 Requires at least: 4.1 6 Tested up to: 4.1.x 7 7 Stable tag: trunk 8 8 License: GPLv2 … … 75 75 76 76 == Changelog == 77 78 = 2.4.3 = 79 * Debug mode was broken 80 * Update the generated .gz javascript file 81 * modify the media library to have a fallback url 82 * check that option `pte_jpeg_compression` exists before trying to access it 77 83 78 84 = 2.4.2 = -
post-thumbnail-editor/tags/2.4.3/html/pte.php
r1001040 r1066688 284 284 <?php 285 285 286 function evaluate_attributes( $array ) { 287 foreach ( $array as $key => $value ) { 288 $attributes[] = "$key=\"$value\""; 289 } 290 return $attributes; 291 } 292 293 $script_tag = "<script %s></script>"; 294 $options = pte_get_options(); 295 if ( $options['pte_debug'] ) { 296 $script_attributes = evaluate_attributes( array( 297 'src' => PTE_PLUGINURL . "apps/requirejs/require.js", 298 'data-main' => PTE_PLUGINURL . 'js/main' 299 ) ); 300 } 301 else { 302 $script_attributes = evaluate_attributes( array( 303 'src' => PTE_PLUGINURL . "js-build/main.js" 304 ) ); 305 } 306 307 308 echo sprintf( $script_tag, join( $script_attributes, " " ) ); 286 function enqueue_script_filter($tag, $handle) { 287 if ('pte-require' !== $handle) 288 return $tag; 289 return str_replace(' src', ' data-main="' . PTE_PLUGINURL . 'js/main" src', $tag); 290 } 291 292 $options = pte_get_options(); 293 294 if ( $options['pte_debug'] ) { 295 wp_enqueue_script( 296 'pte-require', 297 PTE_PLUGINURL . "apps/requirejs/require.js", 298 null, 299 PTE_VERSION, 300 true 301 ); 302 add_filter('script_loader_tag', 'enqueue_script_filter', 10, 2); 303 } 304 else { 305 wp_enqueue_script( 306 'pte-min-js', 307 PTE_PLUGINURL . "js-build/main.js", 308 null, 309 PTE_VERSION, 310 true 311 ); 312 } -
post-thumbnail-editor/tags/2.4.3/js/snippets/pte_enable_media.js
r982619 r1066688 14 14 // Change the attachment-details html 15 15 injectTemplate = _.template("<a class=\"pte\" href=\"" + 16 pteL10n. url.replace(/&TB_iframe=true/,'') +16 pteL10n.fallbackUrl.replace(/&TB_iframe=true/,'') + 17 17 "\">\n " + 18 18 pteL10n.PTE + … … 25 25 template = $("#tmpl-attachment-details-two-column").text(); 26 26 template = template.replace(/(<div class="actions">)([\s\S]*?)(<\/div>)/m, 27 "$1$2 " + injectTemplate + "$3");27 "$1$2| " + injectTemplate + "$3"); 28 28 $("#tmpl-attachment-details-two-column").text(template); 29 29 }); … … 51 51 loadPteEditor: function(evt) { 52 52 evt.preventDefault(); 53 evt.stopImmediatePropagation(); 54 53 55 var state = this.controller.state().id; 54 56 var me = this; -
post-thumbnail-editor/tags/2.4.3/php/functions.php
r1001040 r1066688 251 251 "\nWORDPRESS: " . $GLOBALS['wp_version'] ); 252 252 253 $script_url = PTE_PLUGINURL . 'php/load-scripts.php?load=jquery,imgareaselect,jquery-json,pte';254 $style_url = PTE_PLUGINURL . 'php/load-styles.php?load=imgareaselect,pte';255 if ( $options['pte_debug'] ){256 $style_url .= "&d=1";257 $script_url .= "&d=1";258 }259 260 253 // Generate an image and put into the ptetmp directory 261 254 if (false === $editor_image = pte_generate_working_image($id)) { -
post-thumbnail-editor/tags/2.4.3/php/options.php
r982619 r1066688 108 108 foreach ( $sizes as $size ){ 109 109 // Hidden 110 if ( is _array( $input['pte_hidden_sizes'] )111 andin_array( $size, $input['pte_hidden_sizes'] ) ){110 if ( isset($input['pte_hidden_sizes']) && is_array( $input['pte_hidden_sizes'] ) 111 && in_array( $size, $input['pte_hidden_sizes'] ) ){ 112 112 $pte_hidden_sizes[] = $size; 113 113 } … … 117 117 118 118 // Check the JPEG Compression value 119 if ( $input['pte_jpeg_compression'] != "" ){119 if ( isset($input['pte_jpeg_compression']) && $input['pte_jpeg_compression'] != "" ){ 120 120 $tmp_jpeg_compression = (int) preg_replace( "/[\D]/", "", $input['pte_jpeg_compression'] ); 121 121 if ( ! is_int( $tmp_jpeg_compression ) -
post-thumbnail-editor/tags/2.4.3/post-thumbnail-editor.php
r1001040 r1066688 5 5 Author: sewpafly 6 6 Author URI: http://sewpafly.github.io/post-thumbnail-editor/ 7 Version: 2.4. 27 Version: 2.4.3 8 8 Description: Individually manage your post thumbnails 9 9 … … 35 35 define( 'PTE_PLUGINPATH', dirname(__FILE__) . "/"); 36 36 define( 'PTE_DOMAIN', "post-thumbnail-editor"); 37 define( 'PTE_VERSION', "2.4. 2");37 define( 'PTE_VERSION', "2.4.3"); 38 38 39 39 // TODO: … … 211 211 , array('PTE' => __('Post Thumbnail Editor', PTE_DOMAIN) 212 212 , 'url' => pte_url( "<%= id %>", true ) 213 , 'fallbackUrl' => pte_url( "<%= id %>" ) 213 214 ) 214 215 ); … … 339 340 , array('PTE' => __('Post Thumbnail Editor', PTE_DOMAIN) 340 341 , 'url' => pte_url( "<%= id %>", true ) 342 , 'fallbackUrl' => pte_url( "<%= id %>" ) 341 343 ) 342 344 ); … … 443 445 444 446 include_once( PTE_PLUGINPATH . "php/functions.php" ); 445 $pte_body = pte_body( $post->ID );446 447 447 448 // Add the scripts and styles … … 451 452 wp_enqueue_style( 'colors' ); 452 453 wp_enqueue_style( 'wp-jquery-ui-dialog' ); 454 455 $pte_body = pte_body( $post->ID ); 453 456 } 454 457 -
post-thumbnail-editor/trunk/README.txt
r1001040 r1066688 3 3 Donate link: http://sewpafly.github.io/post-thumbnail-editor/#toc_donations 4 4 Tags: post-thumbnail, post thumbnail, featured image, featured, editor, image, awesome, crop 5 Requires at least: 3.56 Tested up to: 4. 0.x5 Requires at least: 4.1 6 Tested up to: 4.1.x 7 7 Stable tag: trunk 8 8 License: GPLv2 … … 75 75 76 76 == Changelog == 77 78 = 2.4.3 = 79 * Debug mode was broken 80 * Update the generated .gz javascript file 81 * modify the media library to have a fallback url 82 * check that option `pte_jpeg_compression` exists before trying to access it 77 83 78 84 = 2.4.2 = -
post-thumbnail-editor/trunk/html/pte.php
r1001040 r1066688 284 284 <?php 285 285 286 function evaluate_attributes( $array ) { 287 foreach ( $array as $key => $value ) { 288 $attributes[] = "$key=\"$value\""; 289 } 290 return $attributes; 291 } 292 293 $script_tag = "<script %s></script>"; 294 $options = pte_get_options(); 295 if ( $options['pte_debug'] ) { 296 $script_attributes = evaluate_attributes( array( 297 'src' => PTE_PLUGINURL . "apps/requirejs/require.js", 298 'data-main' => PTE_PLUGINURL . 'js/main' 299 ) ); 300 } 301 else { 302 $script_attributes = evaluate_attributes( array( 303 'src' => PTE_PLUGINURL . "js-build/main.js" 304 ) ); 305 } 306 307 308 echo sprintf( $script_tag, join( $script_attributes, " " ) ); 286 function enqueue_script_filter($tag, $handle) { 287 if ('pte-require' !== $handle) 288 return $tag; 289 return str_replace(' src', ' data-main="' . PTE_PLUGINURL . 'js/main" src', $tag); 290 } 291 292 $options = pte_get_options(); 293 294 if ( $options['pte_debug'] ) { 295 wp_enqueue_script( 296 'pte-require', 297 PTE_PLUGINURL . "apps/requirejs/require.js", 298 null, 299 PTE_VERSION, 300 true 301 ); 302 add_filter('script_loader_tag', 'enqueue_script_filter', 10, 2); 303 } 304 else { 305 wp_enqueue_script( 306 'pte-min-js', 307 PTE_PLUGINURL . "js-build/main.js", 308 null, 309 PTE_VERSION, 310 true 311 ); 312 } -
post-thumbnail-editor/trunk/js/snippets/pte_enable_media.js
r982619 r1066688 14 14 // Change the attachment-details html 15 15 injectTemplate = _.template("<a class=\"pte\" href=\"" + 16 pteL10n. url.replace(/&TB_iframe=true/,'') +16 pteL10n.fallbackUrl.replace(/&TB_iframe=true/,'') + 17 17 "\">\n " + 18 18 pteL10n.PTE + … … 25 25 template = $("#tmpl-attachment-details-two-column").text(); 26 26 template = template.replace(/(<div class="actions">)([\s\S]*?)(<\/div>)/m, 27 "$1$2 " + injectTemplate + "$3");27 "$1$2| " + injectTemplate + "$3"); 28 28 $("#tmpl-attachment-details-two-column").text(template); 29 29 }); … … 51 51 loadPteEditor: function(evt) { 52 52 evt.preventDefault(); 53 evt.stopImmediatePropagation(); 54 53 55 var state = this.controller.state().id; 54 56 var me = this; -
post-thumbnail-editor/trunk/php/functions.php
r1001040 r1066688 251 251 "\nWORDPRESS: " . $GLOBALS['wp_version'] ); 252 252 253 $script_url = PTE_PLUGINURL . 'php/load-scripts.php?load=jquery,imgareaselect,jquery-json,pte';254 $style_url = PTE_PLUGINURL . 'php/load-styles.php?load=imgareaselect,pte';255 if ( $options['pte_debug'] ){256 $style_url .= "&d=1";257 $script_url .= "&d=1";258 }259 260 253 // Generate an image and put into the ptetmp directory 261 254 if (false === $editor_image = pte_generate_working_image($id)) { -
post-thumbnail-editor/trunk/php/options.php
r982619 r1066688 108 108 foreach ( $sizes as $size ){ 109 109 // Hidden 110 if ( is _array( $input['pte_hidden_sizes'] )111 andin_array( $size, $input['pte_hidden_sizes'] ) ){110 if ( isset($input['pte_hidden_sizes']) && is_array( $input['pte_hidden_sizes'] ) 111 && in_array( $size, $input['pte_hidden_sizes'] ) ){ 112 112 $pte_hidden_sizes[] = $size; 113 113 } … … 117 117 118 118 // Check the JPEG Compression value 119 if ( $input['pte_jpeg_compression'] != "" ){119 if ( isset($input['pte_jpeg_compression']) && $input['pte_jpeg_compression'] != "" ){ 120 120 $tmp_jpeg_compression = (int) preg_replace( "/[\D]/", "", $input['pte_jpeg_compression'] ); 121 121 if ( ! is_int( $tmp_jpeg_compression ) -
post-thumbnail-editor/trunk/post-thumbnail-editor.php
r1001040 r1066688 5 5 Author: sewpafly 6 6 Author URI: http://sewpafly.github.io/post-thumbnail-editor/ 7 Version: 2.4. 27 Version: 2.4.3 8 8 Description: Individually manage your post thumbnails 9 9 … … 35 35 define( 'PTE_PLUGINPATH', dirname(__FILE__) . "/"); 36 36 define( 'PTE_DOMAIN', "post-thumbnail-editor"); 37 define( 'PTE_VERSION', "2.4. 2");37 define( 'PTE_VERSION', "2.4.3"); 38 38 39 39 // TODO: … … 211 211 , array('PTE' => __('Post Thumbnail Editor', PTE_DOMAIN) 212 212 , 'url' => pte_url( "<%= id %>", true ) 213 , 'fallbackUrl' => pte_url( "<%= id %>" ) 213 214 ) 214 215 ); … … 339 340 , array('PTE' => __('Post Thumbnail Editor', PTE_DOMAIN) 340 341 , 'url' => pte_url( "<%= id %>", true ) 342 , 'fallbackUrl' => pte_url( "<%= id %>" ) 341 343 ) 342 344 ); … … 443 445 444 446 include_once( PTE_PLUGINPATH . "php/functions.php" ); 445 $pte_body = pte_body( $post->ID );446 447 447 448 // Add the scripts and styles … … 451 452 wp_enqueue_style( 'colors' ); 452 453 wp_enqueue_style( 'wp-jquery-ui-dialog' ); 454 455 $pte_body = pte_body( $post->ID ); 453 456 } 454 457
Note: See TracChangeset
for help on using the changeset viewer.