Plugin Directory

Changeset 1246508


Ignore:
Timestamp:
09/16/2015 08:59:58 AM (11 years ago)
Author:
woorockets
Message:

Fix Visual editor and imagesize image

Location:
wr-pagebuilder/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • wr-pagebuilder/trunk/README.txt

    r1235031 r1246508  
    135135
    136136 * Updated Polish translation
     137 
     138 = 2.5.3 =
     139
     140 * Fixed Some minor bugs
  • wr-pagebuilder/trunk/assets/woorockets/js/handle_setting.js

    r1000337 r1246508  
    506506        return tmp_content;
    507507    }
    508 
     508   
    509509    // Load preview iframe
    510510    $.HandleSetting.loadIframe = function(curr_iframe, url, tmp_content) {
     
    527527
    528528            $('#wr_previewing').val('0');
     529
     530            // Set global variable when iframe has loaded
     531            iframe_load_completed = true;
     532            //console.log(iframe_load_completed)
    529533        });
    530534
  • wr-pagebuilder/trunk/core/core.php

    r1109194 r1246508  
    164164
    165165        do_action( 'wr_pb_custom_hook' );
     166
     167        // global variable iframe_load_completed to use in checking load iframe in Text Element Editor
     168        add_action( 'admin_head', array( &$this, 'add_custom_global_variable' ) );
     169    }
     170
     171
     172    /**
     173    * use global variable for Text Element Editor in loading iframe
     174    */
     175
     176    function add_custom_global_variable () {
     177    ?>
     178
     179        <script type="text/javascript">
     180            //alert("ss");
     181            var iframe_load_completed = false;
     182
     183        </script>
     184
     185    <?php
    166186    }
    167187
  • wr-pagebuilder/trunk/shortcodes/image/image.php

    r1026157 r1246508  
    220220            $image_id       = WR_Pb_Helper_Functions::get_image_id( $image_file );
    221221            $attachment     = wp_prepare_attachment_for_js( $image_id );
    222             $image_file     = ( ! empty( $attachment['sizes'][$image_size]['url'] ) ) ? $attachment['sizes'][$image_size]['url'] : $image_file;
    223             $data = getimagesize( $image_file );
    224             $width = $data[0];
    225             $height = $data[1];
     222            $image_file     = ( ! empty( $attachment['sizes'][$image_size]['url'] ) ) ? $attachment['sizes'][$image_size]['url'] : $image_file;         
     223           
     224            $width = $attachment['sizes'][$image_size]['width'];
     225            $height = $attachment['sizes'][$image_size]['height'];
     226           
    226227            $html_elemments .= "<img width='{$width}' height='{$height}' src='{$image_file}'{$alt_text}{$class_img} />";
    227228            $script         = '';
  • wr-pagebuilder/trunk/shortcodes/testimonial/testimonial.php

    r1119552 r1246508  
    222222            }
    223223
    224             if ( isset ( $item['image_file'] ) && ! empty( $item['image_file'] ) ) {
    225                 $data = getimagesize( $item['image_file'] );
    226                 $width = $data[0];
    227                 $height = $data[1];
     224            if ( isset ( $item['image_file'] ) && ! empty( $item['image_file'] ) ) {               
     225                $width = $attachment['sizes'][$image_size]['width'];
     226                $height = $attachment['sizes'][$image_size]['height'];
    228227                $img = "<div class='wr-testimonial-avatar'><img width='{$width}' height='{$height}' class='$image_container_style' src='{$item['image_file']}' /></div>";
    229228            } else {
  • wr-pagebuilder/trunk/shortcodes/text/assets/js/text.js

    r1129341 r1246508  
    2929    };
    3030
    31     $(document).ready(function () {
     31    $(document).ready(function () {       
    3232        $.WR_Text();
     33        $('#content-html').click();       
     34        var intTimeout = 5000;
     35        var intAmount = 100;
     36        var isInit = false;
     37        $('#param-text-tmce').removeAttr('onclick');
     38        $('#param-text-tmce').off('click');
     39        var ifLoadedInt = setInterval(function(){
     40            if (iframe_load_completed || intAmount >= intTimeout) {               
     41                initContentEditor = tinyMCEPreInit.mceInit['param-text'];             
     42               intAmount += 100;
     43                initContentEditor.setup = function(ed){
     44                    ed.on('blur', function(){
     45                        if ( $('.mce-tinymce').length > 1) {
     46                            $('.mce-tinymce').first().hide();   
     47                        }                       
     48                         tinyMCE.triggerSave();
     49                         jQuery('.wr_pb_editor').first().trigger('change');
     50                    });
     51                }
     52                // Visual Tab
     53                $('#param-text-tmce').click(function(){                   
     54                    setTimeout( function(){
     55                         if ( $('.mce-tinymce').length > 1) {
     56                            $('.mce-tinymce').first().hide();   
     57                        }
     58                    },500);                   
     59                    tinymce.remove(tinymce.get('param-text'));
     60                    tinymce.init(initContentEditor);                     
     61                    isInit = true;
     62                    $('#wp-content-wrap').removeClass('html-active');
     63                    $('#wp-content-wrap').addClass('tmce-active');
     64                });
    3365
    34         // Fix conflict script when create new tinymce editor
    35         $('#content-html').click();
    36         tinymce.remove(tinymce.get('param-text'));
     66                // Text tab
     67                $('#param-text-html').click(function(){
     68                    setTimeout( function(){
     69                         if ( $('.mce-tinymce').length > 1) {
     70                            $('.mce-tinymce').first().hide();   
     71                        }
     72                    },500);                   
     73                    tinymce.remove(tinymce.get('param-text'));
     74                    tinymce.init(initContentEditor);
     75                    $('#wp-content-wrap').removeClass('tmce-active');
     76                    $('#wp-content-wrap').addClass('html-active');
     77                });
     78                iframe_load_completed = false;
     79                window.clearInterval(ifLoadedInt);
     80            }               
     81        },
     82        intAmount
     83        );   
    3784
    38         // Re-init content editor
    39         if (initContentEditor == null) {
    40             initContentEditor = tinyMCEPreInit.mceInit['content'];
    41         }
    42         $('#content-tmce').removeAttr('onclick');
    43         $('#content-tmce').off('click');
    44         $('#content-tmce').click(function() {
    45             tinymce.remove(tinymce.get('content'));
    46             tinymce.init(initContentEditor);
    47             $('#wp-content-wrap').removeClass('html-active');
    48             $('#wp-content-wrap').addClass('tmce-active');
    49         });
     85
    5086    });
    5187})(jQuery);
  • wr-pagebuilder/trunk/wr-pagebuilder.php

    r1224460 r1246508  
    44 * Plugin URI:  http://www.woorockets.com
    55 * Description: Awesome content builder for Wordpress websites
    6  * Version:     2.5.2
     6 * Version:     2.5.3
    77 * Author:      WooRockets Team <[email protected]>
    88 * Author URI:  http://www.wordpress.org/plugins/wr-pagebuilder
Note: See TracChangeset for help on using the changeset viewer.