Changeset 906974
- Timestamp:
- 05/02/2014 04:49:47 PM (12 years ago)
- Location:
- magic-fields/trunk
- Files:
-
- 7 edited
-
MF_Constant.php (modified) (1 diff)
-
Main.php (modified) (1 diff)
-
RCCWP_WritePostPage.php (modified) (2 diffs)
-
js/custom_fields/editor_validate.js (modified) (1 diff)
-
js/custom_fields/media_image.js (modified) (1 diff)
-
js/groups.js (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
magic-fields/trunk/MF_Constant.php
r763762 r906974 315 315 return FALSE; 316 316 } 317 318 function is_wp39(){ 319 global $wp_version; 320 321 if(substr($wp_version, 0, 3) >= 3.9) 322 return TRUE; 323 324 return FALSE; 325 } -
magic-fields/trunk/Main.php
r763762 r906974 5 5 Description: Create custom write panels and easily retrieve their values in your templates. 6 6 Author: Hunk and Gnuget 7 Version: 1.6. 1.17 Version: 1.6.2 8 8 Author URI: http://magicfields.org 9 9 */ -
magic-fields/trunk/RCCWP_WritePostPage.php
r498304 r906974 115 115 <script type="text/javascript"> 116 116 var mf_path = "<?php echo MF_URI ?>" ; 117 var nonce_ajax_upload = "<?php echo wp_create_nonce('once_ajax_uplooad') ?>"; 117 var nonce_ajax_upload = "<?php echo wp_create_nonce('once_ajax_uplooad') ?>"; 118 <?php $mceString = 'Control'; if(is_wp39()){ $mceString = 'Editor'; } ?> 119 var mceString = "<?php echo $mceString ?>"; 118 120 </script> 119 121 <?php … … 1085 1087 <div class="mul_mf"> 1086 1088 1087 <div style="display: none" id="wp-<?php echo $idField ?>-media-buttons"> 1088 <?php 1089 // WP 3.3 changed here, so you need the media buttons on the editor for the tinyMCE plugin to work 1090 require_once( ABSPATH . 'wp-admin/includes/media.php' ) ?> 1091 <?php media_buttons( $idField ) ?> 1092 </div> 1089 <?php if ($hide_visual_editor == '' || $hide_visual_editor == 0 ){ ?> 1090 <?php if(!$hideEditor){ ?> 1091 <div id="wp-<?php echo $idField ?>-media-buttons" class="mf_media_button_div"> 1092 <?php 1093 // WP 3.3 changed here, so you need the media buttons on the editor for the tinyMCE plugin to work 1094 require_once( ABSPATH . 'wp-admin/includes/media.php' ) ?> 1095 <?php media_buttons( $idField ) ?> 1096 </div> 1097 <?php } ?> 1098 <?php } ?> 1093 1099 1094 1100 <textarea <?php if ($customField->required_field) echo 'validate="required:true"'; ?> class="<?php echo $requiredClass;?> <?php echo $classEditor; ?> <?php echo $pre_text ?>" tabindex="3" id="<?php echo $idField; ?>" name="<?php echo $inputName?>" rows="<?php echo $inputHeight?>" cols="<?php echo $inputWidth?>"<?php echo $maxlength?>><?php echo $value?></textarea> -
magic-fields/trunk/js/custom_fields/editor_validate.js
r394087 r906974 80 80 new_valor = switchEditors.wpautop(new_valor); 81 81 jQuery('#'+id).val(new_valor); 82 tinyMCE.execCommand('mceAdd Control', false, id);82 tinyMCE.execCommand('mceAdd'+mceString, false, id); 83 83 } 84 84 85 // Remove the editor (button) 85 86 function del_editor(id){ 86 tinyMCE.execCommand('mceRemove Control', false, id);87 tinyMCE.execCommand('mceRemove'+mceString, false, id); 87 88 } -
magic-fields/trunk/js/custom_fields/media_image.js
r763762 r906974 25 25 wpActiveEditor = a.id.replace('_add_media', ''); 26 26 }, 500 ); 27 }); 28 29 //focus for visual editor wp 3.8 30 jQuery(document).on('click',".mf_media_button_div > .add_media",function(){ 31 var idElem = jQuery(this).parent('div.mf_media_button_div').attr('id'); 32 console.log(idElem); 33 idElem = idElem.replace(/wp-/, ""); 34 idElem = idElem.replace(/-media-buttons/, ""); 35 tinyMCE.get(idElem).focus(); 27 36 }); 28 37 -
magic-fields/trunk/js/groups.js
r763762 r906974 852 852 // function fix the problem of block of the editor visual textareas 853 853 start: function() { 854 854 855 id = jQuery(this).attr("id"); 855 jQuery("#"+id+" :input[type='textarea'].mf_editor").each( function(inputField){856 jQuery("#"+id+" textarea.mf_editor").each( function(inputField){ 856 857 var editor_text = jQuery(this).attr('id'); 857 858 if(tinyMCE.get(editor_text)){ 858 tinyMCE.execCommand('mceRemove Control', false, editor_text);859 tinyMCE.execCommand('mceRemove'+mceString, false, editor_text); 859 860 jQuery('#'+editor_text).addClass('temp_remove_editor'); 860 861 } 861 862 }); 862 863 }, 863 stop : function(){864 id = jQuery(this).attr("id").split("_")[3];865 kids = jQuery("#write_panel_wrap_"+id).children().filter(".magicfield_group");866 for(i=0;i < kids.length; i++){867 groupCounter = kids[i].id.split("_")[2];868 ids = kids[i].id.split("_")[3];869 jQuery("#order_"+groupCounter+"_"+ids).val(i+1);870 jQuery("#counter_"+groupCounter+"_"+ids).text((i+1));871 }864 stop : function(){ 865 id = jQuery(this).attr("id").split("_")[3]; 866 kids = jQuery("#write_panel_wrap_"+id).children().filter(".magicfield_group"); 867 for(i=0;i < kids.length; i++){ 868 groupCounter = kids[i].id.split("_")[2]; 869 ids = kids[i].id.split("_")[3]; 870 jQuery("#order_"+groupCounter+"_"+ids).val(i+1); 871 jQuery("#counter_"+groupCounter+"_"+ids).text((i+1)); 872 } 872 873 //add the editor visual in textareas 873 jQuery("#"+jQuery(this).attr("id")+" :input[type='textarea'].temp_remove_editor").each( function(inputField){874 jQuery("#"+jQuery(this).attr("id")+" textarea.temp_remove_editor").each( function(inputField){ 874 875 var editor_text = jQuery(this).attr('id'); 875 tinyMCE.execCommand('mceAdd Control', false, editor_text);876 tinyMCE.execCommand('mceAdd'+mceString, false, editor_text); 876 877 jQuery('#'+editor_text).removeClass('temp_remove_editor'); 877 878 }); … … 1206 1207 jQuery(".pre_editor", context).each( function(inputField){ 1207 1208 var editor_text = jQuery(this).attr('id'); 1208 tinyMCE.execCommand('mceAdd Control', true, editor_text);1209 tinyMCE.execCommand('mceAdd'+mceString, true, editor_text); 1209 1210 jQuery('#'+editor_text, context).removeClass('pre_editor'); 1210 1211 }); -
magic-fields/trunk/readme.txt
r763762 r906974 2 2 Contributors: hunk, Gnuget 3 3 Tags: custom write panel, custom, write panel, cms, magic fields 4 Tested up to: Wordpress 3. 64 Tested up to: Wordpress 3.9 5 5 Requires at least: 2.9 6 6 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=edgar%40programador%2ecom&lc=GB&item_name=Donation%20Magic%20Fields¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest 7 Stable tag: 1.6. 1.17 Stable tag: 1.6.2 8 8 Description: Magic Fields is a feature rich WordPress CMS plugin. 9 9 … … 28 28 29 29 == Changelog == 30 31 = 1.6.2 = 32 * fix issue visual editor (WP 3.9) 33 * fix issue drag and drop multiline 30 34 31 35 = 1.6.1.1 =
Note: See TracChangeset
for help on using the changeset viewer.