Plugin Directory

Changeset 420749


Ignore:
Timestamp:
08/09/2011 12:06:28 AM (14 years ago)
Author:
bitinn
Message:

trunk update

Location:
faster-image-insert/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • faster-image-insert/trunk/faster-image-insert.php

    r376549 r420749  
    22/*
    33Plugin Name: Faster Image Insert
    4 Plugin URI: http://blog.ticktag.org/2009/02/19/2765/
     4Plugin URI: http://bitinn.net/2765/
    55Description: 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.
    66Version: trunk
    77Author: David Frank
    8 Author URI: http://blog.ticktag.org/
     8Author URI: http://bitinn.net/
    99License: GPL2
    1010*/
     
    4848 
    4949//iframe for editing panel when wp_version > 3.0
     50//since FII 2.2.0, modified behaviour to workaround issue with jquery live + iframe
    5051function fast_insert_form() {
    5152  global $post_ID, $temp_ID;
     
    6465      if(view) {
    6566        <?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.'&#038;flash=0'; else echo $id; ?>&#038;type=image&#038;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.'&#038;flash=0'; else echo $id; ?>&#038;type=image&#038;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>');
    6768        <?php } else { ?>
    6869        $('#fastinsert > .inside').html('<p><?php _e('Click here to reload after autosave. Or manually save the draft.', 'faster-image-insert') ?></p>');
     
    7576      if(view) {
    7677        <?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.'&#038;flash=0'; else echo $id; ?>&#038;type=image&#038;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.'&#038;flash=0'; else echo $id; ?>&#038;type=image&#038;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>');
    7879        <?php } else { ?>
    7980        $('#fastinsert > .inside').html('<p><?php _e('Click here to reload after autosave. Or manually save the draft.', 'faster-image-insert') ?></p>');
     
    8182      }
    8283    });
    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 '&#038;flash=0'; ?>&#038;type=image&#038;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 insert
    99     $('#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 } ?>
    10584  });
    10685/* ]]> */
     
    165144   
    166145    //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') ); ?>" /> ');
    169149    $('.ml-submit #invertall').click(
    170150      function(){
    171151        $('#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);
    174154        });
    175155        return false;
     
    198178
    199179      //read value and apply
     180      //since FII 2.2.0: changed to adapt to jquery 1.6 checkbox prop
    200181      $('#massedit').click(function() {
    201182        var massedit = new Array();
     
    219200          }
    220201          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);
    222203          }
    223204          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);
    225206          }
    226207        });
     
    288269        if ( !empty($attachment['url']) ) {
    289270          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)."'";
    291272          $html = "<a href='{$attachment['url']}'$rel>$html</a>";
    292273        }
     
    396377
    397378  //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') ) {
    399380   
    400381    //compatible with version older than FII 2.0
     
    486467}
    487468
     469
     470//add setting link to plugin page
     471function 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
    488484//hook it up
    489485add_action('init', 'faster_insert_textdomain');
     
    495491add_filter('media_upload_image', 'faster_insert_media_upload_image');
    496492add_filter('disable_captions', 'caption_off');
    497 ?>
     493add_filter('plugin_action_links', 'faster_insert_action_links', 10, 2);
     494?>
  • faster-image-insert/trunk/readme.txt

    r376551 r420749  
    8989* [unstable release](http://downloads.wordpress.org/plugin/faster-image-insert.zip)
    9090
     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
    9197= 2.1.0 =
    9298
     
    155161== Upgrade Notice ==
    156162
     163= 2.2.0 =
     164For WordPress 3.2+ Only
     165
    157166= 2.1.0 =
    158167Includes a security fix to avoid potential CSRF
     
    168177Translations:
    169178
    170 * Chinese - by [DF](http://blog.ticktag.org/)
     179* Chinese - by [DF](http://bitinn.net/)
    171180* French - by [Li-An](http://www.li-an.fr/)
    172181* Danish - by [Georg](http://wordpress.blogos.dk/)
Note: See TracChangeset for help on using the changeset viewer.