Changeset 3369 for trunk/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin.pm
- Timestamp:
- 04/03/09 17:28:17 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin.pm
r2957 r3369 1 2 1 # Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/ 3 2 # … … 19 18 use Assert; 20 19 21 our $VERSION = '$Rev$'; 22 our $RELEASE = '21 Jan 2009'; 23 our $SHORTDESCRIPTION = 'Integration of TinyMCE with WysiwygPlugin'; 20 our $VERSION = '$Rev$'; 21 our $RELEASE = '21 Jan 2009'; 22 our $SHORTDESCRIPTION = 'Integration of the !TinyMCE WYSIWYG Editor'; 23 our $NO_PREFS_IN_TOPIC = 1; 24 25 # Defaults for TINYMCEPLUGIN_INIT and INIT_browser. Defined as our vars to 26 # allow other extensions to override them. 27 # PLEASE ENSURE THE PLUGIN TOPIC EXAMPLES ARE KEPT IN SYNCH! 28 our $defaultINIT = <<'HERE'; 29 mode:"textareas", 30 editor_selector : "foswikiWysiwygEdit", 31 save_on_tinymce_forms: true, 32 cleanup : true, 33 theme : "advanced", 34 convert_urls : true, 35 relative_urls : false, 36 remove_script_host : false, 37 dialog_type: "modal", 38 setupcontent_callback : FoswikiTiny.setUpContent, 39 urlconverter_callback : "FoswikiTiny.convertLink", 40 foswikipuburl_callback : "FoswikiTiny.convertPubURL", 41 save_callback : "FoswikiTiny.saveCallback", 42 %IF{"$TINYMCEPLUGIN_DEBUG" then="debug:true,"}% 43 plugins : "table,searchreplace,autosave,paste,foswikibuttons,foswikiimage%IF{ "context TinyMCEUsabilityUpgradePluginEnabled" then=",foswikilink" else=""}%", 44 foswiki_secret_id : "%WYSIWYG_SECRET_ID%", 45 foswiki_vars : { PUBURLPATH : "%PUBURLPATH%", PUBURL : "%PUBURL%", WEB : "%WEB%", TOPIC : "%TOPIC%", ATTACHURL : "%ATTACHURL%", ATTACHURLPATH : "%ATTACHURLPATH%", VIEWSCRIPTURL : "%SCRIPTURL{view}%", SCRIPTSUFFIX: "%SCRIPTSUFFIX%", SCRIPTURL : "%SCRIPTURL%", SYSTEMWEB: "%SYSTEMWEB%" }, 46 theme_advanced_toolbar_align : "left", 47 foswikibuttons_formats : [ 48 { name: "Normal", el: "", style: null }, 49 { name: "Heading 1", el: "h1", style: false }, 50 { name: "Heading 2", el: "h2", style: false }, 51 { name: "Heading 3", el: "h3", style: false }, 52 { name: "Heading 4", el: "h4", style: false }, 53 { name: "Heading 5", el: "h5", style: false }, 54 { name: "Heading 6", el: "h6", style: false }, 55 { name: "VERBATIM", el: "pre", style: "TMLverbatim" }, 56 { name: "LITERAL", el: "span", style: "WYSIWYG_LITERAL" }, 57 { name: "Protect on save", el: null, style: "WYSIWYG_PROTECTED" }, 58 { name: "Protect forever", el: null, style: "WYSIWYG_STICKY" } 59 ], 60 paste_create_paragraphs : true, 61 paste_create_linebreaks : false, 62 paste_convert_middot_lists : true, 63 paste_convert_headers_to_strong : false, 64 paste_remove_spans: true, 65 paste_remove_styles: true, 66 paste_strip_class_attributes: "all", 67 theme_advanced_buttons1 : "foswikiformat,separator,bold,italic,tt,colour,removeformat,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor,separator,attach,image,charmap,hr,separator,undo,redo,separator,search,replace", 68 theme_advanced_buttons2: "tablecontrols,separator,code,hide", 69 theme_advanced_buttons3: "", 70 theme_advanced_toolbar_location: "top", 71 theme_advanced_resize_horizontal : false, 72 theme_advanced_resizing : true, 73 theme_advanced_path: false, 74 theme_advanced_statusbar_location : "bottom", 75 keep_styles : false, 76 gecko_spellcheck : true, 77 content_css : "%PUBURLPATH%/%SYSTEMWEB%/TinyMCEPlugin/wysiwyg%IF{"$TINYMCEPLUGIN_DEBUG" then="_src"}%.css,%PUBURLPATH%/%SYSTEMWEB%/SkinTemplates/base.css,%FOSWIKI_STYLE_URL%,%FOSWIKI_COLORS_URL%" 78 HERE 79 our %defaultINIT_BROWSER = ( 80 MSIE => 'paste_auto_cleanup_on_paste : true', 81 OPERA => '', 82 GECKO => '', 83 SAFARI => '', 84 ); 24 85 25 86 use Foswiki::Func; … … 102 163 103 164 my $init = Foswiki::Func::getPreferencesValue('TINYMCEPLUGIN_INIT') 104 || <<'HERE'; 105 ' 106 HERE 165 || $defaultINIT; 107 166 my $extras = ''; 108 167 … … 122 181 } 123 182 if ($extras) { 124 $extras = 125 Foswiki::Func::getPreferencesValue( 'TINYMCEPLUGIN_INIT_' . $extras );183 $extras = Foswiki::Func::getPreferencesValue( 184 'TINYMCEPLUGIN_INIT_' . $extras ) || $defaultINIT_BROWSER{$extras}; 126 185 if ( defined $extras ) { 127 186 $init = join( ',', ( split( ',', $init ), split( ',', $extras ) ) );
Note: See TracChangeset
for help on using the changeset viewer.
