Plugin Directory

Changeset 893792


Ignore:
Timestamp:
04/15/2014 07:21:32 PM (12 years ago)
Author:
DWUser.com
Message:

Update EasyRotator for WordPress to version 1.0.11 - Adding WordPress 3.9 compatibility, including theme customizer support

Location:
easyrotator-for-wordpress
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • easyrotator-for-wordpress/tags/1.0.2/css/easyrotator_admin.css

    r585231 r893792  
    11/*
    2 Copyright 2011 DWUser.com.
     2Copyright 2011-2014 DWUser.com.
    33Email contact: support ~attt~ dwuser.com
    44
     
    9898            background: transparent url('../img/admin_icons.png?ver=1') no-repeat scroll -6px -133px;
    9999        }
     100
     101        /* fs tinymce button for 3.9+ */
     102        #wp-fullscreen-buttons #wp_fs_easyrotator {
     103            background: transparent url('../img/admin_icons.png?ver=1') no-repeat scroll -3px -163px;
     104        }
     105        #wp-fullscreen-buttons #wp_fs_easyrotator:hover {
     106            background: transparent url('../img/admin_icons.png?ver=1') no-repeat scroll -3px -131px;
     107        }
    100108       
    101109        /* meta box title icon, more */
  • easyrotator-for-wordpress/trunk/easyrotator.php

    r713155 r893792  
    44Plugin URI: http://www.dwuser.com/easyrotator/wordpress/
    55Description: Add professional, customizable photo sliders to your site in seconds.  Powered by the EasyRotator application from DWUser.com.
    6 Version: 1.0.10
     6Version: 1.0.11
    77Author: DWUser.com
    88Author URI: http://www.dwuser.com/
     
    1111
    1212/*
    13 Copyright 2011-2012 DWUser.com.
     13Copyright 2011-2014 DWUser.com.
    1414Email contact: support {at] dwuser.com
    1515
     
    6363    function EasyRotator()
    6464    {
     65        global $wp_version;
    6566        // --- Initialization ---
    6667       
     
    8687        add_action( 'admin_footer'    , array( $this, 'editor_easyrotator_manage_dialog' ) );
    8788        add_action( 'admin_footer'    , array( $this, 'admin_inline_help_content') );
    88        
     89
     90        if (version_compare($wp_version, '3.8.99', '>'))
     91        {
     92            // Widget support in customizer on 3.9+
     93            add_action( 'customize_controls_print_styles'    , array( $this, 'hook_admin_init' ) ); //customize_controls_print_styles
     94            add_action( 'customize_controls_print_styles'    , array( $this, 'hook_customizer_styles' ) );
     95            add_action( 'customize_controls_print_footer_scripts'    , array( $this, 'editor_easyrotator_manage_dialog_customizer' ) );
     96        }
     97
    8998        add_action( 'edit_form_advanced'   , array( $this, 'editor_quicktags' ) );
    9099        add_action( 'edit_page_form'       , array( $this, 'editor_quicktags' ) );
     
    142151       
    143152    }
     153
     154    function hook_customizer_styles()
     155    {
     156        // This is for special customizer styles.  Make sure that dialogs appear on top of preview (z-index=500000)
     157        ?>
     158        <style type="text/css">
     159            body .ui-front {
     160                z-index: 500100 !important;
     161            }
     162        </style>
     163        <?php
     164    }
    144165   
    145166    function hook_admin_menu()
     
    879900    }
    880901   
    881    
     902
     903    // This is called when the customizer is being used
     904    function editor_easyrotator_manage_dialog_customizer()
     905    {
     906        $this->editor_easyrotator_manage_dialog(true); // $isCustomizer=true
     907    }
     908
    882909    /**
    883910     * This method is used whenever on the admin post/page editor pages.  Used to write out the manager dialog,
    884911     * which is launched via the tinymce button or the quicktag button.
    885912     **/
    886     function editor_easyrotator_manage_dialog() { //was editor_tinymce_plugin_dialog()
     913    function editor_easyrotator_manage_dialog($isCustomizer = false) { //was editor_tinymce_plugin_dialog()
    887914        global $erwp;
    888        
     915
    889916        // Render only if post/page editing or widget mode on admin page
    890917        $pageName = basename( $_SERVER['PHP_SELF'] );
    891         if ( in_array( $pageName, array( 'post-new.php', 'page-new.php', 'post.php', 'page.php', 'widgets.php' ) ) ) { // TOASK: good check, esp widgets?
    892            
     918        if ( in_array( $pageName, array( 'post-new.php', 'page-new.php', 'post.php', 'page.php', 'widgets.php' ) ) || $isCustomizer ) { // TOASK: good check, esp widgets?
     919
    893920            $engineURL = $this->url . 'engine/main.php';
    894921            $apiInfo = $this->api_getInfo();
    895             $inWidgetMode = ($pageName == 'widgets.php');
    896            
     922            $inWidgetMode = ($pageName == 'widgets.php' || $isCustomizer);
     923
    897924            echo('<div style="display:none;">
    898925                   
     
    945972                    easyrotator_fs_dialog_launch = function()
    946973                    {
    947                         if (window[\'fullscreen\']) // just for safety
     974                        var fullscreen;
     975                        try {
     976                            fullscreen = window[\'fullscreen\'] || window.wp.editor.fullscreen;
     977                        } catch (e){}
     978                        if (fullscreen) // just for safety
    948979                        {
    949980                            // See if we\'re in Visual/tinyMCE or HTML mode in fullscreen; ref: wp-fullscreen.dev.js.
    950981                            var s = fullscreen.settings;
    951                             if ( s.has_tinymce && s.mode == \'tinymce\' )
     982                            if ( (s.has_tinymce || s.hasTinymce) && s.mode == \'tinymce\' )
    952983                            {
    953984                                easyrotator_tinymce_dialog_launch();
     
    9981029                            setTimeout(function(){
    9991030                                jQuery("#easyrotator_manage_dialog").dialog("close");
    1000                             }, 100);
     1031                            }, 100); // TODO: May need to be increased if issues crop up
    10011032                        };
    10021033                    };
     
    12951326                            {
    12961327                                wrap.data('easyrotatorWidgetBoxInitialized', true); // set initialized flag
    1297                                
     1328
    12981329                                // Wire-up the widget form; wrap for persistent scope
    12991330                                (function(wrap){
     
    13281359                                        if (show)
    13291360                                        {
    1330                                             wrap.find('p.er_save_notification').slideDown();
    1331                                             wrap.find('hr.er_bottom_hr').hide();
     1361                                            if (<?php echo($isCustomizer ? 'false' : 'true'); ?>) // no notification on customizer page due to auto-save
     1362                                            {
     1363                                                wrap.find('p.er_save_notification').slideDown();
     1364                                                wrap.find('hr.er_bottom_hr').hide();
     1365                                            }
    13321366                                        }
    13331367                                        else
     
    13421376                                        // Update the hidden field; load the name
    13431377                                        pathField.val(path);
     1378                                        <?php if ($isCustomizer) { ?>
     1379                                            pathField.trigger('change'); // trigger the auto-save since this is a hidden field
     1380                                        <?php } ?>
    13441381                                       
    13451382                                        // Show save notification if changed
     
    14631500    function editor_quicktags()
    14641501    {
    1465         global $erwp;
     1502        global $erwp, $wp_version;
    14661503   
    14671504        // Append the easyrotator button to the Quicktags section, making it look like the other buttons.
     1505        $class = 'ed_button';
     1506        if (version_compare($wp_version, '3.8.99', '>'))
     1507            $class .= ' button button-small';
    14681508        ?>
    14691509        <script type="text/javascript">
     
    14771517                    setTimeout(addButtonIfNeeded, tryInterval); // toolbar not ready; wait a tad
    14781518                else
    1479                     $('#ed_toolbar').append('<input type="button" id="ed_easyrotator" class="ed_button" onclick="easyrotator_quicktags_dialog_launch();" title="Insert rotator into post/page..." value="Insert EasyRotator" style="wascolor:#09F;" />');
     1519                    $('#ed_toolbar').append('<input type="button" id="ed_easyrotator" class="<?php echo($class); ?>" onclick="easyrotator_quicktags_dialog_launch();" title="Insert rotator into post/page..." value="Insert EasyRotator" style="wascolor:#09F;" />');
    14801520            }
    14811521            addButtonIfNeeded();
     
    17541794           
    17551795            // Finally, listen for exiting fullscreen view if applicable.  Update only when hiding that, since we won't show the edit panel in fs.  Ref: wp-fullscreen.dev.js
    1756             if (window['fullscreen'] && fullscreen.pubsub && fullscreen.pubsub.subscribe)
     1796            var fullscreen;
     1797            try {
     1798                fullscreen = window['fullscreen'] || window.wp.editor.fullscreen;
     1799            }catch(e){}
     1800            if (fullscreen && fullscreen.pubsub && fullscreen.pubsub.subscribe)
    17571801                fullscreen.pubsub.subscribe('hide', function(){ 
    17581802                    // Wait a second, for the other updates to occur
     
    20502094        $instance['showTitle'] = $new_instance['showTitle'] == 'true' ? 'true' : 'false';
    20512095        $instance['path'] = strip_tags($new_instance['path']);
    2052        
     2096        if (@$instance['form'] == '') // the customizer initially calls with an empty form; we need to add some fake content to force the display to work
     2097        {
     2098            ob_start();
     2099            $this->form($instance);
     2100            $instance['form'] = ob_end_clean();
     2101        }
     2102
    20532103        if (false) // debug
    20542104        {
  • easyrotator-for-wordpress/trunk/readme.txt

    r845451 r893792  
    44Tags: rotator, slider, slide, slide show, slideshow, photos, photo, pictures, gallery, photo gallery, image gallery, images, image, media, video, audio, posts, pages, widget, plugin, seo, WordPress slider, templates, mobile, iPad, iPhone, touchscreen, jQuery, Adobe AIR, flash replacement
    55Requires at least: 2.8
    6 Tested up to: 3.8.1
    7 Stable tag: 1.0.10
     6Tested up to: 3.9 RC2
     7Stable tag: 1.0.11
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    162162
    163163== Changelog ==
     164= 1.0.11 =
     165* Compatibility Enhancement: Support for WordPress 3.9, including the theme customizer
     166
    164167= 1.0.10 =
    165168* Compatibility Enhancement: Better Safari support on widget page (not WordPress-version specific); may avoid a "blocked click" click on some installation configurations.
Note: See TracChangeset for help on using the changeset viewer.