Changeset 586

Show
Ignore:
Timestamp:
2007-07-28 00:50:41 (18 months ago)
Author:
fredck
Message:

Added context menu support for formulas.

Location:
MediaWiki/trunk/extensions/FCKeditor
Files:
3 modified

Legend:

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

    r581 r586  
    103103        if ($wgUseTeX) { 
    104104            //it may add much overload on page with huge amount of math content... 
    105             $text = preg_replace('/<img class="tex" alt="([^"]*)"/m', '<img alt="$1" _fck_mw_math="$1"', $text); 
    106             $text = preg_replace("/<img class='tex' src=\"([^\"]*)\" alt=\"([^\"]*)\"/m", '<img src="$1" alt="$2" _fck_mw_math="$2"', $text); 
     105                        $text = preg_replace('/<img class="tex" alt="([^"]*)"/m', '<img _fckfakelement="true" _fck_mw_math="$1"', $text); 
     106                        $text = preg_replace("/<img class='tex' src=\"([^\"]*)\" alt=\"([^\"]*)\"/m", '<img src="$1" _fckfakelement="true" _fck_mw_math="$2"', $text); 
    107107        } 
    108108         
  • MediaWiki/trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/math.html

    r585 r586  
    9898         
    9999        SetAttribute( oMathImage, "_fck_mw_math", GetE('xTemplateRaw').value.Trim() ) ; 
     100        SetAttribute( oMathImage, "_fckfakelement", 'true' ) ; 
    100101 
    101102        oMathImage.src = response.responseText ; 
  • MediaWiki/trunk/extensions/FCKeditor/plugins/mediawiki/fckplugin.js

    r585 r586  
    134134                                // Here we found an element that is not the real element, but a 
    135135                                // fake one (like the Flash placeholder image), so we must get the real one. 
    136                                 if ( htmlNode.getAttribute('_fckfakelement') ) 
     136                                if ( htmlNode.getAttribute('_fckfakelement') && !htmlNode.getAttribute( '_fck_mw_math' ) ) 
    137137                                        return this._AppendNode( FCK.GetRealElement( htmlNode ), stringBuilder ) ; 
    138138 
     
    574574                                contextMenu.AddItem( 'MW_Ref', 'Reference Properties' ) ; 
    575575                        } 
     576                        if ( tag.getAttribute( '_fck_mw_math' ) ) 
     577                        { 
     578                                contextMenu.AddSeparator() ; 
     579                                contextMenu.AddItem( 'MW_Math', 'Edit Formula' ) ; 
     580                        } 
    576581                } 
    577582        }