Ticket #1837: 1837_5.patch
File 1837_5.patch, 4.2 KB (added by , 16 years ago) |
---|
-
FCKeditor.body.php
283 283 global $wgFCKEditorExtDir, $wgFCKEditorDir, $wgFCKEditorHeight, $wgUser; 284 284 global $wgStylePath, $wgStyleVersion, $wgDefaultSkin, $wgExtensionFunctions; 285 285 global $wgFCKWikiTextBeforeParse; 286 global $wgHooks; 286 287 287 288 if (!isset($this->showFCKEditor)) 288 289 { … … 361 362 if (!empty($userStyles)) { 362 363 $script .= 'sEditorAreaCSS += ",'.implode(',', $userStyles).'";'; 363 364 } 365 366 $showRef = false; 367 if (isset ($wgHooks['ParserFirstCallInit']) && (in_array('wfCite',$wgHooks['ParserFirstCallInit']) )){ 368 $showRef = true; 369 }else if (isset ($wgExtensionFunctions) && (in_array('wfCite',$wgExtensionFunctions) )){ 370 $showRef = true; 371 } 372 364 373 $script .= ' 365 374 var showFCKEditor = '. $this->showFCKEditor .'; 366 375 var popup = false; //pointer to popup document … … 382 391 oFCKeditor.Config["EditorAreaCSS"] = "'.$wgScriptPath.'/'.$wgFCKEditorExtDir.'/css/fckeditor.css" ; 383 392 oFCKeditor.ToolbarSet = "'. $wgFCKEditorToolbarSet .'" ; 384 393 oFCKeditor.ready = true; 394 oFCKeditor.Config["showreferences"] = '.(($showRef)?'true':'false').'; 385 395 '; 386 396 $script .= '</script>'; 387 397 -
fckeditor_config.js
12 12 ['Cut','Copy','Paste',/*'PasteText','PasteWord',*/'-','Print'], 13 13 ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], 14 14 ['SpecialChar','Table','Image','Rule'], 15 ['MW_Template','MW_Special','MW_Ref','MW_ Math'],15 ['MW_Template','MW_Special','MW_Ref','MW_References','MW_Math'], 16 16 '/', 17 17 ['FontFormat'], 18 18 ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], -
plugins/mediawiki/fckplugin.js
36 36 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_template.gif' ; 37 37 FCKToolbarItems.RegisterItem( 'MW_Template', tbButton ) ; 38 38 39 tbButton = new FCKToolbarButton( 'MW_Ref', 'Reference', FCKLang.wikiBtnReference || 'Insert/Edit Reference' ) ; 39 //Ref button 40 tbButton = new FCKToolbarButton( 'MW_Ref', 'Ref', FCKLang.wikiBtnReference || 'Insert/Edit Reference',FCK_TOOLBARITEM_ICONTEXT ) ; 40 41 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_ref.gif' ; 42 if ( !FCKConfig.showreferences ) { //hack to disable MW_Ref button 43 tbButton.Create = function() {return 0;} 44 tbButton.Disable = function() {return 0;} 45 } 41 46 FCKToolbarItems.RegisterItem( 'MW_Ref', tbButton ) ; 42 47 48 49 //References button 50 var FCKReferences = function( ) { } ; 51 FCKReferences.prototype.GetState = function() { return ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED) } ; 52 FCKCommands.RegisterCommand( 'MW_References', new FCKReferences() ) ; 53 tbButton = new FCKToolbarButton( 'MW_References', 'References', 'Insert <references /> tag', FCK_TOOLBARITEM_ICONTEXT,true, true, 1 ); 54 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_ref.gif' ; 55 if ( !FCKConfig.showreferences ) { //hack to disable MW_References button 56 tbButton.Create = function() {return 0;} 57 tbButton.Disable = function() {return 0;} 58 } 59 60 FCKReferences.prototype.Execute = function() 61 { 62 if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ) 63 return ; 64 65 FCKUndo.SaveUndoStep() ; 66 67 var e = FCK.EditorDocument.createElement( 'span' ) ; 68 e.setAttribute("_fck_mw_customtag", "true"); 69 e.setAttribute("_fck_mw_tagname", "references"); 70 e.className = "fck_mw_references"; 71 72 oFakeImage = FCK.InsertElement( FCKDocumentProcessor_CreateFakeImage( 'FCK__MWReferences', e ) ) ; 73 } 74 FCKToolbarItems.RegisterItem( 'MW_References', tbButton ) ; 75 76 43 77 tbButton = new FCKToolbarButton( 'MW_Math', 'Formula', FCKLang.wikiBtnFormula || 'Insert/Edit Formula' ) ; 44 78 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_math.gif' ; 45 79 FCKToolbarItems.RegisterItem( 'MW_Math', tbButton ) ;