Plugin Directory

Changeset 1363759


Ignore:
Timestamp:
03/04/2016 03:19:36 AM (10 years ago)
Author:
woorockets
Message:

Release version 2.5.4

Location:
wr-pagebuilder/trunk
Files:
7 edited

Legend:

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

    r1246508 r1363759  
    135135
    136136 * Updated Polish translation
    137  
     137
    138138 = 2.5.3 =
    139139
    140140 * Fixed Some minor bugs
     141
     142 = 2.5.4 =
     143
     144 * Fixed Bug editor in text element
  • wr-pagebuilder/trunk/assets/woorockets/css/page_builder.css

    r1129341 r1363759  
    126126#modalOptions .wp-switch-editor {
    127127    height: 27px !important;
     128}
     129#modalOptions #wp-param-text-media-buttons #wr_pb_button {
     130    display: none;
    128131}
    129132
  • wr-pagebuilder/trunk/core/core.php

    r1246508 r1363759  
    167167        // global variable iframe_load_completed to use in checking load iframe in Text Element Editor
    168168        add_action( 'admin_head', array( &$this, 'add_custom_global_variable' ) );
    169     }
    170 
     169
     170        // Add wp editor html
     171        add_action( 'wr_pb_footer', array( __CLASS__, 'text_html_wp_editor' ) );
     172
     173    }
     174
     175    /**
     176    * Render html wp editor
     177    */
     178    public static function text_html_wp_editor() {
     179        echo "<script type='text/html' id='tmpl-wr-editor'>";
     180            wp_editor( '_WR_CONTENT_', 'param-text', array(
     181                                        'textarea_name' => 'param-text',
     182                                        'textarea_rows' => 15,
     183                                        'editor_class' => 'wr_pb_editor'
     184                                    )
     185            );
     186        echo '</script>';
     187    }
    171188
    172189    /**
  • wr-pagebuilder/trunk/core/helper/type.php

    r1168145 r1363759  
    735735         */
    736736        static function get_single_by_post_types( $posttype = '' ) {
     737            global $wpdb;
     738           
    737739            $posttypes = self::get_post_types();
    738740            $results   = array();
     
    740742                if ( ! isset( $results[$slug] ) )
    741743                $results[$slug] = array();
    742                 // query post by post type
    743                 $args = array( 'post_type' => $slug, 'posts_per_page' => -1, 'post_status' => ($slug == 'attachment' ) ? 'inherit' : 'publish' );
    744                 $query = new WP_Query( $args );
    745                 while ( $query->have_posts() ) {
    746                     $query->the_post();
    747                     $results[$slug][get_the_ID()] = __( get_the_title(), WR_PBL );
    748                 }
    749                 wp_reset_postdata();
     744           
     745                $list_post = $wpdb->get_results( "SELECT ID, post_title FROM $wpdb->posts  WHERE post_type = '" . $slug . "' AND post_status = '" . ( ( $slug == 'attachment' ) ? 'inherit' : 'publish' ) . "'  ORDER BY post_date DESC", ARRAY_A );
     746               
     747                if( $list_post ) {
     748                    foreach( $list_post as $val ) {
     749                        $results[ $slug ][ $val['ID'] ] = __( $val['post_title'], WR_PBL );
     750                    }
     751                }
     752               
    750753            }
    751754            if ( $posttype )
    752             return $results[$posttype];
     755                return $results[$posttype];
     756           
    753757            return $results;
    754758        }
  • wr-pagebuilder/trunk/shortcodes/text/assets/js/text.js

    r1246508 r1363759  
    3131    $(document).ready(function () {       
    3232        $.WR_Text();
    33         $('#content-html').click();       
     33
    3434        var intTimeout = 5000;
    35         var intAmount = 100;
    36         var isInit = false;
    37         $('#param-text-tmce').removeAttr('onclick');
    38         $('#param-text-tmce').off('click');
     35        var intAmount  = 100;
     36
    3937        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                 });
     38            if (iframe_load_completed || intAmount >= intTimeout) {
    6539
    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                 });
     40                var text_content = $( '#param-text.form-control' ).html();
     41
     42                var wr_editor = $( '#tmpl-wr-editor' ).html();
     43
     44                wr_editor = wr_editor.replace( '_WR_CONTENT_', text_content );
     45
     46                $( '#param-text' ).after( wr_editor );
     47
     48                $( '#param-text.form-control' ).remove();
     49
     50                ( function() {
     51                    var init, id, $wrap;
     52
     53                    // Render Visual Tab
     54                    for ( id in tinyMCEPreInit.mceInit ) {
     55                        if ( id != 'param-text' )
     56                            continue;
     57
     58                        init  = tinyMCEPreInit.mceInit[id];
     59                        $wrap = tinymce.$( '#wp-' + id + '-wrap' );
     60
     61                        tinymce.remove(tinymce.get('param-text'));
     62                        tinymce.init( init );
     63
     64                        setTimeout( function(){
     65                            $( '#wp-param-text-wrap' ).removeClass( 'html-active' );
     66                            $( '#wp-param-text-wrap' ).addClass( 'tmce-active' );
     67                        }, 10 );
     68
     69                        if ( ! window.wpActiveEditor )
     70                                window.wpActiveEditor = id;
     71
     72                        break;
     73                    }
     74
     75                    // Render Text tab
     76                    for ( id in tinyMCEPreInit.qtInit ) {
     77                        if ( id != 'param-text' )
     78                            continue;
     79
     80                        quicktags( tinyMCEPreInit.qtInit[id] );
     81
     82                        // Re call inset quicktags button
     83                        QTags._buttonsInit();
     84
     85                        if ( ! window.wpActiveEditor )
     86                            window.wpActiveEditor = id;
     87
     88                        break;
     89                    }
     90                }());
     91
    7892                iframe_load_completed = false;
    7993                window.clearInterval(ifLoadedInt);
    80             }               
     94            }
    8195        },
    8296        intAmount
    83         );   
    84 
     97        );
    8598
    8699    });
  • wr-pagebuilder/trunk/shortcodes/text/text.php

    r1129341 r1363759  
    7575                    'desc' => __( 'Enter some content for this textblock', WR_PBL ),
    7676                    'id'   => 'text',
    77                     'type' => 'tiny_mce',
     77                    'type' => 'text_area',
    7878                    'role' => 'content',
    7979                    'std'  => WR_Pb_Helper_Type::lorem_text(),
  • wr-pagebuilder/trunk/wr-pagebuilder.php

    r1246508 r1363759  
    44 * Plugin URI:  http://www.woorockets.com
    55 * Description: Awesome content builder for Wordpress websites
    6  * Version:     2.5.3
     6 * Version:     2.5.4
    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.