Changeset 420749
- Timestamp:
- 08/09/2011 12:06:28 AM (14 years ago)
- Location:
- faster-image-insert/trunk
- Files:
-
- 2 edited
-
faster-image-insert.php (modified) (12 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
faster-image-insert/trunk/faster-image-insert.php
r376549 r420749 2 2 /* 3 3 Plugin Name: Faster Image Insert 4 Plugin URI: http://b log.ticktag.org/2009/02/19/2765/4 Plugin URI: http://bitinn.net/2765/ 5 5 Description: Fully integrates media manager into editing interface, avoid having to reload it separately in thickbox pop-up; comes with enhanced features, suitable for precise image control. 6 6 Version: trunk 7 7 Author: David Frank 8 Author URI: http://b log.ticktag.org/8 Author URI: http://bitinn.net/ 9 9 License: GPL2 10 10 */ … … 48 48 49 49 //iframe for editing panel when wp_version > 3.0 50 //since FII 2.2.0, modified behaviour to workaround issue with jquery live + iframe 50 51 function fast_insert_form() { 51 52 global $post_ID, $temp_ID; … … 64 65 if(view) { 65 66 <?php if($id > 0) { ?> 66 $('#fastinsert > .inside').html('<iframe frameborder="0" name="fast_insert" id="fast_insert" src="<?php echo site_url() ?>/wp-admin/media-upload.php?post_id=<?php if($noflash) echo $id.'&flash=0'; else echo $id; ?>&type=image&tab=type" hspace="0" > </iframe>');67 $('#fastinsert > .inside').html('<iframe frameborder="0" name="fast_insert" id="fast_insert" src="<?php echo site_url() ?>/wp-admin/media-upload.php?post_id=<?php if($noflash) echo $id.'&flash=0'; else echo $id; ?>&type=image&tab=type" hspace="0" onload="if (document.getElementById(\'fast_insert\').contentWindow.document.title.length == 0) document.getElementById(\'fast_insert\').contentDocument.location.href = document.getElementById(\'fast_insert\').contentDocument.location.href"> </iframe>'); 67 68 <?php } else { ?> 68 69 $('#fastinsert > .inside').html('<p><?php _e('Click here to reload after autosave. Or manually save the draft.', 'faster-image-insert') ?></p>'); … … 75 76 if(view) { 76 77 <?php if($id > 0) { ?> 77 $('#fastinsert > .inside').html('<iframe frameborder="0" name="fast_insert" id="fast_insert" src="<?php echo site_url() ?>/wp-admin/media-upload.php?post_id=<?php if($noflash) echo $id.'&flash=0'; else echo $id; ?>&type=image&tab=type" hspace="0" > </iframe>');78 $('#fastinsert > .inside').html('<iframe frameborder="0" name="fast_insert" id="fast_insert" src="<?php echo site_url() ?>/wp-admin/media-upload.php?post_id=<?php if($noflash) echo $id.'&flash=0'; else echo $id; ?>&type=image&tab=type" hspace="0" onload="if (document.getElementById(\'fast_insert\').contentWindow.document.title.length == 0) document.getElementById(\'fast_insert\').contentDocument.location.href = document.getElementById(\'fast_insert\').contentDocument.location.href"> </iframe>'); 78 79 <?php } else { ?> 79 80 $('#fastinsert > .inside').html('<p><?php _e('Click here to reload after autosave. Or manually save the draft.', 'faster-image-insert') ?></p>'); … … 81 82 } 82 83 }); 83 <?php if($id < 0) { ?>84 //update state after autosave, bind load event.85 $('#fastinsert').click(function() {86 var newid = $('#post_ID').val();87 if(notSaved == false && newid > 0) {88 $('#fastinsert > .inside').html('<iframe frameborder="0" name="fast_insert" id="fast_insert" src="<?php echo site_url() ?>/wp-admin/media-upload.php?post_id='+newid+'<?php if($noflash) echo '&flash=0'; ?>&type=image&tab=type" hspace="0"> </iframe>');89 $('#fast_insert').bind("load", function() {90 if($(this).contents().find('#media-upload').length < 1) {91 document.getElementById('fast_insert').contentWindow.location.href = document.getElementById('fast_insert').contentWindow.location.href;92 }93 });94 }95 });96 <?php } ?>97 <?php if($id > 0) { ?>98 //update state on insert99 $('#fast_insert').bind("load", function() {100 if($(this).contents().find('#media-upload').length < 1) {101 document.getElementById('fast_insert').contentWindow.location.href = document.getElementById('fast_insert').contentWindow.location.href;102 }103 });104 <?php } ?>105 84 }); 106 85 /* ]]> */ … … 165 144 166 145 //buttons for enhanced functions 167 $('.ml-submit:first').append('<input type="submit" class="button savebutton" name="insertall" id="insertall" value="<?php echo attribute_escape( __( 'Insert selected images', 'faster-image-insert') ); ?>" /> '); 168 $('.ml-submit:first').append('<input type="submit" class="button savebutton" name="invertall" id="invertall" value="<?php echo attribute_escape( __( 'Invert selection', 'faster-image-insert') ); ?>" /> '); 146 //since FII 2.2.0: changed to adapt to jquery 1.6 checkbox prop 147 $('.ml-submit:first').append('<input type="submit" class="button savebutton" name="insertall" id="insertall" value="<?php echo esc_attr( __( 'Insert selected images', 'faster-image-insert') ); ?>" /> '); 148 $('.ml-submit:first').append('<input type="submit" class="button savebutton" name="invertall" id="invertall" value="<?php echo esc_attr( __( 'Invert selection', 'faster-image-insert') ); ?>" /> '); 169 149 $('.ml-submit #invertall').click( 170 150 function(){ 171 151 $('#media-items .item_selection').each(function(e) { 172 if($(this).is(':checked')) $(this). attr("checked","");173 else $(this).attr("checked", "checked");152 if($(this).is(':checked')) $(this).prop("checked",false); 153 else $(this).attr("checked",true); 174 154 }); 175 155 return false; … … 198 178 199 179 //read value and apply 180 //since FII 2.2.0: changed to adapt to jquery 1.6 checkbox prop 200 181 $('#massedit').click(function() { 201 182 var massedit = new Array(); … … 219 200 } 220 201 if(typeof massedit[3] !== "undefined" && massedit[3].length > 0) { 221 $(this).find('.align .field input[value='+massedit[3]+']'). attr("checked","checked");202 $(this).find('.align .field input[value='+massedit[3]+']').prop("checked",true); 222 203 } 223 204 if(typeof massedit[4] !== "undefined" && massedit[4].length > 0) { 224 $(this).find('.image-size .field input[value='+massedit[4]+']'). attr("checked","checked");205 $(this).find('.image-size .field input[value='+massedit[4]+']').prop("checked",true); 225 206 } 226 207 }); … … 288 269 if ( !empty($attachment['url']) ) { 289 270 if ( strpos($attachment['url'], 'attachment_id') || false !== strpos($attachment['url'], get_permalink($post_id)) ) 290 $rel = " rel='attachment wp-att-". attribute_escape($attachment_id)."'";271 $rel = " rel='attachment wp-att-".esc_attr($attachment_id)."'"; 291 272 $html = "<a href='{$attachment['url']}'$rel>$html</a>"; 292 273 } … … 396 377 397 378 //delete options 398 if( isset($_POST[ $faster_insert_delete ]) && $_POST[ $faster_insert_valid ] == 'V') {379 if( isset($_POST[ $faster_insert_delete ]) && check_admin_referer($faster_insert_valid,'check-form') ) { 399 380 400 381 //compatible with version older than FII 2.0 … … 486 467 } 487 468 469 470 //add setting link to plugin page 471 function faster_insert_action_links($links, $file) { 472 static $this_plugin; 473 if (!$this_plugin) { 474 $this_plugin = plugin_basename(__FILE__); 475 } 476 if ($file == $this_plugin) { 477 $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=faster-image-insert/faster-image-insert.php">Settings</a>'; 478 array_unshift($links, $settings_link); 479 } 480 return $links; 481 } 482 483 488 484 //hook it up 489 485 add_action('init', 'faster_insert_textdomain'); … … 495 491 add_filter('media_upload_image', 'faster_insert_media_upload_image'); 496 492 add_filter('disable_captions', 'caption_off'); 497 ?> 493 add_filter('plugin_action_links', 'faster_insert_action_links', 10, 2); 494 ?> -
faster-image-insert/trunk/readme.txt
r376551 r420749 89 89 * [unstable release](http://downloads.wordpress.org/plugin/faster-image-insert.zip) 90 90 91 = 2.2.0 = 92 93 * For WordPress 3.2+ 94 * Fix various issues linked to jQuery 1.6.x on WP 3.2+ 95 * Fix an issue where uninstallation is not successful 96 91 97 = 2.1.0 = 92 98 … … 155 161 == Upgrade Notice == 156 162 163 = 2.2.0 = 164 For WordPress 3.2+ Only 165 157 166 = 2.1.0 = 158 167 Includes a security fix to avoid potential CSRF … … 168 177 Translations: 169 178 170 * Chinese - by [DF](http://b log.ticktag.org/)179 * Chinese - by [DF](http://bitinn.net/) 171 180 * French - by [Li-An](http://www.li-an.fr/) 172 181 * Danish - by [Georg](http://wordpress.blogos.dk/)
Note: See TracChangeset
for help on using the changeset viewer.