Ignore:
Timestamp:
04/03/09 17:28:17 (3 years ago)
Author:
CrawfordCurrie
Message:

Item1383: Optimised the preferences Item8094: fixed the pickaxe

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin.pm

    r2957 r3369  
    1  
    21# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/ 
    32# 
     
    1918use Assert; 
    2019 
    21 our $VERSION          = '$Rev$'; 
    22 our $RELEASE          = '21 Jan 2009'; 
    23 our $SHORTDESCRIPTION = 'Integration of TinyMCE with WysiwygPlugin'; 
     20our $VERSION           = '$Rev$'; 
     21our $RELEASE           = '21 Jan 2009'; 
     22our $SHORTDESCRIPTION  = 'Integration of the !TinyMCE WYSIWYG Editor'; 
     23our $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! 
     28our $defaultINIT       = <<'HERE'; 
     29mode:"textareas", 
     30editor_selector : "foswikiWysiwygEdit", 
     31save_on_tinymce_forms: true, 
     32cleanup : true, 
     33theme : "advanced", 
     34convert_urls : true, 
     35relative_urls : false, 
     36remove_script_host : false, 
     37dialog_type: "modal", 
     38setupcontent_callback : FoswikiTiny.setUpContent, 
     39urlconverter_callback : "FoswikiTiny.convertLink", 
     40foswikipuburl_callback : "FoswikiTiny.convertPubURL", 
     41save_callback : "FoswikiTiny.saveCallback", 
     42%IF{"$TINYMCEPLUGIN_DEBUG" then="debug:true,"}% 
     43plugins : "table,searchreplace,autosave,paste,foswikibuttons,foswikiimage%IF{ "context TinyMCEUsabilityUpgradePluginEnabled" then=",foswikilink" else=""}%", 
     44foswiki_secret_id : "%WYSIWYG_SECRET_ID%", 
     45foswiki_vars : { PUBURLPATH : "%PUBURLPATH%", PUBURL : "%PUBURL%", WEB : "%WEB%", TOPIC : "%TOPIC%", ATTACHURL : "%ATTACHURL%", ATTACHURLPATH : "%ATTACHURLPATH%", VIEWSCRIPTURL : "%SCRIPTURL{view}%", SCRIPTSUFFIX: "%SCRIPTSUFFIX%", SCRIPTURL : "%SCRIPTURL%", SYSTEMWEB: "%SYSTEMWEB%" }, 
     46theme_advanced_toolbar_align : "left", 
     47foswikibuttons_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], 
     60paste_create_paragraphs : true, 
     61paste_create_linebreaks : false, 
     62paste_convert_middot_lists : true, 
     63paste_convert_headers_to_strong : false, 
     64paste_remove_spans: true, 
     65paste_remove_styles: true, 
     66paste_strip_class_attributes: "all", 
     67theme_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", 
     68theme_advanced_buttons2: "tablecontrols,separator,code,hide", 
     69theme_advanced_buttons3: "", 
     70theme_advanced_toolbar_location: "top", 
     71theme_advanced_resize_horizontal : false, 
     72theme_advanced_resizing : true, 
     73theme_advanced_path: false, 
     74theme_advanced_statusbar_location : "bottom", 
     75keep_styles : false, 
     76gecko_spellcheck : true, 
     77content_css : "%PUBURLPATH%/%SYSTEMWEB%/TinyMCEPlugin/wysiwyg%IF{"$TINYMCEPLUGIN_DEBUG" then="_src"}%.css,%PUBURLPATH%/%SYSTEMWEB%/SkinTemplates/base.css,%FOSWIKI_STYLE_URL%,%FOSWIKI_COLORS_URL%" 
     78HERE 
     79our %defaultINIT_BROWSER     = ( 
     80    MSIE => 'paste_auto_cleanup_on_paste : true', 
     81    OPERA => '', 
     82    GECKO => '', 
     83    SAFARI => '', 
     84   ); 
    2485 
    2586use Foswiki::Func; 
     
    102163 
    103164    my $init = Foswiki::Func::getPreferencesValue('TINYMCEPLUGIN_INIT') 
    104       || <<'HERE'; 
    105 ' 
    106 HERE 
     165      || $defaultINIT; 
    107166    my $extras = ''; 
    108167 
     
    122181    } 
    123182    if ($extras) { 
    124         $extras = 
    125           Foswiki::Func::getPreferencesValue( 'TINYMCEPLUGIN_INIT_' . $extras ); 
     183        $extras = Foswiki::Func::getPreferencesValue( 
     184            'TINYMCEPLUGIN_INIT_' . $extras ) || $defaultINIT_BROWSER{$extras}; 
    126185        if ( defined $extras ) { 
    127186            $init = join( ',', ( split( ',', $init ), split( ',', $extras ) ) ); 
Note: See TracChangeset for help on using the changeset viewer.