Changeset 1519271
- Timestamp:
- 10/21/2016 01:20:46 PM (9 years ago)
- Location:
- acf-qtranslate/trunk
- Files:
-
- 7 edited
-
acf-qtranslate.php (modified) (1 diff)
-
assets/acf_5/main.js (modified) (3 diffs)
-
assets/common.css (modified) (2 diffs)
-
assets/common.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
src/acf_4/fields/wysiwyg.php (modified) (2 diffs)
-
src/acf_5/fields/wysiwyg.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
acf-qtranslate/trunk/acf-qtranslate.php
r1156402 r1519271 4 4 Plugin URI: http://github.com/funkjedi/acf-qtranslate 5 5 Description: Provides multilingual versions of the text, text area, and wysiwyg fields. 6 Version: 1.7. 96 Version: 1.7.10 7 7 Author: funkjedi 8 8 Author URI: http://funkjedi.com -
acf-qtranslate/trunk/assets/acf_5/main.js
r1154984 r1519271 4 4 */ 5 5 acf.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 } 11 14 }); 12 15 … … 18 21 focus: function() { 19 22 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 20 26 this.o = acf.get_data(this.$el); 21 27 } … … 26 32 */ 27 33 acf.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 } 46 52 }); -
acf-qtranslate/trunk/assets/common.css
r1154984 r1519271 34 34 top: 1px; 35 35 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 37 41 } 38 42 … … 97 101 border-bottom-color: #f5f5f5; 98 102 } 99 -
acf-qtranslate/trunk/assets/common.js
r1154984 r1519271 42 42 editor = $(this).hasClass('switch-tmce') ? 'tmce' : 'html'; 43 43 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 } 45 50 }); 46 51 }); -
acf-qtranslate/trunk/readme.txt
r1156399 r1519271 4 4 Requires at least: 3.5.0 5 5 Tested up to: 4.2.1 6 Version: 1.7. 97 Stable tag: 1.7. 96 Version: 1.7.10 7 Stable tag: 1.7.10 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 59 59 60 60 == 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 61 70 62 71 = 1.7.9 = -
acf-qtranslate/trunk/src/acf_4/fields/wysiwyg.php
r1156399 r1519271 62 62 $values = qtrans_split($field['value'], $quicktags = true); 63 63 $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 } 64 76 65 77 echo '<div class="multi-language-field multi-language-field-wysiwyg">'; … … 94 106 <?php endif; ?> 95 107 <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> 108 109 </div> 109 110 </div> -
acf-qtranslate/trunk/src/acf_5/fields/wysiwyg.php
r1102077 r1519271 51 51 52 52 // 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')); 54 54 55 55 acf_field::__construct(); … … 98 98 99 99 // mode 100 $switch_class = $mode . '-active';100 $switch_class = ($mode === 'html') ? 'html-active' : 'tmce-active'; 101 101 102 102 // filter value for editor 103 103 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); 107 114 } 108 else { 109 add_filter('acf_the_editor_content', 'wp_htmledit_pre'); 110 } 111 112 global $q_config, $wp_version; 115 113 116 $languages = qtrans_getSortedLanguages(true); 114 117 $values = qtrans_split($field['value'], $quicktags = true); … … 124 127 $uid = uniqid('acf-editor-'); 125 128 foreach ($languages as $language): 126 $value = apply_filters('acf_the_editor_content', $values[$language]);129 127 130 $id = $uid . "-$language"; 128 131 $name = $field['name'] . "[$language]"; … … 131 134 $class .= ' current-language'; 132 135 } 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 134 146 ?> 135 147 <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; ?>"> … … 142 154 <?php if( user_can_richedit() && $show_tabs ): ?> 143 155 <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> 146 158 </div> 147 159 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.