Plugin Directory

Changeset 1519271


Ignore:
Timestamp:
10/21/2016 01:20:46 PM (9 years ago)
Author:
funkjedi
Message:

Syncing with Github

Location:
acf-qtranslate/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • acf-qtranslate/trunk/acf-qtranslate.php

    r1156402 r1519271  
    44Plugin URI: http://github.com/funkjedi/acf-qtranslate
    55Description: Provides multilingual versions of the text, text area, and wysiwyg fields.
    6 Version: 1.7.9
     6Version: 1.7.10
    77Author: funkjedi
    88Author URI: http://funkjedi.com
  • acf-qtranslate/trunk/assets/acf_5/main.js

    r1154984 r1519271  
    44 */
    55acf.fields.qtranslate_image = acf.fields.image.extend({
    6     type: 'qtranslate_image',
    7     focus: function() {
    8         this.$el = this.$field.find('.acf-image-uploader.current-language');
    9         this.o = acf.get_data(this.$el);
    10     }
     6    type: 'qtranslate_image',
     7    focus: function() {
     8        this.$el = this.$field.find('.acf-image-uploader.current-language');
     9        this.$input = this.$el.find('[data-name="id"]');
     10        this.$img = this.$el.find('[data-name="image"]');
     11
     12        this.o = acf.get_data(this.$el);
     13    }
    1114});
    1215
     
    1821    focus: function() {
    1922        this.$el = this.$field.find('.acf-file-uploader.current-language');
     23        this.$input = this.$el.find('[data-name="id"]');
     24        this.$img = this.$el.find('[data-name="file"]');
     25
    2026        this.o = acf.get_data(this.$el);
    2127    }
     
    2632 */
    2733acf.fields.qtranslate_wysiwyg = acf.fields.wysiwyg.extend({
    28     type: 'qtranslate_wysiwyg',
    29     focus: function() {
    30         this.$el = this.$field.find('.wp-editor-wrap.current-language').last();
    31         this.$textarea = this.$el.find('textarea');
    32         this.o = acf.get_data(this.$el);
    33         this.o.id = this.$textarea.attr('id');
    34     },
    35     initialize: function() {
    36         var self = this;
    37         this.$field.find('.wp-editor-wrap').each(function() {
    38             self.$el = jQuery(this);
    39             self.$textarea = self.$el.find('textarea');
    40             self.o = acf.get_data(self.$el);
    41             self.o.id = self.$textarea.attr('id');
    42             acf.fields.wysiwyg.initialize.call(self);
    43         });
    44         this.focus();
    45     }
     34    type: 'qtranslate_wysiwyg',
     35    focus: function() {
     36        this.$el = this.$field.find('.wp-editor-wrap.current-language').last();
     37        this.$textarea = this.$el.find('textarea');
     38        this.o = acf.get_data(this.$el);
     39        this.o.id = this.$textarea.attr('id');
     40    },
     41    initialize: function() {
     42        var self = this;
     43        this.$field.find('.wp-editor-wrap').each(function() {
     44            self.$el = jQuery(this);
     45            self.$textarea = self.$el.find('textarea');
     46            self.o = acf.get_data(self.$el);
     47            self.o.id = self.$textarea.attr('id');
     48            acf.fields.wysiwyg.initialize.call(self);
     49        });
     50        this.focus();
     51    }
    4652});
  • acf-qtranslate/trunk/assets/common.css

    r1154984 r1519271  
    3434    top: 1px;
    3535    z-index: 100;
    36     border-color: #dedede;
     36    border: 1px solid #ededed;
     37    margin-left: -1px;
     38    padding: 6px 7px;
     39    text-transform: uppercase;
     40    cursor: pointer
    3741}
    3842
     
    97101    border-bottom-color: #f5f5f5;
    98102}
    99 
  • acf-qtranslate/trunk/assets/common.js

    r1154984 r1519271  
    4242            editor = $(this).hasClass('switch-tmce') ? 'tmce' : 'html';
    4343        parent.find('.wp-editor-tabs .wp-switch-editor.switch-' + editor).not(this).each(function() {
    44             switchEditors.switchto(this);
     44            var id = $(this).attr( 'data-wp-editor-id' );
     45            if (id) { // WP 4.3
     46                window.switchEditors.go(id, editor);
     47            } else { // WP < 4.3       
     48                switchEditors.switchto(this);       
     49            }
    4550        });
    4651    });
  • acf-qtranslate/trunk/readme.txt

    r1156399 r1519271  
    44Requires at least: 3.5.0
    55Tested up to: 4.2.1
    6 Version: 1.7.9
    7 Stable tag: 1.7.9
     6Version: 1.7.10
     7Stable tag: 1.7.10
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5959
    6060== Changelog ==
     61
     62= 1.7.10 =
     63* Bug Fix: (HeikoMamerow) ACF5 File compatibility fix
     64* Bug Fix: (Tusko) ACF5 Image compatibility fix
     65* Bug Fix: (Tusko) Replace deprecated `acf/input/admin_footer_js` action
     66* Bug Fix: (Tusko) Switcher styles fixed
     67* Bug Fix: (fburatti) ACF4 WYSIWYG WP 4.3 compatibility fix
     68* Bug Fix: (fburatti) WYSIWYG was appending all values together
     69* Bug Fix: (fburatti) WP 4.3 PHP warning in WYSIWYG value
    6170
    6271= 1.7.9 =
  • acf-qtranslate/trunk/src/acf_4/fields/wysiwyg.php

    r1156399 r1519271  
    6262        $values = qtrans_split($field['value'], $quicktags = true);
    6363        $currentLanguage = $this->plugin->get_active_language();
     64       
     65        // filter value for editor
     66        remove_all_filters('acf_the_editor_content');
     67       
     68        // WP 4.3
     69        if( version_compare($wp_version, '4.3', '>=' ) ) {             
     70            add_filter( 'acf_the_editor_content', 'format_for_editor' );   
     71        // WP < 4.3
     72        } else {       
     73            $function = user_can_richedit() ? 'wp_richedit_pre' : 'wp_htmledit_pre';   
     74            add_filter('acf_the_editor_content', $function);           
     75        }
    6476
    6577        echo '<div class="multi-language-field multi-language-field-wysiwyg">';
     
    94106                <?php endif; ?>
    95107                <div id="wp-<?php echo $id; ?>-editor-container" class="wp-editor-container">
    96                     <textarea id="<?php echo $id; ?>" class="qtx-wp-editor-area" name="<?php echo $name; ?>" ><?php
    97 
    98                     if( user_can_richedit() )
    99                     {
    100                         echo wp_richedit_pre( $field['value'] );
    101                     }
    102                     else
    103                     {
    104                         echo wp_htmledit_pre( $field['value'] );
    105                     }
    106 
    107                     ?></textarea>
     108                    <textarea id="<?php echo $id; ?>" class="qtx-wp-editor-area" name="<?php echo $name; ?>" ><?php echo apply_filters( 'acf_the_editor_content', $value, 'tinymce' ); ?></textarea>
    108109                </div>
    109110            </div>
  • acf-qtranslate/trunk/src/acf_5/fields/wysiwyg.php

    r1102077 r1519271  
    5151
    5252        // actions
    53         add_action('acf/input/admin_footer_js',     array($this, 'input_admin_footer_js'));
     53        add_action('acf/input/admin_footer',    array($this, 'input_admin_footer'));
    5454
    5555        acf_field::__construct();
     
    9898
    9999        // mode
    100         $switch_class = $mode . '-active';
     100        $switch_class = ($mode === 'html') ? 'html-active' : 'tmce-active';
    101101
    102102        // filter value for editor
    103103        remove_all_filters('acf_the_editor_content');
    104 
    105         if ($mode == 'tmce') {
    106             add_filter('acf_the_editor_content', 'wp_richedit_pre');
     104       
     105        global $q_config, $wp_version;
     106       
     107        // WP 4.3
     108        if( version_compare($wp_version, '4.3', '>=' ) ) {
     109            add_filter( 'acf_the_editor_content', 'format_for_editor', 10, 2 );         
     110        // WP < 4.3
     111        } else {
     112            $function = ($mode === 'html') ? 'wp_htmledit_pre' : 'wp_richedit_pre';
     113            add_filter('acf_the_editor_content', $function, 10, 1);         
    107114        }
    108         else {
    109             add_filter('acf_the_editor_content', 'wp_htmledit_pre');
    110         }
    111 
    112         global $q_config, $wp_version;
     115       
    113116        $languages = qtrans_getSortedLanguages(true);
    114117        $values = qtrans_split($field['value'], $quicktags = true);
     
    124127        $uid = uniqid('acf-editor-');
    125128        foreach ($languages as $language):
    126             $value = apply_filters('acf_the_editor_content', $values[$language]);
     129       
    127130            $id = $uid . "-$language";
    128131            $name = $field['name'] . "[$language]";
     
    131134                $class .= ' current-language';
    132135            }
    133 
     136            // WP 4.3
     137            if( version_compare($wp_version, '4.3', '>=' ) ) {
     138                $button = 'data-wp-editor-id="' . $id . '"';               
     139            // WP < 4.3
     140            } else {   
     141                $button = 'onclick="switchEditors.switchto(this);"';   
     142            }
     143   
     144            $value = apply_filters('acf_the_editor_content', $values[$language], $mode);
     145       
    134146            ?>
    135147            <div id="wp-<?php echo $id; ?>-wrap" class="acf-editor-wrap wp-core-ui wp-editor-wrap <?php echo $class; ?>" data-toolbar="<?php echo $field['toolbar']; ?>" data-upload="<?php echo $field['media_upload']; ?>" data-language="<?php echo $language; ?>">
     
    142154                    <?php if( user_can_richedit() && $show_tabs ): ?>
    143155                        <div class="wp-editor-tabs">
    144                             <button id="<?php echo $id; ?>-tmce" class="wp-switch-editor switch-tmce" onclick="switchEditors.switchto(this);" type="button"><?php echo __('Visual', 'acf'); ?></button>
    145                             <button id="<?php echo $id; ?>-html" class="wp-switch-editor switch-html" onclick="switchEditors.switchto(this);" type="button"><?php echo _x( 'Text', 'Name for the Text editor tab (formerly HTML)', 'acf' ); ?></button>
     156                            <button id="<?php echo $id; ?>-tmce" class="wp-switch-editor switch-tmce" <?php echo  $button; ?> type="button"><?php echo __('Visual', 'acf'); ?></button>
     157                            <button id="<?php echo $id; ?>-html" class="wp-switch-editor switch-html" <?php echo  $button; ?> type="button"><?php echo _x( 'Text', 'Name for the Text editor tab (formerly HTML)', 'acf' ); ?></button>
    146158                        </div>
    147159                    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.