Permalink
Browse files

Fixes for WP 3.3 wp_editor(). Fixes #159. Fixes #158

  • Loading branch information...
1 parent 446588d commit 421fbde384b2d4b92b375df28d471022ed8d55a2 @boonebgorges committed Dec 13, 2011
Showing with 28 additions and 11 deletions.
  1. +0 −7 includes/js/bp-docs.js
  2. +27 −3 includes/templates/docs/edit-doc.php
  3. +1 −1 readme.txt
View
@@ -76,13 +76,6 @@ jQuery(document).ready(function($){
});
}
- /* On some setups, it helps TinyMCE to load if we fire the switchEditors event on load */
- if ( typeof(switchEditors) == 'object' ) {
- if ( !$("#edButtonPreview").hasClass('active') ) {
- switchEditors.go('doc[content]', 'tinymce');
- }
- }
-
$('#bp-docs-group-enable').click(function(){
$('#group-doc-options').slideToggle(400);
});
@@ -4,8 +4,10 @@
// No media support at the moment. Want to integrate with something like BP Group Documents
// include_once ABSPATH . '/wp-admin/includes/media.php' ;
-require_once ABSPATH . '/wp-admin/includes/post.php' ;
-wp_tiny_mce();
+if ( !function_exists( 'wp_editor' ) ) {
+ require_once ABSPATH . '/wp-admin/includes/post.php' ;
+ wp_tiny_mce();
+}
?>
@@ -42,7 +44,16 @@
<?php echo bpsp_media_buttons(); ?>
</div>
*/ ?>
- <?php the_editor( bp_docs_get_edit_doc_content(), 'doc[content]', 'doc[title]', false ); ?>
+ <?php
+ if ( function_exists( 'wp_editor' ) ) {
+ wp_editor( bp_docs_get_edit_doc_content(), 'doc[content]', array(
+ 'media_buttons' => false,
+ 'dfw' => false
+ ) );
+ } else {
+ the_editor( bp_docs_get_edit_doc_content(), 'doc[content]', 'doc[title]', false );
+ }
+ ?>
</div>
</div>
@@ -125,6 +136,19 @@
<?php bp_docs_inline_toggle_js() ?>
+<?php if ( !function_exists( 'wp_editor' ) ) : ?>
+<script type="text/javascript">
+jQuery(document).ready(function($){
+ /* On some setups, it helps TinyMCE to load if we fire the switchEditors event on load */
+ if ( typeof(switchEditors) == 'object' ) {
+ if ( !$("#edButtonPreview").hasClass('active') ) {
+ switchEditors.go('doc[content]', 'tinymce');
+ }
+ }
+},(jQuery));
+</script>
+<?php endif ?>
+
<script type="text/javascript" >
var tb_closeImage = "<?php bp_root_domain() ?>/wp-includes/js/thickbox/tb-close.png";
</script>
View
@@ -36,7 +36,7 @@ This plugin is in active development. For feature requests and bug reports, visi
== Changelog ==
= 1.1.19 =
-* Fixed bug that may have caused TinyMCE problems on WP 3.3
+* Improved WP 3.3 support
* Ensure that groups' can-delete setting defaults to 'member' when not present, to account for legacy groups
* Moved to groups_get_group() for greater efficiency under BP 1.6
* Fixed bug that redirected users to wp-admin when comparing a revision to itself

0 comments on commit 421fbde

Please sign in to comment.