Ticket #1837: 1837_2.patch
File 1837_2.patch, 4.1 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', 'Ref erence', 'Insert/Edit Reference') ;39 tbButton = new FCKToolbarButton( 'MW_Ref', 'Ref', 'Insert/Edit Reference', FCK_TOOLBARITEM_ICONTEXT ) ; 40 40 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_ref.gif' ; 41 if ( !FCKConfig.showreferences ) { //hack to disable MW_Ref button 42 tbButton.Create = function() {return 0;} 43 tbButton.Disable = function() {return 0;} 44 } 41 45 FCKToolbarItems.RegisterItem( 'MW_Ref', tbButton ) ; 42 46 47 var FCKReferences = function( ) this.EditMode = FCK.EditMode ; 48 FCKReferences.prototype.GetState = function() ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ) ; 49 50 FCKCommands.RegisterCommand( 'MW_References', new FCKReferences() ) ; 51 tbButton = new FCKToolbarButton( 'MW_References', 'References', 'Insert <references /> tag', FCK_TOOLBARITEM_ICONTEXT, true, true ) ; 52 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_ref.gif' ; 53 if ( !FCKConfig.showreferences ) { //hack to disable MW_References button 54 tbButton.Create = function() {return 0;} 55 tbButton.Disable = function() {return 0;} 56 } 57 FCKToolbarItems.RegisterItem( 'MW_References', tbButton ) ; 58 59 FCKReferences.prototype.Execute = function() 60 { 61 if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG ) 62 return ; 63 64 FCKUndo.SaveUndoStep() ; 65 66 var e = FCK.EditorDocument.createElement( 'span' ) ; 67 e.setAttribute("_fck_mw_customtag", "true"); 68 e.setAttribute("_fck_mw_tagname", "references"); 69 e.className = "fck_mw_references"; 70 71 oFakeImage = FCK.InsertElement( FCKDocumentProcessor_CreateFakeImage( 'FCK__MWReferences', e ) ) ; 72 } 73 43 74 tbButton = new FCKToolbarButton( 'MW_Math', 'Formula', 'Insert/Edit Formula' ) ; 44 75 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_math.gif' ; 45 76 FCKToolbarItems.RegisterItem( 'MW_Math', tbButton ) ;