Changeset 1834 for MediaWiki/trunk
- Timestamp:
- 2008-03-28 16:56:36 (5 months ago)
- Location:
- MediaWiki/trunk
- Files:
-
- 6 modified
-
fckeditor_config.js (modified) (2 diffs)
-
FCKeditorParser.body.php (modified) (3 diffs)
-
FCKeditor.php (modified) (1 diff)
-
FCKeditorSajax.body.php (modified) (1 diff)
-
mw12/FCKeditorParser_OldPP.body.php (modified) (3 diffs)
-
plugins/mediawiki/fckplugin.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
MediaWiki/trunk/fckeditor_config.js
r1660 r1834 13 13 ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], 14 14 ['SpecialChar','Table','Image','Rule'], 15 ['MW_Template','MW_ Ref','MW_Math'],15 ['MW_Template','MW_Special','MW_Ref','MW_Math'], 16 16 '/', 17 17 ['FontFormat'], … … 37 37 38 38 FCKConfig.EditorAreaStyles = '\ 39 .FCK__MWTemplate \39 .FCK__MWTemplate, .FCK__MWRef, .FCK__MWSpecial, .FCK__MWReferences, .FCK__MWNowiki, .FCK__MWIncludeonly, .FCK__MWNoinclude, .FCK__MWOnlyinclude \ 40 40 { \ 41 41 border: 1px dotted #00F; \ 42 42 background-position: center center; \ 43 background-repeat: no-repeat; \ 44 vertical-align: middle; \ 45 } \ 46 .FCK__MWTemplate, \ 47 { \ 43 48 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_template.gif); \ 44 background-repeat: no-repeat; \45 49 width: 20px; \ 46 50 height: 15px; \ 47 vertical-align: middle; \48 51 } \ 49 52 .FCK__MWRef \ 50 53 { \ 51 border: 1px dotted #00F; \52 background-position: center center; \53 54 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_ref.gif); \ 54 background-repeat: no-repeat; \55 55 width: 18px; \ 56 56 height: 15px; \ 57 vertical-align: middle; \ 57 } \ 58 .FCK__MWSpecial \ 59 { \ 60 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_special.gif); \ 61 width: 66px; \ 62 height: 15px; \ 63 } \ 64 .FCK__MWNowiki \ 65 { \ 66 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_nowiki.gif); \ 67 width: 66px; \ 68 height: 15px; \ 69 } \ 70 .FCK__MWIncludeonly \ 71 { \ 72 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_includeonly.gif); \ 73 width: 66px; \ 74 height: 15px; \ 75 } \ 76 .FCK__MWNoinclude \ 77 { \ 78 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_noinclude.gif); \ 79 width: 66px; \ 80 height: 15px; \ 81 } \ 82 .FCK__MWOnlyinclude \ 83 { \ 84 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_onlyinclude.gif); \ 85 width: 66px; \ 86 height: 15px; \ 58 87 } \ 59 88 .FCK__MWReferences \ 60 89 { \ 61 border: 1px dotted #00F; \62 background-position: center center; \63 90 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_references.gif); \ 64 background-repeat: no-repeat; \65 91 width: 66px; \ 66 92 height: 15px; \ 67 vertical-align: middle; \68 93 } \ 69 94 ' ; -
MediaWiki/trunk/FCKeditorParser.body.php
r1829 r1834 47 47 $key = 'Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw'; 48 48 $this->fck_mw_strtr_span_counter++; 49 $this->fck_mw_strtr_span[$key] = $text;49 $this->fck_mw_strtr_span[$key] = str_replace(array("\r\n", "\n", "\r"),"fckLR",$text); 50 50 return $key; 51 51 } … … 59 59 */ 60 60 function fck_genericTagHook( $str, $argv, $parser ) { 61 if (in_array($this->fck_mw_taghook, array("ref", "math", "references"))) { 62 $class = $this->fck_mw_taghook; 63 } 64 else { 65 $class = "special"; 66 } 67 61 68 if (empty($argv)) { 62 $ret = "<span class=\"fck_mw_".$ this->fck_mw_taghook."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">";69 $ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">"; 63 70 } 64 71 else { 65 $ret = "<span class=\"fck_mw_".$ this->fck_mw_taghook."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\"";72 $ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\""; 66 73 foreach ($argv as $key=>$value) { 67 74 $ret .= " ".$key."=\"".$value."\""; … … 91 98 function fck_wikiTag( $tagName, $str, $argv = array()) { 92 99 if (empty($argv)) { 93 $ret = "<span class=\"fck_mw_".$tagName."\" >";100 $ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">"; 94 101 } 95 102 else { 96 $ret = "<span class=\"fck_mw_".$tagName."\" ";103 $ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">"; 97 104 foreach ($argv as $key=>$value) { 98 105 $ret .= " ".$key."=\"".$value."\""; -
MediaWiki/trunk/FCKeditor.php
r1829 r1834 69 69 $wgAjaxExportList[] = 'wfSajaxGetMathUrl'; 70 70 $wgAjaxExportList[] = 'wfSajaxSearchTemplateFCKeditor'; 71 $wgAjaxExportList[] = 'wfSajaxSearchSpecialTagFCKeditor'; 71 72 72 73 $wgExtensionCredits['other'][] = array( -
MediaWiki/trunk/FCKeditorSajax.body.php
r1829 r1834 37 37 38 38 return $url; 39 } 40 41 function wfSajaxSearchSpecialTagFCKeditor($empty) 42 { 43 global $wgParser; 44 45 $ret = "nowiki\nincludeonly\nonlyinclude\nnoinclude\n"; 46 foreach ($wgParser->getTags() as $h) { 47 if (!in_array($h, array("pre", "math", "ref", "references"))) { 48 $ret .= $h ."\n"; 49 } 50 } 51 return $ret; 39 52 } 40 53 -
MediaWiki/trunk/mw12/FCKeditorParser_OldPP.body.php
r1829 r1834 47 47 $key = 'Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw'; 48 48 $this->fck_mw_strtr_span_counter++; 49 $this->fck_mw_strtr_span[$key] = $text;49 $this->fck_mw_strtr_span[$key] = str_replace(array("\r\n", "\n", "\r"),"fckLR",$text); 50 50 return $key; 51 51 } … … 59 59 */ 60 60 function fck_genericTagHook( $str, $argv, $parser ) { 61 if (in_array($this->fck_mw_taghook, array("ref", "math", "references"))) { 62 $class = $this->fck_mw_taghook; 63 } 64 else { 65 $class = "special"; 66 } 67 61 68 if (empty($argv)) { 62 $ret = "<span class=\"fck_mw_".$ this->fck_mw_taghook."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">";69 $ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">"; 63 70 } 64 71 else { 65 $ret = "<span class=\"fck_mw_".$ this->fck_mw_taghook."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\"";72 $ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\""; 66 73 foreach ($argv as $key=>$value) { 67 74 $ret .= " ".$key."=\"".$value."\""; … … 91 98 function fck_wikiTag( $tagName, $str, $argv = array()) { 92 99 if (empty($argv)) { 93 $ret = "<span class=\"fck_mw_".$tagName."\" >";100 $ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">"; 94 101 } 95 102 else { 96 $ret = "<span class=\"fck_mw_".$tagName."\" ";103 $ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">"; 97 104 foreach ($argv as $key=>$value) { 98 105 $ret .= " ".$key."=\"".$value."\""; -
MediaWiki/trunk/plugins/mediawiki/fckplugin.js
r1832 r1834 45 45 FCKToolbarItems.RegisterItem( 'MW_Math', tbButton ) ; 46 46 47 tbButton = new FCKToolbarButton( 'MW_Special', 'Special Tag', 'Insert/Edit Special Tag' ) ; 48 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_special.gif' ; 49 FCKToolbarItems.RegisterItem( 'MW_Special', tbButton ) ; 50 47 51 // Override some dialogs. 48 52 FCKCommands.RegisterCommand( 'MW_Template', new FCKDialogCommand( 'MW_Template', 'Template Properties', FCKConfig.PluginsPath + 'mediawiki/dialogs/template.html', 400, 330 ) ) ; 49 53 FCKCommands.RegisterCommand( 'MW_Ref', new FCKDialogCommand( 'MW_Ref', 'Reference Properties', FCKConfig.PluginsPath + 'mediawiki/dialogs/ref.html', 400, 250 ) ) ; 50 54 FCKCommands.RegisterCommand( 'MW_Math', new FCKDialogCommand( 'MW_Math', 'Formula', FCKConfig.PluginsPath + 'mediawiki/dialogs/math.html', 400, 300 ) ) ; 55 FCKCommands.RegisterCommand( 'MW_Special', new FCKDialogCommand( 'MW_Special', 'Special Tag Properties', FCKConfig.PluginsPath + 'mediawiki/dialogs/special.html', 400, 330 ) ) ; //YC 51 56 FCKCommands.RegisterCommand( 'Link', new FCKDialogCommand( 'Link', FCKLang.DlgLnkWindowTitle, FCKConfig.PluginsPath + 'mediawiki/dialogs/link.html', 400, 250 ) ) ; 52 57 FCKCommands.RegisterCommand( 'Image', new FCKDialogCommand( 'Image', FCKLang.DlgImgTitle, FCKConfig.PluginsPath + 'mediawiki/dialogs/image.html', 450, 300 ) ) ; 58 53 59 54 60 // MediaWiki Wikitext Data Processor implementation. … … 452 458 case 'fck_mw_onlyinclude' : 453 459 sNodeName = 'onlyinclude' ; 460 454 461 break ; 455 462 } … … 517 524 var parentIsSpecialTag = htmlNode.parentNode.getAttribute( '_fck_mw_customtag' ) ; 518 525 var textValue = htmlNode.nodeValue; 519 526 520 527 if ( !parentIsSpecialTag ) 521 528 { 522 529 textValue = textValue.replace( /[\n\t]/g, ' ' ) ; 530 523 531 textValue = FCKTools.HTMLEncode( textValue ) ; 524 532 textValue = textValue.replace( /\u00A0/g, ' ' ) ; … … 537 545 if ( this._inLSpace && textValue.length == 1 && textValue.charCodeAt(0) == 13 ) 538 546 textValue = textValue + " " ; 539 540 547 if ( this._IsInsideCell ) 541 548 textValue = textValue.replace( /\|/g, '|' ) ; 542 543 549 } 544 550 else 545 { 546 textValue = FCKTools.HTMLDecode( textValue );551 { 552 textValue = FCKTools.HTMLDecode(textValue).replace(/fckLR/g,'\r\n'); 547 553 } 548 554 549 555 stringBuilder.push( textValue ) ; 550 556 return ; … … 676 682 className = 'FCK__MWReferences' ; 677 683 case 'fck_mw_template' : 684 if ( className == null ) //YC 685 className = 'FCK__MWTemplate' ; //YC 678 686 case 'fck_mw_magic' : 679 687 if ( className == null ) 680 className = 'FCK__MWTemplate' ; 681 688 className = 'FCK__MWMagicWord' ; 689 case 'fck_mw_magic' : 690 if ( className == null ) 691 className = 'FCK__MWMagicWord' ; 692 case 'fck_mw_special' : //YC 693 if ( className == null ) 694 className = 'FCK__MWSpecial' ; 695 case 'fck_mw_nowiki' : 696 if ( className == null ) 697 //className = 'FCK__MWSpecial' ; 698 className = 'FCK__MWNowiki' ; 699 case 'fck_mw_includeonly' : 700 if ( className == null ) 701 //className = 'FCK__MWSpecial' ; 702 className = 'FCK__MWIncludeonly' ; 703 case 'fck_mw_noinclude' : 704 if ( className == null ) 705 //className = 'FCK__MWSpecial' ; 706 className = 'FCK__MWNoinclude' ; 707 case 'fck_mw_onlyinclude' : 708 if ( className == null ) 709 //className = 'FCK__MWSpecial' ; 710 className = 'FCK__MWOnlyinclude' ; 711 682 712 var oImg = FCKDocumentProcessor_CreateFakeImage( className, eSpan.cloneNode(true) ) ; 683 713 oImg.setAttribute( '_' + eSpan.className, 'true', 0 ) ; … … 716 746 contextMenu.AddItem( 'MW_Math', 'Edit Formula' ) ; 717 747 } 748 if ( tag.getAttribute( '_fck_mw_special' ) || tag.getAttribute( '_fck_mw_nowiki' ) || tag.getAttribute( '_fck_mw_includeonly' ) || tag.getAttribute( '_fck_mw_noinclude' ) || tag.getAttribute( '_fck_mw_onlyinclude' )) //YC 749 { 750 contextMenu.AddSeparator() ; 751 contextMenu.AddItem( 'MW_Special', 'Special Tag Properties' ) ; 752 } 718 753 } 719 754 }