Ticket #1385: 1385.patch
File 1385.patch, 2.8 KB (added by , 16 years ago) |
---|
-
FCKeditor.body.php
110 110 111 111 public function onCustomEditor(&$article, &$user) 112 112 { 113 global $wgRequest, $mediaWiki ;113 global $wgRequest, $mediaWiki, $fckPageEditor; 114 114 115 115 $action = $mediaWiki->getVal('Action'); 116 116 … … 121 121 if( !$mediaWiki->getVal( 'UseExternalEditor' ) || $action=='submit' || $internal || 122 122 $section || $oldid || ( !$user->getOption( 'externaleditor' ) && !$external ) ) { 123 123 $editor = new FCKeditorEditPage( $article ); 124 global $fckPageEditor; 125 $fckPageEditor = $editor; 124 126 $editor->submit(); 125 127 } elseif( $mediaWiki->getVal( 'UseExternalEditor' ) && ( $external || $user->getOption( 'externaleditor' ) ) ) { 126 128 $mode = $wgRequest->getVal( 'mode' ); … … 315 317 } 316 318 addOnloadHook( onLoadFCKeditor ) ; 317 319 318 /* 320 319 321 function showSource() { 320 322 var wp = document.getElementById("wpDiff"); 321 323 var s = document.createElement("input"); … … 345 347 } 346 348 347 349 addOnloadHook(showSource); 348 */ 350 349 351 </script> 350 352 HEREDOC; 351 353 -
FCKeditorEditPage.body.php
7 7 * 8 8 * @return bool 9 9 */ 10 11 public function FCKeditorEditPage( $article ){ 12 parent::EditPage( $article ); 13 } 14 10 15 public function previewOnOpen() { 11 16 global $wgRequest, $wgUser; 12 17 if( $wgRequest->getVal( 'preview' ) == 'yes' ) { … … 40 45 } 41 46 return $result; 42 47 } 48 function getContent( $def_text = '' ) { 49 $t = parent::getContent( $def_text ); 50 if(!$this->isConflict) return $t; 51 $options = new FCKeditorParserOptions(); 52 $options->setTidy(true); 53 $parser = new FCKeditorParser(); 54 $parser->setOutputType(OT_HTML); 55 $pa = $parser->parse($t, $this->mTitle, $options); 56 return $pa->mText; 57 58 } 59 function getWikiContent(){ 60 return $this->mArticle->getContent(); 61 } 43 62 } 63 No newline at end of file -
FCKeditor.php
84 84 $oFCKeditorExtension = new FCKeditor_MediaWiki(); 85 85 $oFCKeditorExtension->registerHooks(); 86 86 87 function stripComments($txt){ 88 return ereg_replace("<!--.*-->", "", $txt); 89 } 90 function editConflictFix($pageEditor){ 91 global $fckPageEditor,$wgRequest; 92 $fckPageEditor->textbox2 = stripComments($wgRequest->getVal( 'wpTextbox1' )); 93 $fckPageEditor->textbox1 = stripComments($fckPageEditor->getWikiContent()); 94 return true; 95 } 96 global $wgHooks; 87 97 98 $wgHooks['EditPageBeforeConflictDiff'][] = 'editConflictFix'; 88 99 89 100 90 101 91 102 92 103 93 104 105 106