Plugin Directory

Changeset 683695


Ignore:
Timestamp:
03/18/2013 02:28:05 PM (12 years ago)
Author:
prasannasp
Message:

Updating Tiny URL plugin. Enqueue ZeroClipboard js files only if the copy to clipboard option is enabled

Location:
tiny-url
Files:
2 added
1 deleted
2 edited
10 copied

Legend:

Unmodified
Added
Removed
  • tiny-url/tags/1.3.4/readme.txt

    r682489 r683695  
    55Requires at least: 3.0
    66Tested up to: 3.5.1
    7 Stable tag: 1.3.3
     7Stable tag: 1.3.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7676== Changelog ==
    7777
     78= 1.3.4 =
     79
     80* Enqueue ZeroClipboard js files only if the copy to clipboard option is enabled.
     81* Moved inline jQuery script to a new file `ZeroClipboardMain.js`
     82
    7883= 1.3.3 =
    7984
  • tiny-url/tags/1.3.4/tiny-url.php

    r682489 r683695  
    44Plugin URI: http://www.prasannasp.net/wordpress-plugins/tiny-url/
    55Description: This plugin automatically adds a tiny URL for all blog posts after post content. Uses http://tinyurl.com/ service to get Tiny URLs.
    6 Version: 1.3.3
     6Version: 1.3.4
    77Author: Prasanna SP
    88Author URI: http://www.prasannasp.net/
     
    8484
    8585function tu_load_zeroclipboard_js() {
     86    $options = get_option('tinyurl_options');
     87    if ( isset($options['copy_url_button']) ) {
    8688    wp_enqueue_script('jquery-zeroclipboard', plugins_url('/js/ZeroClipboard.js', __FILE__), array('jquery'));
     89    wp_enqueue_script('jquery-zeroclipboard-main', plugins_url('/js/ZeroClipboardMain.js', __FILE__), array('jquery'));
     90    }
    8791}
    8892add_action('wp_enqueue_scripts', 'tu_load_zeroclipboard_js');
     
    9397?>
    9498<script type="text/javascript">
    95             jQuery ( function($) {
    96                 ZeroClipboard.setDefaults( { moviePath: '<?php echo '' .plugins_url( 'swf/ZeroClipboard.swf' , __FILE__ ). ''; ?>' } );
    97                
    98                 /** workaround for firefox versions 18 and 19.
    99                         https://bugzilla.mozilla.org/show_bug.cgi?id=829557
    100                         https://github.com/jonrohan/ZeroClipboard/issues/73
    101                         http://plugins.trac.wordpress.org/browser/wp-clone-by-wp-academy/trunk/lib/view.php?rev=677374#L6
    102                 */
    103                 var TUenableZC = true;
    104                 var is_firefox18 = navigator.userAgent.toLowerCase().indexOf('firefox/18') > -1;
    105                 var is_firefox19 = navigator.userAgent.toLowerCase().indexOf('firefox/19') > -1;
    106                 if (is_firefox18 || is_firefox19) TUenableZC = false;
    107                
    108                
    109                 $( ".tiny-url" ).each( function() {
    110                         var clip = new ZeroClipboard( $( "button#tiny-url-button",this ) );
    111                         clip.glue( 'tiny-url-button', 'tiny-url-button-div' );
    112                         /** FF 18/19 users won't see an alert box. */
    113                         if (TUenableZC) {
    114                                 clip.on( 'complete', function (client, args) {
    115                                         alert( "Tiny URL copied to clipboard:" );
    116                                 });
    117                         }
    118                 });
    119         });
     99ZeroClipboard.setDefaults( { moviePath: '<?php echo '' .plugins_url( 'swf/ZeroClipboard.swf' , __FILE__ ). ''; ?>' } );
    120100</script>
    121101<?php
     
    123103}
    124104
    125 add_action('wp_footer', 'tu_tinyurl_copy_script');
     105add_action('wp_head', 'tu_tinyurl_copy_script');
    126106
    127107// Set-up Action and Filter Hooks
  • tiny-url/trunk/readme.txt

    r682489 r683695  
    55Requires at least: 3.0
    66Tested up to: 3.5.1
    7 Stable tag: 1.3.3
     7Stable tag: 1.3.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7676== Changelog ==
    7777
     78= 1.3.4 =
     79
     80* Enqueue ZeroClipboard js files only if the copy to clipboard option is enabled.
     81* Moved inline jQuery script to a new file `ZeroClipboardMain.js`
     82
    7883= 1.3.3 =
    7984
  • tiny-url/trunk/tiny-url.php

    r682489 r683695  
    44Plugin URI: http://www.prasannasp.net/wordpress-plugins/tiny-url/
    55Description: This plugin automatically adds a tiny URL for all blog posts after post content. Uses http://tinyurl.com/ service to get Tiny URLs.
    6 Version: 1.3.3
     6Version: 1.3.4
    77Author: Prasanna SP
    88Author URI: http://www.prasannasp.net/
     
    8484
    8585function tu_load_zeroclipboard_js() {
     86    $options = get_option('tinyurl_options');
     87    if ( isset($options['copy_url_button']) ) {
    8688    wp_enqueue_script('jquery-zeroclipboard', plugins_url('/js/ZeroClipboard.js', __FILE__), array('jquery'));
     89    wp_enqueue_script('jquery-zeroclipboard-main', plugins_url('/js/ZeroClipboardMain.js', __FILE__), array('jquery'));
     90    }
    8791}
    8892add_action('wp_enqueue_scripts', 'tu_load_zeroclipboard_js');
     
    9397?>
    9498<script type="text/javascript">
    95             jQuery ( function($) {
    96                 ZeroClipboard.setDefaults( { moviePath: '<?php echo '' .plugins_url( 'swf/ZeroClipboard.swf' , __FILE__ ). ''; ?>' } );
    97                
    98                 /** workaround for firefox versions 18 and 19.
    99                         https://bugzilla.mozilla.org/show_bug.cgi?id=829557
    100                         https://github.com/jonrohan/ZeroClipboard/issues/73
    101                         http://plugins.trac.wordpress.org/browser/wp-clone-by-wp-academy/trunk/lib/view.php?rev=677374#L6
    102                 */
    103                 var TUenableZC = true;
    104                 var is_firefox18 = navigator.userAgent.toLowerCase().indexOf('firefox/18') > -1;
    105                 var is_firefox19 = navigator.userAgent.toLowerCase().indexOf('firefox/19') > -1;
    106                 if (is_firefox18 || is_firefox19) TUenableZC = false;
    107                
    108                
    109                 $( ".tiny-url" ).each( function() {
    110                         var clip = new ZeroClipboard( $( "button#tiny-url-button",this ) );
    111                         clip.glue( 'tiny-url-button', 'tiny-url-button-div' );
    112                         /** FF 18/19 users won't see an alert box. */
    113                         if (TUenableZC) {
    114                                 clip.on( 'complete', function (client, args) {
    115                                         alert( "Tiny URL copied to clipboard:" );
    116                                 });
    117                         }
    118                 });
    119         });
     99ZeroClipboard.setDefaults( { moviePath: '<?php echo '' .plugins_url( 'swf/ZeroClipboard.swf' , __FILE__ ). ''; ?>' } );
    120100</script>
    121101<?php
     
    123103}
    124104
    125 add_action('wp_footer', 'tu_tinyurl_copy_script');
     105add_action('wp_head', 'tu_tinyurl_copy_script');
    126106
    127107// Set-up Action and Filter Hooks
Note: See TracChangeset for help on using the changeset viewer.