Changeset 2388 for MediaWiki/trunk

Show
Ignore:
Timestamp:
2008-08-27 16:58:27 (4 months ago)
Author:
wwalc
Message:

Changed the way how FCKeditor is loaded + a couple of other bugfixes

Location:
MediaWiki/trunk
Files:
2 added
11 modified

Legend:

Unmodified
Added
Removed
  • MediaWiki/trunk/FCKeditor.body.php

    r2077 r2388  
    11<?php 
     2/** 
     3 * Options for FCKeditor 
     4 * [start with FCKeditor] 
     5 */ 
     6define("RTE_VISIBLE", 1); 
     7/** 
     8 * Options for FCKeditor 
     9 * [show toggle link] 
     10 */ 
     11define('RTE_TOGGLE_LINK', 2); 
     12/** 
     13 * Options for FCKeditor 
     14 * [show popup link] 
     15 */ 
     16define('RTE_POPUP', 4); 
    217 
    318class FCKeditor_MediaWiki { 
     19        public $showFCKEditor; 
    420        private $count = array(); 
    521        private $wgFCKBypassText = ""; 
     
    7894                */ 
    7995                if ( (!$wgUser->getOption( 'showtoolbar' ) || $wgUser->getOption( 'riched_disable' ) || !$wgFCKEditorIsCompatible) || 
    80                                 in_array($wgTitle->getNamespace(), $this->getExcludedNamespaces()) || 
     96                                in_array($wgTitle->getNamespace(), $this->getExcludedNamespaces()) || !($this->showFCKEditor & RTE_VISIBLE) || 
    8197                                false !== strpos($pageEditor->textbox1, "__NORICHEDITOR__") 
    8298                        ) { 
     
    269285                global $wgFCKWikiTextBeforeParse; 
    270286 
     287                if (!isset($this->showFCKEditor)) 
     288                { 
     289                        $this->showFCKEditor = 0; 
     290                        if ( !$wgUser->getOption( 'riched_start_disabled' ) ) { 
     291                                $this->showFCKEditor += RTE_VISIBLE; 
     292                        } 
     293                        if ( $wgUser->getOption( 'riched_use_popup' ) ) { 
     294                                $this->showFCKEditor += RTE_POPUP; 
     295                        } 
     296                        if ( $wgUser->getOption( 'riched_use_toggle' ) ) { 
     297                                $this->showFCKEditor += RTE_TOGGLE_LINK; 
     298                        } 
     299                } 
     300 
     301                if( (!empty($_SESSION['showMyFCKeditor'])) && ($wgUser->getOption( 'riched_toggle_remember_state' ))) 
     302                { 
     303                        //clear RTE_VISIBLE flag 
     304                        $this->showFCKEditor &= ~RTE_VISIBLE ; 
     305                        //get flag from session 
     306                        $this->showFCKEditor |= $_SESSION['showMyFCKeditor'] ;                   
     307                } 
     308         
    271309                if (!$wgUser->getOption( 'showtoolbar' ) || $wgUser->getOption( 'riched_disable' ) || !$wgFCKEditorIsCompatible) { 
    272310                        return true; 
     
    281319                } 
    282320 
    283                 $options = new FCKeditorParserOptions(); 
    284                 $options->setTidy(true); 
    285                 $parser = new FCKeditorParser(); 
    286                 $parser->setOutputType(OT_HTML); 
    287321                $wgFCKWikiTextBeforeParse = $form->textbox1; 
    288                 $form->textbox1 = $parser->parse($form->textbox1, $wgTitle, $options)->getText(); 
     322                if ($this->showFCKEditor & RTE_VISIBLE) 
     323                { 
     324                        $options = new FCKeditorParserOptions(); 
     325                        $options->setTidy(true); 
     326                        $parser = new FCKeditorParser(); 
     327                        $parser->setOutputType(OT_HTML); 
     328                        $form->textbox1 = $parser->parse($form->textbox1, $wgTitle, $options)->getText(); 
     329                } 
    289330 
    290331                $printsheet = htmlspecialchars( "$wgStylePath/common/wikiprintable.css?$wgStyleVersion" ); 
     
    317358HEREDOC; 
    318359 
     360                $script .= '<script type="text/javascript"> '; 
    319361                if (!empty($userStyles)) { 
    320                         $script .= ' 
    321 <script type="text/javascript">  
    322 sEditorAreaCSS += ",'.implode(',', $userStyles).'"; 
    323 </script>'; 
    324                 } 
    325  
     362                        $script .= 'sEditorAreaCSS += ",'.implode(',', $userStyles).'";'; 
     363                } 
     364                $script .= ' 
     365var showFCKEditor = '. $this->showFCKEditor .'; 
     366var popup = false;              //pointer to popup document 
     367var firstLoad = true; 
     368var editorMsgOn = "'. wfMsg( 'textrichditor' ) .'"; 
     369var editorMsgOff = "'. wfMsg( 'tog-riched_disable' ) .'"; 
     370var editorLink = "'. (($this->showFCKEditor & RTE_VISIBLE)? wfMsg( 'tog-riched_disable' ): wfMsg( 'textrichditor' )) .'";                
     371var saveSetting = '. ($wgUser->getOption( 'riched_toggle_remember_state' ) ?  1 : 0) .'; 
     372var RTE_VISIBLE = '.RTE_VISIBLE.'; 
     373var RTE_TOGGLE_LINK = '.RTE_TOGGLE_LINK.'; 
     374var RTE_POPUP = '.RTE_POPUP.'; 
     375 
     376 
     377var oFCKeditor = new FCKeditor( "wpTextbox1" ) ; 
     378 
     379//Set config 
     380oFCKeditor.BasePath = "'.$wgScriptPath.'/'.$wgFCKEditorDir.'/" ; 
     381oFCKeditor.Config["CustomConfigurationsPath"] = "'.$wgScriptPath.'/'.$wgFCKEditorExtDir.'/fckeditor_config.js" ; 
     382oFCKeditor.Config["EditorAreaCSS"] = "'.$wgScriptPath.'/'.$wgFCKEditorExtDir.'/css/fckeditor.css" ; 
     383oFCKeditor.ToolbarSet = "'. $wgFCKEditorToolbarSet .'" ;  
     384oFCKeditor.ready = true; 
     385'; 
     386                $script .= '</script>'; 
     387                 
     388                $newWinMsg = wfMsg('rich_editor_new_window'); 
    326389                $script .= <<<HEREDOC 
    327390<script type="text/javascript">  
    328391 
    329 // Remove the mwSetupToolbar onload hook to avoid a JavaScript error with FF. 
    330 if ( window.removeEventListener ) 
    331         window.removeEventListener( 'load', mwSetupToolbar, false ) ; 
    332 else if ( window.detachEvent ) 
    333         window.detachEvent( 'onload', mwSetupToolbar ) ; 
    334          
    335 mwSetupToolbar = function() { return false ; } ; 
     392//IE hack to call func from popup 
     393function FCK_sajax(func_name, args, target) { 
     394        sajax_request_type = 'POST' ; 
     395        sajax_do_call(func_name, args, function (x) { 
     396                // I know this is function, not object 
     397                target(x); 
     398                } 
     399        ); 
     400} 
    336401 
    337402function onLoadFCKeditor() 
    338403{ 
    339         if ( document.getElementById('wpTextbox1') ) 
     404        if (!(showFCKEditor & RTE_VISIBLE))  
     405                showFCKEditor += RTE_VISIBLE; 
     406        firstLoad = false; 
     407        realTextarea = document.getElementById('wpTextbox1'); 
     408        if ( realTextarea ) 
    340409        { 
    341410                var height = $wgFCKEditorHeight ; 
    342                  
     411                realTextarea.style.display = 'none'; 
    343412                if ( height == 0 ) 
    344413                { 
     
    362431                 
    363432                // Create the editor instance and replace the textarea. 
    364                 var oFCKeditor = new FCKeditor('wpTextbox1') ; 
    365                 oFCKeditor.BasePath = '$wgScriptPath/$wgFCKEditorDir/' ; 
    366                 oFCKeditor.Config['CustomConfigurationsPath'] = '$wgScriptPath/$wgFCKEditorExtDir/fckeditor_config.js' ; 
    367                 oFCKeditor.Config['EditorAreaCSS'] = "$wgScriptPath/$wgFCKEditorExtDir/css/fckeditor.css" ; 
    368433                oFCKeditor.Height = height ; 
    369                 oFCKeditor.ToolbarSet = '$wgFCKEditorToolbarSet' ; 
    370434                oFCKeditor.ReplaceTextarea() ; 
    371435                 
    372436                // Hide the default toolbar. 
    373                 document.getElementById('toolbar').style.cssText = 'display:none;' ; 
     437                document.getElementById('toolbar').style.display = 'none' ; 
    374438                // do things with CharInsert for example 
    375439 
     
    378442                        edittools_markup.style.display = 'none' ; 
    379443                } 
    380                 insertTags = function (tagOpen, tagClose, sampleText) 
     444                FCKeditorInsertTags = function (tagOpen, tagClose, sampleText, oDoc) 
    381445                { 
    382446                        var txtarea; 
    383447 
    384                         if ( !(typeof(FCK) == "undefined") && !(typeof(FCK.EditingArea) == "undefined") ) 
     448                        if ( !(typeof(oDoc.FCK) == "undefined") && !(typeof(oDoc.FCK.EditingArea) == "undefined") ) 
    385449                        { 
    386                                 txtarea = FCK.EditingArea.Textarea ; 
    387                         } 
    388                         else if (document.editform) 
     450                                txtarea = oDoc.FCK.EditingArea.Textarea ; 
     451                        } 
     452                        else if (oDoc.editform) 
    389453                        { 
    390454                                // if we have FCK enabled, behave differently... 
    391                                 FCKarea = document.getElementById( oFCKeditor.InstanceName ) ; 
    392                                 if ( FCKarea.style.display == 'none' ) 
     455                                if ( showFCKEditor & RTE_VISIBLE ) 
    393456                                { 
    394                                         SRCiframe = document.getElementById ('wpTextbox1___Frame') ; 
     457                                        SRCiframe = oDoc.getElementById ('wpTextbox1___Frame') ; 
    395458                                        if ( SRCiframe ) 
    396459                                        { 
    397460                                                if (window.frames[SRCiframe]) 
    398                                                         SRCdoc = window.frames[SRCiframe].document ; 
     461                                                        SRCdoc = window.frames[SRCiframe].oDoc ; 
    399462                                                else 
    400463                                                        SRCdoc = SRCiframe.contentDocument ; 
     
    415478                                else 
    416479                                { 
    417                                         txtarea = document.editform.wpTextbox1 ; 
     480                                        txtarea = oDoc.editform.wpTextbox1 ; 
    418481                                } 
    419482                        } 
     
    421484                        { 
    422485                                // some alternate form? take the first one we can find 
    423                                 var areas = document.getElementsByTagName( 'textarea' ) ; 
     486                                var areas = oDoc.getElementsByTagName( 'textarea' ) ; 
    424487                                txtarea = areas[0] ; 
    425488                        } 
     
    427490                        var selText, isSample = false ; 
    428491 
    429                         if ( document.selection  && document.selection.createRange )  
     492                        if ( oDoc.selection  && oDoc.selection.createRange )  
    430493                        { // IE/Opera 
    431494 
    432495                                //save window scroll position 
    433                                 if ( document.documentElement && document.documentElement.scrollTop ) 
    434                                         var winScroll = document.documentElement.scrollTop ; 
    435                                 else if ( document.body ) 
    436                                         var winScroll = document.body.scrollTop ; 
     496                                if ( oDoc.documentElement && oDoc.documentElement.scrollTop ) 
     497                                        var winScroll = oDoc.documentElement.scrollTop ; 
     498                                else if ( oDoc.body ) 
     499                                        var winScroll = oDoc.body.scrollTop ; 
    437500 
    438501                                //get current selection 
    439502                                txtarea.focus() ; 
    440                                 var range = document.selection.createRange() ; 
     503                                var range = oDoc.selection.createRange() ; 
    441504                                selText = range.text ; 
    442505                                //insert tags 
    443                                 checkSelectedText() ; 
     506                                checkSelected(); 
    444507                                range.text = tagOpen + selText + tagClose ; 
    445508                                //mark sample text as selected 
     
    453516                                range.select(); 
    454517                                //restore window scroll position 
    455                                 if ( document.documentElement && document.documentElement.scrollTop ) 
    456                                         document.documentElement.scrollTop = winScroll ; 
    457                                 else if ( document.body ) 
    458                                         document.body.scrollTop = winScroll ; 
     518                                if ( oDoc.documentElement && oDoc.documentElement.scrollTop ) 
     519                                        oDoc.documentElement.scrollTop = winScroll ; 
     520                                else if ( oDoc.body ) 
     521                                        oDoc.body.scrollTop = winScroll ; 
    459522 
    460523                        }  
     
    500563        } 
    501564} 
    502 addOnloadHook( onLoadFCKeditor ) ; 
    503 </script> 
     565function checkSelected() 
     566{ 
     567        if (!selText) { 
     568                selText = sampleText; 
     569                isSample = true; 
     570        } else if (selText.charAt(selText.length - 1) == ' ') { //exclude ending space char 
     571                selText = selText.substring(0, selText.length - 1); 
     572                tagClose += ' ' 
     573        }  
     574} 
     575function initEditor() 
     576{        
     577        var toolbar = document.getElementById('toolbar') ; 
     578        //show popup or toogle link 
     579        if (showFCKEditor & (RTE_POPUP|RTE_TOGGLE_LINK)){ 
     580                //add new toolbar before wiki toolbar 
     581                var fckTools = document.createElement('div'); 
     582                fckTools.setAttribute('id', 'fckTools'); 
     583                toolbar.parentNode.insertBefore( fckTools, toolbar ); 
     584                 
     585                var SRCtextarea = document.getElementById( "wpTextbox1" ) ; 
     586                if (showFCKEditor & RTE_VISIBLE) SRCtextarea.style.display = "none"; 
     587        } 
     588 
     589        if (showFCKEditor & RTE_TOGGLE_LINK) 
     590        { 
     591                fckTools.innerHTML='[<a class="fckToogle" id="toggle_wpTextbox1" href="javascript:void(0)" onclick="ToggleFCKEditor(\'toggle\',\'wpTextbox1\')">'+ editorLink +'</a>] '; 
     592        } 
     593        if (showFCKEditor & RTE_POPUP) 
     594        { 
     595                var style = (showFCKEditor & RTE_VISIBLE) ? 'style="display:none"' : ""; 
     596                fckTools.innerHTML+='<span ' + style + ' id="popup_wpTextbox1">[<a class="fckPopup" href="javascript:void(0)" onclick="ToggleFCKEditor(\'popup\',\'wpTextbox1\')">{$newWinMsg}</a>]</span>'; 
     597        } 
     598 
     599        if (showFCKEditor & RTE_VISIBLE) 
     600        { 
     601                if ( toolbar )          //insert wiki buttons 
     602                { 
     603                        // Remove the mwSetupToolbar onload hook to avoid a JavaScript error with FF. 
     604                        if ( window.removeEventListener ) 
     605                                window.removeEventListener( 'load', mwSetupToolbar, false ) ; 
     606                        else if ( window.detachEvent ) 
     607                                window.detachEvent( 'onload', mwSetupToolbar ) ; 
     608                        mwSetupToolbar = function() { return false ; } ; 
     609 
     610                        for (var i = 0; i < mwEditButtons.length; i++) { 
     611                                mwInsertEditButton(toolbar, mwEditButtons[i]); 
     612                        } 
     613                        for (var i = 0; i < mwCustomEditButtons.length; i++) { 
     614                                mwInsertEditButton(toolbar, mwCustomEditButtons[i]); 
     615                        } 
     616                } 
     617                onLoadFCKeditor(); 
     618        } 
     619        return true; 
     620} 
     621addOnloadHook( initEditor ); 
     622 
    504623HEREDOC; 
    505624 
    506 /* 
    507 $script .= <<<HEREDOC 
    508 <script type="text/javascript"> 
    509 function showSource() { 
    510         var wp = document.getElementById("wpDiff"); 
    511         var s = document.createElement("input"); 
    512         s.type="submit"; 
    513         s.value="Wiki2HTML"; 
    514         s.name="Wiki2HTML"; 
    515         s.onclick = function wiki2html() { 
    516                 var oEditor = FCKeditorAPI.GetInstance('wpTextbox1'); 
    517                 WikiToHTML_Call(); 
    518                 return false; 
    519         } 
    520         wp.parentNode.insertBefore(s, wp.nextSibling); 
    521 } 
    522  
    523 var sajax_debug_mode = false; 
    524 var sajax_request_type = "GET"; 
    525  
    526 function WikiToHTML_Result(result) { 
    527         var oEditor = FCKeditorAPI.GetInstance('wpTextbox1'); 
    528         oEditor.SetHTML(result.responseText); 
    529 } 
    530 function WikiToHTML_Call() { 
    531         var oEditor = FCKeditorAPI.GetInstance('wpTextbox1'); 
    532         sajax_do_call('wfSajaxWikiToHTML', [oEditor.GetHTML()], WikiToHTML_Result); 
    533 } 
    534  
    535 addOnloadHook(showSource); 
    536 </script> 
     625if ($this->showFCKEditor & (RTE_TOGGLE_LINK | RTE_POPUP) ){ 
     626        //add toogle link and handler 
     627        $script .= <<<HEREDOC 
     628 
     629function ToggleFCKEditor(mode, objId) 
     630{ 
     631        var SRCtextarea = document.getElementById( objId ) ; 
     632        if(mode == 'popup'){ 
     633                if (( showFCKEditor & RTE_VISIBLE) && ( FCKeditorAPI )) //if FCKeditor is up-to-date 
     634                { 
     635                        var oEditorIns = FCKeditorAPI.GetInstance( objId ); 
     636                        var text = oEditorIns.GetData( oEditorIns.Config.FormatSource ); 
     637                        SRCtextarea.value = text;                       //copy text to textarea 
     638                } 
     639                FCKeditor_OpenPopup('oFCKeditor',objId); 
     640                return true; 
     641        } 
     642         
     643        var oToggleLink = document.getElementById('toggle_'+ objId ); 
     644        var oPopupLink = document.getElementById('popup_'+ objId ); 
     645 
     646        if ( firstLoad ) 
     647        { 
     648                // firstLoad = true => FCKeditor start invisible 
     649                if (oToggleLink) oToggleLink.innerHTML = "Loading..."; 
     650                sajax_request_type = 'POST' ; 
     651                oFCKeditor.ready = false; 
     652                sajax_do_call('wfSajaxWikiToHTML', [SRCtextarea.value], function ( result ){ 
     653                        if ( firstLoad )        //still 
     654                        { 
     655                                SRCtextarea.value = result.responseText; //insert parsed text 
     656                                onLoadFCKeditor(); 
     657                                if (oToggleLink) oToggleLink.innerHTML = editorMsgOff; 
     658                                oFCKeditor.ready = true; 
     659                        } 
     660                }); 
     661                return true; 
     662        } 
     663         
     664        if (!oFCKeditor.ready) return false;            //sajax_do_call in action 
     665        if (!FCKeditorAPI) return false;                        //not loaded yet 
     666        var oEditorIns = FCKeditorAPI.GetInstance( objId ); 
     667        var oEditorIframe  = document.getElementById( objId+'___Frame' ); 
     668        var FCKtoolbar = document.getElementById('toolbar'); 
     669        var bIsWysiwyg = ( oEditorIns.EditMode == FCK_EDITMODE_WYSIWYG ); 
     670 
     671        //FCKeditor visible -> hidden 
     672        if ( showFCKEditor & RTE_VISIBLE) 
     673        { 
     674                var text = oEditorIns.GetData( oEditorIns.Config.FormatSource ); 
     675                SRCtextarea.value = text; 
     676                if ( bIsWysiwyg ) oEditorIns.SwitchEditMode();          //switch to plain 
     677                var text = oEditorIns.GetData( oEditorIns.Config.FormatSource ); 
     678                //copy from FCKeditor to textarea 
     679                SRCtextarea.value = text; 
     680                if (saveSetting) 
     681                { 
     682                        sajax_request_type = 'GET' ; 
     683                        sajax_do_call( 'wfSajaxToggleFCKeditor', ['hide'], function(){} ) ;             //remember closing in session 
     684                } 
     685                if (oToggleLink) oToggleLink.innerHTML = editorMsgOn; 
     686                if (oPopupLink) oPopupLink.style.display = ''; 
     687                showFCKEditor -= RTE_VISIBLE; 
     688                oEditorIframe.style.display = 'none'; 
     689                FCKtoolbar.style.display = ''; 
     690                SRCtextarea.style.display = ''; 
     691        } 
     692        //FCKeditor hidden -> visible 
     693        else 
     694        { 
     695                if ( bIsWysiwyg ) oEditorIns.SwitchEditMode();          //switch to plain 
     696                SRCtextarea.style.display = 'none'; 
     697                //copy from textarea to FCKeditor 
     698                oEditorIns.EditingArea.Textarea.value = SRCtextarea.value 
     699                FCKtoolbar.style.display = 'none'; 
     700                oEditorIframe.style.display = ''; 
     701                if ( !bIsWysiwyg ) oEditorIns.SwitchEditMode();         //switch to WYSIWYG 
     702                showFCKEditor += RTE_VISIBLE; // showFCKEditor+=RTE_VISIBLE 
     703                if (oToggleLink) oToggleLink.innerHTML = editorMsgOff; 
     704                if (oPopupLink) oPopupLink.style.display = 'none'; 
     705        } 
     706        return true; 
     707} 
     708 
    537709HEREDOC; 
    538 */ 
     710} 
     711 
     712if($this->showFCKEditor & RTE_POPUP){ 
     713        $script .= <<<HEREDOC 
     714 
     715function FCKeditor_OpenPopup(jsID, textareaID) 
     716{ 
     717        popupUrl = '${wgFCKEditorExtDir}/FCKeditor.popup.html'; 
     718        popupUrl = popupUrl + '?var='+ jsID + '&el=' + textareaID; 
     719        window.open(popupUrl, null, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=1,dependent=yes'); 
     720        return 0; 
     721} 
     722HEREDOC; 
     723} 
     724$script .= "</script>"; 
    539725 
    540726                $wgOut->addScript($script); 
     
    545731        public function onUserToggles( &$extraToggles ) { 
    546732                $extraToggles[] = 'riched_disable'; 
     733                $extraToggles[] = 'riched_start_disabled'; 
     734                $extraToggles[] = 'riched_use_popup'; 
     735                $extraToggles[] = 'riched_use_toggle'; 
     736                $extraToggles[] = 'riched_toggle_remember_state'; 
     737                 
    547738                $extraToggles = array_merge($extraToggles, self::$nsToggles); 
    548739                return true; 
  • MediaWiki/trunk/fckeditor_config.js

    r1838 r2388  
    3737 
    3838FCKConfig.EditorAreaStyles = '\ 
    39 .FCK__MWTemplate, .FCK__MWRef, .FCK__MWSpecial, .FCK__MWReferences, .FCK__MWNowiki, .FCK__MWIncludeonly, .FCK__MWNoinclude, .FCK__MWOnlyinclude, .FCK__MWGallery \ 
     39.FCK__MWTemplate, .FCK__MWRef, .FCK__MWSpecial, .FCK__MWReferences, .FCK__MWMath, .FCK__MWNowiki, .FCK__MWIncludeonly, .FCK__MWNoinclude, .FCK__MWOnlyinclude, .FCK__MWGallery \ 
    4040{ \ 
    4141        border: 1px dotted #00F; \ 
     
    6565{ \ 
    6666        background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_nowiki.gif); \ 
     67        width: 66px; \ 
     68        height: 15px; \ 
     69} \ 
     70.FCK__MWMath \ 
     71{ \ 
     72        background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_math.gif); \ 
    6773        width: 66px; \ 
    6874        height: 15px; \ 
  • MediaWiki/trunk/FCKeditor.i18n.en.php

    r1833 r2388  
    2020'tog-riched_disable_ns_category' => 'Disable rich editor within the "{{ns:Category}}" namespace', 
    2121'tog-riched_disable_ns_category_talk' => 'Disable rich editor within the "{{ns:Category_talk}}" namespace', 
     22'rich_editor_new_window' => 'Open Rich editor in new window', 
     23'tog-riched_start_disabled' => 'Start with rich editor disabled', 
     24'tog-riched_use_popup' => 'Open rich editor in a popup', 
     25'tog-riched_use_toggle' => 'Use toggle to switch between wikitext and rich editor (replace textarea with rich editor)', 
     26'tog-riched_toggle_remember_state' => 'Remember last toggle state', 
    2227); 
  • MediaWiki/trunk/FCKeditor.i18n.pl.php

    r1833 r2388  
    33$messages = array( 
    44'textrichditor' => 'Rich Editor', 
     5'rich_editor_new_window' => 'Otwórz rich editor w nowym oknie', 
    56'tog-riched_disable' => 'Wyłącz Rich Editora', 
    67'tog-riched_disable_ns_main' => 'Wyłącz Rich Editora wewątrz głównej przestrzeni nazw', 
     
    2021'tog-riched_disable_ns_category' => 'Wyłącz Rich Editora wewątrz przestrzeni nazw "{{ns:Category}}"', 
    2122'tog-riched_disable_ns_category_talk' => 'Wyłącz Rich Editora wewątrz przestrzeni nazw "{{ns:Category_talk}}"', 
     23'tog-riched_start_disabled' => 'Rich editor domyślnie wyłączony', 
     24'tog-riched_use_popup' => 'Pozwól otwierać Rich Editor w okienku popup', 
     25'tog-riched_use_toggle' => 'Pozwól otwierać Rich Editor na żądanie (zastąpi domyślne pole textarea)', 
     26'tog-riched_toggle_remember_state' => 'Zapamiętuj ostatni stan Rich Editora', 
    2227); 
  • MediaWiki/trunk/FCKeditorParser.body.php

    r2077 r2388  
    154154         */ 
    155155        function strip( $text, $state, $stripcomments = false , $dontstrip = array () ) { 
    156                 global $wgContLang; 
     156                global $wgContLang, $wgUseTeX, $wgScriptPath; 
    157157 
    158158                wfProfileIn( __METHOD__ ); 
     
    165165 
    166166                $elements = array_merge( 
    167                 array( 'nowiki', 'gallery' ), 
     167                array( 'nowiki', 'gallery', 'math' ), 
    168168                array_keys( $this->mTagHooks ) ); 
    169169                global $wgRawHtml; 
    170170                if( $wgRawHtml ) { 
    171171                        $elements[] = 'html'; 
    172                 } 
    173                 if( $this->mOptions->getUseTeX() ) { 
    174                         $elements[] = 'math'; 
    175172                } 
    176173 
     
    210207                                                break; 
    211208                                        case 'math': 
    212                                                 $output = $wgContLang->armourMath( MathRenderer::renderMath( $content ) ); 
     209                                                if($wgUseTeX){          //normal render 
     210                                                        $output = $wgContLang->armourMath( MathRenderer::renderMath( $content ) ); 
     211                                                }else                           //show fakeimage 
     212                                                        $output = '<img _fckfakelement="true" class="FCK__MWMath" _fck_mw_math="'.$content.'" src="'.$wgScriptPath.'/skins/common/images/button_math.png" />'; 
    213213                                                break; 
    214214                                        case 'gallery':