load_nextgen_tinymce

The NextGen TinyMCE Picture Description load nextgen tinymce function.

Description

load_nextgen_tinymce(); 

Usage

  1. if ( !function_exists( 'load_nextgen_tinymce' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-tinymce-picture-description/nextgen-tinymce.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = load_nextgen_tinymce(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/nextgen-tinymce.php  
  1. function load_nextgen_tinymce() { 
  2. ?> 
  3. <script type="text/javascript"> 
  4.  
  5. jQuery(document).ready(function() { 
  6. var newnextgen = false; 
  7. var elements=[]; 
  8.  
  9. jQuery('textarea').filter(function() { 
  10.  
  11. if(jQuery(this).attr('name').match(/\[[0-9]{1, }\]+\[description\]/)) 
  12. {  
  13. newnextgen = true; 
  14. return jQuery(this).attr('name').match(/\[[0-9]{1, }\]+\[description\]/) 
  15. }  
  16. else  
  17. newnextgen = false; 
  18. return jQuery(this).attr('name').match(/description\[[0-9]{1, }\]+/) 
  19. }  
  20.  
  21. }).each(function(k) { 
  22.  
  23. if(newnextgen = false) 
  24. var elem_id = 'description-'+jQuery(this).parent().parent().attr('id'); 
  25. } else { 
  26. var elem_id = 'description-'+jQuery(this).parent().parent().find('.column-2').text();  
  27. }  
  28.  
  29. jQuery(this).attr('id', elem_id ); 
  30. elements.push(elem_id); 
  31. }); 
  32.  
  33.  
  34.  
  35. tinyMCE.init({ 
  36. mode : "exact",  
  37. elements: elements.join(', '),  
  38. width:"100%",  
  39. height:"200",  
  40. theme:"advanced",  
  41. skin:"default",  
  42. language: tinyMCE.settings.language, // get setting from WP tinymce 
  43. plugins : "fullscreen, inlinepopups, spellchecker",  
  44. theme_advanced_buttons1 : "bold, italic, underline, blockquote, separator, strikethrough, link, unlink",  
  45. theme_advanced_buttons2 : "bullist, numlist, justifyleft, justifycenter, justifyright, undo, redo, fullscreen",  
  46. theme_advanced_buttons3 : "",  
  47. theme_advanced_toolbar_location : "top",  
  48. theme_advanced_toolbar_align : "left",  
  49. theme_advanced_statusbar_location : "bottom",  
  50. theme_advanced_resizing : true 
  51.  
  52. }); 
  53.  
  54.  
  55. }); 
  56. </script> 
  57. <?php