r50666 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50665‎ | r50666 | r50667 >
Date:19:08, 16 May 2009
Author:ashley
Status:deferred
Tags:
Comment:
updating FCKeditor to r3468 of http://svn.fckeditor.net/MediaWiki/trunk to begin working on it
Modified paths:
  • /trunk/extensions/FCKeditor/FCKeditor.body.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.en.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.es.php (added) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.fa.php (added) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.fr.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.gl.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.he.php (added) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.ko.php (added) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.pl.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.sv.php (added) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.i18n.zh-tw.php (added) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditor.popup.html (added) (history)
  • /trunk/extensions/FCKeditor/FCKeditorEditPage.body.php (added) (history)
  • /trunk/extensions/FCKeditor/FCKeditorParser.body.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditorParserOptions.body.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditorSajax.body.php (modified) (history)
  • /trunk/extensions/FCKeditor/FCKeditorSkin.body.php (modified) (history)
  • /trunk/extensions/FCKeditor/css/fckeditor-rtl.css (added) (history)
  • /trunk/extensions/FCKeditor/fckeditor (modified) (history)
  • /trunk/extensions/FCKeditor/fckeditor_config.js (modified) (history)
  • /trunk/extensions/FCKeditor/mw11 (added) (history)
  • /trunk/extensions/FCKeditor/mw11/FCKeditorParserWrapper.body.php (added) (history)
  • /trunk/extensions/FCKeditor/mw12/FCKeditorParserWrapper.body.php (added) (history)
  • /trunk/extensions/FCKeditor/mw12/FCKeditorParser_OldPP.body.php (deleted) (history)
  • /trunk/extensions/FCKeditor/mw14 (added) (history)
  • /trunk/extensions/FCKeditor/mw14/Parser_OldPP.body.php (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki (modified) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/category.html (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/image.html (modified) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/link.html (modified) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/math.html (modified) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/ref.html (modified) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/source.html (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/special.html (modified) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/template.html (modified) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/fckplugin.js (modified) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/images/icon_html.gif (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/images/icon_math.gif (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/images/icon_signature.gif (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/images/icon_source.gif (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/images/tb_icon_category.gif (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/images/tb_icon_source.gif (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/images/tb_signature.gif (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/lang (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/lang/en.js (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/lang/he.js (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/lang/ko.js (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/lang/pl.js (added) (history)
  • /trunk/extensions/FCKeditor/plugins/mediawiki/lang/sv.js (added) (history)

Diff [purge]

Index: trunk/extensions/FCKeditor/FCKeditor.popup.html
@@ -0,0 +1,99 @@
 2+<html xmlns="http://www.w3.org/1999/xhtml">
 3+<head>
 4+ <title>FCKeditor</title>
 5+ <script type="text/javascript">
 6+// #### URLParams: holds all URL passed parameters (like ?Param1=Value1&Param2=Value2)
 7+var FCKURLParams = new Object() ;
 8+
 9+var aParams = document.location.search.substr(1).split('&') ;
 10+for ( var i = 0 ; i < aParams.length ; i++ )
 11+{
 12+ var aParam = aParams[i].split('=') ;
 13+ var sParamName = aParam[0] ;
 14+ var sParamValue = aParam[1] ;
 15+
 16+ FCKURLParams[ sParamName ] = sParamValue ;
 17+}
 18+
 19+// It is preferable to have the oFCKeditor object defined in the opener window,
 20+// so all the configurations will be there. In this way the popup doesn't need
 21+// to take care of the configurations "clonning".
 22+var popup = window.opener;
 23+var oFCKeditor = window.opener[ FCKURLParams[ 'var' ] ] ;
 24+oFCKeditor.Width = '100%' ;
 25+oFCKeditor.Height = '100%' ;
 26+oFCKeditor.Value = popup.document.getElementById( FCKURLParams[ 'el' ] ).value ;
 27+
 28+function Ok()
 29+{
 30+ var oEditor = FCKeditorAPI.GetInstance( oFCKeditor.InstanceName ) ;
 31+ if ( oEditor.IsDirty() )
 32+ {
 33+ if ((window.opener.firstLoad == false) && (popup.FCKeditorAPI)) { //already loaded
 34+ var parentOEditor = popup.FCKeditorAPI.GetInstance(FCKURLParams[ 'el' ]);
 35+ var parentIsWysiwyg = ( parentOEditor.EditMode == FCK_EDITMODE_WYSIWYG ) ;
 36+ var IsWysiwyg = ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG ) ;
 37+ if ( !IsWysiwyg && parentIsWysiwyg ) //copy from PLAIN (popup) to WYSIWIG (parent)
 38+ {
 39+ parentOEditor.SwitchEditMode(); //switch to plain
 40+ var text = oEditor.GetData(parentOEditor.Config.FormatSource);
 41+ parentOEditor.SetHTML( text );
 42+ }
 43+ else if ( parentIsWysiwyg )
 44+ {
 45+ var text = oEditor.EditorDocument.documentElement.innerHTML;
 46+ parentOEditor.EditingArea.Start( text );
 47+ }
 48+ else
 49+ {
 50+ var text = oEditor.GetData(parentOEditor.Config.FormatSource);
 51+ parentOEditor.SetHTML( text );
 52+ }
 53+ }
 54+ window.opener.document.getElementById( FCKURLParams[ 'el' ] ).value = oEditor.GetData( true ) ; // "true" means you want it formatted.
 55+ }
 56+ window.opener.focus() ;
 57+ window.close() ;
 58+ return true;
 59+}
 60+
 61+function Cancel()
 62+{
 63+ var oEditor = FCKeditorAPI.GetInstance( oFCKeditor.InstanceName ) ;
 64+ if ( oEditor.IsDirty() )
 65+ {
 66+ if ( !confirm( 'Are you sure you want to cancel? Your changes will be lost.' ) )
 67+ return ;
 68+ }
 69+
 70+ window.close() ;
 71+ return true;
 72+}
 73+
 74+ </script>
 75+</head>
 76+<body style="margin:0px 0px 10px;">
 77+ <table width="100%" cellspacing=0 cellpadding=0 height="100%">
 78+ <tr>
 79+ <td height="100%">
 80+ <div id="FCKdiv" style='width:100%;height:100%'></div>
 81+ <script type="text/javascript">
 82+document.write( '<input type="hidden" id="' + oFCKeditor.InstanceName + '" name="' + oFCKeditor.InstanceName + '" value="' + oFCKeditor._HTMLEncode( 'nic' ) + '" style="width:100%;display:none" />' ) ;
 83+
 84+popup.window.parent.FCK_sajax('wfSajaxWikiToHTML', [oFCKeditor.Value], function ( result ){
 85+ var FCKinput = document.getElementById( oFCKeditor.InstanceName );
 86+ FCKinput.value = (result.responseText);
 87+ document.getElementById( 'FCKdiv' ).innerHTML = oFCKeditor._GetConfigHtml() + oFCKeditor._GetIFrameHtml();
 88+});
 89+ </script>
 90+ </td>
 91+ </tr>
 92+ <tr valign="middle" height="40">
 93+ <td align="center" >
 94+ <input type="button" value="Ok" onclick="Ok();" style="width:120px" />
 95+ <input type="button" value="Cancel" onclick="Cancel();" />
 96+ </td>
 97+ </tr>
 98+ </table>
 99+</body>
 100+</html>
Index: trunk/extensions/FCKeditor/plugins/mediawiki/fckplugin.js
@@ -32,36 +32,157 @@
3333 FCKToolbarItems.RegisterItem( 'Source', new FCKToolbarButton( 'Source', 'Wikitext', null, FCK_TOOLBARITEM_ICONTEXT, true, true, 1 ) ) ;
3434
3535 // Register our toolbar buttons.
36 -var tbButton = new FCKToolbarButton( 'MW_Template', 'Template', 'Insert/Edit Template' ) ;
 36+var tbButton = new FCKToolbarButton( 'MW_Template', 'Template', FCKLang.wikiBtnTemplate || 'Insert/Edit Template') ;
3737 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_template.gif' ;
3838 FCKToolbarItems.RegisterItem( 'MW_Template', tbButton ) ;
3939
40 -tbButton = new FCKToolbarButton( 'MW_Ref', 'Reference', 'Insert/Edit Reference' ) ;
 40+//Ref button
 41+tbButton = new FCKToolbarButton( 'MW_Ref', 'Ref', FCKLang.wikiBtnReference || 'Insert/Edit Reference' ) ;
4142 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_ref.gif' ;
4243 FCKToolbarItems.RegisterItem( 'MW_Ref', tbButton ) ;
 44+if ( !FCKConfig.showreferences ) { //hack to disable MW_Ref button
 45+ tbButton.Create = function() {return 0;}
 46+ tbButton.Disable = function() {return 0;}
 47+ tbButton.RefreshState = function() {return 0;}
 48+}
4349
44 -tbButton = new FCKToolbarButton( 'MW_Math', 'Formula', 'Insert/Edit Formula' ) ;
 50+//References button
 51+var FCKReferences = function( ) { } ;
 52+FCKReferences.prototype.GetState = function() { return ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED) } ;
 53+FCKCommands.RegisterCommand( 'MW_References', new FCKReferences() ) ;
 54+tbButton = new FCKToolbarButton( 'MW_References', 'References', FCKLang.wikiBtnReferences || 'Insert <references /> tag', FCK_TOOLBARITEM_ICONTEXT,true, true, 1 );
 55+tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_ref.gif' ;
 56+if ( !FCKConfig.showreferences ) { //hack to disable MW_References button
 57+ tbButton.Create = function() {return 0;}
 58+ tbButton.Disable = function() {return 0;}
 59+ tbButton.RefreshState = function() {return 0;}
 60+}
 61+
 62+FCKReferences.prototype.Execute = function()
 63+{
 64+ if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
 65+ return ;
 66+
 67+ FCKUndo.SaveUndoStep() ;
 68+
 69+ var e = FCK.EditorDocument.createElement( 'span' ) ;
 70+ e.setAttribute("_fck_mw_customtag", "true");
 71+ e.setAttribute("_fck_mw_tagname", "references");
 72+ e.className = "fck_mw_references";
 73+
 74+ oFakeImage = FCK.InsertElement( FCKDocumentProcessor_CreateFakeImage( 'FCK__MWReferences', e ) ) ;
 75+}
 76+FCKToolbarItems.RegisterItem( 'MW_References', tbButton ) ;
 77+
 78+//Signature button
 79+var FCKSignature = function( ) {} ;
 80+FCKSignature.prototype.GetState = function() { return ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED) } ;
 81+FCKCommands.RegisterCommand( 'MW_Signature', new FCKSignature() ) ;
 82+tbButton = new FCKToolbarButton( 'MW_Signature', 'Signature', FCKLang.wikiBtnSignature || 'Insert signature', FCK_TOOLBARITEM_ONLYICON,true, true, 1 );
 83+tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_signature.gif' ;
 84+
 85+FCKSignature.prototype.Execute = function()
 86+{
 87+ if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
 88+ return ;
 89+
 90+ FCKUndo.SaveUndoStep() ;
 91+ var e = FCK.EditorDocument.createElement( 'span' ) ;
 92+ e.className = "fck_mw_signature";
 93+
 94+ oFakeImage = FCK.InsertElement( FCKDocumentProcessor_CreateFakeImage( 'FCK__MWSignature', e ) ) ;
 95+}
 96+FCKToolbarItems.RegisterItem( 'MW_Signature', tbButton ) ;
 97+
 98+tbButton = new FCKToolbarButton( 'MW_Math', 'Formula', FCKLang.wikiBtnFormula || 'Insert/Edit Formula' ) ;
4599 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_math.gif' ;
46100 FCKToolbarItems.RegisterItem( 'MW_Math', tbButton ) ;
47101
48 -tbButton = new FCKToolbarButton( 'MW_Special', 'Special Tag', 'Insert/Edit Special Tag' ) ;
 102+tbButton = new FCKToolbarButton( 'MW_Source', 'Source', FCKLang.wikiBtnSourceCode || 'Insert/Edit Source Code' ) ;
 103+tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_source.gif' ;
 104+FCKToolbarItems.RegisterItem( 'MW_Source', tbButton ) ;
 105+if ( !FCKConfig.showsource ) { //hack to disable MW_Source button
 106+ tbButton.Create = function() {return 0;}
 107+ tbButton.Disable = function() {return 0;}
 108+ tbButton.RefreshState = function() {return 0;}
 109+}
 110+
 111+tbButton = new FCKToolbarButton( 'MW_Special', 'Special Tag', FCKLang.wikiBtnSpecial || 'Insert/Edit Special Tag' ) ;
49112 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_special.gif' ;
50113 FCKToolbarItems.RegisterItem( 'MW_Special', tbButton ) ;
51114
 115+tbButton = new FCKToolbarButton( 'MW_Category', 'Categories', FCKLang.wikiBtnCategories || 'Insert/Edit categories' ) ;
 116+tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_category.gif' ;
 117+FCKToolbarItems.RegisterItem( 'MW_Category', tbButton ) ;
 118+
52119 // Override some dialogs.
53 -FCKCommands.RegisterCommand( 'MW_Template', new FCKDialogCommand( 'MW_Template', 'Template Properties', FCKConfig.PluginsPath + 'mediawiki/dialogs/template.html', 400, 330 ) ) ;
54 -FCKCommands.RegisterCommand( 'MW_Ref', new FCKDialogCommand( 'MW_Ref', 'Reference Properties', FCKConfig.PluginsPath + 'mediawiki/dialogs/ref.html', 400, 250 ) ) ;
55 -FCKCommands.RegisterCommand( 'MW_Math', new FCKDialogCommand( 'MW_Math', 'Formula', FCKConfig.PluginsPath + 'mediawiki/dialogs/math.html', 400, 300 ) ) ;
56 -FCKCommands.RegisterCommand( 'MW_Special', new FCKDialogCommand( 'MW_Special', 'Special Tag Properties', FCKConfig.PluginsPath + 'mediawiki/dialogs/special.html', 400, 330 ) ) ; //YC
 120+FCKCommands.RegisterCommand( 'MW_Template', new FCKDialogCommand( 'MW_Template', ( FCKLang.wikiCmdTemplate || 'Template Properties' ), FCKConfig.PluginsPath + 'mediawiki/dialogs/template.html', 400, 330 ) ) ;
 121+FCKCommands.RegisterCommand( 'MW_Ref', new FCKDialogCommand( 'MW_Ref', ( FCKLang.wikiCmdReference || 'Reference Properties' ), FCKConfig.PluginsPath + 'mediawiki/dialogs/ref.html', 400, 250 ) ) ;
 122+FCKCommands.RegisterCommand( 'MW_Math', new FCKDialogCommand( 'MW_Math', ( FCKLang.wikiCmdFormula || 'Formula' ), FCKConfig.PluginsPath + 'mediawiki/dialogs/math.html', 400, 300 ) ) ;
 123+FCKCommands.RegisterCommand( 'MW_Special', new FCKDialogCommand( 'MW_Special', ( FCKLang.wikiCmdSpecial || 'Special Tag Properties' ), FCKConfig.PluginsPath + 'mediawiki/dialogs/special.html', 400, 330 ) ) ;
 124+FCKCommands.RegisterCommand( 'MW_Source', new FCKDialogCommand( 'MW_Source', ( FCKLang.wikiCmdSourceCode || 'Source Code Properties' ), FCKConfig.PluginsPath + 'mediawiki/dialogs/source.html', 720, 380 ) ) ;
57125 FCKCommands.RegisterCommand( 'Link', new FCKDialogCommand( 'Link', FCKLang.DlgLnkWindowTitle, FCKConfig.PluginsPath + 'mediawiki/dialogs/link.html', 400, 250 ) ) ;
 126+FCKCommands.RegisterCommand( 'MW_Category', new FCKDialogCommand( 'MW_Category', ( FCKLang.wikiCmdCategories || 'Categories' ), FCKConfig.PluginsPath + 'mediawiki/dialogs/category.html', 400, 500 ) ) ;
58127 FCKCommands.RegisterCommand( 'Image', new FCKDialogCommand( 'Image', FCKLang.DlgImgTitle, FCKConfig.PluginsPath + 'mediawiki/dialogs/image.html', 450, 300 ) ) ;
59128
 129+FCKToolbarItems.OldGetItem = FCKToolbarItems.GetItem;
60130
 131+FCKToolbarItems.GetItem = function( itemName )
 132+{
 133+ var oItem = FCKToolbarItems.LoadedItems[ itemName ] ;
 134+
 135+ if ( oItem )
 136+ return oItem ;
 137+
 138+ switch ( itemName )
 139+ {
 140+ case 'Bold' : oItem = new FCKToolbarButton( 'Bold' , FCKLang.Bold, null, null, true, true, 20 ) ; break ;
 141+ case 'Italic' : oItem = new FCKToolbarButton( 'Italic' , FCKLang.Italic, null, null, true, true, 21 ) ; break ;
 142+ case 'Underline' : oItem = new FCKToolbarButton( 'Underline' , FCKLang.Underline, null, null, true, true, 22 ) ; break ;
 143+ case 'StrikeThrough': oItem = new FCKToolbarButton( 'StrikeThrough' , FCKLang.StrikeThrough, null, null, true, true, 23 ) ; break ;
 144+ case 'Link' : oItem = new FCKToolbarButton( 'Link' , FCKLang.InsertLinkLbl, FCKLang.InsertLink, null, true, true, 34 ) ; break ;
 145+
 146+ default:
 147+ return FCKToolbarItems.OldGetItem( itemName );
 148+ }
 149+
 150+ FCKToolbarItems.LoadedItems[ itemName ] = oItem ;
 151+
 152+ return oItem ;
 153+}
 154+
 155+FCKToolbarButton.prototype.Click = function()
 156+{
 157+ var oToolbarButton = this._ToolbarButton || this ;
 158+
 159+ // for some buttons, do something else instead...
 160+ var CMode = false ;
 161+ if ( oToolbarButton.SourceView && (FCK_EDITMODE_SOURCE == FCK.EditMode) )
 162+ {
 163+ if ( !window.parent.popup )
 164+ var oDoc = window.parent;
 165+ else
 166+ var oDoc = window.parent.popup;
 167+
 168+ switch (oToolbarButton.CommandName)
 169+ {
 170+ case 'Bold' : oDoc.FCKeditorInsertTags ('\'\'\'', '\'\'\'', 'Bold text', document) ; CMode = true ; break ;
 171+ case 'Italic' : oDoc.FCKeditorInsertTags ('\'\'', '\'\'', 'Italic text', document) ; CMode = true ; break ;
 172+ case 'Underline' : oDoc.FCKeditorInsertTags ('<u>', '</u>', 'Underlined text', document) ; CMode = true ; break ;
 173+ case 'StrikeThrough': oDoc.FCKeditorInsertTags ('<strike>', '</strike>', 'Strikethrough text', document) ; CMode = true ; break ;
 174+ case 'Link' : oDoc.FCKeditorInsertTags ('[[', ']]', 'Internal link', document) ; CMode = true ; break ;
 175+ }
 176+ }
 177+
 178+ if ( !CMode )
 179+ FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( oToolbarButton.CommandName ).Execute() ;
 180+}
 181+
61182 // MediaWiki Wikitext Data Processor implementation.
62183 FCK.DataProcessor =
63184 {
64185 _inPre : false,
65 - _inLSpace : false,
 186+ _inLSpace : false,
66187
67188 /*
68189 * Returns a string representing the HTML format of "data". The returned
@@ -176,14 +297,14 @@
177298 if ( !FCKRegexLib.ElementName.test( sNodeName ) )
178299 return ;
179300
180 - if ( sNodeName == 'br' && ( this._inPre || this._inLSpace ) )
 301+ if ( sNodeName == 'br' && ( this._inPre || this._inLSpace ) )
181302 {
182303 stringBuilder.push( "\n" ) ;
183304 if ( this._inLSpace )
184305 stringBuilder.push( " " ) ;
185306 return ;
186307 }
187 -
 308+
188309 // Remove the <br> if it is a bogus node.
189310 if ( sNodeName == 'br' && htmlNode.getAttribute( 'type', 2 ) == '_moz' )
190311 return ;
@@ -221,8 +342,20 @@
222343 if ( basic0 )
223344 stringBuilder.push( basic0 ) ;
224345
 346+ var len = stringBuilder.length ;
 347+
225348 if ( !basicElement[2] )
 349+ {
226350 this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ;
 351+ // only empty element inside, remove it to avoid quotes
 352+ if ( ( stringBuilder.length == len || (stringBuilder.length == len + 1 && !stringBuilder[len].length) )
 353+ && basicElement[0] && basicElement[0].charAt(0) == "'")
 354+ {
 355+ stringBuilder.pop();
 356+ stringBuilder.pop();
 357+ return;
 358+ }
 359+ }
227360
228361 if ( basic1 )
229362 stringBuilder.push( basic1 ) ;
@@ -251,10 +384,10 @@
252385 if ( sLastStr != ";" && sLastStr != ":" && sLastStr != "#" && sLastStr != "*")
253386 stringBuilder.push( '\n' + prefix ) ;
254387 }
255 -
 388+
256389 var parent = htmlNode.parentNode ;
257390 var listType = "#" ;
258 -
 391+
259392 while ( parent )
260393 {
261394 if ( parent.nodeName.toLowerCase() == 'ul' )
@@ -272,35 +405,56 @@
273406
274407 parent = parent.parentNode ;
275408 }
276 -
 409+
277410 stringBuilder.push( listType ) ;
278411 this._AppendChildNodes( htmlNode, stringBuilder, prefix + listType ) ;
279 -
 412+
280413 break ;
281414
282415 case 'a' :
283416
 417+ var pipeline = true;
284418 // Get the actual Link href.
285419 var href = htmlNode.getAttribute( '_fcksavedurl' ) ;
286420 var hrefType = htmlNode.getAttribute( '_fck_mw_type' ) || '' ;
287 -
 421+
288422 if ( href == null )
289423 href = htmlNode.getAttribute( 'href' , 2 ) || '' ;
290424
291425 var isWikiUrl = true ;
292 -
 426+
293427 if ( hrefType == "media" )
294428 stringBuilder.push( '[[Media:' ) ;
295429 else if ( htmlNode.className == "extiw" )
 430+ {
296431 stringBuilder.push( '[[' ) ;
 432+ var isWikiUrl = true;
 433+ }
297434 else
298435 {
299436 var isWikiUrl = !( href.StartsWith( 'mailto:' ) || /^\w+:\/\//.test( href ) ) ;
300437 stringBuilder.push( isWikiUrl ? '[[' : '[' ) ;
301438 }
 439+ //#2223
 440+ if (htmlNode.getAttribute( '_fcknotitle' ) && htmlNode.getAttribute( '_fcknotitle' ) == "true")
 441+ {
 442+ var testHref = FCKConfig.ProtectedSource.Revert( href, 0 ) ;
 443+ var testInner = FCKConfig.ProtectedSource.Revert( htmlNode.innerHTML, 0 ) ;
 444+ if ( href.toLowerCase().StartsWith( 'category:' ) )
 445+ testInner = 'Category:' + testInner ;
 446+ if ( testHref.toLowerCase().StartsWith( 'rtecolon' ) )
 447+ testHref = testHref.replace( /rtecolon/, ":" ) ;
 448+ testInner = testInner.replace( /&amp;/, "&" ) ;
 449+ if ( testInner == testHref )
 450+ pipeline = false ;
 451+ }
 452+ if (href.toLowerCase().StartsWith( 'rtecolon' )) //change 'rtecolon=' => ':' in links
 453+ {
 454+ stringBuilder.push(':');
 455+ href = href.substring(8);
 456+ }
302457 stringBuilder.push( href ) ;
303 - //if ( href != htmlNode.innerHTML && htmlNode.innerHTML != '[n]' )
304 - if ( htmlNode.innerHTML != '[n]' )
 458+ if ( pipeline && htmlNode.innerHTML != '[n]' && (!isWikiUrl || href != htmlNode.innerHTML || !href.toLowerCase().StartsWith("category:")))
305459 {
306460 stringBuilder.push( isWikiUrl? '|' : ' ' ) ;
307461 this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ;
@@ -308,18 +462,18 @@
309463 stringBuilder.push( isWikiUrl ? ']]' : ']' ) ;
310464
311465 break ;
312 -
 466+
313467 case 'dl' :
314 -
 468+
315469 this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ;
316470 var isFirstLevel = !htmlNode.parentNode.nodeName.IEquals( 'ul', 'ol', 'li', 'dl', 'dd', 'dt' ) ;
317471 if ( isFirstLevel && stringBuilder[ stringBuilder.length - 1 ] != "\n" )
318472 stringBuilder.push( '\n') ;
319 -
 473+
320474 break ;
321475
322476 case 'dt' :
323 -
 477+
324478 if( stringBuilder.length > 1)
325479 {
326480 var sLastStr = stringBuilder[ stringBuilder.length - 1 ] ;
@@ -328,11 +482,11 @@
329483 }
330484 stringBuilder.push( ';' ) ;
331485 this._AppendChildNodes( htmlNode, stringBuilder, prefix + ";") ;
332 -
 486+
333487 break ;
334488
335489 case 'dd' :
336 -
 490+
337491 if( stringBuilder.length > 1)
338492 {
339493 var sLastStr = stringBuilder[ stringBuilder.length - 1 ] ;
@@ -341,9 +495,9 @@
342496 }
343497 stringBuilder.push( ':' ) ;
344498 this._AppendChildNodes( htmlNode, stringBuilder, prefix + ":" ) ;
345 -
 499+
346500 break ;
347 -
 501+
348502 case 'table' :
349503
350504 var attribs = this._GetAttributesStr( htmlNode ) ;
@@ -374,7 +528,7 @@
375529 attribs = this._GetAttributesStr( htmlNode.rows[r].cells[c] ) ;
376530
377531 if ( htmlNode.rows[r].cells[c].tagName.toLowerCase() == "th" )
378 - stringBuilder.push( '!' ) ;
 532+ stringBuilder.push( '!' ) ;
379533 else
380534 stringBuilder.push( '|' ) ;
381535
@@ -413,10 +567,24 @@
414568 var imgLocation = htmlNode.getAttribute( '_fck_mw_location' ) || '' ;
415569 var imgWidth = htmlNode.getAttribute( '_fck_mw_width' ) || '' ;
416570 var imgHeight = htmlNode.getAttribute( '_fck_mw_height' ) || '' ;
 571+ var imgStyleWidth = ( parseInt(htmlNode.style.width) || '' ) + '' ;
 572+ var imgStyleHeight = ( parseInt(htmlNode.style.height) || '' ) + '' ;
 573+ var imgRealWidth = ( htmlNode.getAttribute( 'width' ) || '' ) + '' ;
 574+ var imgRealHeight = ( htmlNode.getAttribute( 'height' ) || '' ) + '' ;
417575
418 - stringBuilder.push( '[[Image:' )
419 - stringBuilder.push( imgName )
 576+ stringBuilder.push( '[[Image:' ) ;
 577+ stringBuilder.push( imgName ) ;
420578
 579+ if ( imgStyleWidth.length > 0 )
 580+ imgWidth = imgStyleWidth ;
 581+ else if ( imgWidth.length > 0 && imgRealWidth.length > 0 )
 582+ imgWidth = imgRealWidth ;
 583+
 584+ if ( imgStyleHeight.length > 0 )
 585+ imgHeight = imgStyleHeight ;
 586+ else if ( imgHeight.length > 0 && imgRealHeight.length > 0 )
 587+ imgHeight = imgRealHeight ;
 588+
421589 if ( imgType.length > 0 )
422590 stringBuilder.push( '|' + imgType ) ;
423591
@@ -436,13 +604,23 @@
437605 if ( imgCaption.length > 0 )
438606 stringBuilder.push( '|' + imgCaption ) ;
439607
440 - stringBuilder.push( ']]' )
 608+ stringBuilder.push( ']]' ) ;
441609
442610 break ;
443611
444612 case 'span' :
445613 switch ( htmlNode.className )
446614 {
 615+ case 'fck_mw_source' :
 616+ var refLang = htmlNode.getAttribute( 'lang' ) ;
 617+
 618+ stringBuilder.push( '<source' ) ;
 619+ stringBuilder.push( ' lang="' + refLang + '"' ) ;
 620+ stringBuilder.push( '>' ) ;
 621+ stringBuilder.push( FCKTools.HTMLDecode(htmlNode.innerHTML).replace(/fckLR/g,'\r\n') ) ;
 622+ stringBuilder.push( '</source>' ) ;
 623+ return ;
 624+
447625 case 'fck_mw_ref' :
448626 var refName = htmlNode.getAttribute( 'name' ) ;
449627
@@ -465,10 +643,14 @@
466644 stringBuilder.push( '<references />' ) ;
467645 return ;
468646
 647+ case 'fck_mw_signature' :
 648+ stringBuilder.push( FCKConfig.WikiSignature ) ;
 649+ return ;
 650+
469651 case 'fck_mw_template' :
470652 stringBuilder.push( FCKTools.HTMLDecode(htmlNode.innerHTML).replace(/fckLR/g,'\r\n') ) ;
471653 return ;
472 -
 654+
473655 case 'fck_mw_magic' :
474656 stringBuilder.push( htmlNode.innerHTML ) ;
475657 return ;
@@ -477,6 +659,10 @@
478660 sNodeName = 'nowiki' ;
479661 break ;
480662
 663+ case 'fck_mw_html' :
 664+ sNodeName = 'html' ;
 665+ break ;
 666+
481667 case 'fck_mw_includeonly' :
482668 sNodeName = 'includeonly' ;
483669 break ;
@@ -488,10 +674,10 @@
489675 case 'fck_mw_gallery' :
490676 sNodeName = 'gallery' ;
491677 break ;
492 -
 678+
493679 case 'fck_mw_onlyinclude' :
494680 sNodeName = 'onlyinclude' ;
495 -
 681+
496682 break ;
497683 }
498684
@@ -501,15 +687,26 @@
502688
503689 case 'pre' :
504690 var attribs = this._GetAttributesStr( htmlNode ) ;
505 -
 691+
506692 if ( htmlNode.className == "_fck_mw_lspace")
507693 {
508694 stringBuilder.push( "\n " ) ;
509695 this._inLSpace = true ;
510696 this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ;
511697 this._inLSpace = false ;
512 - if ( !stringBuilder[stringBuilder.length-1].EndsWith("\n") )
513 - stringBuilder.push( "\n" ) ;
 698+ var len = stringBuilder.length ;
 699+ if ( len>1 ) {
 700+ var tail = stringBuilder[len-2] + stringBuilder[len-1];
 701+ if ( len>2 ) {
 702+ tail = stringBuilder[len-3] + tail ;
 703+ }
 704+ if (tail.EndsWith("\n ")) {
 705+ stringBuilder[len-1] = stringBuilder[len-1].replace(/ $/, "");
 706+ }
 707+ else if ( !tail.EndsWith("\n") ) {
 708+ stringBuilder.push( "\n" ) ;
 709+ }
 710+ }
514711 }
515712 else
516713 {
@@ -518,17 +715,21 @@
519716
520717 if ( attribs.length > 0 )
521718 stringBuilder.push( attribs ) ;
 719+ if(htmlNode.innerHTML == "")
 720+ stringBuilder.push( ' />' ) ;
 721+ else
 722+ {
 723+ stringBuilder.push( '>' ) ;
 724+ this._inPre = true ;
 725+ this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ;
 726+ this._inPre = false ;
522727
523 - stringBuilder.push( '>' ) ;
524 - this._inPre = true ;
525 - this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ;
526 - this._inPre = false ;
 728+ stringBuilder.push( '<\/' ) ;
 729+ stringBuilder.push( sNodeName ) ;
 730+ stringBuilder.push( '>' ) ;
 731+ }
 732+ }
527733
528 - stringBuilder.push( '<\/' ) ;
529 - stringBuilder.push( sNodeName ) ;
530 - stringBuilder.push( '>' ) ;
531 - }
532 -
533734 break ;
534735 default :
535736 var attribs = this._GetAttributesStr( htmlNode ) ;
@@ -554,17 +755,24 @@
555756 // Text Node.
556757 case 3 :
557758
558 - var parentIsSpecialTag = htmlNode.parentNode.getAttribute( '_fck_mw_customtag' ) ;
 759+ var parentIsSpecialTag = htmlNode.parentNode.getAttribute( '_fck_mw_customtag' ) ;
559760 var textValue = htmlNode.nodeValue;
560 -
561 - if ( !parentIsSpecialTag )
 761+ if ( !parentIsSpecialTag )
562762 {
563763 if ( FCKBrowserInfo.IsIE && this._inLSpace ) {
564 - textValue = textValue.replace(/\r/, "\r ") ;
 764+ textValue = textValue.replace( /\r/g, "\r " ) ;
 765+ if (textValue.EndsWith( "\r " )) {
 766+ textValue = textValue.replace( /\r $/, "\r" );
 767+ }
565768 }
566 -
567 - textValue = textValue.replace( /[\n\t]/g, ' ' ) ;
568 -
 769+ if ( !FCKBrowserInfo.IsIE && this._inLSpace ) {
 770+ textValue = textValue.replace( /\n(?! )/g, "\n " ) ;
 771+ }
 772+
 773+ if (!this._inLSpace && !this._inPre) {
 774+ textValue = textValue.replace( /[\n\t]/g, ' ' ) ;
 775+ }
 776+
569777 textValue = FCKTools.HTMLEncode( textValue ) ;
570778 textValue = textValue.replace( /\u00A0/g, '&nbsp;' ) ;
571779
@@ -582,14 +790,30 @@
583791
584792 if ( this._inLSpace && textValue.length == 1 && textValue.charCodeAt(0) == 13 )
585793 textValue = textValue + " " ;
586 - if ( this._IsInsideCell )
 794+
 795+ if ( !this._inLSpace && !this._inPre && textValue == " " ) {
 796+ var len = stringBuilder.length;
 797+ if (len > 1) {
 798+ var tail = stringBuilder[len-2] + stringBuilder[len-1];
 799+ if ( tail.toString().EndsWith( "\n" ) )
 800+ textValue = "";
 801+ }
 802+ }
 803+
 804+ if ( this._IsInsideCell ) {
 805+ var result, linkPattern = new RegExp( "\\[\\[.*?\\]\\]", "g" ) ;
 806+ while( result = linkPattern.exec( textValue ) ) {
 807+ textValue = textValue.replace( result, result.toString().replace( /\|/g, "<!--LINK_PIPE-->" ) ) ;
 808+ }
587809 textValue = textValue.replace( /\|/g, '&#124;' ) ;
 810+ textValue = textValue.replace( /<!--LINK_PIPE-->/g, '|' ) ;
 811+ }
588812 }
589 - else
 813+ else
590814 {
591815 textValue = FCKTools.HTMLDecode(textValue).replace(/fckLR/g,'\r\n');
592816 }
593 -
 817+
594818 stringBuilder.push( textValue ) ;
595819 return ;
596820
@@ -659,7 +883,13 @@
660884 else
661885 sAttValue = htmlNode.getAttribute( sAttName, 2 ) ; // We must use getAttribute to get it exactly as it is defined.
662886
663 - attStr += ' ' + sAttName + '="' + String(sAttValue).replace( '"', '&quot;' ) + '"' ;
 887+ // leave templates
 888+ if ( sAttName.StartsWith( '{{' ) && sAttName.EndsWith( '}}' ) ) {
 889+ attStr += ' ' + sAttName ;
 890+ }
 891+ else {
 892+ attStr += ' ' + sAttName + '="' + String(sAttValue).replace( '"', '&quot;' ) + '"' ;
 893+ }
664894 }
665895 }
666896 return attStr ;
@@ -670,42 +900,105 @@
671901 // switching from Wikitext.
672902 (function()
673903 {
 904+ if (window.parent.showFCKEditor & (2|4)) //if popup or toggle link
 905+ {
 906+ var original_ULF = FCK.UpdateLinkedField ;
 907+ FCK.UpdateLinkedField = function(){
 908+ if (window.parent.showFCKEditor & 1) //only if editor is up-to-date
 909+ {
 910+ original_ULF.apply();
 911+ }
 912+ }
 913+ }
674914 var original = FCK.SwitchEditMode ;
675 -
 915+ window.parent.oFCKeditor.ready = true;
676916 FCK.SwitchEditMode = function()
677917 {
678918 var args = arguments ;
679 -
 919+ window.parent.oFCKeditor.ready = false;
680920 var loadHTMLFromAjax = function( result )
681921 {
682922 FCK.EditingArea.Textarea.value = result.responseText ;
683923 original.apply( FCK, args ) ;
 924+ window.parent.oFCKeditor.ready = true;
684925 }
 926+ var edittools_markup = parent.document.getElementById ('editpage-specialchars') ;
685927
686928 if ( FCK.EditMode == FCK_EDITMODE_SOURCE )
687929 {
688930 // Hide the textarea to avoid seeing the code change.
689931 FCK.EditingArea.Textarea.style.visibility = 'hidden' ;
690 -
691932 var loading = document.createElement( 'span' ) ;
692 - loading.innerHTML = '&nbsp;Loading Wikitext. Please wait...&nbsp;' ;
 933+ loading.innerHTML = '&nbsp;'+ (FCKLang.wikiLoadingWikitext || 'Loading Wikitext. Please wait...' )+'&nbsp;';
693934 loading.style.position = 'absolute' ;
694935 loading.style.left = '5px' ;
695936 // loading.style.backgroundColor = '#ff0000' ;
696937 FCK.EditingArea.Textarea.parentNode.appendChild( loading, FCK.EditingArea.Textarea ) ;
 938+ // if we have a standard Edittools div, hide the one containing wikimarkup
 939+ if (edittools_markup) {
 940+ edittools_markup.style.display = 'none' ;
 941+ }
697942
698943 // Use Ajax to transform the Wikitext to HTML.
699 - window.parent.sajax_request_type = 'POST' ;
700 - window.parent.sajax_do_call( 'wfSajaxWikiToHTML', [FCK.EditingArea.Textarea.value], loadHTMLFromAjax ) ;
 944+ if( window.parent.popup ){
 945+ window.parent.popup.parent.FCK_sajax( 'wfSajaxWikiToHTML', [FCK.EditingArea.Textarea.value], loadHTMLFromAjax ) ;
 946+ }
 947+ else{
 948+ window.parent.FCK_sajax( 'wfSajaxWikiToHTML', [FCK.EditingArea.Textarea.value], loadHTMLFromAjax ) ;
 949+ }
701950 }
702 - else
 951+ else {
703952 original.apply( FCK, args ) ;
 953+ if (edittools_markup) {
 954+ edittools_markup.style.display = '' ;
 955+ }
 956+ window.parent.oFCKeditor.ready = true;
 957+ }
704958 }
705959 })() ;
706960
707961 // MediaWiki document processor.
708962 FCKDocumentProcessor.AppendNew().ProcessDocument = function( document )
709963 {
 964+ // #1011: change signatures to SPAN elements
 965+ var aTextNodes = document.getElementsByTagName( '*' ) ;
 966+ var i = 0 ;
 967+ var signatureRegExp = new RegExp( FCKConfig.WikiSignature.replace( /([*:.*?();|$])/g, "\\$1" ), "i" );
 968+ while (element = aTextNodes[i++])
 969+ {
 970+ var nodes = element.childNodes ;
 971+ var j = 0 ;
 972+ while ( node = nodes[j++] )
 973+ {
 974+ if ( node.nodeType == 3 )
 975+ {//textNode
 976+ var index = 0 ;
 977+
 978+ while ( aSignatures = node.nodeValue.match( signatureRegExp ) )
 979+ {
 980+ index = node.nodeValue.indexOf( aSignatures[0] ) ;
 981+ if ( index != -1 )
 982+ {
 983+ var e = FCK.EditorDocument.createElement( 'span' ) ;
 984+ e.className = "fck_mw_signature";
 985+ var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__MWSignature', e ) ;
 986+
 987+ var substr1 = FCK.EditorDocument.createTextNode( node.nodeValue.substring(0, index) ) ;
 988+ var substr2 = FCK.EditorDocument.createTextNode( node.nodeValue.substring(index + aSignatures[0].length) ) ;
 989+
 990+ node.parentNode.insertBefore( substr1, node ) ;
 991+ node.parentNode.insertBefore( oFakeImage, node ) ;
 992+ node.parentNode.insertBefore( substr2, node ) ;
 993+
 994+ node.parentNode.removeChild( node ) ;
 995+ if ( node )
 996+ node.nodeValue = '' ;
 997+ }
 998+ }
 999+ }
 1000+ }
 1001+ }
 1002+
7101003 // Templates and magic words.
7111004 var aSpans = document.getElementsByTagName( 'SPAN' ) ;
7121005
@@ -716,8 +1009,11 @@
7171010 var className = null ;
7181011 switch ( eSpan.className )
7191012 {
 1013+ case 'fck_mw_source' :
 1014+ className = 'FCK__MWSource' ;
7201015 case 'fck_mw_ref' :
721 - className = 'FCK__MWRef' ;
 1016+ if (className == null)
 1017+ className = 'FCK__MWRef' ;
7221018 case 'fck_mw_references' :
7231019 if ( className == null )
7241020 className = 'FCK__MWReferences' ;
@@ -736,6 +1032,9 @@
7371033 case 'fck_mw_nowiki' :
7381034 if ( className == null )
7391035 className = 'FCK__MWNowiki' ;
 1036+ case 'fck_mw_html' :
 1037+ if ( className == null )
 1038+ className = 'FCK__MWHtml' ;
7401039 case 'fck_mw_includeonly' :
7411040 if ( className == null )
7421041 className = 'FCK__MWIncludeonly' ;
@@ -748,7 +1047,7 @@
7491048 case 'fck_mw_onlyinclude' :
7501049 if ( className == null )
7511050 className = 'FCK__MWOnlyinclude' ;
752 -
 1051+
7531052 var oImg = FCKDocumentProcessor_CreateFakeImage( className, eSpan.cloneNode(true) ) ;
7541053 oImg.setAttribute( '_' + eSpan.className, 'true', 0 ) ;
7551054
@@ -757,8 +1056,23 @@
7581057 break ;
7591058 }
7601059 }
761 -
762 - // Templates and magic words.
 1060+
 1061+ // Math tags without Tex.
 1062+ var aImgs = document.getElementsByTagName( 'IMG' ) ;
 1063+ var eImg ;
 1064+ i = aImgs.length - 1 ;
 1065+ while ( i >= 0 && ( eImg = aImgs[i--] ) )
 1066+ {
 1067+ var className = null ;
 1068+ switch ( eImg.className )
 1069+ {
 1070+ case 'FCK__MWMath' :
 1071+ eImg.src = FCKConfig.PluginsPath + 'mediawiki/images/icon_math.gif' ;
 1072+ break ;
 1073+ }
 1074+ }
 1075+
 1076+ // InterWiki / InterLanguage links
7631077 var aHrefs = document.getElementsByTagName( 'A' ) ;
7641078 var a ;
7651079 var i = aHrefs.length - 1 ;
@@ -766,9 +1080,20 @@
7671081 {
7681082 if (a.className == 'extiw')
7691083 {
770 - a.href = a.innerHTML = ":" + a.title ;
771 - a.setAttribute( '_fcksavedurl', ":" + a.title ) ;
 1084+ a.href = a.title ;
 1085+ a.setAttribute( '_fcksavedurl', a.href ) ;
7721086 }
 1087+ else
 1088+ {
 1089+ if (a.href.toLowerCase().StartsWith( 'rtecolon' ))
 1090+ {
 1091+ a.href = ":" + a.href.substring(8);
 1092+ if (a.innerHTML.toLowerCase().StartsWith( 'rtecolon' ))
 1093+ {
 1094+ a.innerHTML = a.innerHTML.substring(8);
 1095+ }
 1096+ }
 1097+ }
7731098 }
7741099 }
7751100
@@ -781,27 +1106,37 @@
7821107 if ( tag.getAttribute( '_fck_mw_template' ) )
7831108 {
7841109 contextMenu.AddSeparator() ;
785 - contextMenu.AddItem( 'MW_Template', 'Template Properties' ) ;
 1110+ contextMenu.AddItem( 'MW_Template', FCKLang.wikiMnuTemplate || 'Template Properties' ) ;
7861111 }
7871112 if ( tag.getAttribute( '_fck_mw_magic' ) )
7881113 {
7891114 contextMenu.AddSeparator() ;
790 - contextMenu.AddItem( 'MW_MagicWord', 'Modify Magic Word' ) ;
 1115+ contextMenu.AddItem( 'MW_MagicWord', FCKLang.wikiMnuMagicWord || 'Modify Magic Word' ) ;
7911116 }
7921117 if ( tag.getAttribute( '_fck_mw_ref' ) )
7931118 {
7941119 contextMenu.AddSeparator() ;
795 - contextMenu.AddItem( 'MW_Ref', 'Reference Properties' ) ;
 1120+ contextMenu.AddItem( 'MW_Ref', FCKLang.wikiMnuReference || 'Reference Properties' ) ;
7961121 }
 1122+ if ( tag.getAttribute( '_fck_mw_html' ) )
 1123+ {
 1124+ contextMenu.AddSeparator() ;
 1125+ contextMenu.AddItem( 'MW_Special', 'Edit HTML code' ) ;
 1126+ }
 1127+ if ( tag.getAttribute( '_fck_mw_source' ) )
 1128+ {
 1129+ contextMenu.AddSeparator() ;
 1130+ contextMenu.AddItem( 'MW_Source', FCKLang.wikiMnuSourceCode || 'Source Code Properties' ) ;
 1131+ }
7971132 if ( tag.getAttribute( '_fck_mw_math' ) )
7981133 {
7991134 contextMenu.AddSeparator() ;
800 - contextMenu.AddItem( 'MW_Math', 'Edit Formula' ) ;
 1135+ contextMenu.AddItem( 'MW_Math', FCKLang.wikiMnuFormula || 'Edit Formula' ) ;
8011136 }
8021137 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' ) || tag.getAttribute( '_fck_mw_gallery' )) //YC
8031138 {
8041139 contextMenu.AddSeparator() ;
805 - contextMenu.AddItem( 'MW_Special', 'Special Tag Properties' ) ;
 1140+ contextMenu.AddItem( 'MW_Special', FCKLang.wikiMnuSpecial || 'Special Tag Properties' ) ;
8061141 }
8071142 }
8081143 }
Index: trunk/extensions/FCKeditor/plugins/mediawiki/lang/sv.js
@@ -0,0 +1,178 @@
 2+/*
 3+ * mediaWiki FCKeditor plugin
 4+ *
 5+ * Swedish language file.
 6+ */
 7+
 8+FCKLang.wikiTabEdit = 'Editera';
 9+FCKLang.wikiTabManual = 'Manual';
 10+
 11+FCKLang.wikiBtnTemplate = 'Infoga/Ändra Mall';
 12+FCKLang.wikiBtnReference = 'Infoga/Ändra Reference';
 13+FCKLang.wikiBtnReferences = 'Infoga <references /> tag';
 14+FCKLang.wikiBtnFormula = 'Infoga/Ändra Formel';
 15+FCKLang.wikiBtnSpecial = 'Infoga/Ändra Special Tag';
 16+FCKLang.wikiBtnSourceCode = 'Infoga/Ändra Source Kod';
 17+FCKLang.wikiBtnSignature = 'Infoga signatur';
 18+FCKLang.wikiCmdTemplate = 'Mall Egenskaper';
 19+FCKLang.wikiCmdReference = 'Reference egenskaper';
 20+FCKLang.wikiCmdFormula = 'Formel';
 21+FCKLang.wikiCmdCategories = 'Kategorier';
 22+FCKLang.wikiLoadingWikitext = 'Laddar Wikitext. vänligen vänta...';
 23+FCKLang.wikiLoadingCategories = 'Laddar kategorier...';
 24+FCKLang.wikiSearchCategory = 'sök kategori';
 25+FCKLang.wikiSelectedCategories = 'Valda kategorier';
 26+FCKLang.wikiBtnCategories = 'Infoga/Ändra kategorier';
 27+FCKLang.wikiAddNewCategory = 'Lägg till ny';
 28+FCKLang.wikiCategoryTree = 'Kategoriträd';
 29+FCKLang.wikiMnuTemplate = 'Mall Egenskaper';
 30+FCKLang.wikiMnuMagicWord = 'Modifiera Magic Word';
 31+FCKLang.wikiMnuReference = 'Reference Egenskaper';
 32+FCKLang.wikiMnuFormula = 'Ändra Formel';
 33+FCKLang.wikiCmdSpecial = 'Special Tag egenskaper';
 34+FCKLang.wikiCmdSourceCode = 'Source Kod egenskaper';
 35+FCKLang.wikiMnuSpecial = 'Special Tag Properties';
 36+FCKLang.wikiMnuSourceCode = 'Ändra source kod';
 37+FCKLang.wikiSourceCode = 'Source Kod';
 38+FCKLang.wikiSourceLanguage = 'Source Språk';
 39+
 40+FCKLang.wikiImgFileName = 'Bildens filnamn';
 41+FCKLang.wikiImgNotice1 = 'Bilden måste laddas upp först';
 42+FCKLang.wikiImgNotice2 = 'använd "Ladda upp fil" i vänsterkanten av skärmen';
 43+FCKLang.wikiImgCaption = 'Caption';
 44+FCKLang.wikiImgType = 'Special Type';
 45+FCKLang.wikiImgTypeThumb = 'Tumnagel';
 46+FCKLang.wikiImgTypeFrame = 'Ram';
 47+FCKLang.wikiImgTypeBorder = 'Kant';
 48+FCKLang.wikiImgAlignCenter = 'Center';
 49+
 50+FCKLang.wikiImgAutomatic = 'Automatiska sökresultat';
 51+FCKLang.wikiImgTooShort = 'För kort... skriv mer';
 52+FCKLang.wikiImgStartTyping = 'Börja skriv i fältet ovan';
 53+FCKLang.wikiImgStopTyping = 'Sluta skriv för att söka';
 54+FCKLang.wikiImgSearching = 'söker...';
 55+FCKLang.wikiImgSearchNothing = 'Inga bilder funna';
 56+FCKLang.wikiImgSearch1Found = 'en bild funnen';
 57+FCKLang.wikiImgSearchSeveral = '%1 bilder funna ';
 58+FCKLang.wikiImgSearchALot = '%1 bilder funan ';
 59+
 60+FCKLang.wikiLnk = 'Länk';
 61+FCKLang.wikiLnkAutomatic = 'Automatiska sökresultat';
 62+FCKLang.wikiLnkNoSearchAnchor = 'förankra länk... ingen sökning';
 63+FCKLang.wikiLnkNoSearchMail = 'e-post länk... ingen sökning';
 64+FCKLang.wikiLnkNoSearchExt = 'external link... ingan sökning';
 65+FCKLang.wikiLnkTooShort = 'för kort... skriv mer';
 66+FCKLang.wikiLnkStartTyping = 'Börja skriv i fältet ovan';
 67+FCKLang.wikiLnkStopTyping = 'Sluta skriv för att söka';
 68+FCKLang.wikiLnkSearching = 'söker...';
 69+FCKLang.wikiLnkSearchNothing = 'Inga sidor funna';
 70+FCKLang.wikiLnkSearch1Found = 'En sida funnen';
 71+FCKLang.wikiLnkSearchSeveral = '%1 sidor funna';
 72+FCKLang.wikiLnkSearchALot = '%1 sidor funna';
 73+
 74+FCKLang.wikiTeX = 'Formel (TeX markup)';
 75+FCKLang.wikiTeXEmpty = 'Skriv formeln';
 76+
 77+FCKLang.wikiSpTag = 'Vald Special Tag';
 78+FCKLang.wikiSpParam = 'Special tag parametrar';
 79+
 80+FCKLang.wikiRef = 'Reference text (Wikitext)';
 81+FCKLang.wikiRefName = 'Reference namn (frivilligt)';
 82+
 83+FCKLang.wikiTmpl = 'Raw mall definiering (från {{ till }})';
 84+FCKLang.wikiTmplEmpty = 'Mallar måste börja med {{ och sluta med }}. vänligen kontrollera.';
 85+FCKLang.wikiTmpsel = '(Hämta manualen till en mall här)';
 86+
 87+FCKLang.wikiUnsupportedLanguage = 'Ej supporerat språk: %1';
 88+
 89+FCKLang.DplHelp = 'DPL står för Dynamic Page List, DPL används för att generera listor på sidor baserat på sökkriterier. Se %link för mer info';
 90+FCKLang.inputboxHelp = 'Inputbox är en extension för att skapa formulär i wiki. Nya sidor kan bli för-definierade via en mall. Se %link för mer info';
 91+/*
 92+ * mediaWiki FCKeditor plugin
 93+ *
 94+ * Swedish language file.
 95+ */
 96+
 97+FCKLang.wikiTabEdit = 'Editera';
 98+FCKLang.wikiTabManual = 'Manual';
 99+
 100+FCKLang.wikiBtnTemplate = 'Infoga/Ändra Mall';
 101+FCKLang.wikiBtnReference = 'Infoga/Ändra Reference';
 102+FCKLang.wikiBtnReferences = 'Infoga <references /> tag';
 103+FCKLang.wikiBtnFormula = 'Infoga/Ändra Formel';
 104+FCKLang.wikiBtnSpecial = 'Infoga/Ändra Special Tag';
 105+FCKLang.wikiBtnSourceCode = 'Infoga/Ändra Source Kod';
 106+FCKLang.wikiBtnSignature = 'Infoga signatur';
 107+FCKLang.wikiCmdTemplate = 'Mall Egenskaper';
 108+FCKLang.wikiCmdReference = 'Reference egenskaper';
 109+FCKLang.wikiCmdFormula = 'Formel';
 110+FCKLang.wikiCmdCategories = 'Kategorier';
 111+FCKLang.wikiLoadingWikitext = 'Laddar Wikitext. vänligen vänta...';
 112+FCKLang.wikiLoadingCategories = 'Laddar kategorier...';
 113+FCKLang.wikiSearchCategory = 'sök kategori';
 114+FCKLang.wikiSelectedCategories = 'Valda kategorier';
 115+FCKLang.wikiBtnCategories = 'Infoga/Ändra kategorier';
 116+FCKLang.wikiAddNewCategory = 'Lägg till ny';
 117+FCKLang.wikiCategoryTree = 'Kategoriträd';
 118+FCKLang.wikiMnuTemplate = 'Mall Egenskaper';
 119+FCKLang.wikiMnuMagicWord = 'Modifiera Magic Word';
 120+FCKLang.wikiMnuReference = 'Reference Egenskaper';
 121+FCKLang.wikiMnuFormula = 'Ändra Formel';
 122+FCKLang.wikiCmdSpecial = 'Special Tag egenskaper';
 123+FCKLang.wikiCmdSourceCode = 'Source Kod egenskaper';
 124+FCKLang.wikiMnuSpecial = 'Special Tag Properties';
 125+FCKLang.wikiMnuSourceCode = 'Ändra source kod';
 126+FCKLang.wikiSourceCode = 'Source Kod';
 127+FCKLang.wikiSourceLanguage = 'Source Språk';
 128+
 129+FCKLang.wikiImgFileName = 'Bildens filnamn';
 130+FCKLang.wikiImgNotice1 = 'Bilden måste laddas upp först';
 131+FCKLang.wikiImgNotice2 = 'använd "Ladda upp fil" i vänsterkanten av skärmen';
 132+FCKLang.wikiImgCaption = 'Caption';
 133+FCKLang.wikiImgType = 'Special Type';
 134+FCKLang.wikiImgTypeThumb = 'Tumnagel';
 135+FCKLang.wikiImgTypeFrame = 'Ram';
 136+FCKLang.wikiImgTypeBorder = 'Kant';
 137+FCKLang.wikiImgAlignCenter = 'Center';
 138+
 139+FCKLang.wikiImgAutomatic = 'Automatiska sökresultat';
 140+FCKLang.wikiImgTooShort = 'För kort... skriv mer';
 141+FCKLang.wikiImgStartTyping = 'Börja skriv i fältet ovan';
 142+FCKLang.wikiImgStopTyping = 'Sluta skriv för att söka';
 143+FCKLang.wikiImgSearching = 'söker...';
 144+FCKLang.wikiImgSearchNothing = 'Inga bilder funna';
 145+FCKLang.wikiImgSearch1Found = 'en bild funnen';
 146+FCKLang.wikiImgSearchSeveral = '%1 bilder funna ';
 147+FCKLang.wikiImgSearchALot = '%1 bilder funan ';
 148+
 149+FCKLang.wikiLnk = 'Länk';
 150+FCKLang.wikiLnkAutomatic = 'Automatiska sökresultat';
 151+FCKLang.wikiLnkNoSearchAnchor = 'förankra länk... ingen sökning';
 152+FCKLang.wikiLnkNoSearchMail = 'e-post länk... ingen sökning';
 153+FCKLang.wikiLnkNoSearchExt = 'external link... ingan sökning';
 154+FCKLang.wikiLnkTooShort = 'för kort... skriv mer';
 155+FCKLang.wikiLnkStartTyping = 'Börja skriv i fältet ovan';
 156+FCKLang.wikiLnkStopTyping = 'Sluta skriv för att söka';
 157+FCKLang.wikiLnkSearching = 'söker...';
 158+FCKLang.wikiLnkSearchNothing = 'Inga sidor funna';
 159+FCKLang.wikiLnkSearch1Found = 'En sida funnen';
 160+FCKLang.wikiLnkSearchSeveral = '%1 sidor funna';
 161+FCKLang.wikiLnkSearchALot = '%1 sidor funna';
 162+
 163+FCKLang.wikiTeX = 'Formel (TeX markup)';
 164+FCKLang.wikiTeXEmpty = 'Skriv formeln';
 165+
 166+FCKLang.wikiSpTag = 'Vald Special Tag';
 167+FCKLang.wikiSpParam = 'Special tag parametrar';
 168+
 169+FCKLang.wikiRef = 'Reference text (Wikitext)';
 170+FCKLang.wikiRefName = 'Reference namn (frivilligt)';
 171+
 172+FCKLang.wikiTmpl = 'Raw mall definiering (från {{ till }})';
 173+FCKLang.wikiTmplEmpty = 'Mallar måste börja med {{ och sluta med }}. vänligen kontrollera.';
 174+FCKLang.wikiTmpsel = '(Hämta manualen till en mall här)';
 175+
 176+FCKLang.wikiUnsupportedLanguage = 'Ej supporerat språk: %1';
 177+
 178+FCKLang.DplHelp = 'DPL står för Dynamic Page List, DPL används för att generera listor på sidor baserat på sökkriterier. Se %link för mer info';
 179+FCKLang.inputboxHelp = 'Inputbox är en extension för att skapa formulär i wiki. Nya sidor kan bli för-definierade via en mall. Se %link för mer info';
Index: trunk/extensions/FCKeditor/plugins/mediawiki/lang/ko.js
@@ -0,0 +1,89 @@
 2+/*
 3+ * mediaWiki FCKeditor plugin
 4+ *
 5+ * 한국어 language file.
 6+ */
 7+
 8+FCKLang.wikiTabEdit = '편집';
 9+FCKLang.wikiTabManual = '매뉴얼';
 10+
 11+FCKLang.wikiBtnTemplate = '삽입/편집 틀';
 12+FCKLang.wikiBtnReference = '삽입/편집 참조';
 13+FCKLang.wikiBtnReferences = '삽입 <references /> 태그';
 14+FCKLang.wikiBtnFormula = '삽입/편집 수식';
 15+FCKLang.wikiBtnSpecial = '삽입/편집 특수기능 태그';
 16+FCKLang.wikiBtnSourceCode = '삽입/편집 소스 코드';
 17+FCKLang.wikiBtnSignature = '삽입 signature';
 18+FCKLang.wikiCmdTemplate = '틀 속성';
 19+FCKLang.wikiCmdReference = '참조 속성';
 20+FCKLang.wikiCmdFormula = '수식';
 21+FCKLang.wikiCmdCategories = '분류 목록';
 22+FCKLang.wikiLoadingWikitext = '위키텍스트를 적재하는 중입니다. 기다려주세요...';
 23+FCKLang.wikiLoadingCategories = '분류 목록을 적재하는 중입니다...';
 24+FCKLang.wikiSearchCategory = '검색 분류';
 25+FCKLang.wikiSelectedCategories = '선택한 분류 목록';
 26+FCKLang.wikiBtnCategories = '삽입/편집 분류 목록';
 27+FCKLang.wikiAddNewCategory = '새로 추가';
 28+FCKLang.wikiCategoryTree = '분류 트리';
 29+FCKLang.wikiMnuTemplate = '틀 속성';
 30+FCKLang.wikiMnuMagicWord = '주문 수정하기';
 31+FCKLang.wikiMnuReference = '참조 속성';
 32+FCKLang.wikiMnuFormula = '수식 편집하기';
 33+FCKLang.wikiCmdSpecial = '특수 태그 속성';
 34+FCKLang.wikiCmdSourceCode = '소스 코드 속성';
 35+FCKLang.wikiMnuSpecial = '특수 태그 속성';
 36+FCKLang.wikiMnuSourceCode = '소스 코드 편집하기';
 37+FCKLang.wikiSourceCode = '소스 코드';
 38+FCKLang.wikiSourceLanguage = '소스 언어';
 39+
 40+FCKLang.wikiImgFileName = '이미지 파일 이름';
 41+FCKLang.wikiImgNotice1 = '이미지를 먼저 올려야 합니다';
 42+FCKLang.wikiImgNotice2 = '화면 좌측의 "파일 올리기"를 이용하세요';
 43+FCKLang.wikiImgCaption = '캡션';
 44+FCKLang.wikiImgType = '특수 형';
 45+FCKLang.wikiImgTypeThumb = '썸네일';
 46+FCKLang.wikiImgTypeFrame = '프레임';
 47+FCKLang.wikiImgTypeBorder = '두께';
 48+FCKLang.wikiImgAlignCenter = '중앙';
 49+
 50+FCKLang.wikiImgAutomatic = '자동 검색 결과';
 51+FCKLang.wikiImgTooShort = '너무 짧습니다. 글자를 더 넣으세요';
 52+FCKLang.wikiImgStartTyping = '위쪽 필드부터 적으세요';
 53+FCKLang.wikiImgStopTyping = '타이핑을 멈추면 검색을 시작합니다';
 54+FCKLang.wikiImgSearching = '검색 중...';
 55+FCKLang.wikiImgSearchNothing = '발견한 이미지 없음';
 56+FCKLang.wikiImgSearch1Found = '이미지 하나 발견';
 57+FCKLang.wikiImgSearchSeveral = '%1 개의 이미지 발견';
 58+FCKLang.wikiImgSearchALot = '%1 개의 이미지 발견';
 59+
 60+FCKLang.wikiLnk = '링크';
 61+FCKLang.wikiLnkAutomatic = '자동 검색 결과';
 62+FCKLang.wikiLnkNoSearchAnchor = '앵커 링크... 검색된 내용 없음';
 63+FCKLang.wikiLnkNoSearchMail = '이메일 링크... 검색된 내용 없음';
 64+FCKLang.wikiLnkNoSearchExt = '외부 링크... 검색된 내용 없음';
 65+FCKLang.wikiLnkTooShort = '너무 짧습니다. 글자를 더 넣으세요';
 66+FCKLang.wikiLnkStartTyping = '위쪽 필드부터 적으세요';
 67+FCKLang.wikiLnkStopTyping = '타이핑을 멈추면 검색을 시작합니다';
 68+FCKLang.wikiLnkSearching = '검색 중...';
 69+FCKLang.wikiLnkSearchNothing = '발견한 글 없음';
 70+FCKLang.wikiLnkSearch1Found = '글 하나 발견';
 71+FCKLang.wikiLnkSearchSeveral = '%1 개의 글 발견';
 72+FCKLang.wikiLnkSearchALot = '%1 개의 글 발견';
 73+
 74+FCKLang.wikiTeX = '수식 (TeX 마크업)';
 75+FCKLang.wikiTeXEmpty = '수식을 입력해주세요';
 76+
 77+FCKLang.wikiSpTag = '현재 특수 태그';
 78+FCKLang.wikiSpParam = '특수 태그 매개변수';
 79+
 80+FCKLang.wikiRef = 'Reference text (Wikitext)';
 81+FCKLang.wikiRefName = 'Reference name (optional)';
 82+
 83+FCKLang.wikiTmpl = '틀 원시 정의 ({{로 시작, }}로 끝남)';
 84+FCKLang.wikiTmplEmpty = '틀은 {{로 시작해서 }}로 끝나야 합니다. 확인해보세요.';
 85+FCKLang.wikiTmpsel = '(여기서 틀 매뉴얼을 고르세요)';
 86+
 87+FCKLang.wikiUnsupportedLanguage = '지원하지 않는 언어: %1';
 88+
 89+FCKLang.DplHelp = 'DPL은 Dynamic Page List를 뜻하며 선택 기준에 근거해 페이지 목록을 예쁘게 꾸며서 보여줍니다. 자세히 알고 싶으면 %link 를 참고하세요';
 90+FCKLang.inputboxHelp = '입력 상자는 사용자가 새 페이지를 생성하는 폼을 생성하게 해줍니다. 어느 틀에나 새 페이지 편집 상자를 미리 적재할 수 있습니다. 자세히 알고 싶으면 %link 를 참고하세요';
Index: trunk/extensions/FCKeditor/plugins/mediawiki/lang/pl.js
@@ -0,0 +1,90 @@
 2+/*
 3+ * mediaWiki FCKeditor plugin
 4+ *
 5+ * Polish language file.
 6+ */
 7+
 8+FCKLang.wikiTabEdit = 'Edycja';
 9+FCKLang.wikiTabManual = 'Własny' ;
 10+
 11+FCKLang.wikiBtnTemplate = 'Wstaw/edytuj szablon';
 12+FCKLang.wikiBtnReference = 'Wstaw/edytuj przypis';
 13+FCKLang.wikiBtnReferences = 'Wstaw znacznik <references />';
 14+FCKLang.wikiBtnFormula = 'Wstaw/edytuj formułę matematyczną';
 15+FCKLang.wikiBtnSpecial = 'Wstaw/edytuj specialny znacznik';
 16+FCKLang.wikiBtnSignature = 'Wstaw sygnaturkę';
 17+FCKLang.wikiBtnSourceCode = 'Wstaw/edytuj kod źródłowy programu';
 18+FCKLang.wikiCmdTemplate = 'Właściwości szablonu';
 19+FCKLang.wikiCmdReference = 'Właściwości przypisu';
 20+FCKLang.wikiCmdFormula = 'Właściwości formuły matematycznej';
 21+FCKLang.wikiCmdCategories = 'Kategorie';
 22+FCKLang.wikiLoadingWikitext = '&nbsp;Konwertuję format wiki. Proszę czekać...&nbsp;';
 23+FCKLang.wikiLoadingCategories = 'Ładuję kategorie...';
 24+FCKLang.wikiSearchCategory = 'Szukaj kategorii';
 25+FCKLang.wikiSelectedCategories = 'Wybrane kategorie';
 26+FCKLang.wikiBtnCategories = 'Wstaw/edytuj kategorie';
 27+FCKLang.wikiAddNewCategory = 'Dodaj nową';
 28+FCKLang.wikiCategoryTree = 'Drzewo kategorii';
 29+FCKLang.wikiMnuTemplate = 'Właściwości szablonu';
 30+FCKLang.wikiMnuMagicWord = 'Zmodyfikuj "magiczne słowo"';
 31+FCKLang.wikiMnuReference = 'Właściwości przypisu';
 32+FCKLang.wikiMnuFormula = 'Właściwości formuły matematycznej';
 33+FCKLang.wikiCmdSpecial = 'Właściwości specialnego znacznika';
 34+FCKLang.wikiCmdSourceCode = 'Właściwości kodu źródłowego';
 35+FCKLang.wikiMnuSpecial = 'Edytuj specialny znacznik';
 36+FCKLang.wikiMnuSourceCode = 'Edytuj kod źródłowy';
 37+FCKLang.wikiSourceCode = 'Kod źródłowy';
 38+FCKLang.wikiSourceLanguage = 'Język programowania';
 39+
 40+FCKLang.wikiImgFileName = 'Nazwa obrazka';
 41+FCKLang.wikiImgNotice1 = 'Obrazek musi być uprzednio zapisany';
 42+FCKLang.wikiImgNotice2 = 'patrz menu "Prześlij plik" z lewej strony ekranu.';
 43+FCKLang.wikiImgCaption = 'Tytuł/tekst zastępczy';
 44+FCKLang.wikiImgType = "Typ";
 45+FCKLang.wikiImgTypeThumb = 'Podgląd';
 46+FCKLang.wikiImgTypeFrame = 'Ramka+podpis';
 47+FCKLang.wikiImgTypeBorder = 'Ramka';
 48+FCKLang.wikiImgAlignCenter = 'Do środka';
 49+
 50+FCKLang.wikiImgAutomatic = 'Wyniki wyszukiwania';
 51+FCKLang.wikiImgTooShort = 'za mało liter... napisz coś jeszcze';
 52+FCKLang.wikiImgStartTyping = 'zacznij pisać w polu powyżej';
 53+FCKLang.wikiImgStopTyping = 'przestań pisać, by rozpocząć wyszukiwanie';
 54+FCKLang.wikiImgSearching = 'wyszukiwanie...';
 55+FCKLang.wikiImgSearchNothing = 'nie znaleziono żadnego obrazka';
 56+FCKLang.wikiImgSearch1Found = 'znaleziono jeden&nbsp;obrazek';
 57+FCKLang.wikiImgSearchSeveral = 'znaleziono %1&nbsp;obrazki';
 58+FCKLang.wikiImgSearchALot = 'znaleziono %1&nbsp;obrazków';
 59+
 60+FCKLang.wikiLnk = 'Hiperłącze';
 61+FCKLang.wikiLnkAutomatic = 'Wyniki wyszukiwania';
 62+FCKLang.wikiLnkNoSearchAnchor = 'Kotwica... nie da się wyszukać';
 63+FCKLang.wikiLnkNoSearchMail = 'Adres pocztowy... nie da się wyszukać';
 64+FCKLang.wikiLnkNoSearchExt = 'Łącze do zewnętrzne... nie da się wyszukać';
 65+FCKLang.wikiLnkTooShort = 'za mało liter aby wyszukać';
 66+FCKLang.wikiLnkStartTyping = 'zacznij pisać w polu powyżej';
 67+FCKLang.wikiLnkStopTyping = 'przestań pisać, by rozpocząć wyszukiwanie';
 68+FCKLang.wikiLnkSearching = 'wyszukiwanie...';
 69+FCKLang.wikiLnkSearchNothing = 'nie znaleziono żadnego artykułu';
 70+FCKLang.wikiLnkSearch1Found = 'znaleziono jednen artykuł';
 71+FCKLang.wikiLnkSearchSeveral = 'znaleziono %1 artykuły'
 72+FCKLang.wikiLnkSearchALot = 'znaleziono %1 artykułów'
 73+
 74+FCKLang.wikiTeX = 'Formuła matematyczna (notacja TeX)';
 75+FCKLang.wikiTeXEmpty = 'Nie wprowadzono formuły';
 76+
 77+FCKLang.wikiSpTag = 'Typ znacznika';
 78+FCKLang.wikiSpParam = 'Parametry';
 79+
 80+FCKLang.wikiRef = 'Treść cytatu (format wiki)';
 81+FCKLang.wikiRefName = 'Nazwa cytatu (opcjonalna)';
 82+
 83+FCKLang.wikiTmpl = 'Szablon (np. {{PrzykładowySzablon}})';
 84+FCKLang.wikiTmplEmpty = 'Szablon musi zaczynać się znakami {{ i kończyć się znakami }}';
 85+FCKLang.wikiTmpsel = '(Wybierz z listy)';
 86+
 87+FCKLang.wikiUnsupportedLanguage = 'Nieprawidłowy język programowania: %1';
 88+
 89+FCKLang.DplHelp = 'Dynamic Page List pozwala na generowanie formatowanych list stron bazując na podanych kryteriach Zobacz %link aby dowiedzieć się więcej';;
 90+FCKLang.inputboxHelp = 'Inputbox pozwala na stworzenie formularza dla użytkowników do tworzenia nowych stron. Zobacz %link aby dowiedzieć się więcej';
 91+
Index: trunk/extensions/FCKeditor/plugins/mediawiki/lang/he.js
@@ -0,0 +1,89 @@
 2+/*
 3+ * mediaWiki FCKeditor plugin
 4+ *
 5+ * Hebrew language file.
 6+ */
 7+
 8+FCKLang.wikiTabEdit = 'עריכה';
 9+FCKLang.wikiTabManual = 'הוראות שימוש';
 10+
 11+FCKLang.wikiBtnTemplate = 'הוסף/ערוך תבנית';
 12+FCKLang.wikiBtnReference = 'הוסף/ערוך הערת שוליים';
 13+FCKLang.wikiBtnReferences = 'הוסף תג <references />';
 14+FCKLang.wikiBtnFormula = 'הוסף/ערוך נוסחה';
 15+FCKLang.wikiBtnSpecial = 'הוסף/ערוך תג מיוחד';
 16+FCKLang.wikiBtnSourceCode = 'הוסף/ערוך קוד מקור';
 17+FCKLang.wikiBtnSignature = 'הוסף חתימה';
 18+FCKLang.wikiCmdTemplate = 'תכונות התבנית';
 19+FCKLang.wikiCmdReference = 'תכונות הערת השוליים';
 20+FCKLang.wikiCmdFormula = 'נוסחה';
 21+FCKLang.wikiCmdCategories = 'קטגוריות';
 22+FCKLang.wikiLoadingWikitext = 'טוען ויקיטקסט. אנא המתן...';
 23+FCKLang.wikiLoadingCategories = 'טוען קטגוריות...';
 24+FCKLang.wikiSearchCategory = 'חפש קטגוריה';
 25+FCKLang.wikiSelectedCategories = 'קטגוריות שנבחרו';
 26+FCKLang.wikiBtnCategories = 'הוסף/ערוך קטגוריות';
 27+FCKLang.wikiAddNewCategory = 'הוסף קטגוריה';
 28+FCKLang.wikiCategoryTree = 'עץ קטגוריות';
 29+FCKLang.wikiMnuTemplate = 'תכונות התבנית';
 30+FCKLang.wikiMnuMagicWord = 'ערוך פקודת קסם';
 31+FCKLang.wikiMnuReference = 'תכונות הערת השוליים';
 32+FCKLang.wikiMnuFormula = 'ערוך נוסחה';
 33+FCKLang.wikiCmdSpecial = 'תכונות התג המיוחד';
 34+FCKLang.wikiCmdSourceCode = 'תכונות קוד המקור';
 35+FCKLang.wikiMnuSpecial = 'תכונות התג המיוחד';
 36+FCKLang.wikiMnuSourceCode = 'ערוך קוד מקור';
 37+FCKLang.wikiSourceCode = 'קוד מקור';
 38+FCKLang.wikiSourceLanguage = 'שפת קוד המקור';
 39+
 40+FCKLang.wikiImgFileName = 'שם קובץ התמונה';
 41+FCKLang.wikiImgNotice1 = 'יש להעלות את התמונות לפני השימוש';
 42+FCKLang.wikiImgNotice2 = 'השתמש ב"העלאת קובץ לשרת" בצידו השמאלי של המסך';
 43+FCKLang.wikiImgCaption = 'כיתוב תמונה';
 44+FCKLang.wikiImgType = 'הגדרות התמונה';
 45+FCKLang.wikiImgTypeThumb = 'ממוזערת';
 46+FCKLang.wikiImgTypeFrame = 'ממוסגרת';
 47+FCKLang.wikiImgTypeBorder = 'בעלת גבול';
 48+FCKLang.wikiImgAlignCenter = 'למרכז';
 49+
 50+FCKLang.wikiImgAutomatic = 'תוצאות חיפוש אוטומטיות';
 51+FCKLang.wikiImgTooShort = 'קצר מדי... הקלד עוד';
 52+FCKLang.wikiImgStartTyping = 'התחל להקליד בשדה שמלמעלה';
 53+FCKLang.wikiImgStopTyping = 'הפסק להקליד כדי לחפש';
 54+FCKLang.wikiImgSearching = 'מחפש...';
 55+FCKLang.wikiImgSearchNothing = 'לא נמצאו תמונות';
 56+FCKLang.wikiImgSearch1Found = 'תמונה אחת נמצאה';
 57+FCKLang.wikiImgSearchSeveral = '%1 תמונות נמצאו';
 58+FCKLang.wikiImgSearchALot = '%1 תמונות נמצאו';
 59+
 60+FCKLang.wikiLnk = 'קישור';
 61+FCKLang.wikiLnkAutomatic = 'תוצאות חיפוש אוטומטיות';
 62+FCKLang.wikiLnkNoSearchAnchor = 'קישור לעוגן... אין חיפוש עבור קישורים אלו';
 63+FCKLang.wikiLnkNoSearchMail = 'קישור למייל... אין חיפוש עבור קישורים אלו';
 64+FCKLang.wikiLnkNoSearchExt = 'קישור חיצוני... אין חיפוש עבור קישורים אלו';
 65+FCKLang.wikiLnkTooShort = 'קצר מדי... הקלד עוד';
 66+FCKLang.wikiLnkStartTyping = 'התחל להקליד בשדה שמלמעלה';
 67+FCKLang.wikiLnkStopTyping = 'הפסק להקליד כדי לחפש';
 68+FCKLang.wikiLnkSearching = 'מחפש...';
 69+FCKLang.wikiLnkSearchNothing = 'לא נמצאו ערכים';
 70+FCKLang.wikiLnkSearch1Found = 'נמצא ערך אחד';
 71+FCKLang.wikiLnkSearchSeveral = '%1 ערכים נמצאו';
 72+FCKLang.wikiLnkSearchALot = '%1 ערכים נמצאו';
 73+
 74+FCKLang.wikiTeX = 'נוסחה (שפת TeX)';
 75+FCKLang.wikiTeXEmpty = 'אנא הקלד את הנוסחה';
 76+
 77+FCKLang.wikiSpTag = 'התג המיוחד הנוכחי';
 78+FCKLang.wikiSpParam = 'משתני התג המיוחד';
 79+
 80+FCKLang.wikiRef = 'טקסט הערת השוליים (ויקיטקסט)';
 81+FCKLang.wikiRefName = 'שם הערת השוליים (אופציונלי)';
 82+
 83+FCKLang.wikiTmpl = 'הגדרה גסה של התבנית (מ-{{ ל-}})';
 84+FCKLang.wikiTmplEmpty = 'על תבניות להתחיל ב-{{ ולהסתיים ב-}}. נסה שנית.';
 85+FCKLang.wikiTmpsel = '(בחר תבנית כאן)';
 86+
 87+FCKLang.wikiUnsupportedLanguage = 'שפה לא נתמכת: %1';
 88+
 89+FCKLang.DplHelp = 'DPL הן ראשי תיבות של Dynamic Page List (בעברית - רשימת דפים דינמית). הרחבה זו מאפשרת ליצור רשימת דפים על בסיס קריטריון נבחר. לפרטים, ראה %link';
 90+FCKLang.inputboxHelp = 'Inputbox הוא הרחבה המאפשרת ליצור טופס שנותן למשתמשים ליצור דפים חדשים. תיבת העריכה של הדף החדש יכולה להטען מראש עם כל תבנית. לפרטים, ראה %link';
Index: trunk/extensions/FCKeditor/plugins/mediawiki/lang/en.js
@@ -0,0 +1,89 @@
 2+/*
 3+ * mediaWiki FCKeditor plugin
 4+ *
 5+ * English language file.
 6+ */
 7+
 8+FCKLang.wikiTabEdit = 'Edit';
 9+FCKLang.wikiTabManual = 'Manual';
 10+
 11+FCKLang.wikiBtnTemplate = 'Insert/Edit Template';
 12+FCKLang.wikiBtnReference = 'Insert/Edit Reference';
 13+FCKLang.wikiBtnReferences = 'Insert <references /> tag';
 14+FCKLang.wikiBtnFormula = 'Insert/Edit Formula';
 15+FCKLang.wikiBtnSpecial = 'Insert/Edit Special Tag';
 16+FCKLang.wikiBtnSourceCode = 'Insert/Edit Source Code';
 17+FCKLang.wikiBtnSignature = 'Insert signature';
 18+FCKLang.wikiCmdTemplate = 'Template Properties';
 19+FCKLang.wikiCmdReference = 'Reference Properties';
 20+FCKLang.wikiCmdFormula = 'Formula';
 21+FCKLang.wikiCmdCategories = 'Categories';
 22+FCKLang.wikiLoadingWikitext = 'Loading Wikitext. Please wait...';
 23+FCKLang.wikiLoadingCategories = 'loading categories...';
 24+FCKLang.wikiSearchCategory = 'Search category';
 25+FCKLang.wikiSelectedCategories = 'Selected categories';
 26+FCKLang.wikiBtnCategories = 'Insert/Edit categories';
 27+FCKLang.wikiAddNewCategory = 'Add new';
 28+FCKLang.wikiCategoryTree = 'Category tree';
 29+FCKLang.wikiMnuTemplate = 'Template Properties';
 30+FCKLang.wikiMnuMagicWord = 'Modify Magic Word';
 31+FCKLang.wikiMnuReference = 'Reference Properties';
 32+FCKLang.wikiMnuFormula = 'Edit Formula';
 33+FCKLang.wikiCmdSpecial = 'Special Tag Properties';
 34+FCKLang.wikiCmdSourceCode = 'Source Code Properties';
 35+FCKLang.wikiMnuSpecial = 'Special Tag Properties';
 36+FCKLang.wikiMnuSourceCode = 'Edit source code';
 37+FCKLang.wikiSourceCode = 'Source Code';
 38+FCKLang.wikiSourceLanguage = 'Source Language';
 39+
 40+FCKLang.wikiImgFileName = 'Image file name';
 41+FCKLang.wikiImgNotice1 = 'Image have to be uploded before';
 42+FCKLang.wikiImgNotice2 = 'use "Upload file" on the left side of the screen';
 43+FCKLang.wikiImgCaption = 'Caption';
 44+FCKLang.wikiImgType = 'Special Type';
 45+FCKLang.wikiImgTypeThumb = 'Thumbnail';
 46+FCKLang.wikiImgTypeFrame = 'Frame';
 47+FCKLang.wikiImgTypeBorder = 'Border';
 48+FCKLang.wikiImgAlignCenter = 'Center';
 49+
 50+FCKLang.wikiImgAutomatic = 'Automatic search results';
 51+FCKLang.wikiImgTooShort = 'too short... type more';
 52+FCKLang.wikiImgStartTyping = 'start typing in the above field';
 53+FCKLang.wikiImgStopTyping = 'stop typing to search';
 54+FCKLang.wikiImgSearching = 'searching...';
 55+FCKLang.wikiImgSearchNothing = 'no images found';
 56+FCKLang.wikiImgSearch1Found = 'one image found';
 57+FCKLang.wikiImgSearchSeveral = '%1 images found ';
 58+FCKLang.wikiImgSearchALot = '%1 images found ';
 59+
 60+FCKLang.wikiLnk = 'Link';
 61+FCKLang.wikiLnkAutomatic = 'Automatic search results';
 62+FCKLang.wikiLnkNoSearchAnchor = 'anchor link... no search for it';
 63+FCKLang.wikiLnkNoSearchMail = 'e-mail link... no search for it';
 64+FCKLang.wikiLnkNoSearchExt = 'external link... no search for it';
 65+FCKLang.wikiLnkTooShort = 'too short... type more';
 66+FCKLang.wikiLnkStartTyping = 'start typing in the above field';
 67+FCKLang.wikiLnkStopTyping = 'stop typing to search';
 68+FCKLang.wikiLnkSearching = 'searching...';
 69+FCKLang.wikiLnkSearchNothing = 'no articles found';
 70+FCKLang.wikiLnkSearch1Found = 'one article found';
 71+FCKLang.wikiLnkSearchSeveral = '%1 articles found';
 72+FCKLang.wikiLnkSearchALot = '%1 articles found';
 73+
 74+FCKLang.wikiTeX = 'Formula (TeX markup)';
 75+FCKLang.wikiTeXEmpty = 'Please type the formula';
 76+
 77+FCKLang.wikiSpTag = 'Current Special Tag';
 78+FCKLang.wikiSpParam = 'Special tag parameters';
 79+
 80+FCKLang.wikiRef = 'Reference text (Wikitext)';
 81+FCKLang.wikiRefName = 'Reference name (optional)';
 82+
 83+FCKLang.wikiTmpl = 'Template raw definition (from {{ to }})';
 84+FCKLang.wikiTmplEmpty = 'Templates must start with {{ and end with }}. Please check it.';
 85+FCKLang.wikiTmpsel = '(Pick up a template manual here)';
 86+
 87+FCKLang.wikiUnsupportedLanguage = 'Unsupported language: %1';
 88+
 89+FCKLang.DplHelp = 'DPL stands for Dynamic Page List, and allows to generate a formatted list of pages based on selection criteria. See %link for details';
 90+FCKLang.inputboxHelp = 'Inputbox allows to create a form for users to create new pages. The new pages edit box can be pre-loaded with any template. See %link for details';
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/math.html
@@ -60,6 +60,7 @@
6161 // Activate the "OK" button.
6262 window.parent.SetOkButton( true ) ;
6363 window.parent.SetAutoSize( true ) ;
 64+ GetE('xTemplateRaw').focus();
6465 }
6566
6667 function LoadSelection()
@@ -73,35 +74,50 @@
7475 function Ok()
7576 {
7677 var formula = GetE('xTemplateRaw').value.Trim() ;
77 -
 78+
7879 if ( formula.length == 0 )
7980 {
80 - alert( 'Please type the formula' ) ;
 81+ alert( FCKLang.wikiTeXEmpty || 'Please type the formula' ) ;
8182 return false ;
8283 }
8384
84 - window.parent.document.getElementById( 'btnOk' ).disabled = true ;
85 - window.parent.document.getElementById( 'btnCancel' ).disabled = true ;
 85+ if ( oEditor.window.parent.FCKeditorAPI && oEditor.window.parent.FCKeditorAPI.Version.match( /^2\.5/ ) ) {
 86+ window.parent.document.getElementById( 'btnOk' ).disabled = true ;
 87+ window.parent.document.getElementById( 'btnCancel' ).disabled = true ;
 88+ }
8689
8790 oEditor.window.parent.sajax_request_type = 'GET' ;
8891 oEditor.window.parent.sajax_do_call( 'wfSajaxGetMathUrl', [formula], UpdateImageFromAjax ) ;
89 -
 92+
9093 return false ;
9194 }
9295
9396 function UpdateImageFromAjax( response )
9497 {
 98+ oEditor.FCKUndo.SaveUndoStep() ;
 99+
95100 if ( !oMathImage )
 101+ {
96102 oMathImage = FCK.CreateElement( 'IMG' ) ;
 103+ oMathImage.className = 'FCK__MWMath' ;
 104+ oMathImage.src = FCKConfig.PluginsPath + 'mediawiki/images/icon_math.gif' ;
 105+ }
97106 else
98 - oEditor.FCKUndo.SaveUndoStep() ;
99 -
 107+ {
 108+ if ( response.responseText )
 109+ {
 110+ oMathImage.src = response.responseText ;
 111+ SetAttribute( oMathImage, "_fcksavedurl", response.responseText ) ;
 112+ }
 113+ else
 114+ {
 115+ oMathImage.src = FCKConfig.PluginsPath + 'mediawiki/images/icon_math.gif' ;
 116+ }
 117+ }
 118+
100119 SetAttribute( oMathImage, "_fck_mw_math", GetE('xTemplateRaw').value.Trim() ) ;
101120 SetAttribute( oMathImage, "_fckfakelement", 'true' ) ;
102121
103 - oMathImage.src = response.responseText ;
104 - SetAttribute( oMathImage, "_fcksavedurl", response.responseText ) ;
105 -
106122 // Call it using setTimeout to avoid a strange behavior in Firefox.
107123 window.setTimeout( window.parent.Cancel, 0 ) ;
108124 }
@@ -113,7 +129,7 @@
114130 <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
115131 <tr>
116132 <td>
117 - <span>Formula (TeX markup)</span>
 133+ <span fcklang="wikiTeX">Formula (TeX markup)</span>
118134 </td>
119135 </tr>
120136 <tr>
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/template.html
@@ -43,8 +43,8 @@
4444 //#### Dialog Tabs
4545
4646 // Set the dialog tabs.
47 -window.parent.AddTab( 'Edit', 'Edit' ) ;
48 -window.parent.AddTab( 'Manual', 'Manual' ) ;
 47+window.parent.AddTab( 'Edit', FCKLang.wikiTabEdit || 'Edit' ) ;
 48+window.parent.AddTab( 'Manual', FCKLang.wikiTabManual || 'Manual' ) ;
4949
5050 function OnDialogTabChange( tabCode )
5151 {
@@ -75,6 +75,7 @@
7676 // Activate the "OK" button.
7777 window.parent.SetOkButton( true ) ;
7878 window.parent.SetAutoSize( true ) ;
 79+ GetE('xTemplateRaw').focus();
7980 }
8081
8182 function LoadSearchResults( result )
@@ -95,18 +96,19 @@
9697 var empty = '';
9798 oEditor.window.parent.sajax_request_type = 'GET' ;
9899 oEditor.window.parent.sajax_do_call( 'wfSajaxSearchTemplateFCKeditor',[empty], LoadSearchResults ) ;
99 -
 100+
100101 if ( !oTemplateSpan ) return ;
101102
102103 var inputText = FCKTools.HTMLDecode(oTemplateSpan.innerHTML);
103 - if (inputText.length>0 && inputText.indexOf('{{#')<0 && inputText.indexOf('{{:')<0 )
 104+ inputText = FCKConfig.ProtectedSource.Revert(inputText, 0); //#2509
 105+ if (inputText.length>0 && inputText.indexOf('{{#')<0 && inputText.indexOf('{{:')<0 )
104106 {
105107 var templateName = inputText.substring(2,inputText.indexOf('fckLR'));
106 - if (inputText.indexOf('fckLR')<1)
 108+ if (inputText.indexOf('fckLR')<1)
107109 templateName = inputText.substring(2,inputText.indexOf('|'));
108 - if (inputText.indexOf('|')<1)
 110+ if (inputText.indexOf('|')<1)
109111 templateName = inputText.substring(2,inputText.indexOf('}}'));
110 -
 112+
111113 SetUrl(templateName.charAt(0).toUpperCase() + templateName.substr(1));
112114 }
113115 GetE('xTemplateRaw').value = inputText.replace(/fckLR/g,'\r\n').replace( /&quot;/g, '"' );
@@ -127,15 +129,16 @@
128130 oTemplateSpan = FCK.EditorDocument.createElement( 'SPAN' ) ;
129131 oTemplateSpan.className = 'fck_mw_template' ;
130132 }
131 -
132 - var templateData = FCKTools.HTMLEncode(GetE('xTemplateRaw').value.Trim().replace(/(\r\n|\n)/g, 'fckLR')).replace( /"/g, '&quot;' ) ;
133 -
 133+
 134+ var protectedValue = FCKConfig.ProtectedSource.Protect(GetE('xTemplateRaw').value);
 135+ var templateData = FCKTools.HTMLEncode(protectedValue.toString().Trim().replace(/(\r\n|\n)/g, 'fckLR')).replace( /"/g, '&quot;' ) ;
 136+
134137 if ( !( /^{{[\s\S]+}}$/.test( templateData ) ) )
135138 {
136 - alert( 'Templates must start with {{ and end with }}. Please check it.' ) ;
 139+ alert( FCKLang.wikiTmplEmpty || 'Templates must start with {{ and end with }}. Please check it.' ) ;
137140 return false ;
138141 }
139 -
 142+
140143 oTemplateSpan.innerHTML = templateData ;
141144
142145 if ( !oFakeImage )
@@ -156,7 +159,7 @@
157160 <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
158161 <tr>
159162 <td>
160 - <span>Template raw definition (from {{ to }})</span><br />
 163+ <span fcklang="wikiTmpl">Template raw definition (from {{ to }})</span><br />
161164 </td>
162165 </tr>
163166 <tr>
@@ -176,7 +179,7 @@
177180 <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
178181 <tr>
179182 <select id="xWikiResults" style="width: 100%;" onchange="SetUrl( this.value );">
180 - <option value="">&lt;Pick up a template manual here&gt;</option>
 183+ <option fcklang="wikiTmpsel" value="">&lt;Pick up a template manual here&gt;</option>
181184 </select>
182185 </tr>
183186 <tr>
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/ref.html
@@ -63,6 +63,7 @@
6464 // Activate the "OK" button.
6565 window.parent.SetOkButton( true ) ;
6666 window.parent.SetAutoSize( true ) ;
 67+ GetE('xRefText').focus();
6768 }
6869
6970 function LoadSelection()
@@ -81,7 +82,7 @@
8283 oRef = FCK.EditorDocument.createElement( 'SPAN' ) ;
8384 oRef.className = 'fck_mw_ref' ;
8485 }
85 -
 86+
8687 var refData = FCKTools.HTMLEncode( GetE('xRefText').value ).Trim().replace( /"/g, '&quot;' ) ;
8788 oRef.innerHTML = refData ;
8889 SetAttribute( oRef, "name", GetE('xRefName').value ) ;
@@ -103,7 +104,7 @@
104105 <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
105106 <tr>
106107 <td>
107 - <span>Reference text (Wikitext)</span>
 108+ <span fcklang="wikiRef">Reference text (Wikitext)</span>
108109 </td>
109110 </tr>
110111 <tr>
@@ -114,7 +115,7 @@
115116 </tr>
116117 <tr>
117118 <td>
118 - Reference name (optional)<br />
 119+ <span fcklang="wikiRefName">Reference name (optional)</span><br />
119120 <input id="xRefName" type="text" size="15" />
120121 </td>
121122 </tr>
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/category.html
@@ -0,0 +1,395 @@
 2+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 3+<!--
 4+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 5+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
 6+ *
 7+ * == BEGIN LICENSE ==
 8+ *
 9+ * Licensed under the terms of any of the following licenses at your
 10+ * choice:
 11+ *
 12+ * - GNU General Public License Version 2 or later (the "GPL")
 13+ * http://www.gnu.org/licenses/gpl.html
 14+ *
 15+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 16+ * http://www.gnu.org/licenses/lgpl.html
 17+ *
 18+ * - Mozilla Public License Version 1.1 or later (the "MPL")
 19+ * http://www.mozilla.org/MPL/MPL-1.1.html
 20+ *
 21+ * == END LICENSE ==
 22+ *
 23+ * Category dialog window.
 24+-->
 25+<html>
 26+<head>
 27+<title>Categories</title>
 28+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 29+<meta name="robots" content="noindex, nofollow" />
 30+<script type="text/javascript">
 31+var oEditor = window.parent.InnerDialogLoaded();
 32+var FCK = oEditor.FCK;
 33+var FCKLang = oEditor.FCKLang;
 34+var FCKConfig = oEditor.FCKConfig;
 35+var FCKRegexLib = oEditor.FCKRegexLib;
 36+var FCKTools = oEditor.FCKTools;
 37+var FCKBrowserInfo = oEditor.FCKBrowserInfo;
 38+var EditorDocument = oEditor.FCK.EditorDocument;
 39+
 40+document.write( '<script src="' + FCKConfig.BasePath + 'dialog/common/fck_dialog_common.js" type="text/javascript"><\/script>' );
 41+
 42+window.onload = function()
 43+{
 44+ // Translate the dialog box texts.
 45+ oEditor.FCKLanguageManager.TranslatePage( document );
 46+
 47+ // Load the selected link information (if any).
 48+ InitSelected();
 49+ SetSearchMessage( FCKLang.wikiLoadingCategories || 'loading categories...' );
 50+ oEditor.window.parent.sajax_request_type = 'GET';
 51+ oEditor.window.parent.sajax_do_call( 'wfSajaxSearchCategoryFCKeditor', [], InitCategoryTree );
 52+
 53+ // Activate the "OK" button.
 54+ window.parent.SetOkButton( true );
 55+ window.parent.SetAutoSize( true );
 56+};
 57+
 58+var selectedCats;
 59+
 60+function InitSelected()
 61+{
 62+ selectedCats = new Array();
 63+ var node = EditorDocument;
 64+ while ( node )
 65+ {
 66+ if ( node.nodeType == 1 && node.tagName.toLowerCase() == 'a' )
 67+ {
 68+ // Get the actual Link href.
 69+ var sHRef = node.getAttribute( '_fcksavedurl' );
 70+ if ( sHRef == null )
 71+ sHRef = node.getAttribute( 'href', 2 ) || '';
 72+ if ( sHRef.StartsWith( 'Category:' ) )
 73+ {
 74+ var select = GetE( 'xCategories' );
 75+ var cat = sHRef.slice( 9 );
 76+ SelectCategory( cat, -1 );
 77+ }
 78+ }
 79+ node = FCKTools.GetNextNode( node, EditorDocument );
 80+ }
 81+}
 82+
 83+function SelectCategory( cat, catTreeRow )
 84+{
 85+ var select, row = parseInt( catTreeRow );
 86+ if ( row >= 0 )
 87+ {
 88+ select = GetE( 'xWikiResults' );
 89+ cat = select.options[ row ].text;
 90+ var lvl = 0;
 91+ while ( cat.charAt( lvl ) == placeholder )
 92+ lvl++;
 93+ cat = cat.slice( lvl );
 94+ if ( cat.charAt( 0 ) == '[' && cat.charAt( cat.length - 1 ) == ']' )
 95+ cat = cat.substring( 1, cat.length - 1 );
 96+ }
 97+
 98+ if ( selectedCats[ cat ] )
 99+ delete selectedCats[ cat ];
 100+ else
 101+ selectedCats[ cat ] = cat;
 102+
 103+ select = GetE( 'xCategories' );
 104+
 105+ while ( select.options.length > 0 )
 106+ select.remove( 0 );
 107+
 108+ for ( cat in selectedCats )
 109+ FCKTools.AddSelectOption( select, cat, cat );
 110+}
 111+
 112+var catTree;
 113+
 114+function InitCategoryTree( result )
 115+{
 116+ SetSearchMessage( FCKLang.wikiLnkStartTyping || 'start typing in the above field' );
 117+
 118+ catTree = new Object();
 119+ var levelsHead = new Array( 'root' );
 120+ var levelsBody = new Array( '' );
 121+
 122+ var results = result.responseText.Trim().split( '\n' );
 123+ var previousLvl = -1;
 124+ for ( var i = 0 ; i < results.length ; i++ )
 125+ {
 126+ var lvl = 0;
 127+ while ( results[ i ].charAt( lvl ) == ' ' )
 128+ lvl++;
 129+ var t = results[ i ].slice( lvl );
 130+ for ( var j = previousLvl ; j > lvl - 1 ; j-- )
 131+ {
 132+
 133+ if ( levelsBody[ j + 1 ] != '' )
 134+ catTree[ levelsHead[ j + 1 ] ] = levelsBody[ j + 1 ];
 135+ delete levelsHead[ j + 1 ];
 136+ delete levelsBody[ j + 1 ];
 137+ }
 138+ if ( lvl > previousLvl )
 139+ levelsBody[ lvl ] = t;
 140+ else
 141+ levelsBody[ lvl ] = levelsBody[ lvl ] + ' ' + t;
 142+ levelsHead[ lvl + 1 ] = t;
 143+ levelsBody[ lvl + 1 ] = '';
 144+ previousLvl = lvl;
 145+ }
 146+ for ( var j = previousLvl ; j >= -1 ; j-- )
 147+ {
 148+ if ( levelsBody[ j + 1 ] != '' )
 149+ catTree[ levelsHead[ j + 1 ] ] = levelsBody[ j + 1 ];
 150+ delete levelsHead[ j + 1 ];
 151+ delete levelsBody[ j + 1 ];
 152+ }
 153+
 154+ ShowCategoriesSubTree( -1 );
 155+}
 156+
 157+var placeholder = '.';
 158+
 159+//draw category subtree
 160+function ShowCategoriesSubTree( rowInTree )
 161+{
 162+ var row = parseInt( rowInTree );
 163+ var select = GetE( 'xWikiResults' );
 164+ var root = 'root';
 165+ var lvl = -1;
 166+ var prefix = '';
 167+ if ( row >= 0 )
 168+ {
 169+ root = select.options[ row ].text;
 170+ lvl = 0;
 171+ while ( root.charAt( lvl ) == placeholder )
 172+ lvl++;
 173+ root = root.slice( lvl );
 174+ if ( root.charAt( 0 ) == '[' && root.charAt( root.length - 1 ) == ']' )
 175+ root = root.substring( 1, root.length - 1 );
 176+ prefix = new Array( lvl + 1 + 3 ).join( placeholder );
 177+ }
 178+ if ( !catTree[ root ] )
 179+ return;
 180+
 181+ var itCount = select.options.length;
 182+ var itSkip = row + 1;
 183+ var opts = new Array();
 184+ for ( var i = row + 1 ; i < itCount ; i++ )
 185+ {
 186+ var t = select.options[ i ].text;
 187+ var sublvl = 0;
 188+ while ( t.charAt( sublvl ) == placeholder )
 189+ sublvl++;
 190+ if ( sublvl > lvl )
 191+ itSkip = i + 1;
 192+ else
 193+ break;
 194+ }
 195+ for ( var i = itCount - 1 ; i > row ; i-- )
 196+ {
 197+ var t = select.options[ i ].text;
 198+ if ( i >= itSkip )
 199+ opts.push( t );
 200+ select.remove( i );
 201+ }
 202+ if ( itSkip == row + 1 )
 203+ {
 204+ var cats = catTree[ root ].split( ' ' );
 205+
 206+ for ( var k in cats )
 207+ {
 208+ var p = cats[ k ];
 209+ if ( catTree[ cats[ k ] ] )
 210+ p = '[' + p + ']';
 211+ var e = FCKTools.AddSelectOption( select, prefix + p, ++row );
 212+ if ( catTree[ cats[ k ] ] )
 213+ e.style.color = '#00f';
 214+
 215+ }
 216+ }
 217+ for ( var i = opts.length - 1 ; i >= 0 ; i-- )
 218+ {
 219+ var e = FCKTools.AddSelectOption( select, opts[ i ], ++row );
 220+ if ( opts[ i ].indexOf( '[' ) >= 0 )
 221+ e.style.color = '#00f';
 222+ }
 223+
 224+}
 225+
 226+//draw filtered
 227+function ShowFilteredCategories( filter )
 228+{
 229+ var select = GetE( 'xWikiResults' );
 230+ while ( select.options.length > 0 )
 231+ select.remove( 0 );
 232+ var found = new Object();
 233+ if ( filter.length == 0 )
 234+ {
 235+ ShowCategoriesSubTree( -1 );
 236+ return;
 237+ }
 238+ filter = filter.toLowerCase();
 239+ var row = -1;
 240+ for ( var folder in catTree )
 241+ {
 242+ var cats = catTree[ folder ].split( ' ' );
 243+ for ( var k in cats )
 244+ {
 245+ var p = cats[ k ].toLowerCase();
 246+ if ( p.indexOf( filter ) >= 0 )
 247+ {
 248+ if ( found[ cats[ k ] ] )
 249+ ;
 250+ else
 251+ {
 252+ found[ cats[ k ] ] = cats[ k ];
 253+ FCKTools.AddSelectOption( select, cats[ k ], ++row );
 254+ }
 255+ }
 256+ }
 257+ }
 258+}
 259+
 260+function AddNew()
 261+{
 262+ var select = GetE( 'txtUrl' );
 263+ if ( select.value.Trim() )
 264+ SelectCategory( select.value, -1 );
 265+ select.value = '';
 266+}
 267+
 268+//#### The OK button was hit.
 269+function Ok()
 270+{
 271+ var nodes = new Array();
 272+ var node = EditorDocument;
 273+ var nodeNext;
 274+ var s = '';
 275+ var i = 0;
 276+ while ( node )
 277+ {
 278+ nodeNext = FCKTools.GetNextNode( node, EditorDocument );
 279+ if ( node.nodeType == 1 && node.tagName.toLowerCase() == 'a' )
 280+ {
 281+ // Get the actual Link href.
 282+ var sHRef = node.getAttribute( '_fcksavedurl' );
 283+ if ( sHRef == null )
 284+ sHRef = node.getAttribute( 'href', 2 ) || '';
 285+ if ( sHRef.StartsWith( 'Category:' ) )
 286+ nodes[ i++ ] = node;
 287+ }
 288+ node = nodeNext;
 289+ }
 290+ for ( var i = 0 ; i < nodes.length ; i++ )
 291+ nodes[ i ].parentNode.removeChild( nodes[ i ] );
 292+
 293+ for ( var cat in selectedCats )
 294+ AddCategoryLink( cat );
 295+
 296+ CleanUpCategoryLinks();
 297+
 298+ return true;
 299+}
 300+
 301+function CleanUpCategoryLinks()
 302+{
 303+ var node = EditorDocument;
 304+ var nodes = [];
 305+ while ( node )
 306+ {
 307+ if ( node.nodeType == 1 && node.tagName.toLowerCase() == 'a' )
 308+ {
 309+ // Get the actual Link href.
 310+ var sHRef = node.getAttribute( '_fcksavedurl' );
 311+ if ( sHRef == null )
 312+ sHRef = node.getAttribute( 'href', 2 ) || '';
 313+ if ( sHRef.StartsWith( 'Category:' ) )
 314+ nodes.push(node);
 315+ }
 316+ node = FCKTools.GetNextNode( node, EditorDocument );
 317+ }
 318+
 319+ for ( var i = 0; i < nodes.length ; i++ )
 320+ EditorDocument.body.appendChild( nodes[i] );
 321+}
 322+
 323+function AddCategoryLink( cat )
 324+{
 325+ var sUri = 'Category:' + cat;
 326+ var sInnerHtml;
 327+
 328+ // If no link is selected, create a new one (it may result in more than one link creation - #220).
 329+ var aLinks = oEditor.FCK.CreateLink( sUri );
 330+
 331+ // If no selection, no links are created, so use the uri as the link text (by dom, 2006-05-26)
 332+ var aHasSelection = (aLinks.length > 0);
 333+ if ( !aHasSelection )
 334+ {
 335+ sInnerHtml = sUri;
 336+
 337+ var oLinkPathRegEx = new RegExp( "//?([^?\"']+)([?].*)?$" );
 338+ var asLinkPath = oLinkPathRegEx.exec( sUri );
 339+ if ( asLinkPath != null )
 340+ sInnerHtml = asLinkPath[ 1 ]; // use matched path
 341+
 342+ // Create a new (empty) anchor.
 343+ aLinks = [ oEditor.FCK.InsertElement( 'a' ) ];
 344+ }
 345+
 346+ oEditor.FCKUndo.SaveUndoStep();
 347+
 348+ for ( var i = 0 ; i < aLinks.length ; i++ )
 349+ {
 350+ oLink = aLinks[ i ];
 351+
 352+ if ( aHasSelection )
 353+ sInnerHtml = oLink.innerHTML; // Save the innerHTML (IE changes it if it is like an URL).
 354+
 355+ oLink.href = sUri;
 356+ SetAttribute( oLink, '_fcksavedurl', sUri );
 357+
 358+ oLink.innerHTML = sInnerHtml; // Set (or restore) the innerHTML
 359+ }
 360+
 361+ return true;
 362+}
 363+
 364+//#### Called while the user types the URL.
 365+function OnUrlChange()
 366+{
 367+ var link = GetE( 'txtUrl' ).value.Trim();
 368+ ShowFilteredCategories( link );
 369+ return;
 370+}
 371+
 372+function SetSearchMessage( message )
 373+{
 374+ GetE( 'xWikiSearchStatus' ).innerHTML = message;
 375+}
 376+</script>
 377+</head>
 378+<body scroll="no" style="overflow: hidden">
 379+<div id="divInfo">
 380+<div id="divLinkTypeUrl"><span fcklang="wikiSelectedCategories">Selected categories</span><br />
 381+<select id="xCategories" size="10" style="width: 100%; height: 70px"
 382+ ondblclick="SelectCategory( this.value,-1);">
 383+</select><br />
 384+<span fcklang="wikiSearchCategory">Search category</span><br />
 385+<input id="txtUrl" style="width: 76%" type="text"
 386+ onkeyup="OnUrlChange();" /> <input id="btnNew" style="width: 22%"
 387+ type="button" onclick="AddNew();" value="Add new" fcklang="wikiAddNewCategory"/> <br />
 388+<span fcklang="wikiCategoryTree">Category tree</span> (<span fcklang="wikiLnkStartTyping" id="xWikiSearchStatus">start typing in the
 389+above field</span>)<br />
 390+<select id="xWikiResults" size="10" style="width: 100%; height: 300px"
 391+ onclick="ShowCategoriesSubTree( this.value );"
 392+ ondblclick="SelectCategory('', this.value );">
 393+</select></div>
 394+</div>
 395+</body>
 396+</html>
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/link.html
@@ -46,7 +46,7 @@
4747 FCK.Selection.SelectNode( oLink ) ;
4848
4949 var bLinkEqualsName = false ;
50 -
 50+
5151 window.onload = function()
5252 {
5353 // Translate the dialog box texts.
@@ -58,6 +58,7 @@
5959 // Activate the "OK" button.
6060 window.parent.SetOkButton( true ) ;
6161 window.parent.SetAutoSize( true ) ;
 62+ GetE('txtUrl').focus();
6263 }
6364
6465 function LoadSelection()
@@ -68,10 +69,15 @@
6970 var sHRef = oLink.getAttribute( '_fcksavedurl' ) ;
7071 if ( sHRef == null )
7172 sHRef = oLink.getAttribute( 'href' , 2 ) || '' ;
72 -
 73+
 74+ sHRef = FCKConfig.ProtectedSource.Revert(sHRef, 0); //#2509
 75+
7376 if ( sHRef == oLink.innerHTML )
7477 bLinkEqualsName = true ;
7578
 79+ if ( sHRef.toLowerCase().StartsWith( 'rtecolon' ) )
 80+ sHRef = ":" + sHRef.substring(8) ;
 81+
7682 GetE('txtUrl').value = sHRef ;
7783 }
7884
@@ -84,22 +90,22 @@
8591
8692 if ( searchTimer )
8793 window.clearTimeout( searchTimer ) ;
88 -
 94+
8995 if ( link.StartsWith( '#' ) )
9096 {
91 - SetSearchMessage( 'anchor link... no search for it' ) ;
 97+ SetSearchMessage( FCKLang.wikiLnkNoSearchAnchor || 'anchor link... no search for it' ) ;
9298 return ;
93 - }
94 -
 99+ }
 100+
95101 if ( link.StartsWith( 'mailto:' ) )
96102 {
97 - SetSearchMessage( 'e-mail link... no search for it' ) ;
 103+ SetSearchMessage( FCKLang.wikiLnkNoSearchMail || 'e-mail link... no search for it' ) ;
98104 return ;
99 - }
100 -
 105+ }
 106+
101107 if( /^\w+:\/\//.test( link ) )
102108 {
103 - SetSearchMessage( 'external link... no search for it' ) ;
 109+ SetSearchMessage( FCKLang.wikiLnkNoSearchExt || 'external link... no search for it' ) ;
104110 return ;
105111 }
106112
@@ -108,13 +114,13 @@
109115 ClearSearch() ;
110116
111117 if ( link.length == 0 )
112 - SetSearchMessage( 'start typing in the above field' ) ;
 118+ SetSearchMessage( FCKLang.wikiLnkStartTyping || 'start typing in the above field' ) ;
113119 else
114 - SetSearchMessage( 'too short... type more' ) ;
 120+ SetSearchMessage( FCKLang.wikiLnkTooShort || 'too short... type more' ) ;
115121 return ;
116122 }
117 -
118 - SetSearchMessage( 'stop typing to search' ) ;
 123+
 124+ SetSearchMessage( FCKLang.wikiLnkStopTyping || 'stop typing to search' ) ;
119125 searchTimer = window.setTimeout( StartSearch, 500 ) ;
120126 }
121127
@@ -125,7 +131,7 @@
126132 if ( link.length < 3 )
127133 return ;
128134
129 - SetSearchMessage( 'searching...' ) ;
 135+ SetSearchMessage( FCKLang.wikiLnkSearching || 'searching...' ) ;
130136
131137 // Make an Ajax search for the pages.
132138 oEditor.window.parent.sajax_request_type = 'GET' ;
@@ -136,19 +142,19 @@
137143 {
138144 var results = result.responseText.Trim().split( '\n' ) ;
139145 var select = GetE( 'xWikiResults' ) ;
140 -
 146+
141147 ClearSearch() ;
142148
143149 if ( results.length == 0 || ( results.length == 1 && results[0].length == 0 ) )
144150 {
145 - SetSearchMessage( 'no articles found' ) ;
 151+ SetSearchMessage( FCKLang.wikiLnkSearchNothing || 'no articles found' ) ;
146152 }
147153 else
148154 {
149155 if ( results.length == 1 )
150 - SetSearchMessage( 'one article found' ) ;
 156+ SetSearchMessage( FCKLang.wikiLnkSearch1Found || 'one article found' ) ;
151157 else
152 - SetSearchMessage( results.length + ' articles found' ) ;
 158+ SetSearchMessage( (FCKLang.wikiLnkSearchSeveral || '%1 articles found').replace( /%1/g, results.length ) ) ;
153159
154160 for ( var i = 0 ; i < results.length ; i++ )
155161 FCKTools.AddSelectOption( select, results[i], results[i] ) ;
@@ -160,7 +166,7 @@
161167 var select = GetE( 'xWikiResults' ) ;
162168
163169 while ( select.options.length > 0 )
164 - select.remove( 0 )
 170+ select.remove( 0 )
165171 }
166172
167173 function SetSearchMessage( message )
@@ -177,22 +183,28 @@
178184 function Ok()
179185 {
180186 var sUri = GetE('txtUrl').value ;
 187+ sUri = FCKConfig.ProtectedSource.Protect(sUri); //#2509
 188+ var realUri = sUri;
 189+ if (sUri.StartsWith( ':' ) )
 190+ sUri = sUri.replace(/:/, "rtecolon");
181191 var sInnerHtml ;
182192
183193 // If no link is selected, create a new one (it may result in more than one link creation - #220).
184194 var aLinks = oLink ? [ oLink ] : oEditor.FCK.CreateLink( sUri ) ;
185195
186196 // If no selection, no links are created, so use the uri as the link text (by dom, 2006-05-26)
 197+ var noTitle = false;
187198 var aHasSelection = ( aLinks.length > 0 ) ;
188199 if ( !aHasSelection )
189200 {
190 - sInnerHtml = sUri;
 201+ sInnerHtml = realUri;
 202+ noTitle = true;
191203
192204 var oLinkPathRegEx = new RegExp("//?([^?\"']+)([?].*)?$") ;
193 - var asLinkPath = oLinkPathRegEx.exec( sUri ) ;
 205+ var asLinkPath = oLinkPathRegEx.exec( realUri ) ;
194206 if (asLinkPath != null)
195207 sInnerHtml = asLinkPath[1]; // use matched path
196 -
 208+
197209 // Create a new (empty) anchor.
198210 aLinks = [ oEditor.FCK.InsertElement( 'a' ) ] ;
199211 }
@@ -210,10 +222,12 @@
211223 SetAttribute( oLink, '_fcksavedurl', sUri ) ;
212224
213225 if ( bLinkEqualsName )
214 - oLink.innerHTML = sUri ;
 226+ oLink.innerHTML = realUri ;
215227 else
216228 oLink.innerHTML = sInnerHtml ; // Set (or restore) the innerHTML
217229
 230+ if ( noTitle )
 231+ SetAttribute( oLink, '_fcknotitle','true');
218232 }
219233
220234 // Select the (first) link.
@@ -227,10 +241,10 @@
228242 <body scroll="no" style="overflow: hidden">
229243 <div id="divInfo">
230244 <div id="divLinkTypeUrl">
231 - <span>Link</span><br />
 245+ <span fcklang="wikiLnk">Link</span><br />
232246 <input id="txtUrl" style="width: 100%" type="text" onkeyup="OnUrlChange();" />
233247 <br />
234 - Automatic search results (<span id="xWikiSearchStatus">start typing in the above field</span>)<br />
 248+ <span fcklang="wikiLnkAutomatic">Automatic search results</span> (<span fcklang="wikiLnkStartTyping" id="xWikiSearchStatus">start typing in the above field</span>)<br />
235249 <select id="xWikiResults" size="10" style="width: 100%; height:150px" onclick="SetUrl( this.value );">
236250 </select>
237251 </div>
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/source.html
@@ -0,0 +1,137 @@
 2+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 3+<!--
 4+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 5+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
 6+ *
 7+ * == BEGIN LICENSE ==
 8+ *
 9+ * Licensed under the terms of any of the following licenses at your
 10+ * choice:
 11+ *
 12+ * - GNU General Public License Version 2 or later (the "GPL")
 13+ * http://www.gnu.org/licenses/gpl.html
 14+ *
 15+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 16+ * http://www.gnu.org/licenses/lgpl.html
 17+ *
 18+ * - Mozilla Public License Version 1.1 or later (the "MPL")
 19+ * http://www.mozilla.org/MPL/MPL-1.1.html
 20+ *
 21+ * == END LICENSE ==
 22+ *
 23+ * Link dialog window.
 24+-->
 25+<html>
 26+<head>
 27+ <title>Source Properties</title>
 28+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 29+ <meta name="robots" content="noindex, nofollow" />
 30+ <script type="text/javascript">
 31+
 32+var oEditor = window.parent.InnerDialogLoaded() ;
 33+var FCK = oEditor.FCK ;
 34+var FCKLang = oEditor.FCKLang ;
 35+var FCKConfig = oEditor.FCKConfig ;
 36+var FCKRegexLib = oEditor.FCKRegexLib ;
 37+var FCKTools = oEditor.FCKTools ;
 38+
 39+document.write( '<script src="' + FCKConfig.BasePath + 'dialog/common/fck_dialog_common.js" type="text/javascript"><\/script>' ) ;
 40+
 41+ </script>
 42+ <script type="text/javascript">
 43+
 44+// Get the selected flash embed (if available).
 45+var oFakeImage = FCK.Selection.GetSelectedElement() ;
 46+var oSource ;
 47+
 48+if ( oFakeImage )
 49+{
 50+ if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fck_mw_source') )
 51+ {
 52+ oSource = FCK.GetRealElement( oFakeImage ) ;
 53+ }
 54+ else
 55+ {
 56+ oFakeImage = null ;
 57+ }
 58+}
 59+
 60+window.onload = function()
 61+{
 62+ // Translate the dialog box texts.
 63+ oEditor.FCKLanguageManager.TranslatePage(document) ;
 64+
 65+ // Load the selected link information (if any).
 66+ LoadSelection() ;
 67+
 68+ // Activate the "OK" button.
 69+ window.parent.SetOkButton( true ) ;
 70+ window.parent.SetAutoSize( true ) ;
 71+}
 72+
 73+function LoadSelection()
 74+{
 75+ if ( !oSource ) return ;
 76+
 77+ GetE('xSourceText').value = FCKTools.HTMLDecode( oSource.innerHTML ).replace(/fckLR/g,'\r\n').replace( /&quot;/g, '"' );
 78+ GetE('xSourceLang').value = oSource.getAttribute( 'lang' ) ;
 79+}
 80+
 81+//#### The OK button was hit.
 82+function Ok()
 83+{
 84+ var supportedLanguages = ',abap,actionscript,actionscript3,ada,apache,applescript,apt_sources,asm,asp,autoit,avisynth,bash,basic4gl,bf,blitzbasic,bnf,boo,c,c_mac,caddcl,cadlisp,cfdg,cfm,cil,cobol,cpp,cpp-qt,csharp,css,d,delphi,diff,div,dos,dot,eiffel,email,fortran,freebasic,genero,gettext,glsl,gml,gnuplot,groovy,haskell,hq9plus,html4strict,idl,ini,inno,intercal,io,java,java5,javascript,kixtart,klonec,klonecpp,latex,lisp,lolcode,lotusformulas,lotusscript,lscript,lua,m68k,make,matlab,mirc,mpasm,mxml,mysql,nsis,objc,ocaml,ocaml-brief,oobas,oracle11,oracle8,pascal,per,perl,php,php-brief,pic16,pixelbender,plsql,povray,powershell,progress,prolog,providex,python,qbasic,rails,reg,robots,ruby,sas,scala,scheme,scilab,sdlbasic,smalltalk,smarty,sql,tcl,teraterm,text,thinbasic,tsql,typoscript,vb,vbnet,verilog,vhdl,vim,visualfoxpro,visualprolog,whitespace,winbatch,xml,xorg_conf,xpp,z80,';
 85+
 86+ if ( !oSource )
 87+ {
 88+ oSource = FCK.EditorDocument.createElement( 'SPAN' ) ;
 89+ oSource.className = 'fck_mw_source' ;
 90+ }
 91+
 92+ var sourceData = FCKTools.HTMLEncode(GetE('xSourceText').value.Trim().replace(/(\r\n|\n)/g, 'fckLR')).replace( /"/g, '&quot;' ) ;
 93+ var lang = GetE('xSourceLang').value.Trim().toLowerCase();
 94+
 95+ if ( lang.length && supportedLanguages.indexOf( ',' + lang + ',' ) == -1) {
 96+ alert( (FCKLang.wikiUnsupportedLanguage || 'Unsupported language: %1').replace(/%1/, lang) );
 97+ return false;
 98+ }
 99+
 100+ oSource.innerHTML = sourceData ;
 101+ oSource.setAttribute( 'lang', lang ) ;
 102+
 103+ if ( !oFakeImage )
 104+ {
 105+ oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__MWSource', oSource ) ;
 106+ oFakeImage.setAttribute( '_fck_mw_source', 'true', 0 ) ;
 107+ oFakeImage = FCK.InsertElement( oFakeImage ) ;
 108+ }
 109+
 110+ return true ;
 111+}
 112+
 113+ </script>
 114+</head>
 115+<body style="overflow: hidden">
 116+ <div id="divInfo">
 117+ <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
 118+ <tr>
 119+ <td>
 120+ <span fcklang="wikiSourceCode">Source Code</span>
 121+ </td>
 122+ </tr>
 123+ <tr>
 124+ <td height="100%">
 125+ <textarea wrap=OFF id="xSourceText" style="width: 100%; height: 100%; font-family: Monospace"
 126+ cols="50" rows="5"></textarea>
 127+ </td>
 128+ </tr>
 129+ <tr>
 130+ <td>
 131+ <span fcklang="wikiSourceLanguage">Source Language</span><br />
 132+ <input id="xSourceLang" type="text" size="15" />
 133+ </td>
 134+ </tr>
 135+ </table>
 136+ </div>
 137+</body>
 138+</html>
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/special.html
@@ -55,6 +55,11 @@
5656 oTemplateSpan = FCK.GetRealElement( oFakeImage ) ;
5757 sFakeClass = 'FCK__MWSpecial';
5858 }
 59+ else if ( oFakeImage.getAttribute('_fck_mw_html') )
 60+ {
 61+ oTemplateSpan = FCK.GetRealElement( oFakeImage ) ;
 62+ sFakeClass = 'FCK__MWHtml';
 63+ }
5964 else if ( oFakeImage.getAttribute('_fck_mw_nowiki') )
6065 {
6166 oTemplateSpan = FCK.GetRealElement( oFakeImage ) ;
@@ -99,6 +104,7 @@
100105 // Activate the "OK" button.
101106 window.parent.SetOkButton( true ) ;
102107 window.parent.SetAutoSize( true ) ;
 108+ GetE('xTemplateRaw').focus();
103109 }
104110
105111 function LoadSearchResults( result )
@@ -111,7 +117,7 @@
112118 for ( var i = 0 ; i < results.length ; i++ )
113119 FCKTools.AddSelectOption( select, results[i], results[i] ) ;
114120 }
115 -
 121+
116122 if ( sSelectedTag ) {
117123 select.value = sSelectedTag ;
118124 }
@@ -129,7 +135,7 @@
130136
131137 GetE('xTemplateRaw').value = FCKTools.HTMLDecode(oTemplateSpan.innerHTML).replace(/fckLR/g,'\r\n' ).replace( /&quot;/g, '"' ) ;
132138 var tagName = oTemplateSpan.getAttribute('_fck_mw_tagname').toLowerCase();
133 -
 139+
134140 sSelectedTag = tagName ;
135141 GetE('xSelectTag').value = tagName;
136142 }
@@ -138,10 +144,15 @@
139145 {
140146 var tagName = GetE('xSelectTag').value;
141147 if (tagName == 'dpl')
142 - GetE('xDefinition').innerHTML = 'DPL stands for Dynamic Page List, and allows to generate a formatted list of pages based on selection criteria. See <a href="#" onclick="javascript:window.open(\'http://semeb.com/dpldemo/index.php?title=Dynamic_Page_List\')">manual</a> for details';
143 -
 148+ {
 149+ if (!FCKLang.DplHelp) FCKLang.DplHelp = 'DPL stands for Dynamic Page List, and allows to generate a formatted list of pages based on selection criteria. See %link for details';
 150+ GetE('xDefinition').innerHTML = FCKLang.DplHelp.replace( /%link/g, '<a href="#" onclick="javascript:window.open(\'http://semeb.com/dpldemo/index.php?title=Dynamic_Page_List\')">manual</a>' ) ;
 151+ }
144152 if (tagName == 'inputbox')
145 - GetE('xDefinition').innerHTML = 'Inputbox allows to create a form for users to create new pages. The new pages edit box can be pre-loaded with any template. See <a href="#" onclick="javascript:window.open(\'http://meta.wikimedia.org/wiki/Help:Inputbox\')">manual</a> for details';
 153+ {
 154+ if (!FCKLang.inputboxHelp) FCKLang.inputboxHelp = 'Inputbox allows to create a form for users to create new pages. The new pages edit box can be pre-loaded with any template. See %link for details';
 155+ GetE('xDefinition').innerHTML = FCKLang.inputboxHelp.replace( /%link/g, '<a href="#" onclick="javascript:window.open(\'http://meta.wikimedia.org/wiki/Help:Inputbox\')">manual</a>' ) ;
 156+ }
146157 }
147158
148159 //#### The OK button was hit.
@@ -153,11 +164,11 @@
154165 oTemplateSpan.className = 'fck_mw_special' ;
155166 SetAttribute( oTemplateSpan, '_fck_mw_customtag', 'true' ) ;
156167 }
157 -
 168+
158169 var templateData = FCKTools.HTMLEncode(GetE('xTemplateRaw').value.Trim().replace(/(\r\n|\n)/g, 'fckLR' )).replace( /"/g, '&quot;' ) ;
159 -
 170+
160171 oTemplateSpan.innerHTML = templateData ;
161 - SetAttribute( oTemplateSpan, '_fck_mw_tagname', GetE('xSelectTag').value ) ;
 172+ SetAttribute( oTemplateSpan, '_fck_mw_tagname', GetE('xSelectTag').value ) ;
162173
163174 switch (GetE('xSelectTag').value)
164175 {
@@ -173,6 +184,9 @@
174185 case 'includeonly':
175186 sFakeClass = 'FCK__MWIncludeonly';
176187 break;
 188+ case 'html':
 189+ sFakeClass = 'FCK__MWHtml';
 190+ break;
177191 case 'onlyinclude':
178192 sFakeClass = 'FCK__MWOnlyinclude';
179193 break;
@@ -180,14 +194,14 @@
181195 sFakeClass = 'FCK__MWSpecial';
182196 break;
183197 }
184 -
 198+
185199 if ( !oFakeImage )
186200 {
187201 oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( sFakeClass, oTemplateSpan ) ;
188202 oFakeImage.setAttribute( '_fck_mw_special', 'true', 0 ) ;
189203 oFakeImage = FCK.InsertElement( oFakeImage ) ;
190204 }
191 - else
 205+ else
192206 oFakeImage.className = sFakeClass ;
193207
194208 return true ;
@@ -200,7 +214,7 @@
201215 <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
202216 <tr>
203217 <td>
204 - <span>Current Special Tag:</span>
 218+ <span fcklang="wikiSpTag">Current Special Tag</span>:
205219 <select id="xSelectTag" onchange="LoadDocumentation()">
206220 </select><br>
207221 <i><span id="xDefinition"></span></i>
@@ -209,7 +223,7 @@
210224 <tr>
211225 <td>
212226 <hr>
213 - Special tag parameters:
 227+ <span fcklang="wikiSpParam">Special tag parameters</span>:
214228 </tr>
215229 <tr>
216230 <td height="100%">
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/image.html
@@ -58,6 +58,7 @@
5959
6060 window.parent.SetAutoSize( true ) ;
6161 window.parent.SetOkButton( true ) ;
 62+ GetE('txtUrl').focus();
6263 }
6364
6465 function LoadSelection()
@@ -88,8 +89,10 @@
8990 return false ;
9091 }
9192
92 - window.parent.document.getElementById( 'btnOk' ).disabled = true ;
93 - window.parent.document.getElementById( 'btnCancel' ).disabled = true ;
 93+ if ( oEditor.window.parent.FCKeditorAPI && oEditor.window.parent.FCKeditorAPI.Version.match( /^2\.5/ ) ) {
 94+ window.parent.document.getElementById( 'btnOk' ).disabled = true ;
 95+ window.parent.document.getElementById( 'btnCancel' ).disabled = true ;
 96+ }
9497
9598 var imgName = GetE('txtUrl').value ;
9699 var imgCaption = GetE('txtAlt').value ;
@@ -191,13 +194,13 @@
192195 ClearSearch() ;
193196
194197 if ( link.length == 0 )
195 - SetSearchMessage( 'start typing in the above field' ) ;
 198+ SetSearchMessage( FCKLang.wikiImgStartTyping || 'start typing in the above field' ) ;
196199 else
197 - SetSearchMessage( 'too short... type more' ) ;
 200+ SetSearchMessage( FCKLang.wikiImgTooShort || 'too short... type more' ) ;
198201 return ;
199202 }
200203
201 - SetSearchMessage( 'stop typing to search' ) ;
 204+ SetSearchMessage( FCKLang.wikiImgStopTyping || 'stop typing to search' ) ;
202205 searchTimer = window.setTimeout( StartSearch, 500 ) ;
203206 }
204207
@@ -208,7 +211,7 @@
209212 if ( link.length < 3 )
210213 return ;
211214
212 - SetSearchMessage( 'searching...' ) ;
 215+ SetSearchMessage( FCKLang.wikiLnkSearching || 'searching...' ) ;
213216
214217 // Make an Ajax search for the pages.
215218 oEditor.window.parent.sajax_request_type = 'GET' ;
@@ -224,20 +227,21 @@
225228
226229 if ( results.length == 0 || ( results.length == 1 && results[0].length == 0 ) )
227230 {
228 - SetSearchMessage( 'no images found' ) ;
 231+ SetSearchMessage( FCKLang.wikiImgSearchNothing || 'no images found' ) ;
229232 }
230233 else
231234 {
232235 if ( results.length == 1 )
233 - SetSearchMessage( 'one image found' ) ;
 236+ SetSearchMessage( FCKLang.wikiImgSearch1Found || 'one image found' ) ;
234237 else
235 - SetSearchMessage( results.length + ' images found' ) ;
 238+ SetSearchMessage( (FCKLang.wikiImgSearchSeveral || '%1 images found').replace( /%1/g, results.length ) ) ;
236239
237240 for ( var i = 0 ; i < results.length ; i++ )
238241 FCKTools.AddSelectOption( select, results[i], results[i] ) ;
239242 }
240243 }
241244
 245+
242246 function ClearSearch()
243247 {
244248 var select = GetE( 'xWikiResults' ) ;
@@ -280,10 +284,10 @@
281285 <table cellspacing="1" cellpadding="1" border="0" width="100%">
282286 <tr valign="center">
283287 <td>
284 - <span>Image file name</span><br />
 288+ <span fcklang="wikiImgFileName">Image file name</span><br />
285289 <input id="txtUrl" style="width: 100%" type="text" onkeyup="OnUrlChange();" />
286290 <br />
287 - Automatic search results (<span id="xWikiSearchStatus">start typing in the above field</span>)<br />
 291+ <span fcklang="wikiImgAutomatic">Automatic search results</span> <b>(<span fcklang="wikiImgStartTyping" id="xWikiSearchStatus">start typing in the above field</span>)</b><br />
288292 <select id="xWikiResults" size="5" style="width: 100%; height: 70px" onclick="SetUrl( this.value );UpdatePreview();">
289293 </select>
290294 </td>
@@ -293,7 +297,7 @@
294298 </tr>
295299 <tr>
296300 <td colspan="2">
297 - <span>Caption</span><br />
 301+ <span fcklang="wikiImgCaption">Caption</span><br />
298302 <input id="txtAlt" style="width: 100%" type="text"><br />
299303 </td>
300304 </tr>
@@ -302,12 +306,12 @@
303307 <table cellspacing="0" cellpadding="0" border="0">
304308 <tr>
305309 <td nowrap="nowrap">
306 - Special Type<br />
 310+ <span fcklang="wikiImgType">Special Type</span><br />
307311 <select id="xType">
308312 <option value="" selected="selected"></option>
309 - <option value="thumb">Thumbnail</option>
310 - <option value="frame">Frame</option>
311 - <option value="border">Border</option>
 313+ <option fcklang="wikiImgTypeThumb" value="thumb">Thumbnail</option>
 314+ <option fcklang="wikiImgTypeFrame" value="frame">Frame</option>
 315+ <option fcklang="wikiImgTypeBorder" value="border">Border</option>
312316 </select>
313317 </td>
314318 <td style="padding-left:7px;">
@@ -316,7 +320,7 @@
317321 <option value="" selected></option>
318322 <option fcklang="DlgImgAlignRight" value="right">Right</option>
319323 <option fcklang="DlgImgAlignLeft" value="left">Left</option>
320 - <option value="center">Center</option>
 324+ <option fcklang="wikiImgAlignCenter" value="center">Center</option>
321325 </select>
322326 </td>
323327 <td style="padding-left:7px;">
Index: trunk/extensions/FCKeditor/plugins/mediawiki/images/tb_signature.gif
@@ -0,0 +1,5 @@
 2+GIF89a�((())),,,---///777999;;;<<<AAADDDFFFGGGJJJLLLNNNOOOPPPQQQSSSTTTVVVWWWXXXZZZ\\\aaabbbccceeefffgggjjjlllmmmnnnooopppwww{{{|||~~~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!� l,������� +R !���,l�$<XBA� �hb%��H��C $"TSA�$N�`!��D6R|��� ��Dxł�<`q@��.@�Q���
 3+bn.)Q���Hs� +/I``�Gل[���� >zc���_V�02� �#($�a!�� +'e��BG.+6�as�E�KtԈ��B� \EȏC�d134 ;
\ No newline at end of file
Index: trunk/extensions/FCKeditor/plugins/mediawiki/images/tb_icon_source.gif
@@ -0,0 +1,4 @@
 2+GIF89a�Ha��f��e��i��j��n�⇜΁��w�䇠㈡�|�拧Ձ�惫牪熮舮膯靮΋�苳ꍳ鎳莳饱̔�闷ꔸ졵锹왻쨸餺ꥻ짿뮿�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!�
 3+,��.���,��CFG��C��F?@�:82G1��GBDBB>93GA?�7 +$(BA=4�G0FC@:53/� �" <�@=86��%<G�A>=���EDAA� � *�FDDC�#+;
 4+)FF�b� ����8a��� �P�cčD<B"��š��Z;
\ No newline at end of file
Index: trunk/extensions/FCKeditor/plugins/mediawiki/images/icon_math.gif
@@ -0,0 +1,4 @@
 2+GIF89aB��������,B\�������Ԁ��m`�h�}Px�TI�&�
 3+��
 4+�䡞����l.��@�����Ȕ!��i4R{¢Ji�Ksi���:���R$��8��ϛ
 5+;
\ No newline at end of file
Index: trunk/extensions/FCKeditor/plugins/mediawiki/images/icon_source.gif
@@ -0,0 +1,2 @@
 2+GIF89a;�����,;�H����*\Ȱ�Ç@��PbB)jD��`G�B�H��@�G
 3+TI�I�)�\�2$M6i�Ĺ�D�)Y�X�(ёE��4Z�#РJ�����ș3>e*)ӥU�� �*X�5�~]�էnj<{b��jНvn�۲/ܾ� n;
\ No newline at end of file
Index: trunk/extensions/FCKeditor/plugins/mediawiki/images/icon_signature.gif
@@ -0,0 +1,2 @@
 2+GIF89aB��������,B�H����*\�p`��#B��D�/RL`�E�5z$ؑ`�����2�J�/3�����$Gʄɳ�N�)�
 3+j�@���4�t�ҠN�z��R�?�Nm�*V�9��,�Tk׳f�D�4-סe�zm�.L�!��}��%U�U^=h����$6q,�ǐ#K�;
\ No newline at end of file
Index: trunk/extensions/FCKeditor/plugins/mediawiki/images/tb_icon_category.gif
@@ -0,0 +1,2 @@
 2+GIF89a��������!�,0��y�ʱ����A46gU���@Ng�X +������Gˇ��VL�MB���X;
\ No newline at end of file
Index: trunk/extensions/FCKeditor/plugins/mediawiki/images/icon_html.gif
@@ -0,0 +1 @@
 2+GIF89aB��������,B�H����*\Ȱ�Ç�H1�Ą.> PQ dž����`Ʌ'��bJ/�Ĩ���8�����N�'�t�hQ�0�0�aI�&�&�I��F�FO>-JU�U�_n��χM�v\kP�D�pEƝK��]�;
\ No newline at end of file
Property changes on: trunk/extensions/FCKeditor/plugins/mediawiki
___________________________________________________________________
Added: svn:ignore
13 + .settings
.project
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.fr.php
@@ -19,4 +19,9 @@
2020 'tog-riched_disable_ns_help_talk' => 'Désactiver \'\'Rich Editor\'\' dans l\'espace de noms \'\'{{ns:Help_talk}}\'\'.',
2121 'tog-riched_disable_ns_category' => 'Désactiver \'\'Rich Editor\'\' dans l\'espace de noms \'\'{{ns:Category}}\'\'.',
2222 'tog-riched_disable_ns_category_talk' => 'Désactiver \'\'Rich Editor\'\' dans l\'espace de noms \'\'{{ns:Category_talk}}\'\'.',
 23+ 'rich_editor_new_window' => 'Ouvrir "Rich Editor" dans une nouvelle fenêtre',
 24+ 'tog-riched_start_disabled' => 'Démarrer avec le "Rich Editor" désactive',
 25+ 'tog-riched_use_popup' => 'Ouvrir "Rich Editor" dans une popup',
 26+ 'tog-riched_use_toggle' => 'Donner la possibilité de changer entre l\'éditeur original WikiText et "Rich Editor"',
 27+ 'tog-riched_toggle_remember_state' => 'Se souvenir de la dernière selection du éditeur',
2328 );
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.zh-tw.php
@@ -0,0 +1,29 @@
 2+<?php
 3+/** Taiwan Chinese (‪中文(台灣)‬)
 4+ * @author Roc michael
 5+ */
 6+$messages = array(
 7+ 'textrichditor' => '視覺化編輯器(Rich Editor)',
 8+ 'tog-riched_disable' => '停用視覺化編輯器(rich editor)',
 9+ 'tog-riched_disable_ns_main' => '停用主名字空間的視覺化編輯器',
 10+ 'tog-riched_disable_ns_talk' => '停用"{{ns:Talk}}"名字空間的視覺化編輯器',
 11+ 'tog-riched_disable_ns_user' => '停用"{{ns:User}}"名字空間的視覺化編輯器',
 12+ 'tog-riched_disable_ns_user_talk' => '停用"{{ns:User_talk}}"名字空間的視覺化編輯器',
 13+ 'tog-riched_disable_ns_project' => '停用"{{ns:Project}}"名字空間的視覺化編輯器',
 14+ 'tog-riched_disable_ns_project_talk' => '停用"{{ns:Project_talk}}"名字空間的視覺化編輯器',
 15+ 'tog-riched_disable_ns_image' => '停用"{{ns:Image}}"名字空間的視覺化編輯器',
 16+ 'tog-riched_disable_ns_image_talk' => '停用"{{ns:Image_talk}}"名字空間的視覺化編輯器',
 17+ 'tog-riched_disable_ns_mediawiki' => '停用"{{ns:MediaWiki}}"名字空間的視覺化編輯器',
 18+ 'tog-riched_disable_ns_mediawiki_talk' => '停用"{{ns:MediaWiki_talk}}"名字空間的視覺化編輯器',
 19+ 'tog-riched_disable_ns_template' => '停用"{{ns:Template}}"名字空間的視覺化編輯器',
 20+ 'tog-riched_disable_ns_template_talk' => '停用"{{ns:Template_talk}}"名字空間的視覺化編輯器',
 21+ 'tog-riched_disable_ns_help' => '停用"{{ns:Help}}"名字空間的視覺化編輯器',
 22+ 'tog-riched_disable_ns_help_talk' => '停用"{{ns:Help_talk}}"名字空間的視覺化編輯器',
 23+ 'tog-riched_disable_ns_category' => '停用"{{ns:Category}}"名字空間的視覺化編輯器',
 24+ 'tog-riched_disable_ns_category_talk' => '停用"{{ns:Category_talk}}"名字空間的視覺化編輯器',
 25+ 'rich_editor_new_window' => '於新視窗內開啟視覺化編輯器(Rich Editor)',
 26+ 'tog-riched_start_disabled' => '開始時先停用視覺化編輯器(rich editor)',
 27+ 'tog-riched_use_popup' => '於彈出視窗(popup)中使用視覺化編輯器(Rich Editor)',
 28+ 'tog-riched_use_toggle' => '在「維基文字」與「視覺化編輯器」之間以開關作切換(以視覺化編輯器取代文字編輯區)',
 29+ 'tog-riched_toggle_remember_state' => '記住最後的切換設定',
 30+);
\ No newline at end of file
Index: trunk/extensions/FCKeditor/css/fckeditor-rtl.css
@@ -0,0 +1,232 @@
 2+/*
 3+Right-to-left fixes for MonoBook.
 4+Places sidebar on right, tweaks various alignment issues.
 5+
 6+Works mostly ok nicely on Safari 1.2.1; fine in Mozilla.
 7+
 8+Safari bugs (1.2.1):
 9+* Tabs are still appearing in left-to-right order. (Try after localizing)
 10+
 11+Opera bugs (7.23 linux):
 12+* Some bits of ltr text (sidebar box titles) have forward and backward versions overlapping each other
 13+
 14+IE/mac bugs:
 15+* The thing barfs on Hebrew and Arabic anyway, so no point testing.
 16+
 17+Missing features due to lack of support:
 18+* external link icons
 19+
 20+To test:
 21+* Opera6
 22+* IE 5.0
 23+* etc
 24+
 25+*/
 26+body {
 27+ direction: rtl;
 28+ unicode-bidi: embed;
 29+}
 30+#column-content {
 31+ margin: 0 -12.2em 0 0;
 32+ float: left;
 33+}
 34+#column-content #content{
 35+ margin-left: 0;
 36+ margin-right: 12.2em;
 37+ border-right: 1px solid #aaaaaa;
 38+ border-left: none;
 39+}
 40+html > body .portlet {
 41+ float: right;
 42+ clear: right;
 43+}
 44+.editsection {
 45+ float: left;
 46+ margin-right: 5px;
 47+ margin-left: 0; /* bug 9122: undo default LTR */
 48+}
 49+/* recover IEMac (might be fine with the float, but usually it's close to IE */
 50+*>body .portlet {
 51+ float: none;
 52+ clear: none;
 53+}
 54+.pBody {
 55+ padding-right: 0.8em;
 56+ padding-left: 0.5em;
 57+}
 58+
 59+/* Fix alignment */
 60+.documentByLine,
 61+.portletDetails,
 62+.portletMore,
 63+#p-personal {
 64+ text-align: left;
 65+}
 66+
 67+div div.thumbcaption {
 68+ text-align: right;
 69+}
 70+
 71+div.magnify,
 72+#p-logo {
 73+ left: auto;
 74+ right: 0;
 75+}
 76+#p-personal {
 77+ left: auto;
 78+ right: 0;
 79+}
 80+
 81+#p-cactions {
 82+ left: auto;
 83+ right: 11.5em;
 84+ padding-left: 0;
 85+ padding-right: 1em;
 86+}
 87+#p-cactions li {
 88+ margin-left: 0.3em;
 89+ margin-right: 0;
 90+ float: right;
 91+}
 92+* html #p-cactions li a {
 93+ display: block;
 94+ padding-bottom: 0;
 95+}
 96+* html #p-cactions li a:hover {
 97+ padding-bottom: 0.2em;
 98+}
 99+/* offsets to distinguish the tab groups */
 100+li#ca-talk {
 101+ margin-right: auto;
 102+ margin-left: 1.6em;
 103+}
 104+li#ca-watch,li#ca-unwatch {
 105+ margin-right: 1.6em !important;
 106+}
 107+
 108+/* Fix margins for non-css2 browsers */
 109+/* top right bottom left */
 110+
 111+ul {
 112+ margin-left: 0;
 113+ margin-right: 1.5em;
 114+}
 115+ol {
 116+ margin-left: 0;
 117+ margin-right: 2.4em;
 118+}
 119+dd {
 120+ margin-left: 0;
 121+ margin-right: 1.6em;
 122+}
 123+#contentSub {
 124+ margin-right: 1em;
 125+ margin-left: 0;
 126+}
 127+.tocindent {
 128+ margin-left: 0;
 129+ margin-right: 2em;
 130+}
 131+div.tright, div.floatright, table.floatright {
 132+ clear: none;
 133+}
 134+div.tleft, div.floatleft, table.floatleft {
 135+ clear: left;
 136+}
 137+#p-personal li {
 138+ margin-left: 0;
 139+ margin-right: 1em;
 140+}
 141+
 142+li#ca-talk,
 143+li#ca-watch {
 144+ margin-right: auto;
 145+ margin-left: 1.6em;
 146+}
 147+
 148+#p-personal li {
 149+ float: left;
 150+}
 151+/* Fix link icons */
 152+.external {
 153+ padding: 0 !important;
 154+ background: none !important;
 155+}
 156+#footer {
 157+ clear: both;
 158+}
 159+* html #footer {
 160+ margin-left: 0;
 161+ margin-right: 13.6em;
 162+ border-left: 0;
 163+ border-right: 1px solid #fabd23;
 164+}
 165+* html #column-content {
 166+ float: none;
 167+ margin-left: 0;
 168+ margin-right: 0;
 169+}
 170+* html #column-content #content {
 171+ margin-left: 0;
 172+ margin-top: 3em;
 173+}
 174+* html #column-one { right: 0; }
 175+
 176+/* js pref toc */
 177+
 178+#preftoc {
 179+ margin-right: 1em;
 180+}
 181+
 182+.errorbox, .successbox, #preftoc li, .prefsection fieldset {
 183+ float: right;
 184+}
 185+
 186+.prefsection {
 187+ padding-right: 2em;
 188+}
 189+
 190+/* workaround for moz bug, displayed bullets on left side */
 191+
 192+#toc ul {
 193+ text-align: right;
 194+}
 195+
 196+#toc ul ul {
 197+ margin: 0 2em 0 0;
 198+}
 199+
 200+input#wpSave, input#wpDiff {
 201+ margin-right: 0;
 202+ margin-left: .33em;
 203+}
 204+
 205+#userlogin {
 206+ float: right;
 207+ margin: 0 0 1em 3em;
 208+}
 209+/* Convenience links to edit block and delete reasons */
 210+p.mw-ipb-conveniencelinks, p.mw-filedelete-editreasons, p.mw-delete-editreasons {
 211+ float: left;
 212+}
 213+
 214+.toggle {
 215+ margin-left: 0em;
 216+ margin-right: 2em;
 217+}
 218+table.filehistory th {
 219+ text-align: right;
 220+}
 221+
 222+/**
 223+ * Lists:
 224+ * The following lines don't have a visible effect on non-Gecko browsers
 225+ * They fix a problem ith Gecko browsers rendering lists to the right of
 226+ * left-floated objects in an RTL layout.
 227+ */
 228+html > body div#bodyContent ul {
 229+ display: table;
 230+}
 231+html > body div#bodyContent ul#filetoc {
 232+ display: block;
 233+}
\ No newline at end of file
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.pl.php
@@ -2,6 +2,7 @@
33
44 $messages = array(
55 'textrichditor' => 'Rich Editor',
 6+'rich_editor_new_window' => 'Otwórz rich editor w nowym oknie',
67 'tog-riched_disable' => 'Wyłącz Rich Editora',
78 'tog-riched_disable_ns_main' => 'Wyłącz Rich Editora wewątrz głównej przestrzeni nazw',
89 'tog-riched_disable_ns_talk' => 'Wyłącz Rich Editora wewątrz przestrzeni nazw "{{ns:Talk}}"',
@@ -19,4 +20,8 @@
2021 'tog-riched_disable_ns_help_talk' => 'Wyłącz Rich Editora wewątrz przestrzeni nazw "{{ns:Help_talk}}"',
2122 'tog-riched_disable_ns_category' => 'Wyłącz Rich Editora wewątrz przestrzeni nazw "{{ns:Category}}"',
2223 'tog-riched_disable_ns_category_talk' => 'Wyłącz Rich Editora wewątrz przestrzeni nazw "{{ns:Category_talk}}"',
 24+'tog-riched_start_disabled' => 'Rich editor domyślnie wyłączony',
 25+'tog-riched_use_popup' => 'Pozwól otwierać Rich Editor w okienku popup',
 26+'tog-riched_use_toggle' => 'Pozwól otwierać Rich Editor na żądanie (zastąpi domyślne pole textarea)',
 27+'tog-riched_toggle_remember_state' => 'Zapamiętuj ostatni stan Rich Editora',
2328 );
Index: trunk/extensions/FCKeditor/FCKeditorParser.body.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -class FCKeditorParser extends Parser
 4+class FCKeditorParser extends FCKeditorParserWrapper
55 {
66 public static $fkc_mw_makeImage_options;
77 protected $fck_mw_strtr_span;
@@ -25,19 +25,8 @@
2626 "__NOGALLERY__",
2727 );
2828
29 - function __construct() {
30 - global $wgParser;
31 - parent::Parser();
32 -
33 - foreach ($wgParser->getTags() as $h) {
34 - if (!in_array($h, array("pre"))) {
35 - $this->setHook($h, array($this, "fck_genericTagHook"));
36 - }
37 - }
38 - }
39 -
4029 /**
41 - * Add special string (that would be changed by Parser) to array and return simple unique string
 30+ * Add special string (that would be changed by Parser) to array and return simple unique string
4231 * that will remain unchanged during whole parsing operation.
4332 * At the end we'll replace all this unique strings with original content
4433 *
@@ -66,8 +55,19 @@
6756 function maybeDoSubpageLink($target, &$text) {
6857 return $target;
6958 }
70 -
 59+
7160 /**
 61+ * DO NOT Replace special strings like "ISBN xxx" and "RFC xxx" with
 62+ * magic external links.
 63+ *
 64+ * DML
 65+ * @private
 66+ */
 67+ function doMagicLinks( $text ) {
 68+ return $text;
 69+ }
 70+
 71+ /**
7272 * Callback function for custom tags: feed, ref, references etc.
7373 *
7474 * @param string $str Input
@@ -75,13 +75,13 @@
7676 * @return string
7777 */
7878 function fck_genericTagHook( $str, $argv, $parser ) {
79 - if (in_array($this->fck_mw_taghook, array("ref", "math", "references"))) {
 79+ if (in_array($this->fck_mw_taghook, array("ref", "math", "references", "source"))) {
8080 $class = $this->fck_mw_taghook;
8181 }
8282 else {
8383 $class = "special";
8484 }
85 -
 85+
8686 if (empty($argv)) {
8787 $ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">";
8888 }
@@ -117,7 +117,7 @@
118118 $ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">";
119119 }
120120 else {
121 - $ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">";
 121+ $ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\"";
122122 foreach ($argv as $key=>$value) {
123123 $ret .= " ".$key."=\"".$value."\"";
124124 }
@@ -154,7 +154,7 @@
155155 * @private
156156 */
157157 function strip( $text, $state, $stripcomments = false , $dontstrip = array () ) {
158 - global $wgContLang;
 158+ global $wgContLang, $wgUseTeX, $wgScriptPath, $wgVersion, $wgHooks, $wgExtensionFunctions;
159159
160160 wfProfileIn( __METHOD__ );
161161 $render = ($this->mOutputType == OT_HTML);
@@ -164,16 +164,19 @@
165165 $nowikiItems = array();
166166 $generalItems = array();
167167
168 - $elements = array_merge(
169 - array( 'nowiki', 'gallery' ),
170 - array_keys( $this->mTagHooks ) );
 168+ $elements = array_merge( array( 'nowiki', 'gallery', 'math' ), array_keys( $this->mTagHooks ) );
 169+ if ( (isset($wgHooks['ParserFirstCallInit']) && in_array('efSyntaxHighlight_GeSHiSetup', $wgHooks['ParserFirstCallInit']))
 170+ || (isset($wgExtensionFunctions) && in_array('efSyntaxHighlight_GeSHiSetup', $wgExtensionFunctions)) ) {
 171+ $elements = array_merge( $elements, array( 'source' ) );
 172+ }
 173+ if ( (isset($wgHooks['ParserFirstCallInit']) && in_array('wfCite', $wgHooks['ParserFirstCallInit']))
 174+ || (isset($wgExtensionFunctions) && in_array('wfCite', $wgExtensionFunctions)) ) {
 175+ $elements = array_merge( $elements, array( 'ref', 'references' ) );
 176+ }
171177 global $wgRawHtml;
172178 if( $wgRawHtml ) {
173179 $elements[] = 'html';
174180 }
175 - if( $this->mOptions->getUseTeX() ) {
176 - $elements[] = 'math';
177 - }
178181
179182 # Removing $dontstrip tags from $elements list (currently only 'gallery', fixing bug 2700)
180183 foreach ( $elements AS $k => $v ) {
@@ -181,8 +184,14 @@
182185 unset ( $elements[$k] );
183186 }
184187
 188+ $elements = array_unique($elements);
185189 $matches = array();
186 - $text = Parser::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );
 190+ if (version_compare("1.12", $wgVersion, ">")) {
 191+ $text = Parser::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );
 192+ }
 193+ else {
 194+ $text = self::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );
 195+ }
187196
188197 foreach( $matches as $marker => $data ) {
189198 list( $element, $content, $params, $tag ) = $data;
@@ -200,17 +209,28 @@
201210 $output = "$tag-->";
202211 }
203212 break;
 213+ case 'references':
 214+ $output = $this->fck_wikiTag('references', $content, $params);
 215+ break;
 216+ case 'ref':
 217+ $output = $this->fck_wikiTag('ref', $content, $params);
 218+ break;
 219+ case 'source':
 220+ $output = $this->fck_wikiTag('source', $content, $params);
 221+ break;
204222 case 'html':
205223 if( $wgRawHtml ) {
206 - $output = $content;
207 - break;
 224+ $output = $this->fck_wikiTag('html', $content, $params);
208225 }
209 - // Shouldn't happen otherwise. :)
 226+ break;
210227 case 'nowiki':
211228 $output = $this->fck_wikiTag('nowiki', $content, $params); //required by FCKeditor
212229 break;
213230 case 'math':
214 - $output = $wgContLang->armourMath( MathRenderer::renderMath( $content ) );
 231+ if($wgUseTeX){ //normal render
 232+ $output = $wgContLang->armourMath( MathRenderer::renderMath( $content ) );
 233+ }else //show fakeimage
 234+ $output = '<img _fckfakelement="true" class="FCK__MWMath" _fck_mw_math="'.$content.'" src="'.$wgScriptPath.'/skins/common/images/button_math.png" />';
215235 break;
216236 case 'gallery':
217237 $output = $this->fck_wikiTag('gallery', $content, $params); //required by FCKeditor
@@ -307,7 +327,12 @@
308328 }
309329
310330 function replaceInternalLinks( $text ) {
311 - return parent::replaceInternalLinks($text);
 331+ $text = preg_replace("/\[\[([^|\[\]]*?)\]\]/", "[[$1|RTENOTITLE]]", $text); //#2223: [[()]] => [[%1|RTENOTITLE]]
 332+ $text = preg_replace("/\[\[:(.*?)\]\]/", "[[RTECOLON$1]]", $text); //change ':' => 'RTECOLON' in links
 333+ $text = parent::replaceInternalLinks($text);
 334+ $text = preg_replace("/\|RTENOTITLE\]\]/", "]]", $text); // remove unused RTENOTITLE
 335+
 336+ return $text;
312337 }
313338
314339 function makeImage( $nt, $options ) {
@@ -318,10 +343,10 @@
319344 /**
320345 * Replace templates with unique text to preserve them from parsing
321346 *
322 - * @todo if {{template}} is inside string that also must be returned unparsed,
 347+ * @todo if {{template}} is inside string that also must be returned unparsed,
323348 * e.g. <noinclude>{{template}}</noinclude>
324349 * {{template}} replaced with Fckmw[n]fckmw which is wrong...
325 - *
 350+ *
326351 * @param string $text
327352 * @return string
328353 */
@@ -374,6 +399,14 @@
375400 $strtr_span = array();
376401 foreach ($tags as $pos=>$type) {
377402 $sum += $type;
 403+ if (!$pos) {
 404+ $opened = 0;
 405+ $closed = 0;
 406+ }
 407+ else {
 408+ $opened = substr_count($text, '[', 0, $pos); //count [
 409+ $closed = substr_count($text, ']', 0, $pos); //count ]
 410+ }
378411 if ($sum == 1 && $lastSum == 0) {
379412 $stringToParse .= strtr(substr($text, $startingPos, $pos - $startingPos), $strtr);
380413 $startingPos = $pos;
@@ -382,7 +415,11 @@
383416 $stringToParse .= 'Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw';
384417 $inner = htmlspecialchars(strtr(substr($text, $startingPos, $pos - $startingPos + 19), $strtr));
385418 $this->fck_mw_strtr_span['href="Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw"'] = 'href="'.$inner.'"';
386 - $this->fck_mw_strtr_span['Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw'] = '<span class="fck_mw_template">'.str_replace(array("\r\n", "\n", "\r"),"fckLR",$inner).'</span>';
 419+ if($opened <= $closed) { // {{template}} is NOT in [] or [[]]
 420+ $this->fck_mw_strtr_span['Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw'] = '<span class="fck_mw_template">'.str_replace(array("\r\n", "\n", "\r"),"fckLR",$inner).'</span>';
 421+ }else{
 422+ $this->fck_mw_strtr_span['Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw'] = str_replace(array("\r\n", "\n", "\r"),"fckLR",$inner);
 423+ }
387424 $startingPos = $pos + 19;
388425 $this->fck_mw_strtr_span_counter++;
389426 }
@@ -444,6 +481,10 @@
445482 return strtr( $text, $strtr );
446483 }
447484
 485+ function doDoubleUnderscore( $text ) {
 486+ return $text;
 487+ }
 488+
448489 function parse( $text, &$title, $options, $linestart = true, $clearState = true, $revid = null ) {
449490 $text = preg_replace("/^#REDIRECT/", "<!--FCK_REDIRECT-->", $text);
450491 $parserOutput = parent::parse($text, $title, $options, $linestart , $clearState , $revid );
@@ -452,15 +493,31 @@
453494 if ($categories) {
454495 $appendString = "";
455496 foreach ($categories as $cat=>$val) {
456 - $appendString .= "<a href=\"Category:" . $cat ."\">Category:" . $cat ."</a> ";
 497+ $args = '';
 498+ if( $val == 'RTENOTITLE' ){
 499+ $args .= '_fcknotitle="true" ';
 500+ $val = $cat;
 501+ }
 502+ if ($val != $title->mTextform) {
 503+ $appendString .= "<a ".$args."href=\"Category:" . $cat ."\">" . $val ."</a> ";
 504+ }
 505+ else {
 506+ $appendString .= "<a ".$args."href=\"Category:" . $cat ."\">Category:" . $cat ."</a> ";
 507+ }
457508 }
458509 $parserOutput->setText($parserOutput->getText() . $appendString);
459510 }
460511
461512 if (!empty($this->fck_mw_strtr_span)) {
462 - $parserOutput->setText(strtr($parserOutput->getText(), $this->fck_mw_strtr_span));
 513+ global $leaveRawTemplates;
 514+ if (!empty($leaveRawTemplates)) {
 515+ foreach ($leaveRawTemplates as $l) {
 516+ $this->fck_mw_strtr_span[$l] = substr($this->fck_mw_strtr_span[$l], 30, -7);
 517+ }
 518+ }
 519+ $text = strtr($parserOutput->getText(), $this->fck_mw_strtr_span);
 520+ $parserOutput->setText(strtr($text, $this->fck_mw_strtr_span));
463521 }
464 -
465522 if (!empty($this->fck_matches)) {
466523 $text = $parserOutput->getText() ;
467524 foreach ($this->fck_matches as $key => $m) {
@@ -468,7 +525,7 @@
469526 }
470527 $parserOutput->setText($text);
471528 }
472 -
 529+
473530 if (!empty($parserOutput->mLanguageLinks)) {
474531 foreach ($parserOutput->mLanguageLinks as $l) {
475532 $parserOutput->setText($parserOutput->getText() . "\n" . "<a href=\"".$l."\">".$l."</a>") ;
Index: trunk/extensions/FCKeditor/fckeditor_config.js
@@ -4,7 +4,7 @@
55
66 // When using the modified image dialog you must set this variable. It must
77 // correspond to $wgScriptPath in LocalSettings.php.
8 -FCKConfig.mwScriptPath = '' ;
 8+FCKConfig.mwScriptPath = '' ;
99
1010 // Setup the editor toolbar.
1111 FCKConfig.ToolbarSets['Wiki'] = [
@@ -12,7 +12,7 @@
1313 ['Cut','Copy','Paste',/*'PasteText','PasteWord',*/'-','Print'],
1414 ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
1515 ['SpecialChar','Table','Image','Rule'],
16 - ['MW_Template','MW_Special','MW_Ref','MW_Math'],
 16+ ['MW_Template','MW_Special','MW_Ref','MW_References','MW_Source','MW_Math','MW_Signature','MW_Category'],
1717 '/',
1818 ['FontFormat'],
1919 ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
@@ -25,24 +25,32 @@
2626
2727 // Load the extension plugins.
2828 FCKConfig.PluginsPath = FCKConfig.EditorPath + '../plugins/' ;
29 -FCKConfig.Plugins.Add( 'mediawiki' ) ;
 29+FCKConfig.Plugins.Add( 'mediawiki', 'en,he,pl') ;
3030
3131 FCKConfig.ForcePasteAsPlainText = true ;
3232 FCKConfig.FontFormats = 'p;h1;h2;h3;h4;h5;h6;pre' ;
3333
34 -FCKConfig.AutoDetectLanguage = false ;
 34+FCKConfig.AutoDetectLanguage = true ;
3535 FCKConfig.DefaultLanguage = 'en' ;
3636
 37+FCKConfig.WikiSignature = '--~~~~';
 38+
3739 // FCKConfig.DisableObjectResizing = true ;
3840
3941 FCKConfig.EditorAreaStyles = '\
40 -.FCK__MWTemplate, .FCK__MWRef, .FCK__MWSpecial, .FCK__MWReferences, .FCK__MWNowiki, .FCK__MWIncludeonly, .FCK__MWNoinclude, .FCK__MWOnlyinclude, .FCK__MWGallery \
 42+.FCK__MWTemplate, .FCK__MWSource, .FCK__MWRef, .FCK__MWSignature, .FCK__MWSpecial, .FCK__MWReferences, .FCK__MWMath, .FCK__MWNowiki, .FCK__MWIncludeonly, .FCK__MWNoinclude, .FCK__MWOnlyinclude, .FCK__MWGallery \
4143 { \
4244 border: 1px dotted #00F; \
4345 background-position: center center; \
4446 background-repeat: no-repeat; \
4547 vertical-align: middle; \
4648 } \
 49+.FCK__MWSource \
 50+{ \
 51+ background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_source.gif); \
 52+ width: 59px; \
 53+ height: 15px; \
 54+} \
4755 .FCK__MWTemplate \
4856 { \
4957 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_template.gif); \
@@ -67,6 +75,18 @@
6876 width: 66px; \
6977 height: 15px; \
7078 } \
 79+.FCK__MWHtml \
 80+{ \
 81+ background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_html.gif); \
 82+ width: 66px; \
 83+ height: 15px; \
 84+} \
 85+.FCK__MWMath \
 86+{ \
 87+ background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_math.gif); \
 88+ width: 66px; \
 89+ height: 15px; \
 90+} \
7191 .FCK__MWIncludeonly \
7292 { \
7393 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_includeonly.gif); \
@@ -91,6 +111,12 @@
92112 width: 66px; \
93113 height: 15px; \
94114 } \
 115+.FCK__MWSignature \
 116+{ \
 117+ background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_signature.gif); \
 118+ width: 66px; \
 119+ height: 15px; \
 120+} \
95121 .FCK__MWReferences \
96122 { \
97123 background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_references.gif); \
Property changes on: trunk/extensions/FCKeditor/fckeditor
___________________________________________________________________
Added: svn:ignore
98124 + *
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.en.php
@@ -1,7 +1,7 @@
22 <?php
33
44 $messages = array(
5 -'textrichditor' => 'Rich editor',
 5+'textrichditor' => 'Rich Editor',
66 'tog-riched_disable' => 'Disable rich editor',
77 'tog-riched_disable_ns_main' => 'Disable rich editor within the main namespace',
88 'tog-riched_disable_ns_talk' => 'Disable rich editor within the "{{ns:Talk}}" namespace',
@@ -19,4 +19,9 @@
2020 'tog-riched_disable_ns_help_talk' => 'Disable rich editor within the "{{ns:Help_talk}}" namespace',
2121 'tog-riched_disable_ns_category' => 'Disable rich editor within the "{{ns:Category}}" namespace',
2222 'tog-riched_disable_ns_category_talk' => 'Disable rich editor within the "{{ns:Category_talk}}" namespace',
 23+'rich_editor_new_window' => 'Open Rich editor in new window',
 24+'tog-riched_start_disabled' => 'Start with rich editor disabled',
 25+'tog-riched_use_popup' => 'Open rich editor in a popup',
 26+'tog-riched_use_toggle' => 'Use toggle to switch between wikitext and rich editor (replace textarea with rich editor)',
 27+'tog-riched_toggle_remember_state' => 'Remember last toggle state',
2328 );
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.gl.php
@@ -19,4 +19,9 @@
2020 'tog-riched_disable_ns_help_talk' => 'Desactivar o editor rico no espazo de nomes "{{ns:Help_talk}}"',
2121 'tog-riched_disable_ns_category' => 'Desactivar o editor rico no espazo de nomes "{{ns:Category}}"',
2222 'tog-riched_disable_ns_category_talk' => 'Desactivar o editor rico no espazo de nomes "{{ns:Category_talk}}"',
 23+ 'rich_editor_new_window' => 'Abrir editor enriquecido nunha nova ventana',
 24+ 'tog-riched_start_disabled' => 'Comenzar con o editor enriquecido desactivado',
 25+ 'tog-riched_use_popup' => 'Abrir o editor enriquecido nun popup',
 26+ 'tog-riched_use_toggle' => 'Utilizar un selector para cambiar entre wikitext e o editor enriquecido',
 27+ 'tog-riched_toggle_remember_state' => 'Recordar a �ltima selecci�n do editor',
2328 );
Index: trunk/extensions/FCKeditor/FCKeditorSkin.body.php
@@ -1,7 +1,6 @@
22 <?php
33
4 -class FCKeditorSkin
5 -{
 4+class FCKeditorSkin {
65 private $skin;
76
87 /**
@@ -16,16 +15,19 @@
1716 * @param boolean $thumb shows image as thumbnail in a frame
1817 * @param string $manual_thumb image name for the manual thumbnail
1918 * @param string $valign vertical alignment: baseline, sub, super, top, text-top, middle, bottom, text-bottom
20 - * @return string *
 19+ * @return string *
2120 */
2221 function makeImageLinkObj( $nt, $label, $alt, $align = '', $params = array(), $framed = false,
23 - $thumb = false, $manual_thumb = '', $valign = '' )
24 - {
 22+ $thumb = false, $manual_thumb = '', $valign = '' ) {
2523 $orginal = $nt->getText();
2624 $img = new Image( $nt );
2725 $imgName = $img->getName();
2826 $found = $img->getURL();
2927
 28+ if (!is_null($alt) && ( $alt == 'RTENOTITLE' )) { //2223
 29+ $alt = '';
 30+ }
 31+
3032 if ($found) {
3133 //trick to get real Url for image:
3234 $originalLink = strip_tags(Linker::makeImageLinkObj($nt, $label, $alt, $align , $params , $framed , $thumb , $manual_thumb , $valign ), "<img>");
@@ -103,7 +105,7 @@
104106 * @param File $file File object, or false if it doesn't exist
105107 *
106108 * @param array $frameParams Associative array of parameters external to the media handler.
107 - * Boolean parameters are indicated by presence or absence, the value is arbitrary and
 109+ * Boolean parameters are indicated by presence or absence, the value is arbitrary and
108110 * will often be false.
109111 * thumbnail If present, downscale and frame
110112 * manualthumb Image name to use as a thumbnail, instead of automatic scaling
@@ -113,13 +115,13 @@
114116 * upright_factor Fudge factor for "upright" tweak (default 0.75)
115117 * border If present, show a border around the image
116118 * align Horizontal alignment (left, right, center, none)
117 - * valign Vertical alignment (baseline, sub, super, top, text-top, middle,
 119+ * valign Vertical alignment (baseline, sub, super, top, text-top, middle,
118120 * bottom, text-bottom)
119121 * alt Alternate text for image (i.e. alt attribute). Plain text.
120122 * caption HTML for image caption.
121123 *
122 - * @param array $handlerParams Associative array of media handler parameters, to be passed
123 - * to transform(). Typical keys are "width" and "page".
 124+ * @param array $handlerParams Associative array of media handler parameters, to be passed
 125+ * to transform(). Typical keys are "width" and "page".
124126 */
125127 function makeImageLink2( Title $nt, $file, $frameParams = array(), $handlerParams = array() ) {
126128 $orginal = $nt->getText();
@@ -127,6 +129,9 @@
128130 $imgName = $img->getName();
129131 $found = $img->getURL();
130132
 133+ if (!empty($frameParams['alt']) && $frameParams['alt'] == 'RTENOTITLE' ){ //2223
 134+ $frameParams['alt'] = '';
 135+ }
131136 if ($found) {
132137 $linker = new Linker();
133138 $originalLink = $linker->makeImageLink2( $nt, $file, $frameParams, $handlerParams);
@@ -199,7 +204,7 @@
200205 $class .= ($class?" ":"") . "fck_mw_notfound";
201206 }
202207
203 - if (isset($fp['alt']) && !empty($fp['alt']) && false !== strpos(FCKeditorParser::$fkc_mw_makeImage_options, $fp['alt']) && $fp['alt'] != "Image:" . $orginal) {
 208+ if (isset($fp['alt']) && !empty($fp['alt']) && $fp['alt'] != "Image:" . $orginal) {
204209 $ret .= "alt=\"".htmlspecialchars($fp['alt'])."\" ";
205210 }
206211 else {
@@ -215,18 +220,60 @@
216221 return $ret;
217222 }
218223
219 - function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' )
220 - {
 224+ function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
 225+ global $wgUser;
 226+
 227+ wfProfileIn( __METHOD__ );
 228+ if ( $nt->isExternal() ) {
 229+ $args = '';
 230+ $u = $nt->getFullURL();
 231+ $link = $nt->getPrefixedURL();
 232+ if ( '' == $text ) { $text = $nt->getPrefixedText(); }
 233+ $style = $this->getInterwikiLinkAttributes( $link, $text, 'extiw' );
 234+
 235+ $inside = '';
 236+ if ( '' != $trail ) {
 237+ $m = array();
 238+ if ( preg_match( '/^([a-z]+)(.*)$$/sD', $trail, $m ) ) {
 239+ $inside = $m[1];
 240+ $trail = $m[2];
 241+ }
 242+ }
 243+ if( $text == 'RTENOTITLE' ) { //2223
 244+ $text = $u = $link;
 245+ $args .= '_fcknotitle="true" ';
 246+ }
 247+ $t = "<a {$args}href=\"{$u}\"{$style}>{$text}{$inside}</a>";
 248+
 249+ wfProfileOut( __METHOD__ );
 250+ return $t;
 251+ }
 252+
 253+ return Linker::makeLinkObj($nt, $text, $query, $trail, $prefix);
 254+
 255+ }
 256+
 257+ function makeColouredLinkObj( $nt, $colour, $text = '', $query = '', $trail = '', $prefix = '' ) {
 258+ if($colour != ''){
 259+ $style = $this->getInternalLinkAttributesObj( $nt, $text, $colour );
 260+ } else $style = '';
 261+ return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix, '', $style );
 262+ }
 263+
 264+ function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) {
221265 $fname = 'FCKeditorSkin::makeKnownLinkObj';
222266 wfProfileIn( $fname );
223267
 268+ $args = '';
224269 if ( !is_object( $nt ) ) {
225270 wfProfileOut( $fname );
226271 return $text;
227272 }
228273
229274 //$u = $nt->escapeLocalURL( $query );
230 - $u = $nt->getFullText();
 275+ $u = $nt->getFullText();
 276+ //#Updating links tables -> #Updating_links_tables
 277+ $u = str_replace("#".$nt->getFragment(), $nt->getFragmentForURL(), $u);
231278
232279 if ( $nt->getFragment() != '' ) {
233280 if( $nt->getPrefixedDbkey() == '' ) {
@@ -235,7 +282,7 @@
236283 $text = htmlspecialchars( $nt->getFragment() );
237284 }
238285 }
239 -
 286+
240287 /*
241288 * See tickets 1386 and 1690 before changing anything
242289 */
@@ -252,23 +299,34 @@
253300 }
254301
255302 list( $inside, $trail ) = Linker::splitTrail( $trail );
256 - $r = "<a href=\"{$u}\">{$prefix}{$text}{$inside}</a>{$trail}";
 303+ $title = "{$prefix}{$text}{$inside}";
 304+
 305+ $u = preg_replace("/^RTECOLON/", ":", $u); //change 'RTECOLON' => ':'
 306+ if( substr($text, 0, 10) == 'RTENOTITLE' ){ //starts with RTENOTITLE
 307+ $args .= '_fcknotitle="true" ';
 308+ $title = $u;
 309+ $trail = substr($text, 10).$trail;
 310+ }
 311+
 312+ $r = "<a {$args}href=\"{$u}\">{$title}</a>{$trail}";
257313 wfProfileOut( $fname );
258314 return $r;
259315 }
260316
261 - function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' )
262 - {
 317+ function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
263318 # Fail gracefully
264319 if ( ! isset($nt) ) {
265320 # throw new MWException();
266321 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
267322 }
 323+ $args = '';
268324
269325 $fname = 'FCKeditorSkin::makeBrokenLinkObj';
270326 wfProfileIn( $fname );
271327
272 - $u = $nt->getFullText();
 328+ $u = $nt->getFullText();
 329+ //#Updating links tables -> #Updating_links_tables
 330+ $u = str_replace("#".$nt->getFragment(), $nt->getFragmentForURL(), $u);
273331
274332 if ( '' == $text ) {
275333 $text = htmlspecialchars( $nt->getPrefixedText() );
@@ -278,12 +336,34 @@
279337 }
280338
281339 list( $inside, $trail ) = Linker::splitTrail( $trail );
282 - $s = "<a href=\"{$u}\">{$prefix}{$text}{$inside}</a>{$trail}";
 340+ $title = "{$prefix}{$text}{$inside}";
283341
 342+ $u = preg_replace("/^RTECOLON/", ":", $u); //change 'RTECOLON' => ':'
 343+ if( substr($text, 0, 10) == 'RTENOTITLE' ){ //starts with RTENOTITLE
 344+ $args .= '_fcknotitle="true" ';
 345+ $title = $u;
 346+ $trail = substr($text, 10).$trail;
 347+ }
 348+ $s = "<a {$args}href=\"{$u}\">{$title}</a>{$trail}";
 349+
284350 wfProfileOut( $fname );
285351 return $s;
286352 }
287353
 354+ function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 355+ $args = '';
 356+ if ( '' == $text ) {
 357+ $text = $nt->mDbkeyform;
 358+ }
 359+ list( $inside, $trail ) = Linker::splitTrail( $trail );
 360+ $title = "{$prefix}{$text}";
 361+ if( $text == 'RTENOTITLE' ){ //2223
 362+ $args .= '_fcknotitle="true" ';
 363+ $title = $nt->mDbkeyform;
 364+ }
 365+ return "<a {$args}href=\"".$nt->mDbkeyform."\" class=\"selflink\">{$title}</a>{$inside}{$trail}";
 366+ }
 367+
288368 /**
289369 * Create a direct link to a given uploaded file.
290370 *
@@ -299,6 +379,7 @@
300380 ### HOTFIX. Instead of breaking, return empty string.
301381 return $text;
302382 } else {
 383+ $args = '';
303384 $orginal = $title->getPartialURL();
304385 // Mediawiki 1.11
305386 if ( function_exists('wfFindFile') ) {
@@ -328,8 +409,13 @@
329410 if( $text == '' ) {
330411 $text = $alt;
331412 }
332 - $u = htmlspecialchars( $url );
333 - return "<a href=\"{$orginal}\" class=\"$class\" _fck_mw_filename=\"{$orginal}\" _fck_mw_type=\"media\" title=\"{$alt}\">{$text}</a>";
 413+ $orginal = preg_replace("/^RTECOLON/", ":", $orginal); //change 'RTECOLON' => ':'
 414+ if( $text == 'RTENOTITLE' ){ //2223
 415+ $args .= '_fcknotitle="true" ';
 416+ $text = $orginal;
 417+ $alt = $orginal;
 418+ }
 419+ return "<a href=\"{$orginal}\" class=\"$class\" {$args} _fck_mw_filename=\"{$orginal}\" _fck_mw_type=\"media\" title=\"{$alt}\">{$text}</a>";
334420 }
335421 }
336422
@@ -338,19 +424,23 @@
339425 if( $escape ) {
340426 $text = htmlspecialchars( $text );
341427 }
 428+ $url = preg_replace("/^RTECOLON/", ":", $url); //change 'RTECOLON' => ':'
342429 if ($linktype == 'autonumber') {
343430 return '<a href="'.$url.'">[n]</a>';
344431 }
345 - return '<a href="'.$url.'">'.$text.'</a>';
 432+ $args = '';
 433+ if( $text == 'RTENOTITLE' ){ //2223
 434+ $args .= '_fcknotitle="true" ';
 435+ $text = $url;
 436+ }
 437+ return '<a '.$args.'href="'.$url.'">'.$text.'</a>';
346438 }
347439
348 - function __call( $m, $a)
349 - {
 440+ function __call( $m, $a) {
350441 return call_user_func_array( array( $this->skin, $m ), $a );
351442 }
352443
353 - function __construct( &$skin )
354 - {
 444+ function __construct( &$skin ) {
355445 $this->skin = $skin;
356446 }
357447 }
Index: trunk/extensions/FCKeditor/FCKeditorSajax.body.php
@@ -1,7 +1,6 @@
22 <?php
33
4 -function wfSajaxGetMathUrl( $term )
5 -{
 4+function wfSajaxGetMathUrl( $term ) {
65 $originalLink = MathRenderer::renderMath( $term );
76
87 if (false == strpos($originalLink, "src=\"")) {
@@ -14,8 +13,7 @@
1514 return $url;
1615 }
1716
18 -function wfSajaxGetImageUrl( $term )
19 -{
 17+function wfSajaxGetImageUrl( $term ) {
2018 global $wgExtensionFunctions, $wgTitle;
2119
2220 $options = new FCKeditorParserOptions();
@@ -38,21 +36,28 @@
3937 return $url;
4038 }
4139
42 -function wfSajaxSearchSpecialTagFCKeditor($empty)
43 -{
44 - global $wgParser;
 40+function wfSajaxSearchSpecialTagFCKeditor($empty) {
 41+ global $wgParser, $wgRawHtml;
4542
4643 $ret = "nowiki\nincludeonly\nonlyinclude\nnoinclude\ngallery\n";
 44+ if( $wgRawHtml )
 45+ {
 46+ $ret.="html\n";
 47+ }
 48+ $wgParser->firstCallInit();
4749 foreach ($wgParser->getTags() as $h) {
4850 if (!in_array($h, array("pre", "math", "ref", "references"))) {
4951 $ret .= $h ."\n";
5052 }
5153 }
 54+ $arr = explode("\n", $ret);
 55+ sort($arr);
 56+ $ret = implode("\n", $arr);
 57+
5258 return $ret;
5359 }
5460
55 -function wfSajaxSearchImageFCKeditor( $term )
56 -{
 61+function wfSajaxSearchImageFCKeditor( $term ) {
5762 global $wgContLang, $wgOut;
5863 $limit = 10;
5964
@@ -60,21 +65,25 @@
6166 $term1 = str_replace( ' ', '_', $wgContLang->ucfirst( $term ) );
6267 $term2 = str_replace( ' ', '_', $wgContLang->lc( $term ) );
6368 $term3 = str_replace( ' ', '_', $wgContLang->uc( $term ) );
 69+ $term4 = str_replace( ' ', '_', $wgContLang->ucfirst( $term2 ) );
6470 $term = $term1;
6571
6672 if ( strlen( str_replace( '_', '', $term ) )<3 )
6773 return "";
6874
69 - $db =& wfGetDB( DB_SLAVE );
 75+ $db = wfGetDB( DB_SLAVE );
7076 $res = $db->select( 'page', 'page_title',
7177 array( 'page_namespace' => NS_IMAGE,
72 - "LOWER(page_title) LIKE '%". $db->strencode( $term2 ) ."%'" ),
 78+ "page_title LIKE '%". $db->strencode( $term1 ) ."%'".
 79+ "OR (page_title LIKE '%". $db->strencode( $term2 ) ."%') ".
 80+ "OR (page_title LIKE '%". $db->strencode( $term3 ) ."%') ".
 81+ "OR (page_title LIKE '%". $db->strencode( $term4 ) ."%') " ),
7382 "wfSajaxSearch",
7483 array( 'LIMIT' => $limit+1 )
7584 );
7685
7786 $ret = "";
78 - $i=0;
 87+ $i = 0;
7988 while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) {
8089 $ret .= $row->page_title ."\n";
8190 }
@@ -84,44 +93,66 @@
8594 return $ret;
8695 }
8796
88 -function wfSajaxSearchArticleFCKeditor( $term )
89 -{
90 - global $wgContLang, $wgOut;
 97+function wfSajaxSearchArticleFCKeditor( $term ) {
 98+ global $wgContLang, $wgOut, $wgExtraNamespaces;
9199 $limit = 10;
92100 $ns = NS_MAIN;
93101
94102 $term = $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) );
95103
96 - if (strpos($term, "Category:") === 0) {
 104+ if (strpos(strtolower($term), "category:") === 0) {
97105 $ns = NS_CATEGORY;
98106 $term = substr($term, 9);
99107 $prefix = "Category:";
100108 }
101 - else if (strpos($term, ":Category:") === 0) {
 109+ else if (strpos(strtolower($term), ":category:") === 0) {
102110 $ns = NS_CATEGORY;
103111 $term = substr($term, 10);
104112 $prefix = ":Category:";
105113 }
 114+ else if (strpos(strtolower($term), "media:") === 0) {
 115+ $ns = NS_IMAGE;
 116+ $term = substr($term, 6);
 117+ $prefix = "Media:";
 118+ }
 119+ else if (strpos(strtolower($term), ":image:") === 0) {
 120+ $ns = NS_IMAGE;
 121+ $term = substr(strtolower($term), 7);
 122+ $prefix = ":Image:";
 123+ }
 124+ else if ( strpos($term,":") && is_array($wgExtraNamespaces )) {
 125+ $pos = strpos($term,":");
 126+ $find_ns = array_search(substr($term,0,$pos),$wgExtraNamespaces);
 127+ if ($find_ns) {
 128+ $ns = $find_ns;
 129+ $prefix = substr($term,0,$pos+1);
 130+ $term = substr($term,$pos+1);
 131+ }
 132+ }
106133
107134 $term1 = str_replace( ' ', '_', $wgContLang->ucfirst( $term ) );
108135 $term2 = str_replace( ' ', '_', $wgContLang->lc( $term ) );
109136 $term3 = str_replace( ' ', '_', $wgContLang->uc( $term ) );
 137+ $term4 = str_replace( ' ', '_', $wgContLang->ucfirst( $term2 ) );
110138 $term = $term1;
111139
112140 if ( strlen( str_replace( '_', '', $term ) )<3 ) {
113141 return "";
114142 }
115143
116 - $db =& wfGetDB( DB_SLAVE );
 144+ $db = wfGetDB( DB_SLAVE );
117145 $res = $db->select( 'page', 'page_title',
118146 array( 'page_namespace' => $ns,
119 - "LOWER(page_title) LIKE '%". $db->strencode( $term2 ) ."%'" ),
 147+ "page_title LIKE '%". $db->strencode( $term1 ) ."%' ".
 148+ "OR (page_title LIKE '%". $db->strencode( $term2 ) ."%') ".
 149+ "OR (page_title LIKE '%". $db->strencode( $term3 ) ."%') ".
 150+ "OR (page_title LIKE '%". $db->strencode( $term4 ) ."%') " ),
120151 "wfSajaxSearch",
121152 array( 'LIMIT' => $limit+1 )
122153 );
123154
124155 $ret = "";
125 - $i=0;
 156+ $i = 0;
126157 while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) {
127158 if (isset($prefix) && !is_null($prefix)) {
128159 $ret .= $prefix;
@@ -134,15 +165,66 @@
135166 return $ret;
136167 }
137168
138 -function wfSajaxSearchTemplateFCKeditor($empty)
 169+function wfSajaxSearchCategoryFCKeditor()
139170 {
140171 global $wgContLang, $wgOut;
 172+ $ns = NS_CATEGORY;
 173+ $db =& wfGetDB( DB_SLAVE );
 174+ $m_sql="SELECT tmpSelectCat1.cl_to AS title FROM ".$db->tableName('categorylinks')." AS tmpSelectCat1 ".
 175+ "LEFT JOIN ".$db->tableName('page')." AS tmpSelectCatPage ON ( tmpSelectCat1.cl_to = tmpSelectCatPage.page_title ".
 176+ "AND tmpSelectCatPage.page_namespace =$ns ) ".
 177+ "LEFT JOIN ".$db->tableName('categorylinks')." AS tmpSelectCat2 ON tmpSelectCatPage.page_id = tmpSelectCat2.cl_from ".
 178+ "WHERE tmpSelectCat2.cl_from IS NULL GROUP BY tmpSelectCat1.cl_to";
 179+
 180+ $res = $db->query($m_sql,__METHOD__ );
 181+
 182+ $ret = "";
 183+ $i=0;
 184+ while ( ( $row = $db->fetchObject( $res ) ) ) {
 185+ $ret .= $row->title ."\n";
 186+ $sub = explode("\n",wfSajaxSearchCategoryChildrenFCKeditor($row->title));
 187+ foreach($sub as $subrow)if(strlen($subrow)>0)$ret.=" ".$subrow."\n";
 188+ }
 189+
 190+ return $ret;
 191+}
 192+
 193+function wfSajaxSearchCategoryChildrenFCKeditor($m_root)
 194+{
 195+ global $wgContLang, $wgOut;
 196+ $limit = 50;
 197+ $ns = NS_CATEGORY;
 198+ $m_root = str_replace("'","\'",$m_root);
 199+ $db =& wfGetDB( DB_SLAVE );
 200+ $m_sql ="SELECT tmpSelectCatPage.page_title AS title FROM ".$db->tableName('categorylinks')." AS tmpSelectCat ".
 201+ "LEFT JOIN ".$db->tableName('page')." AS tmpSelectCatPage ON tmpSelectCat.cl_from = tmpSelectCatPage.page_id ".
 202+ "WHERE tmpSelectCat.cl_to LIKE '$m_root' AND tmpSelectCatPage.page_namespace = $ns";
 203+
 204+
 205+ $res = $db->query($m_sql,__METHOD__ );
 206+
 207+ $ret = "";
 208+ $i=0;
 209+ while ( ( $row = $db->fetchObject( $res ) ) ) {
 210+ $ret .= $row->title ."\n";
 211+ $sub = explode("\n",wfSajaxSearchCategoryChildrenFCKeditor($row->title));
 212+ foreach($sub as $subrow)if(strlen($subrow)>0)$ret.=" ".$subrow."\n";
 213+
 214+ }
 215+
 216+ return $ret;
 217+}
 218+
 219+function wfSajaxSearchTemplateFCKeditor($empty) {
 220+ global $wgContLang, $wgOut;
141221 $ns = NS_TEMPLATE;
142222
143 - $db =& wfGetDB( DB_SLAVE );
 223+ $db = wfGetDB( DB_SLAVE );
 224+ $options['ORDER BY'] = 'page_title';
144225 $res = $db->select( 'page', 'page_title',
145 - array( 'page_namespace' => $ns),
146 - "wfSajaxSearch"
 226+ array( 'page_namespace' => $ns),
 227+ "wfSajaxSearch",
 228+ $options
147229 );
148230
149231 $ret = "";
@@ -153,8 +235,7 @@
154236 return $ret;
155237 }
156238
157 -function wfSajaxWikiToHTML( $wiki )
158 -{
 239+function wfSajaxWikiToHTML( $wiki ) {
159240 global $wgTitle;
160241
161242 $options = new FCKeditorParserOptions();
@@ -162,5 +243,18 @@
163244 $parser = new FCKeditorParser();
164245 $parser->setOutputType(OT_HTML);
165246
166 - return $parser->parse($wiki, $wgTitle, $options)->getText();
 247+ wfSajaxToggleFCKeditor('show'); //FCKeditor was switched to visible
 248+ return str_replace("<!-- Tidy found serious XHTML errors -->", "", $parser->parse($wiki, $wgTitle, $options)->getText());
167249 }
 250+
 251+function wfSajaxToggleFCKeditor($data) {
 252+ global $wgFCKEditorSaveUserSetting;
 253+
 254+ if($data == 'show'){
 255+ $_SESSION['showMyFCKeditor'] = RTE_VISIBLE; //visible last time
 256+ }
 257+ else {
 258+ $_SESSION['showMyFCKeditor'] = 0; //invisible
 259+ }
 260+ return "SUCCESS";
 261+}
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.es.php
@@ -0,0 +1,27 @@
 2+<?php
 3+
 4+$messages = array(
 5+ 'textrichditor' => 'Editor enriquecido',
 6+ 'tog-riched_disable' => 'Desactivar editor enriquecido',
 7+ 'tog-riched_disable_ns_main' => 'Desactivar editor enriquecido en el espacio de nombres principal',
 8+ 'tog-riched_disable_ns_talk' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Talk}}"',
 9+ 'tog-riched_disable_ns_user' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:User}}"',
 10+ 'tog-riched_disable_ns_user_talk' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:User_talk}}"',
 11+ 'tog-riched_disable_ns_project' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Project}}"',
 12+ 'tog-riched_disable_ns_project_talk' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Project_talk}}"',
 13+ 'tog-riched_disable_ns_image' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Image}}"',
 14+ 'tog-riched_disable_ns_image_talk' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Image_talk}}"',
 15+ 'tog-riched_disable_ns_mediawiki' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:MediaWiki}}"',
 16+ 'tog-riched_disable_ns_mediawiki_talk' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:MediaWiki_talk}}"',
 17+ 'tog-riched_disable_ns_template' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Template}}"',
 18+ 'tog-riched_disable_ns_template_talk' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Template_talk}}"',
 19+ 'tog-riched_disable_ns_help' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Help}}"',
 20+ 'tog-riched_disable_ns_help_talk' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Help_talk}}"',
 21+ 'tog-riched_disable_ns_category' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Category}}"',
 22+ 'tog-riched_disable_ns_category_talk' => 'Desactivar editor enriquecido en el espacio de nombres "{{ns:Category_talk}}"',
 23+ 'rich_editor_new_window' => 'Abrir el editor enriquecido en una nueva ventana',
 24+ 'tog-riched_start_disabled' => 'Empezar con el editor enriquecido desactivado',
 25+ 'tog-riched_use_popup' => 'Abrir editor enriquecido en un popup',
 26+ 'tog-riched_use_toggle' => 'Utilizar un selector para cambiar entre wikitext y editor enriquecido',
 27+ 'tog-riched_toggle_remember_state' => 'Recordar la última selección del editor',
 28+);
Index: trunk/extensions/FCKeditor/FCKeditorParserOptions.body.php
@@ -1,9 +1,8 @@
22 <?php
33
4 -class FCKeditorParserOptions extends ParserOptions
5 -{
6 - function getNumberHeadings() {return false;}
7 - function getEditSection() {return false;}
 4+class FCKeditorParserOptions extends ParserOptions {
 5+ function getNumberHeadings() { return false; }
 6+ function getEditSection() { return false; }
87
98 function getSkin() {
109 if ( !isset( $this->mSkin ) ) {
Index: trunk/extensions/FCKeditor/mw11/FCKeditorParserWrapper.body.php
@@ -0,0 +1,35 @@
 2+<?php
 3+
 4+/**
 5+ * Used by MW <= 1.11
 6+ */
 7+class FCKeditorParserWrapper extends Parser
 8+{
 9+ function __construct() {
 10+ global $wgParser;
 11+
 12+ parent::Parser();
 13+
 14+ foreach ($wgParser->getTags() as $h) {
 15+ if (!in_array($h, array("pre"))) {
 16+ $this->setHook($h, array($this, "fck_genericTagHook"));
 17+ }
 18+ }
 19+ }
 20+
 21+ function replaceInternalLinks( $s ) {
 22+ return parent::replaceInternalLinks( $s );
 23+ }
 24+
 25+ function makeImage( $title, $options, $holders = false ) {
 26+ return parent::makeImage( $title, $options, $holders );
 27+ }
 28+
 29+ function internalParse( $text ) {
 30+ return parent::internalParse( $text );
 31+ }
 32+
 33+ function parse( $text, Title $title, ParserOptions $options, $linestart = true, $clearState = true, $revid = null ) {
 34+ return parent::parse( $text, $title, $options, $linestart, $clearState, $revid );
 35+ }
 36+}
Index: trunk/extensions/FCKeditor/mw12/FCKeditorParser_OldPP.body.php
@@ -1,649 +0,0 @@
2 -<?php
3 -
4 -class FCKeditorParser extends Parser_OldPP
5 -{
6 - public static $fkc_mw_makeImage_options;
7 - protected $fck_mw_strtr_span;
8 - protected $fck_mw_strtr_span_counter=1;
9 - protected $fck_mw_taghook;
10 - protected $fck_internal_parse_text;
11 - protected $fck_matches = array();
12 -
13 - private $FCKeditorMagicWords = array(
14 - '__NOTOC__',
15 - '__FORCETOC__',
16 - '__NOEDITSECTION__',
17 - '__START__',
18 - '__NOTITLECONVERT__',
19 - '__NOCONTENTCONVERT__',
20 - '__END__',
21 - '__TOC__',
22 - '__NOTC__',
23 - '__NOCC__',
24 - "__FORCETOC__",
25 - "__NEWSECTIONLINK__",
26 - "__NOGALLERY__",
27 - );
28 -
29 - function __construct() {
30 - global $wgParser;
31 - parent::__construct();
32 -
33 - foreach ($wgParser->getTags() as $h) {
34 - if (!in_array($h, array("pre"))) {
35 - $this->setHook($h, array($this, "fck_genericTagHook"));
36 - }
37 - }
38 - }
39 -
40 - /**
41 - * Add special string (that would be changed by Parser) to array and return simple unique string
42 - * that will remain unchanged during whole parsing operation.
43 - * At the end we'll replace all this unique strings with original content
44 - *
45 - * @param string $text
46 - * @return string
47 - */
48 - private function fck_addToStrtr($text, $replaceLineBreaks = true) {
49 - $key = 'Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw';
50 - $this->fck_mw_strtr_span_counter++;
51 - if ($replaceLineBreaks) {
52 - $this->fck_mw_strtr_span[$key] = str_replace(array("\r\n", "\n", "\r"),"fckLR",$text);
53 - }
54 - else {
55 - $this->fck_mw_strtr_span[$key] = $text;
56 - }
57 - return $key;
58 - }
59 -
60 - /**
61 - * Handle link to subpage if necessary
62 - * @param string $target the source of the link
63 - * @param string &$text the link text, modified as necessary
64 - * @return string the full name of the link
65 - * @private
66 - */
67 - function maybeDoSubpageLink($target, &$text) {
68 - return $target;
69 - }
70 -
71 - /**
72 - * Callback function for custom tags: feed, ref, references etc.
73 - *
74 - * @param string $str Input
75 - * @param array $argv Arguments
76 - * @return string
77 - */
78 - function fck_genericTagHook( $str, $argv, $parser ) {
79 - if (in_array($this->fck_mw_taghook, array("ref", "math", "references"))) {
80 - $class = $this->fck_mw_taghook;
81 - }
82 - else {
83 - $class = "special";
84 - }
85 -
86 - if (empty($argv)) {
87 - $ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">";
88 - }
89 - else {
90 - $ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\"";
91 - foreach ($argv as $key=>$value) {
92 - $ret .= " ".$key."=\"".$value."\"";
93 - }
94 - $ret .=">";
95 - }
96 - if (is_null($str)) {
97 - $ret = substr($ret, 0, -1) . " />";
98 - }
99 - else {
100 - $ret .= htmlspecialchars($str);
101 - $ret .= "</span>";
102 - }
103 -
104 - $replacement = $this->fck_addToStrtr($ret);
105 - return $replacement;
106 - }
107 -
108 - /**
109 - * Callback function for wiki tags: nowiki, includeonly, noinclude
110 - *
111 - * @param string $tagName tag name, eg. nowiki, math
112 - * @param string $str Input
113 - * @param array $argv Arguments
114 - * @return string
115 - */
116 - function fck_wikiTag( $tagName, $str, $argv = array()) {
117 - if (empty($argv)) {
118 - $ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">";
119 - }
120 - else {
121 - $ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">";
122 - foreach ($argv as $key=>$value) {
123 - $ret .= " ".$key."=\"".$value."\"";
124 - }
125 - $ret .=">";
126 - }
127 - if (is_null($str)) {
128 - $ret = substr($ret, 0, -1) . " />";
129 - }
130 - else {
131 - $ret .= htmlspecialchars($str);
132 - $ret .= "</span>";
133 - }
134 -
135 - $replacement = $this->fck_addToStrtr($ret);
136 -
137 - return $replacement;
138 - }
139 -
140 - /**
141 - * Strips and renders nowiki, pre, math, hiero
142 - * If $render is set, performs necessary rendering operations on plugins
143 - * Returns the text, and fills an array with data needed in unstrip()
144 - *
145 - * @param StripState $state
146 - *
147 - * @param bool $stripcomments when set, HTML comments <!-- like this -->
148 - * will be stripped in addition to other tags. This is important
149 - * for section editing, where these comments cause confusion when
150 - * counting the sections in the wikisource
151 - *
152 - * @param array dontstrip contains tags which should not be stripped;
153 - * used to prevent stipping of <gallery> when saving (fixes bug 2700)
154 - *
155 - * @private
156 - */
157 - function strip( $text, $state, $stripcomments = false , $dontstrip = array () ) {
158 - global $wgContLang;
159 -
160 - wfProfileIn( __METHOD__ );
161 - $render = ($this->mOutputType == OT_HTML);
162 -
163 - $uniq_prefix = $this->mUniqPrefix;
164 - $commentState = new ReplacementArray;
165 - $nowikiItems = array();
166 - $generalItems = array();
167 -
168 - $elements = array_merge(
169 - array( 'nowiki', 'gallery' ),
170 - array_keys( $this->mTagHooks ) );
171 - global $wgRawHtml;
172 - if( $wgRawHtml ) {
173 - $elements[] = 'html';
174 - }
175 - if( $this->mOptions->getUseTeX() ) {
176 - $elements[] = 'math';
177 - }
178 -
179 - # Removing $dontstrip tags from $elements list (currently only 'gallery', fixing bug 2700)
180 - foreach ( $elements AS $k => $v ) {
181 - if ( !in_array ( $v , $dontstrip ) ) continue;
182 - unset ( $elements[$k] );
183 - }
184 -
185 - $matches = array();
186 - $text = self::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );
187 -
188 - foreach( $matches as $marker => $data ) {
189 - list( $element, $content, $params, $tag ) = $data;
190 - if( $render ) {
191 - $tagName = strtolower( $element );
192 - wfProfileIn( __METHOD__."-render-$tagName" );
193 - switch( $tagName ) {
194 - case '!--':
195 - // Comment
196 - if( substr( $tag, -3 ) == '-->' ) {
197 - $output = $tag;
198 - } else {
199 - // Unclosed comment in input.
200 - // Close it so later stripping can remove it
201 - $output = "$tag-->";
202 - }
203 - break;
204 - case 'html':
205 - if( $wgRawHtml ) {
206 - $output = $content;
207 - break;
208 - }
209 - // Shouldn't happen otherwise. :)
210 - case 'nowiki':
211 - $output = $this->fck_wikiTag('nowiki', $content, $params); //required by FCKeditor
212 - break;
213 - case 'math':
214 - $output = $wgContLang->armourMath( MathRenderer::renderMath( $content ) );
215 - break;
216 - case 'gallery':
217 - $output = $this->fck_wikiTag('gallery', $content, $params); //required by FCKeditor
218 - //$output = $this->renderImageGallery( $content, $params );
219 - break;
220 - default:
221 - if( isset( $this->mTagHooks[$tagName] ) ) {
222 - $this->fck_mw_taghook = $tagName; //required by FCKeditor
223 - $output = call_user_func_array( $this->mTagHooks[$tagName],
224 - array( $content, $params, $this ) );
225 - } else {
226 - throw new MWException( "Invalid call hook $element" );
227 - }
228 - }
229 - wfProfileOut( __METHOD__."-render-$tagName" );
230 - } else {
231 - // Just stripping tags; keep the source
232 - $output = $tag;
233 - }
234 -
235 - // Unstrip the output, to support recursive strip() calls
236 - $output = $state->unstripBoth( $output );
237 -
238 - if( !$stripcomments && $element == '!--' ) {
239 - $commentState->setPair( $marker, $output );
240 - } elseif ( $element == 'html' || $element == 'nowiki' ) {
241 - $nowikiItems[$marker] = $output;
242 - } else {
243 - $generalItems[$marker] = $output;
244 - }
245 - }
246 - # Add the new items to the state
247 - # We do this after the loop instead of during it to avoid slowing
248 - # down the recursive unstrip
249 - $state->nowiki->mergeArray( $nowikiItems );
250 - $state->general->mergeArray( $generalItems );
251 -
252 - # Unstrip comments unless explicitly told otherwise.
253 - # (The comments are always stripped prior to this point, so as to
254 - # not invoke any extension tags / parser hooks contained within
255 - # a comment.)
256 - if ( !$stripcomments ) {
257 - // Put them all back and forget them
258 - $text = $commentState->replace( $text );
259 - }
260 -
261 - $this->fck_matches = $matches;
262 - wfProfileOut( __METHOD__ );
263 - return $text;
264 - }
265 -
266 - /** Replace HTML comments with unique text using fck_addToStrtr function
267 - *
268 - * @private
269 - * @param string $text
270 - * @return string
271 - */
272 - private function fck_replaceHTMLcomments( $text ) {
273 - wfProfileIn( __METHOD__ );
274 - while (($start = strpos($text, '<!--')) !== false) {
275 - $end = strpos($text, '-->', $start + 4);
276 - if ($end === false) {
277 - # Unterminated comment; bail out
278 - break;
279 - }
280 -
281 - $end += 3;
282 -
283 - # Trim space and newline if the comment is both
284 - # preceded and followed by a newline
285 - $spaceStart = max($start - 1, 0);
286 - $spaceLen = $end - $spaceStart;
287 - while (substr($text, $spaceStart, 1) === ' ' && $spaceStart > 0) {
288 - $spaceStart--;
289 - $spaceLen++;
290 - }
291 - while (substr($text, $spaceStart + $spaceLen, 1) === ' ')
292 - $spaceLen++;
293 - if (substr($text, $spaceStart, 1) === "\n" and substr($text, $spaceStart + $spaceLen, 1) === "\n") {
294 - # Remove the comment, leading and trailing
295 - # spaces, and leave only one newline.
296 - $replacement = $this->fck_addToStrtr(substr($text, $spaceStart, $spaceLen+1), false);
297 - $text = substr_replace($text, $replacement."\n", $spaceStart, $spaceLen + 1);
298 - }
299 - else {
300 - # Remove just the comment.
301 - $replacement = $this->fck_addToStrtr(substr($text, $start, $end - $start), false);
302 - $text = substr_replace($text, $replacement, $start, $end - $start);
303 - }
304 - }
305 - wfProfileOut( __METHOD__ );
306 -
307 - return $text;
308 - }
309 -
310 - function replaceInternalLinks( $text ) {
311 - return parent::replaceInternalLinks($text);
312 - }
313 -
314 - function makeImage( $nt, $options ) {
315 - FCKeditorParser::$fkc_mw_makeImage_options = $options;
316 - return parent::makeImage( $nt, $options );
317 - }
318 -
319 - /**
320 - * Replace templates with unique text to preserve them from parsing
321 - *
322 - * @todo if {{template}} is inside string that also must be returned unparsed,
323 - * e.g. <noinclude>{{template}}</noinclude>
324 - * {{template}} replaced with Fckmw[n]fckmw which is wrong...
325 - *
326 - * @param string $text
327 - * @return string
328 - */
329 - private function fck_replaceTemplates( $text ) {
330 -
331 - $callback = array('{' =>
332 - array(
333 - 'end'=>'}',
334 - 'cb' => array(
335 - 2=>array('FCKeditorParser', 'fck_leaveTemplatesAlone'),
336 - 3=>array('FCKeditorParser', 'fck_leaveTemplatesAlone'),
337 - ),
338 - 'min' =>2,
339 - 'max' =>3,
340 - )
341 - );
342 -
343 - $text = $this->replace_callback($text, $callback);
344 -
345 - $tags = array();
346 - $offset=0;
347 - $textTmp = $text;
348 - while (false !== ($pos = strpos($textTmp, "<!--FCK_SKIP_START-->")))
349 - {
350 - $tags[abs($pos + $offset)] = 1;
351 - $textTmp = substr($textTmp, $pos+21);
352 - $offset += $pos + 21;
353 - }
354 -
355 - $offset=0;
356 - $textTmp = $text;
357 - while (false !== ($pos = strpos($textTmp, "<!--FCK_SKIP_END-->")))
358 - {
359 - $tags[abs($pos + $offset)] = -1;
360 - $textTmp = substr($textTmp, $pos+19);
361 - $offset += $pos + 19;
362 - }
363 -
364 - if (!empty($tags)) {
365 - ksort($tags);
366 -
367 - $strtr = array("<!--FCK_SKIP_START-->" => "", "<!--FCK_SKIP_END-->" => "");
368 -
369 - $sum=0;
370 - $lastSum=0;
371 - $finalString = "";
372 - $stringToParse = "";
373 - $startingPos = 0;
374 - $inner = "";
375 - $strtr_span = array();
376 - foreach ($tags as $pos=>$type) {
377 - $sum += $type;
378 - if ($sum == 1 && $lastSum == 0) {
379 - $stringToParse .= strtr(substr($text, $startingPos, $pos - $startingPos), $strtr);
380 - $startingPos = $pos;
381 - }
382 - else if ($sum == 0) {
383 - $stringToParse .= 'Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw';
384 - $inner = htmlspecialchars(strtr(substr($text, $startingPos, $pos - $startingPos + 19), $strtr));
385 - $this->fck_mw_strtr_span['href="Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw"'] = 'href="'.$inner.'"';
386 - $this->fck_mw_strtr_span['Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw'] = '<span class="fck_mw_template">'.str_replace(array("\r\n", "\n", "\r"),"fckLR",$inner).'</span>';
387 - $startingPos = $pos + 19;
388 - $this->fck_mw_strtr_span_counter++;
389 - }
390 - $lastSum = $sum;
391 - }
392 - $stringToParse .= substr($text, $startingPos);
393 - $text = &$stringToParse;
394 - }
395 -
396 - return $text;
397 - }
398 -
399 - function internalParse ( $text ) {
400 -
401 - $this->fck_internal_parse_text =& $text;
402 -
403 - //these three tags should remain unchanged
404 - $text = StringUtils::delimiterReplaceCallback( '<includeonly>', '</includeonly>', array($this, 'fck_includeonly'), $text );
405 - $text = StringUtils::delimiterReplaceCallback( '<noinclude>', '</noinclude>', array($this, 'fck_noinclude'), $text );
406 - $text = StringUtils::delimiterReplaceCallback( '<onlyinclude>', '</onlyinclude>', array($this, 'fck_onlyinclude'), $text );
407 -
408 - //html comments shouldn't be stripped
409 - $text = $this->fck_replaceHTMLcomments( $text );
410 - //as well as templates
411 - $text = $this->fck_replaceTemplates( $text );
412 -
413 - $finalString = parent::internalParse($text);
414 -
415 - return $finalString;
416 - }
417 - function fck_includeonly( $matches ) {
418 - return $this->fck_wikiTag('includeonly', $matches[1]);
419 - }
420 - function fck_noinclude( $matches ) {
421 - return $this->fck_wikiTag('noinclude', $matches[1]);
422 - }
423 - function fck_onlyinclude( $matches ) {
424 - return $this->fck_wikiTag('onlyinclude', $matches[1]);
425 - }
426 - function fck_leaveTemplatesAlone( $matches ) {
427 - return "<!--FCK_SKIP_START-->".$matches['text']."<!--FCK_SKIP_END-->";
428 - }
429 - function formatHeadings( $text, $isMain=true ) {
430 - return $text;
431 - }
432 - function replaceFreeExternalLinks( $text ) { return $text; }
433 - function stripNoGallery( &$text) {}
434 - function stripToc( $text ) {
435 - //$prefix = '<span class="fck_mw_magic">';
436 - //$suffix = '</span>';
437 - $prefix = '';
438 - $suffix = '';
439 -
440 - $strtr = array();
441 - foreach ($this->FCKeditorMagicWords as $word) {
442 - $strtr[$word] = $prefix . $word . $suffix;
443 - }
444 -
445 - return strtr( $text, $strtr );
446 - }
447 -
448 - function parse( $text, &$title, $options, $linestart = true, $clearState = true, $revid = null ) {
449 - $text = preg_replace("/^#REDIRECT/", "<!--FCK_REDIRECT-->", $text);
450 - $parserOutput = parent::parse($text, $title, $options, $linestart , $clearState , $revid );
451 -
452 - $categories = $parserOutput->getCategories();
453 - if ($categories) {
454 - $appendString = "";
455 - foreach ($categories as $cat=>$val) {
456 - $appendString .= "<a href=\"Category:" . $cat ."\">Category:" . $cat ."</a> ";
457 - }
458 - $parserOutput->setText($parserOutput->getText() . $appendString);
459 - }
460 -
461 - if (!empty($this->fck_mw_strtr_span)) {
462 - $parserOutput->setText(strtr($parserOutput->getText(), $this->fck_mw_strtr_span));
463 - }
464 - if (!empty($this->fck_matches)) {
465 - $text = $parserOutput->getText() ;
466 - foreach ($this->fck_matches as $key => $m) {
467 - $text = str_replace( $key, $m[3], $text);
468 - }
469 - $parserOutput->setText($text);
470 - }
471 -
472 - if (!empty($parserOutput->mLanguageLinks)) {
473 - foreach ($parserOutput->mLanguageLinks as $l) {
474 - $parserOutput->setText($parserOutput->getText() . "\n" . "<a href=\"".$l."\">".$l."</a>") ;
475 - }
476 - }
477 -
478 - $parserOutput->setText(str_replace("<!--FCK_REDIRECT-->", "#REDIRECT", $parserOutput->getText()));
479 -
480 - return $parserOutput;
481 - }
482 -
483 - /**
484 - * Make lists from lines starting with ':', '*', '#', etc.
485 - *
486 - * @private
487 - * @return string the lists rendered as HTML
488 - */
489 - function doBlockLevels( $text, $linestart ) {
490 - $fname = 'Parser::doBlockLevels';
491 - wfProfileIn( $fname );
492 -
493 - # Parsing through the text line by line. The main thing
494 - # happening here is handling of block-level elements p, pre,
495 - # and making lists from lines starting with * # : etc.
496 - #
497 - $textLines = explode( "\n", $text );
498 -
499 - $lastPrefix = $output = '';
500 - $this->mDTopen = $inBlockElem = false;
501 - $prefixLength = 0;
502 - $paragraphStack = false;
503 -
504 - if ( !$linestart ) {
505 - $output .= array_shift( $textLines );
506 - }
507 - foreach ( $textLines as $oLine ) {
508 - $lastPrefixLength = strlen( $lastPrefix );
509 - $preCloseMatch = preg_match('/<\\/pre/i', $oLine );
510 - $preOpenMatch = preg_match('/<pre/i', $oLine );
511 - if ( !$this->mInPre ) {
512 - # Multiple prefixes may abut each other for nested lists.
513 - $prefixLength = strspn( $oLine, '*#:;' );
514 - $pref = substr( $oLine, 0, $prefixLength );
515 -
516 - # eh?
517 - $pref2 = str_replace( ';', ':', $pref );
518 - $t = substr( $oLine, $prefixLength );
519 - $this->mInPre = !empty($preOpenMatch);
520 - } else {
521 - # Don't interpret any other prefixes in preformatted text
522 - $prefixLength = 0;
523 - $pref = $pref2 = '';
524 - $t = $oLine;
525 - }
526 -
527 - # List generation
528 - if( $prefixLength && 0 == strcmp( $lastPrefix, $pref2 ) ) {
529 - # Same as the last item, so no need to deal with nesting or opening stuff
530 - $output .= $this->nextItem( substr( $pref, -1 ) );
531 - $paragraphStack = false;
532 -
533 - if ( substr( $pref, -1 ) == ';') {
534 - # The one nasty exception: definition lists work like this:
535 - # ; title : definition text
536 - # So we check for : in the remainder text to split up the
537 - # title and definition, without b0rking links.
538 - $term = $t2 = '';
539 - if ($this->findColonNoLinks($t, $term, $t2) !== false) {
540 - $t = $t2;
541 - $output .= $term . $this->nextItem( ':' );
542 - }
543 - }
544 - } elseif( $prefixLength || $lastPrefixLength ) {
545 - # Either open or close a level...
546 - $commonPrefixLength = $this->getCommon( $pref, $lastPrefix );
547 - $paragraphStack = false;
548 -
549 - while( $commonPrefixLength < $lastPrefixLength ) {
550 - $output .= $this->closeList( $lastPrefix{$lastPrefixLength-1} );
551 - --$lastPrefixLength;
552 - }
553 - if ( $prefixLength <= $commonPrefixLength && $commonPrefixLength > 0 ) {
554 - $output .= $this->nextItem( $pref{$commonPrefixLength-1} );
555 - }
556 - while ( $prefixLength > $commonPrefixLength ) {
557 - $char = substr( $pref, $commonPrefixLength, 1 );
558 - $output .= $this->openList( $char );
559 -
560 - if ( ';' == $char ) {
561 - # FIXME: This is dupe of code above
562 - if ($this->findColonNoLinks($t, $term, $t2) !== false) {
563 - $t = $t2;
564 - $output .= $term . $this->nextItem( ':' );
565 - }
566 - }
567 - ++$commonPrefixLength;
568 - }
569 - $lastPrefix = $pref2;
570 - }
571 - if( 0 == $prefixLength ) {
572 - wfProfileIn( "$fname-paragraph" );
573 - # No prefix (not in list)--go to paragraph mode
574 - // XXX: use a stack for nestable elements like span, table and div
575 - $openmatch = preg_match('/(?:<table|<blockquote|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<li|<\\/tr|<\\/td|<\\/th)/iS', $t );
576 - $closematch = preg_match(
577 - '/(?:<\\/table|<\\/blockquote|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|'.
578 - '<td|<th|<\\/?div|<hr|<\\/pre|<\\/p|'.$this->mUniqPrefix.'-pre|<\\/li|<\\/ul|<\\/ol|<\\/?center)/iS', $t );
579 - if ( $openmatch or $closematch ) {
580 - $paragraphStack = false;
581 - # TODO bug 5718: paragraph closed
582 - $output .= $this->closeParagraph();
583 - if ( $preOpenMatch and !$preCloseMatch ) {
584 - $this->mInPre = true;
585 - }
586 - if ( $closematch ) {
587 - $inBlockElem = false;
588 - } else {
589 - $inBlockElem = true;
590 - }
591 - } else if ( !$inBlockElem && !$this->mInPre ) {
592 - if ( ' ' == $t{0} and ( $this->mLastSection == 'pre' or trim($t) != '' ) ) {
593 - // pre
594 - if ($this->mLastSection != 'pre') {
595 - $paragraphStack = false;
596 - $output .= $this->closeParagraph().'<pre class="_fck_mw_lspace">';
597 - $this->mLastSection = 'pre';
598 - }
599 - $t = substr( $t, 1 );
600 - } else {
601 - // paragraph
602 - if ( '' == trim($t) ) {
603 - if ( $paragraphStack ) {
604 - $output .= $paragraphStack.'<br />';
605 - $paragraphStack = false;
606 - $this->mLastSection = 'p';
607 - } else {
608 - if ($this->mLastSection != 'p' ) {
609 - $output .= $this->closeParagraph();
610 - $this->mLastSection = '';
611 - $paragraphStack = '<p>';
612 - } else {
613 - $paragraphStack = '</p><p>';
614 - }
615 - }
616 - } else {
617 - if ( $paragraphStack ) {
618 - $output .= $paragraphStack;
619 - $paragraphStack = false;
620 - $this->mLastSection = 'p';
621 - } else if ($this->mLastSection != 'p') {
622 - $output .= $this->closeParagraph().'<p>';
623 - $this->mLastSection = 'p';
624 - }
625 - }
626 - }
627 - }
628 - wfProfileOut( "$fname-paragraph" );
629 - }
630 - // somewhere above we forget to get out of pre block (bug 785)
631 - if($preCloseMatch && $this->mInPre) {
632 - $this->mInPre = false;
633 - }
634 - if ($paragraphStack === false) {
635 - $output .= $t."\n";
636 - }
637 - }
638 - while ( $prefixLength ) {
639 - $output .= $this->closeList( $pref2{$prefixLength-1} );
640 - --$prefixLength;
641 - }
642 - if ( '' != $this->mLastSection ) {
643 - $output .= '</' . $this->mLastSection . '>';
644 - $this->mLastSection = '';
645 - }
646 -
647 - wfProfileOut( $fname );
648 - return $output;
649 - }
650 -}
Index: trunk/extensions/FCKeditor/mw12/FCKeditorParserWrapper.body.php
@@ -0,0 +1,36 @@
 2+<?php
 3+
 4+/**
 5+ * Used by MW 1.12+
 6+ */
 7+class FCKeditorParserWrapper extends Parser_OldPP
 8+{
 9+ function __construct() {
 10+ global $wgParser;
 11+
 12+ parent::__construct();
 13+
 14+ $wgParser->firstCallInit();
 15+ foreach ($wgParser->getTags() as $h) {
 16+ if (!in_array($h, array("pre"))) {
 17+ $this->setHook($h, array($this, "fck_genericTagHook"));
 18+ }
 19+ }
 20+ }
 21+
 22+ function replaceInternalLinks( $s ) {
 23+ return parent::replaceInternalLinks( $s );
 24+ }
 25+
 26+ function makeImage( $title, $options, $holders = false ) {
 27+ return parent::makeImage( $title, $options, $holders );
 28+ }
 29+
 30+ function internalParse( $text ) {
 31+ return parent::internalParse( $text );
 32+ }
 33+
 34+ function parse( $text, Title $title, ParserOptions $options, $linestart = true, $clearState = true, $revid = null ) {
 35+ return parent::parse( $text, $title, $options, $linestart, $clearState, $revid );
 36+ }
 37+}
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.ko.php
@@ -0,0 +1,27 @@
 2+<?php
 3+
 4+$messages = array(
 5+'textrichditor' => '리치 에디터',
 6+'tog-riched_disable' => '리치 에디터 사용하지 않기',
 7+'tog-riched_disable_ns_main' => '주 이름 공간에서 리치 에디어 사용하지 않기',
 8+'tog-riched_disable_ns_talk' => '"{{ns:Talk}}" 이름 공간에서 리치 에디어 사용하지 않기',
 9+'tog-riched_disable_ns_user' => '"{{ns:User}}" 이름 공간에서 리치 에디어 사용하지 않기',
 10+'tog-riched_disable_ns_user_talk' => '"{{ns:User_talk}}" 이름 공간에서 리치 에디어 사용하지 않기',
 11+'tog-riched_disable_ns_project' => '"{{ns:Project}}" 이름 공간에서 리치 에디어 사용하지 않기',
 12+'tog-riched_disable_ns_project_talk' => '"{{ns:Project_talk}}" 이름 공간에서 리치 에디어 사용하지 않기',
 13+'tog-riched_disable_ns_image' => '"{{ns:Image}}" 이름 공간에서 리치 에디어 사용하지 않기',
 14+'tog-riched_disable_ns_image_talk' => '"{{ns:Image_talk}}" 이름 공간에서 리치 에디어 사용하지 않기',
 15+'tog-riched_disable_ns_mediawiki' => '"{{ns:MediaWiki}}" 이름 공간에서 리치 에디어 사용하지 않기',
 16+'tog-riched_disable_ns_mediawiki_talk' => '"{{ns:MediaWiki_talk}}" 이름 공간에서 리치 에디어 사용하지 않기',
 17+'tog-riched_disable_ns_template' => '"{{ns:Template}}" 이름 공간에서 리치 에디어 사용하지 않기',
 18+'tog-riched_disable_ns_template_talk' => '"{{ns:Template_talk}}" 이름 공간에서 리치 에디어 사용하지 않기',
 19+'tog-riched_disable_ns_help' => '"{{ns:Help}}" 이름 공간에서 리치 에디어 사용하지 않기',
 20+'tog-riched_disable_ns_help_talk' => '"{{ns:Help_talk}}" 이름 공간에서 리치 에디어 사용하지 않기',
 21+'tog-riched_disable_ns_category' => '"{{ns:Category}}" 이름 공간에서 리치 에디어 사용하지 않기',
 22+'tog-riched_disable_ns_category_talk' => '"{{ns:Category_talk}}" 이름 공간에서 리치 에디어 사용하지 않기',
 23+'rich_editor_new_window' => '새 창에 리치 에디터 열기',
 24+'tog-riched_start_disabled' => '리치 에디터를 끈 채로 시작하기',
 25+'tog-riched_use_popup' => '팝업 창에 리치 에디터 열기',
 26+'tog-riched_use_toggle' => '토글을 이용해 위키텍스트와 리치 에디터를 오가기 (텍스트영역을 리치 에디터로 대체하기)',
 27+'tog-riched_toggle_remember_state' => '마지막 토글 상태를 기억하기',
 28+);
Index: trunk/extensions/FCKeditor/mw14/Parser_OldPP.body.php
@@ -0,0 +1,178 @@
 2+<?php
 3+
 4+class Parser_OldPP extends Parser {
 5+ /**
 6+ * parse any parentheses in format ((title|part|part))
 7+ * and call callbacks to get a replacement text for any found piece
 8+ *
 9+ * @param string $text The text to parse
 10+ * @param array $callbacks rules in form:
 11+ * '{' => array( # opening parentheses
 12+ * 'end' => '}', # closing parentheses
 13+ * 'cb' => array(2 => callback, # replacement callback to call if {{..}} is found
 14+ * 3 => callback # replacement callback to call if {{{..}}} is found
 15+ * )
 16+ * )
 17+ * 'min' => 2, # Minimum parenthesis count in cb
 18+ * 'max' => 3, # Maximum parenthesis count in cb
 19+ * @private
 20+ */
 21+ function replace_callback ($text, $callbacks) {
 22+ wfProfileIn( __METHOD__ );
 23+ $openingBraceStack = array(); # this array will hold a stack of parentheses which are not closed yet
 24+ $lastOpeningBrace = -1; # last not closed parentheses
 25+
 26+ $validOpeningBraces = implode( '', array_keys( $callbacks ) );
 27+
 28+ $i = 0;
 29+ while ( $i < strlen( $text ) ) {
 30+ # Find next opening brace, closing brace or pipe
 31+ if ( $lastOpeningBrace == -1 ) {
 32+ $currentClosing = '';
 33+ $search = $validOpeningBraces;
 34+ } else {
 35+ $currentClosing = $openingBraceStack[$lastOpeningBrace]['braceEnd'];
 36+ $search = $validOpeningBraces . '|' . $currentClosing;
 37+ }
 38+ $rule = null;
 39+ $i += strcspn( $text, $search, $i );
 40+ if ( $i < strlen( $text ) ) {
 41+ if ( $text[$i] == '|' ) {
 42+ $found = 'pipe';
 43+ } elseif ( $text[$i] == $currentClosing ) {
 44+ $found = 'close';
 45+ } elseif ( isset( $callbacks[$text[$i]] ) ) {
 46+ $found = 'open';
 47+ $rule = $callbacks[$text[$i]];
 48+ } else {
 49+ # Some versions of PHP have a strcspn which stops on null characters
 50+ # Ignore and continue
 51+ ++$i;
 52+ continue;
 53+ }
 54+ } else {
 55+ # All done
 56+ break;
 57+ }
 58+
 59+ if ( $found == 'open' ) {
 60+ # found opening brace, let's add it to parentheses stack
 61+ $piece = array('brace' => $text[$i],
 62+ 'braceEnd' => $rule['end'],
 63+ 'title' => '',
 64+ 'parts' => null);
 65+
 66+ # count opening brace characters
 67+ $piece['count'] = strspn( $text, $piece['brace'], $i );
 68+ $piece['startAt'] = $piece['partStart'] = $i + $piece['count'];
 69+ $i += $piece['count'];
 70+
 71+ # we need to add to stack only if opening brace count is enough for one of the rules
 72+ if ( $piece['count'] >= $rule['min'] ) {
 73+ $lastOpeningBrace ++;
 74+ $openingBraceStack[$lastOpeningBrace] = $piece;
 75+ }
 76+ } elseif ( $found == 'close' ) {
 77+ # lets check if it is enough characters for closing brace
 78+ $maxCount = $openingBraceStack[$lastOpeningBrace]['count'];
 79+ $count = strspn( $text, $text[$i], $i, $maxCount );
 80+
 81+ # check for maximum matching characters (if there are 5 closing
 82+ # characters, we will probably need only 3 - depending on the rules)
 83+ $matchingCount = 0;
 84+ $matchingCallback = null;
 85+ $cbType = $callbacks[$openingBraceStack[$lastOpeningBrace]['brace']];
 86+ if ( $count > $cbType['max'] ) {
 87+ # The specified maximum exists in the callback array, unless the caller
 88+ # has made an error
 89+ $matchingCount = $cbType['max'];
 90+ } else {
 91+ # Count is less than the maximum
 92+ # Skip any gaps in the callback array to find the true largest match
 93+ # Need to use array_key_exists not isset because the callback can be null
 94+ $matchingCount = $count;
 95+ while ( $matchingCount > 0 && !array_key_exists( $matchingCount, $cbType['cb'] ) ) {
 96+ --$matchingCount;
 97+ }
 98+ }
 99+
 100+ if ($matchingCount <= 0) {
 101+ $i += $count;
 102+ continue;
 103+ }
 104+ $matchingCallback = $cbType['cb'][$matchingCount];
 105+
 106+ # let's set a title or last part (if '|' was found)
 107+ if (null === $openingBraceStack[$lastOpeningBrace]['parts']) {
 108+ $openingBraceStack[$lastOpeningBrace]['title'] =
 109+ substr($text, $openingBraceStack[$lastOpeningBrace]['partStart'],
 110+ $i - $openingBraceStack[$lastOpeningBrace]['partStart']);
 111+ } else {
 112+ $openingBraceStack[$lastOpeningBrace]['parts'][] =
 113+ substr($text, $openingBraceStack[$lastOpeningBrace]['partStart'],
 114+ $i - $openingBraceStack[$lastOpeningBrace]['partStart']);
 115+ }
 116+
 117+ $pieceStart = $openingBraceStack[$lastOpeningBrace]['startAt'] - $matchingCount;
 118+ $pieceEnd = $i + $matchingCount;
 119+
 120+ if( is_callable( $matchingCallback ) ) {
 121+ $cbArgs = array (
 122+ 'text' => substr($text, $pieceStart, $pieceEnd - $pieceStart),
 123+ 'title' => trim($openingBraceStack[$lastOpeningBrace]['title']),
 124+ 'parts' => $openingBraceStack[$lastOpeningBrace]['parts'],
 125+ 'lineStart' => (($pieceStart > 0) && ($text[$pieceStart-1] == "\n")),
 126+ );
 127+ # finally we can call a user callback and replace piece of text
 128+ $replaceWith = call_user_func( $matchingCallback, $cbArgs );
 129+ $text = substr($text, 0, $pieceStart) . $replaceWith . substr($text, $pieceEnd);
 130+ $i = $pieceStart + strlen($replaceWith);
 131+ } else {
 132+ # null value for callback means that parentheses should be parsed, but not replaced
 133+ $i += $matchingCount;
 134+ }
 135+
 136+ # reset last opening parentheses, but keep it in case there are unused characters
 137+ $piece = array('brace' => $openingBraceStack[$lastOpeningBrace]['brace'],
 138+ 'braceEnd' => $openingBraceStack[$lastOpeningBrace]['braceEnd'],
 139+ 'count' => $openingBraceStack[$lastOpeningBrace]['count'],
 140+ 'title' => '',
 141+ 'parts' => null,
 142+ 'startAt' => $openingBraceStack[$lastOpeningBrace]['startAt']);
 143+ $openingBraceStack[$lastOpeningBrace--] = null;
 144+
 145+ if ($matchingCount < $piece['count']) {
 146+ $piece['count'] -= $matchingCount;
 147+ $piece['startAt'] -= $matchingCount;
 148+ $piece['partStart'] = $piece['startAt'];
 149+ # do we still qualify for any callback with remaining count?
 150+ $currentCbList = $callbacks[$piece['brace']]['cb'];
 151+ while ( $piece['count'] ) {
 152+ if ( array_key_exists( $piece['count'], $currentCbList ) ) {
 153+ $lastOpeningBrace++;
 154+ $openingBraceStack[$lastOpeningBrace] = $piece;
 155+ break;
 156+ }
 157+ --$piece['count'];
 158+ }
 159+ }
 160+ } elseif ( $found == 'pipe' ) {
 161+ # lets set a title if it is a first separator, or next part otherwise
 162+ if (null === $openingBraceStack[$lastOpeningBrace]['parts']) {
 163+ $openingBraceStack[$lastOpeningBrace]['title'] =
 164+ substr($text, $openingBraceStack[$lastOpeningBrace]['partStart'],
 165+ $i - $openingBraceStack[$lastOpeningBrace]['partStart']);
 166+ $openingBraceStack[$lastOpeningBrace]['parts'] = array();
 167+ } else {
 168+ $openingBraceStack[$lastOpeningBrace]['parts'][] =
 169+ substr($text, $openingBraceStack[$lastOpeningBrace]['partStart'],
 170+ $i - $openingBraceStack[$lastOpeningBrace]['partStart']);
 171+ }
 172+ $openingBraceStack[$lastOpeningBrace]['partStart'] = ++$i;
 173+ }
 174+ }
 175+
 176+ wfProfileOut( __METHOD__ );
 177+ return $text;
 178+ }
 179+}
Index: trunk/extensions/FCKeditor/FCKeditor.body.php
@@ -1,7 +1,22 @@
22 <?php
 3+/**
 4+ * Options for FCKeditor
 5+ * [start with FCKeditor]
 6+ */
 7+define("RTE_VISIBLE", 1);
 8+/**
 9+ * Options for FCKeditor
 10+ * [show toggle link]
 11+ */
 12+define('RTE_TOGGLE_LINK', 2);
 13+/**
 14+ * Options for FCKeditor
 15+ * [show popup link]
 16+ */
 17+define('RTE_POPUP', 4);
318
4 -class FCKeditor_MediaWiki
5 -{
 19+class FCKeditor_MediaWiki {
 20+ public $showFCKEditor;
621 private $count = array();
722 private $wgFCKBypassText = "";
823 private $debug = 0;
@@ -28,8 +43,7 @@
2944
3045 static $messagesLoaded = false;
3146
32 - function __call($m,$a)
33 - {
 47+ function __call($m, $a) {
3448 print "\n#### " . $m . "\n";
3549 if (!isset($this->count[$m])) {
3650 $this->count[$m] = 0;
@@ -38,57 +52,138 @@
3953 return true;
4054 }
4155
42 - function onMonoBookTemplateToolboxEnd()
43 - {
 56+ function onMonoBookTemplateToolboxEnd() {
4457 if ($this->debug) {
4558 print_r($this->count);
4659 }
4760 }
4861
49 - private function getExcludedNamespaces()
50 - {
51 - global $wgUser;
 62+ private function getExcludedNamespaces() {
 63+ global $wgUser,$wgDefaultUserOptions, $wgFCKEditorExcludedNamespaces;
5264
5365 if ( is_null( $this->excludedNamespaces ) ) {
5466 $this->excludedNamespaces = array();
5567 foreach ( self::$nsToggles as $toggle ) {
56 - if ( $wgUser->getOption( $toggle ) ) {
 68+ $default = isset($wgDefaultUserOptions[$toggle]) ? $wgDefaultUserOptions[$toggle] : "";
 69+ if ( $wgUser->getOption( $toggle, $default) ) {
5770 $this->excludedNamespaces[] = constant(strtoupper(str_replace("riched_disable_", "", $toggle)));
5871 }
5972 }
 73+ /*
 74+ If this site's LocalSettings.php defines Namespaces that shouldn't use the FCKEditor (in the #wgFCKexcludedNamespaces array), those excluded
 75+ namespaces should be combined with those excluded in the user's preferences.
 76+ */
 77+ if (!empty($wgFCKEditorExcludedNamespaces) && is_array($wgFCKEditorExcludedNamespaces)) {
 78+ $this->excludedNamespaces = array_merge($wgFCKEditorExcludedNamespaces, $this->excludedNamespaces);
 79+ }
6080 }
6181
6282 return $this->excludedNamespaces;
6383 }
6484
65 - public function onLanguageGetMagic(&$magicWords, $langCode)
66 - {
 85+ public function onLanguageGetMagic(&$magicWords, $langCode) {
6786 $magicWords['NORICHEDITOR'] = array( 0, '__NORICHEDITOR__' );
68 -
 87+
6988 return true;
7089 }
71 -
72 - public function onParserBeforeInternalParse(&$parser, &$text, &$strip_state)
73 - {
 90+
 91+ public function onParserBeforeInternalParse(&$parser, &$text, &$strip_state) {
7492 MagicWord::get( 'NORICHEDITOR' )->matchAndRemove( $text );
75 -
 93+
7694 return true;
7795 }
7896
 97+ public function onEditPageShowEditFormFields($pageEditor, $wgOut) {
 98+ global $wgUser, $wgFCKEditorIsCompatible, $wgTitle, $wgVersion;
 99+
 100+ /*
 101+ If FCKeditor extension is enabled, BUT it shouldn't appear (because it's disabled by user, we have incompatible browser etc.)
 102+ We must do this trick to show the original text as WikiText instead of HTML when conflict occurs
 103+ */
 104+ if ( (!$wgUser->getOption( 'showtoolbar' ) || $wgUser->getOption( 'riched_disable' ) || !$wgFCKEditorIsCompatible) ||
 105+ in_array($wgTitle->getNamespace(), $this->getExcludedNamespaces()) || !($this->showFCKEditor & RTE_VISIBLE) ||
 106+ false !== strpos($pageEditor->textbox1, "__NORICHEDITOR__")
 107+ ) {
 108+ if ($pageEditor->isConflict) {
 109+ $pageEditor->textbox1 = $pageEditor->getWikiContent();
 110+ }
 111+ }
 112+ /*
 113+ If FCKeditor extension is enabled, and it should appear
 114+ We must do this trick to show HTML instead of the original text when conflict occurs
 115+ This hack is only needed for MW 1.11 and below
 116+ */
 117+ else if (version_compare("1.12", $wgVersion, ">")) {
 118+ if ($pageEditor->isConflict) {
 119+ $options = new FCKeditorParserOptions();
 120+ $options->setTidy(true);
 121+ $parser = new FCKeditorParser();
 122+ $parser->setOutputType(OT_HTML);
 123+ $pa = $parser->parse($pageEditor->textbox1, $pageEditor->mTitle, $options);
 124+ $pageEditor->textbox1 = $pa->mText;
 125+ }
 126+ }
 127+
 128+ return true;
 129+ }
 130+
 131+ public function onEditPageBeforeConflictDiff($pageEditor, $wgOut) {
 132+ global $fckPageEditor, $wgRequest;
 133+
 134+ /*
 135+ Show WikiText instead of HTML when there is a conflict
 136+ http://dev.fckeditor.net/ticket/1385
 137+ */
 138+ $pageEditor->textbox2 = $wgRequest->getVal( 'wpTextbox1' );
 139+ $pageEditor->textbox1 = $pageEditor->getWikiContent();
 140+
 141+ return true;
 142+ }
 143+
 144+ public function onParserBeforeStrip(&$parser, &$text, &$stripState) {
 145+ $text = $parser->strip( $text, $stripState );
 146+ return true;
 147+ }
 148+
 149+ public function onSanitizerAfterFixTagAttributes($text, $element, &$attribs) {
 150+ $text = preg_match_all("/Fckmw\d+fckmw/", $text, $matches);
 151+
 152+ if (!empty($matches[0][0])) {
 153+ global $leaveRawTemplates;
 154+ if (!isset($leaveRawTemplates)) {
 155+ $leaveRawTemplates = array();
 156+ }
 157+ $leaveRawTemplates = array_merge($leaveRawTemplates, $matches[0]);
 158+ $attribs = array_merge($attribs, $matches[0]);
 159+ }
 160+
 161+ return true;
 162+ }
 163+
79164 public function registerHooks() {
80 - global $wgHooks, $wgExtensionFunctions;
 165+ global $wgHooks, $wgExtensionFunctions, $wgVersion;
81166
82167 $wgHooks['UserToggles'][] = array($this, 'onUserToggles');
83168 $wgHooks['MessagesPreLoad'][] = array($this, 'onMessagesPreLoad');
84169 $wgHooks['ParserAfterTidy'][] = array($this, 'onParserAfterTidy');
85170 $wgHooks['EditPage::showEditForm:initial'][] = array($this, 'onEditPageShowEditFormInitial');
 171+ $wgHooks['EditPage::showEditForm:fields'][] = array($this, 'onEditPageShowEditFormFields');
86172 $wgHooks['EditPageBeforePreviewText'][] = array($this, 'onEditPageBeforePreviewText');
 173+ if (version_compare("1.14alpha", $wgVersion, "<=")) {
 174+ $wgHooks['ParserBeforeStrip'][] = array($this, 'onParserBeforeStrip');
 175+ }
87176 $wgHooks['EditPagePreviewTextEnd'][] = array($this, 'onEditPagePreviewTextEnd');
88177 $wgHooks['CustomEditor'][] = array($this, 'onCustomEditor');
89178 $wgHooks['LanguageGetMagic'][] = array($this, "onLanguageGetMagic");
90179 $wgHooks['ParserBeforeInternalParse'][] = array($this, "onParserBeforeInternalParse");
 180+ $wgHooks['EditPageBeforeConflictDiff'][] = array($this, 'onEditPageBeforeConflictDiff');
 181+ $wgHooks['SanitizerAfterFixTagAttributes'][] = array($this, 'onSanitizerAfterFixTagAttributes');
91182
92183 if ($this->debug) {
 184+ /*
 185+ This is just an array of all available hooks, useful for debugging and learning
 186+ Add here all new hooks
 187+ */
93188 $opcje = array('ArticleSave',
94189 'ArticleInsertComplete', 'ArticleSaveComplete', 'TitleMoveComplete', 'ArticleProtect', 'ArticleProtectComplete', 'ArticleDelete', 'ArticleDeleteComplete', 'AlternateEdit', 'ArticleFromTitle', 'ArticleAfterFetchContent',
95190 'ArticlePageDataBefore', 'ArticlePageDataAfter', 'ParserBeforeStrip', 'ParserAfterStrip', 'ParserBeforeInternalParse', 'InternalParseBeforeLinks', 'ParserBeforeTidy', 'ParserAfterTidy', 'ParserClearState', 'ParserGetVariableValueSwitch',
@@ -108,8 +203,7 @@
109204 }
110205 }
111206
112 - public function onCustomEditor(&$article, &$user)
113 - {
 207+ public function onCustomEditor(&$article, &$user) {
114208 global $wgRequest, $mediaWiki;
115209
116210 $action = $mediaWiki->getVal('Action');
@@ -131,8 +225,7 @@
132226 return false;
133227 }
134228
135 - public function onEditPageBeforePreviewText(&$editPage, $previewOnOpen)
136 - {
 229+ public function onEditPageBeforePreviewText(&$editPage, $previewOnOpen) {
137230 global $wgUser, $wgRequest;
138231
139232 if ($wgUser->getOption( 'showtoolbar' ) && !$wgUser->getOption( 'riched_disable' ) && !$previewOnOpen ) {
@@ -143,8 +236,7 @@
144237 return true;
145238 }
146239
147 - public function onEditPagePreviewTextEnd(&$editPage, $previewOnOpen)
148 - {
 240+ public function onEditPagePreviewTextEnd(&$editPage, $previewOnOpen) {
149241 global $wgUser;
150242
151243 if ($wgUser->getOption( 'showtoolbar' ) && !$wgUser->getOption( 'riched_disable' ) && !$previewOnOpen ) {
@@ -154,8 +246,7 @@
155247 return true;
156248 }
157249
158 - public function onParserAfterTidy(&$parser, &$text)
159 - {
 250+ public function onParserAfterTidy(&$parser, &$text) {
160251 global $wgUseTeX, $wgUser, $wgTitle, $wgFCKEditorIsCompatible;
161252
162253 if (!$wgUser->getOption( 'showtoolbar' ) || $wgUser->getOption( 'riched_disable' ) || !$wgFCKEditorIsCompatible) {
@@ -175,8 +266,7 @@
176267 return true;
177268 }
178269
179 - public function onMessagesPreLoad()
180 - {
 270+ public function onMessagesPreLoad() {
181271 global $wgMessageCache, $wgUser, $wgContLanguageCode;
182272
183273 if ( !self::$messagesLoaded ) {
@@ -199,17 +289,41 @@
200290
201291 /**
202292 * Add FCK script
203 - *
 293+ *
204294 * @param unknown_type $q
205295 * @return unknown
206296 */
207297 public function onEditPageShowEditFormInitial( $form ) {
208 - global $wgOut, $wgTitle, $wgScriptPath;
 298+ global $wgOut, $wgTitle, $wgScriptPath, $wgContLang;
209299 global $wgFCKEditorToolbarSet, $wgFCKEditorIsCompatible;
210300 global $wgFCKEditorExtDir, $wgFCKEditorDir, $wgFCKEditorHeight, $wgUser;
211301 global $wgStylePath, $wgStyleVersion, $wgDefaultSkin, $wgExtensionFunctions;
 302+ global $wgFCKWikiTextBeforeParse;
 303+ global $wgHooks, $wgDefaultUserOptions;
212304
213 - if (!$wgUser->getOption( 'showtoolbar' ) || $wgUser->getOption( 'riched_disable' ) || !$wgFCKEditorIsCompatible) {
 305+ if (!isset($this->showFCKEditor))
 306+ {
 307+ $this->showFCKEditor = 0;
 308+ if ( !$wgUser->getOption( 'riched_start_disabled',$wgDefaultUserOptions['riched_start_disabled'] ) ) {
 309+ $this->showFCKEditor += RTE_VISIBLE;
 310+ }
 311+ if ( $wgUser->getOption( 'riched_use_popup',$wgDefaultUserOptions['riched_use_popup'] ) ) {
 312+ $this->showFCKEditor += RTE_POPUP;
 313+ }
 314+ if ( $wgUser->getOption( 'riched_use_toggle',$wgDefaultUserOptions['riched_use_toggle'] ) ) {
 315+ $this->showFCKEditor += RTE_TOGGLE_LINK;
 316+ }
 317+ }
 318+
 319+ if( (!empty($_SESSION['showMyFCKeditor'])) && ($wgUser->getOption( 'riched_toggle_remember_state',$wgDefaultUserOptions['riched_toggle_remember_state'] )))
 320+ {
 321+ //clear RTE_VISIBLE flag
 322+ $this->showFCKEditor &= ~RTE_VISIBLE ;
 323+ //get flag from session
 324+ $this->showFCKEditor |= $_SESSION['showMyFCKeditor'] ;
 325+ }
 326+
 327+ if (!$wgUser->getOption( 'showtoolbar' ) || $wgUser->getOption( 'riched_disable', !empty( $wgDefaultUserOptions['riched_disable'] ) ? $wgDefaultUserOptions['riched_disable'] : false ) || !$wgFCKEditorIsCompatible) {
214328 return true;
215329 }
216330
@@ -221,11 +335,15 @@
222336 return true;
223337 }
224338
225 - $options = new FCKeditorParserOptions();
226 - $options->setTidy(true);
227 - $parser = new FCKeditorParser();
228 - $parser->setOutputType(OT_HTML);
229 - $form->textbox1 = $parser->parse($form->textbox1, $wgTitle, $options)->getText();
 339+ $wgFCKWikiTextBeforeParse = $form->textbox1;
 340+ if ($this->showFCKEditor & RTE_VISIBLE)
 341+ {
 342+ $options = new FCKeditorParserOptions();
 343+ $options->setTidy(true);
 344+ $parser = new FCKeditorParser();
 345+ $parser->setOutputType(OT_HTML);
 346+ $form->textbox1 = str_replace("<!-- Tidy found serious XHTML errors -->", "", $parser->parse($form->textbox1, $wgTitle, $options)->getText());
 347+ }
230348
231349 $printsheet = htmlspecialchars( "$wgStylePath/common/wikiprintable.css?$wgStyleVersion" );
232350
@@ -233,10 +351,11 @@
234352 $skin = $wgUser->getSkin();
235353 $skin->loggedin = $wgUser->isLoggedIn();
236354 $skin->mTitle =& $wgTitle;
 355+ $skin->initPage($wgOut);
237356 //$skin->skinname = 'monobook';
238357 $skin->userpage = $wgUser->getUserPage()->getPrefixedText();
239358 if (method_exists($skin, "setupUserCss")) {
240 - $skin->setupUserCss();
 359+ $skin->setupUserCss($wgOut);
241360 }
242361
243362 if (!empty($skin->usercss) && preg_match_all('/@import "([^"]+)";/', $skin->usercss, $matches)) {
@@ -246,7 +365,7 @@
247366
248367 $script = <<<HEREDOC
249368 <script type="text/javascript" src="$wgScriptPath/$wgFCKEditorDir/fckeditor.js"></script>
250 -<script type="text/javascript">
 369+<script type="text/javascript">
251370 var sEditorAreaCSS = '$printsheet,/mediawiki/skins/monobook/main.css?{$wgStyleVersion}';
252371 </script>
253372 <!--[if lt IE 5.5000]><script type="text/javascript">sEditorAreaCSS += ',/mediawiki/skins/monobook/IE50Fixes.css?{$wgStyleVersion}'; </script><![endif]-->
@@ -256,35 +375,83 @@
257376 <!--[if lt IE 7]><script type="text/javascript">sEditorAreaCSS += ',/mediawiki/skins/monobook/IEFixes.css?{$wgStyleVersion}'; </script><![endif]-->
258377 HEREDOC;
259378
 379+ $script .= '<script type="text/javascript"> ';
260380 if (!empty($userStyles)) {
261 - $script .= '
262 -<script type="text/javascript">
263 -sEditorAreaCSS += ",'.implode(',', $userStyles).'";
264 -</script>';
 381+ $script .= 'sEditorAreaCSS += ",'.implode(',', $userStyles).'";';
265382 }
266383
 384+ $showRef = false;
 385+ if ( (isset($wgHooks['ParserFirstCallInit']) && in_array('wfCite',$wgHooks['ParserFirstCallInit'])) || (isset($wgExtensionFunctions) && in_array('wfCite',$wgExtensionFunctions)) ) {
 386+ $showRef = true;
 387+ }
 388+
 389+ $showSource = false;
 390+ if ( (isset ($wgHooks['ParserFirstCallInit']) && in_array('efSyntaxHighlight_GeSHiSetup', $wgHooks['ParserFirstCallInit']))
 391+ || (isset ($wgExtensionFunctions) && in_array('efSyntaxHighlight_GeSHiSetup', $wgExtensionFunctions)) ) {
 392+ $showSource = true;
 393+ }
 394+
 395+ $script .= '
 396+var showFCKEditor = '. $this->showFCKEditor .';
 397+var popup = false; //pointer to popup document
 398+var firstLoad = true;
 399+var editorMsgOn = "'. wfMsg( 'textrichditor' ) .'";
 400+var editorMsgOff = "'. wfMsg( 'tog-riched_disable' ) .'";
 401+var editorLink = "'. (($this->showFCKEditor & RTE_VISIBLE)? wfMsg( 'tog-riched_disable' ): wfMsg( 'textrichditor' )) .'";
 402+var saveSetting = '. ($wgUser->getOption( 'riched_toggle_remember_state',$wgDefaultUserOptions['riched_toggle_remember_state'] ) ? 1 : 0) .';
 403+var RTE_VISIBLE = '.RTE_VISIBLE.';
 404+var RTE_TOGGLE_LINK = '.RTE_TOGGLE_LINK.';
 405+var RTE_POPUP = '.RTE_POPUP.';
 406+
 407+
 408+var oFCKeditor = new FCKeditor( "wpTextbox1" ) ;
 409+
 410+//Set config
 411+oFCKeditor.BasePath = "'.$wgScriptPath.'/'.$wgFCKEditorDir.'/" ;
 412+oFCKeditor.Config["CustomConfigurationsPath"] = "'.$wgScriptPath.'/'.$wgFCKEditorExtDir.'/fckeditor_config.js" ;';
 413+ if ($wgContLang->isRTL()) {
 414+ $script .= 'oFCKeditor.Config["EditorAreaCSS"] = "'.$wgScriptPath.'/'.$wgFCKEditorExtDir.'/css/fckeditor.css,'.$wgScriptPath.'/'.$wgFCKEditorExtDir.'/css/fckeditor-rtl.css" ;';
 415+ }
 416+ else {
 417+ $script .= 'oFCKeditor.Config["EditorAreaCSS"] = "'.$wgScriptPath.'/'.$wgFCKEditorExtDir.'/css/fckeditor.css" ;';
 418+ }
 419+ $script .= '
 420+oFCKeditor.ToolbarSet = "'. $wgFCKEditorToolbarSet .'" ;
 421+oFCKeditor.ready = true;
 422+oFCKeditor.Config["showreferences"] = '.(($showRef)?'true':'false').';
 423+oFCKeditor.Config["showsource"] = '.(($showSource)?'true':'false').';
 424+';
 425+ $script .= '</script>';
 426+
 427+ $newWinMsg = wfMsg('rich_editor_new_window');
267428 $script .= <<<HEREDOC
268 -<script type="text/javascript">
 429+<script type="text/javascript">
269430
270 -// Remove the mwSetupToolbar onload hook to avoid a JavaScript error with FF.
271 -if ( window.removeEventListener )
272 - window.removeEventListener( 'load', mwSetupToolbar, false ) ;
273 -else if ( window.detachEvent )
274 - window.detachEvent( 'onload', mwSetupToolbar ) ;
275 -
276 -mwSetupToolbar = function() { return false ; } ;
 431+//IE hack to call func from popup
 432+function FCK_sajax(func_name, args, target) {
 433+ sajax_request_type = 'POST' ;
 434+ sajax_do_call(func_name, args, function (x) {
 435+ // I know this is function, not object
 436+ target(x);
 437+ }
 438+ );
 439+}
277440
278441 function onLoadFCKeditor()
279442 {
280 - if ( document.getElementById('wpTextbox1') )
 443+ if (!(showFCKEditor & RTE_VISIBLE))
 444+ showFCKEditor += RTE_VISIBLE;
 445+ firstLoad = false;
 446+ realTextarea = document.getElementById('wpTextbox1');
 447+ if ( realTextarea )
281448 {
282449 var height = $wgFCKEditorHeight ;
283 -
 450+ realTextarea.style.display = 'none';
284451 if ( height == 0 )
285452 {
286453 // Get the window (inner) size.
287454 var height = window.innerHeight || ( document.documentElement && document.documentElement.clientHeight ) || 550 ;
288 -
 455+
289456 // Reduce the height to the offset of the toolbar.
290457 var offset = document.getElementById('wikiPreview') || document.getElementById('toolbar') ;
291458 while ( offset )
@@ -292,62 +459,307 @@
293460 height -= offset.offsetTop ;
294461 offset = offset.offsetParent ;
295462 }
296 -
 463+
297464 // Add a small space to be left in the bottom.
298465 height -= 20 ;
299466 }
300467
301468 // Enforce a minimum height.
302469 height = ( !height || height < 300 ) ? 300 : height ;
303 -
 470+
304471 // Create the editor instance and replace the textarea.
305 - var oFCKeditor = new FCKeditor('wpTextbox1') ;
306 - oFCKeditor.BasePath = '$wgScriptPath/$wgFCKEditorDir/' ;
307 - oFCKeditor.Config['CustomConfigurationsPath'] = '$wgScriptPath/$wgFCKEditorExtDir/fckeditor_config.js' ;
308 - oFCKeditor.Config['EditorAreaCSS'] = "$wgScriptPath/$wgFCKEditorExtDir/css/fckeditor.css" ;
309472 oFCKeditor.Height = height ;
310 - oFCKeditor.ToolbarSet = '$wgFCKEditorToolbarSet' ;
311473 oFCKeditor.ReplaceTextarea() ;
312 -
 474+
313475 // Hide the default toolbar.
314 - document.getElementById('toolbar').style.cssText = 'display:none;' ;
 476+ document.getElementById('toolbar').style.display = 'none' ;
 477+ // do things with CharInsert for example
 478+
 479+ var edittools_markup = document.getElementById ('editpage-specialchars') ;
 480+ if (edittools_markup) {
 481+ edittools_markup.style.display = 'none' ;
 482+ }
 483+ FCKeditorInsertTags = function (tagOpen, tagClose, sampleText, oDoc)
 484+ {
 485+ var txtarea;
 486+
 487+ if ( !(typeof(oDoc.FCK) == "undefined") && !(typeof(oDoc.FCK.EditingArea) == "undefined") )
 488+ {
 489+ txtarea = oDoc.FCK.EditingArea.Textarea ;
 490+ }
 491+ else if (oDoc.editform)
 492+ {
 493+ // if we have FCK enabled, behave differently...
 494+ if ( showFCKEditor & RTE_VISIBLE )
 495+ {
 496+ SRCiframe = oDoc.getElementById ('wpTextbox1___Frame') ;
 497+ if ( SRCiframe )
 498+ {
 499+ if (window.frames[SRCiframe])
 500+ SRCdoc = window.frames[SRCiframe].oDoc ;
 501+ else
 502+ SRCdoc = SRCiframe.contentDocument ;
 503+
 504+ var SRCarea = SRCdoc.getElementById ('xEditingArea').firstChild ;
 505+
 506+ if (SRCarea)
 507+ txtarea = SRCarea ;
 508+ else
 509+ return false ;
 510+
 511+ }
 512+ else
 513+ {
 514+ return false ;
 515+ }
 516+ }
 517+ else
 518+ {
 519+ txtarea = oDoc.editform.wpTextbox1 ;
 520+ }
 521+ }
 522+ else
 523+ {
 524+ // some alternate form? take the first one we can find
 525+ var areas = oDoc.getElementsByTagName( 'textarea' ) ;
 526+ txtarea = areas[0] ;
 527+ }
 528+
 529+ var selText, isSample = false ;
 530+
 531+ if ( oDoc.selection && oDoc.selection.createRange )
 532+ { // IE/Opera
 533+
 534+ //save window scroll position
 535+ if ( oDoc.documentElement && oDoc.documentElement.scrollTop )
 536+ var winScroll = oDoc.documentElement.scrollTop ;
 537+ else if ( oDoc.body )
 538+ var winScroll = oDoc.body.scrollTop ;
 539+
 540+ //get current selection
 541+ txtarea.focus() ;
 542+ var range = oDoc.selection.createRange() ;
 543+ selText = range.text ;
 544+ //insert tags
 545+ checkSelected();
 546+ range.text = tagOpen + selText + tagClose ;
 547+ //mark sample text as selected
 548+ if ( isSample && range.moveStart )
 549+ {
 550+ if (window.opera)
 551+ tagClose = tagClose.replace(/\\n/g,'') ; //check it out one more time
 552+ range.moveStart('character', - tagClose.length - selText.length) ;
 553+ range.moveEnd('character', - tagClose.length) ;
 554+ }
 555+ range.select();
 556+ //restore window scroll position
 557+ if ( oDoc.documentElement && oDoc.documentElement.scrollTop )
 558+ oDoc.documentElement.scrollTop = winScroll ;
 559+ else if ( oDoc.body )
 560+ oDoc.body.scrollTop = winScroll ;
 561+
 562+ }
 563+ else if ( txtarea.selectionStart || txtarea.selectionStart == '0' )
 564+ { // Mozilla
 565+
 566+ //save textarea scroll position
 567+ var textScroll = txtarea.scrollTop ;
 568+ //get current selection
 569+ txtarea.focus() ;
 570+ var startPos = txtarea.selectionStart ;
 571+ var endPos = txtarea.selectionEnd ;
 572+ selText = txtarea.value.substring( startPos, endPos ) ;
 573+
 574+ //insert tags
 575+ if (!selText)
 576+ {
 577+ selText = sampleText ;
 578+ isSample = true ;
 579+ }
 580+ else if (selText.charAt(selText.length - 1) == ' ')
 581+ { //exclude ending space char
 582+ selText = selText.substring(0, selText.length - 1) ;
 583+ tagClose += ' ' ;
 584+ }
 585+ txtarea.value = txtarea.value.substring(0, startPos) + tagOpen + selText + tagClose +
 586+ txtarea.value.substring(endPos, txtarea.value.length) ;
 587+ //set new selection
 588+ if (isSample)
 589+ {
 590+ txtarea.selectionStart = startPos + tagOpen.length ;
 591+ txtarea.selectionEnd = startPos + tagOpen.length + selText.length ;
 592+ }
 593+ else
 594+ {
 595+ txtarea.selectionStart = startPos + tagOpen.length + selText.length + tagClose.length ;
 596+ txtarea.selectionEnd = txtarea.selectionStart;
 597+ }
 598+ //restore textarea scroll position
 599+ txtarea.scrollTop = textScroll;
 600+ }
 601+ }
315602 }
316603 }
317 -addOnloadHook( onLoadFCKeditor ) ;
 604+function checkSelected()
 605+{
 606+ if (!selText) {
 607+ selText = sampleText;
 608+ isSample = true;
 609+ } else if (selText.charAt(selText.length - 1) == ' ') { //exclude ending space char
 610+ selText = selText.substring(0, selText.length - 1);
 611+ tagClose += ' '
 612+ }
 613+}
 614+function initEditor()
 615+{
 616+ var toolbar = document.getElementById('toolbar') ;
 617+ //show popup or toogle link
 618+ if (showFCKEditor & (RTE_POPUP|RTE_TOGGLE_LINK)){
 619+ //add new toolbar before wiki toolbar
 620+ var fckTools = document.createElement('div');
 621+ fckTools.setAttribute('id', 'fckTools');
 622+ toolbar.parentNode.insertBefore( fckTools, toolbar );
318623
319 -/*
320 -function showSource() {
321 - var wp = document.getElementById("wpDiff");
322 - var s = document.createElement("input");
323 - s.type="submit";
324 - s.value="Wiki2HTML";
325 - s.name="Wiki2HTML";
326 - s.onclick = function wiki2html() {
327 - var oEditor = FCKeditorAPI.GetInstance('wpTextbox1');
328 - WikiToHTML_Call();
329 - return false;
 624+ var SRCtextarea = document.getElementById( "wpTextbox1" ) ;
 625+ if (showFCKEditor & RTE_VISIBLE) SRCtextarea.style.display = "none";
330626 }
331 - wp.parentNode.insertBefore(s, wp.nextSibling);
 627+
 628+ if (showFCKEditor & RTE_TOGGLE_LINK)
 629+ {
 630+ fckTools.innerHTML='[<a class="fckToogle" id="toggle_wpTextbox1" href="javascript:void(0)" onclick="ToggleFCKEditor(\'toggle\',\'wpTextbox1\')">'+ editorLink +'</a>] ';
 631+ }
 632+ if (showFCKEditor & RTE_POPUP)
 633+ {
 634+ var style = (showFCKEditor & RTE_VISIBLE) ? 'style="display:none"' : "";
 635+ fckTools.innerHTML+='<span ' + style + ' id="popup_wpTextbox1">[<a class="fckPopup" href="javascript:void(0)" onclick="ToggleFCKEditor(\'popup\',\'wpTextbox1\')">{$newWinMsg}</a>]</span>';
 636+ }
 637+
 638+ if (showFCKEditor & RTE_VISIBLE)
 639+ {
 640+ if ( toolbar ) //insert wiki buttons
 641+ {
 642+ // Remove the mwSetupToolbar onload hook to avoid a JavaScript error with FF.
 643+ if ( window.removeEventListener )
 644+ window.removeEventListener( 'load', mwSetupToolbar, false ) ;
 645+ else if ( window.detachEvent )
 646+ window.detachEvent( 'onload', mwSetupToolbar ) ;
 647+ mwSetupToolbar = function() { return false ; } ;
 648+
 649+ for (var i = 0; i < mwEditButtons.length; i++) {
 650+ mwInsertEditButton(toolbar, mwEditButtons[i]);
 651+ }
 652+ for (var i = 0; i < mwCustomEditButtons.length; i++) {
 653+ mwInsertEditButton(toolbar, mwCustomEditButtons[i]);
 654+ }
 655+ }
 656+ onLoadFCKeditor();
 657+ }
 658+ return true;
332659 }
 660+addOnloadHook( initEditor );
333661
334 -var sajax_debug_mode = false;
335 -var sajax_request_type = "GET";
 662+HEREDOC;
336663
337 -function WikiToHTML_Result(result)
 664+if ($this->showFCKEditor & (RTE_TOGGLE_LINK | RTE_POPUP) ){
 665+ //add toogle link and handler
 666+ $script .= <<<HEREDOC
 667+
 668+function ToggleFCKEditor(mode, objId)
338669 {
339 - var oEditor = FCKeditorAPI.GetInstance('wpTextbox1');
340 - oEditor.SetHTML(result.responseText);
 670+ var SRCtextarea = document.getElementById( objId ) ;
 671+ if(mode == 'popup'){
 672+ if (( showFCKEditor & RTE_VISIBLE) && ( FCKeditorAPI )) //if FCKeditor is up-to-date
 673+ {
 674+ var oEditorIns = FCKeditorAPI.GetInstance( objId );
 675+ var text = oEditorIns.GetData( oEditorIns.Config.FormatSource );
 676+ SRCtextarea.value = text; //copy text to textarea
 677+ }
 678+ FCKeditor_OpenPopup('oFCKeditor',objId);
 679+ return true;
 680+ }
 681+
 682+ var oToggleLink = document.getElementById('toggle_'+ objId );
 683+ var oPopupLink = document.getElementById('popup_'+ objId );
 684+
 685+ if ( firstLoad )
 686+ {
 687+ // firstLoad = true => FCKeditor start invisible
 688+ if (oToggleLink) oToggleLink.innerHTML = "Loading...";
 689+ sajax_request_type = 'POST' ;
 690+ oFCKeditor.ready = false;
 691+ sajax_do_call('wfSajaxWikiToHTML', [SRCtextarea.value], function ( result ){
 692+ if ( firstLoad ) //still
 693+ {
 694+ SRCtextarea.value = result.responseText; //insert parsed text
 695+ onLoadFCKeditor();
 696+ if (oToggleLink) oToggleLink.innerHTML = editorMsgOff;
 697+ oFCKeditor.ready = true;
 698+ }
 699+ });
 700+ return true;
 701+ }
 702+
 703+ if (!oFCKeditor.ready) return false; //sajax_do_call in action
 704+ if (!FCKeditorAPI) return false; //not loaded yet
 705+ var oEditorIns = FCKeditorAPI.GetInstance( objId );
 706+ var oEditorIframe = document.getElementById( objId+'___Frame' );
 707+ var FCKtoolbar = document.getElementById('toolbar');
 708+ var bIsWysiwyg = ( oEditorIns.EditMode == FCK_EDITMODE_WYSIWYG );
 709+
 710+ //FCKeditor visible -> hidden
 711+ if ( showFCKEditor & RTE_VISIBLE)
 712+ {
 713+ var text = oEditorIns.GetData( oEditorIns.Config.FormatSource );
 714+ SRCtextarea.value = text;
 715+ if ( bIsWysiwyg ) oEditorIns.SwitchEditMode(); //switch to plain
 716+ var text = oEditorIns.GetData( oEditorIns.Config.FormatSource );
 717+ //copy from FCKeditor to textarea
 718+ SRCtextarea.value = text;
 719+ if (saveSetting)
 720+ {
 721+ sajax_request_type = 'GET' ;
 722+ sajax_do_call( 'wfSajaxToggleFCKeditor', ['hide'], function(){} ) ; //remember closing in session
 723+ }
 724+ if (oToggleLink) oToggleLink.innerHTML = editorMsgOn;
 725+ if (oPopupLink) oPopupLink.style.display = '';
 726+ showFCKEditor -= RTE_VISIBLE;
 727+ oEditorIframe.style.display = 'none';
 728+ FCKtoolbar.style.display = '';
 729+ SRCtextarea.style.display = '';
 730+ }
 731+ //FCKeditor hidden -> visible
 732+ else
 733+ {
 734+ if ( bIsWysiwyg ) oEditorIns.SwitchEditMode(); //switch to plain
 735+ SRCtextarea.style.display = 'none';
 736+ //copy from textarea to FCKeditor
 737+ oEditorIns.EditingArea.Textarea.value = SRCtextarea.value
 738+ FCKtoolbar.style.display = 'none';
 739+ oEditorIframe.style.display = '';
 740+ if ( !bIsWysiwyg ) oEditorIns.SwitchEditMode(); //switch to WYSIWYG
 741+ showFCKEditor += RTE_VISIBLE; // showFCKEditor+=RTE_VISIBLE
 742+ if (oToggleLink) oToggleLink.innerHTML = editorMsgOff;
 743+ if (oPopupLink) oPopupLink.style.display = 'none';
 744+ }
 745+ return true;
341746 }
342 -function WikiToHTML_Call()
 747+
 748+HEREDOC;
 749+}
 750+
 751+if($this->showFCKEditor & RTE_POPUP){
 752+ $script .= <<<HEREDOC
 753+
 754+function FCKeditor_OpenPopup(jsID, textareaID)
343755 {
344 - var oEditor = FCKeditorAPI.GetInstance('wpTextbox1');
345 - sajax_do_call('wfSajaxWikiToHTML', [oEditor.GetHTML()], WikiToHTML_Result);
 756+ popupUrl = '${wgFCKEditorExtDir}/FCKeditor.popup.html';
 757+ popupUrl = popupUrl + '?var='+ jsID + '&el=' + textareaID;
 758+ window.open(popupUrl, null, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=1,dependent=yes');
 759+ return 0;
346760 }
347 -
348 -addOnloadHook(showSource);
349 -*/
350 -</script>
351761 HEREDOC;
 762+}
 763+$script .= "</script>";
352764
353765 $wgOut->addScript($script);
354766
@@ -355,7 +767,25 @@
356768 }
357769
358770 public function onUserToggles( &$extraToggles ) {
 771+ global $wgUser,$wgDefaultUserOptions;
359772 $extraToggles[] = 'riched_disable';
 773+ $extraToggles[] = 'riched_start_disabled';
 774+ $extraToggles[] = 'riched_use_popup';
 775+ $extraToggles[] = 'riched_use_toggle';
 776+ $extraToggles[] = 'riched_toggle_remember_state';
 777+
 778+ //Show default options in Special:Preferences
 779+ if( !array_key_exists( "riched_disable", $wgUser->mOptions ) && !empty($wgDefaultUserOptions['riched_disable']) )
 780+ $wgUser->setOption("riched_disable", $wgDefaultUserOptions['riched_disable']);
 781+ if( !array_key_exists( "riched_start_disabled", $wgUser->mOptions ) && !empty($wgDefaultUserOptions['riched_start_disabled']) )
 782+ $wgUser->setOption("riched_start_disabled",$wgDefaultUserOptions['riched_start_disabled']);
 783+ if( !array_key_exists( "riched_use_popup", $wgUser->mOptions ) && !empty($wgDefaultUserOptions['riched_use_popup']) )
 784+ $wgUser->setOption("riched_use_popup",$wgDefaultUserOptions['riched_use_popup']);
 785+ if( !array_key_exists( "riched_use_toggle", $wgUser->mOptions ) && !empty($wgDefaultUserOptions['riched_use_toggle']) )
 786+ $wgUser->setOption("riched_use_toggle",$wgDefaultUserOptions['riched_use_toggle']);
 787+ if( !array_key_exists( "riched_toggle_remember_state", $wgUser->mOptions ) && !empty($wgDefaultUserOptions['riched_toggle_remember_state']) )
 788+ $wgUser->setOption("riched_toggle_remember_state",$wgDefaultUserOptions['riched_toggle_remember_state']);
 789+
360790 $extraToggles = array_merge($extraToggles, self::$nsToggles);
361791 return true;
362792 }
Index: trunk/extensions/FCKeditor/FCKeditorEditPage.body.php
@@ -0,0 +1,82 @@
 2+<?php
 3+
 4+class FCKeditorEditPage extends EditPage {
 5+ /**
 6+ * Should we show a preview when the edit form is first shown?
 7+ *
 8+ * @return bool
 9+ */
 10+ public function previewOnOpen() {
 11+ global $wgRequest, $wgUser;
 12+ if( $wgRequest->getVal( 'preview' ) == 'yes' ) {
 13+ // Explicit override from request
 14+ return true;
 15+ } elseif( $wgRequest->getVal( 'preview' ) == 'no' ) {
 16+ // Explicit override from request
 17+ return false;
 18+ } elseif( $this->section == 'new' ) {
 19+ // Nothing *to* preview for new sections
 20+ return false;
 21+ } elseif( ( $wgRequest->getVal( 'preload' ) !== '' || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
 22+ // Standard preference behaviour
 23+ return true;
 24+ } elseif( !$this->mTitle->exists() && $this->mTitle->getNamespace() == NS_CATEGORY ) {
 25+ // Categories are special
 26+ return true;
 27+ } else {
 28+ return false;
 29+ }
 30+ }
 31+
 32+ function getPreviewText() {
 33+ if (!$this->isCssJsSubpage) {
 34+ wfRunHooks( 'EditPageBeforePreviewText', array( &$this, $this->previewOnOpen() ) );
 35+ if ($this->previewOnOpen()) {
 36+ $result = html_entity_decode(parent::getPreviewText());
 37+ }
 38+ else {
 39+ $result = parent::getPreviewText();
 40+ }
 41+ wfRunHooks( 'EditPagePreviewTextEnd', array( &$this, $this->previewOnOpen() ) );
 42+ }
 43+ else {
 44+ $result = parent::getPreviewText();
 45+ }
 46+ return $result;
 47+ }
 48+
 49+ function getContent( $def_text = '' ) {
 50+ $t = parent::getContent( $def_text );
 51+ if(!$this->isConflict) {
 52+ return $t;
 53+ }
 54+ $options = new FCKeditorParserOptions();
 55+ $options->setTidy(true);
 56+ $parser = new FCKeditorParser();
 57+ $parser->setOutputType(OT_HTML);
 58+ $pa = $parser->parse($t, $this->mTitle, $options);
 59+ return $pa->mText;
 60+
 61+ }
 62+
 63+ function getWikiContent(){
 64+ return $this->mArticle->getContent();
 65+ }
 66+
 67+ /**
 68+ * This is a hack to fix
 69+ * http://dev.fckeditor.net/ticket/1174
 70+ * If RTE is enabled, diff must be performed on WikiText, not on HTML
 71+ */
 72+ function showDiff() {
 73+ global $wgFCKWikiTextBeforeParse;
 74+ if (isset($wgFCKWikiTextBeforeParse)) {
 75+ $_textbox1 = $this->textbox1;
 76+ $this->textbox1 = $wgFCKWikiTextBeforeParse;
 77+ }
 78+ $result = parent::showDiff();
 79+ if (isset($wgFCKWikiTextBeforeParse)) {
 80+ $this->textbox1 = $_textbox1;
 81+ }
 82+ }
 83+}
Property changes on: trunk/extensions/FCKeditor/FCKeditorEditPage.body.php
___________________________________________________________________
Added: svn:eol-style
184 + native
Index: trunk/extensions/FCKeditor/FCKeditor.php
@@ -3,7 +3,7 @@
44 # Not a valid entry point, skip unless MEDIAWIKI is defined
55 if (!defined('MEDIAWIKI')) {
66 echo <<<HEREDOC
7 -To install my extension, put the following line in LocalSettings.php:
 7+To install FCKeditor extension, put the following line in LocalSettings.php:
88 require_once( "\$IP/extensions/FCKeditor/FCKeditor.php" );
99 HEREDOC;
1010 exit( 1 );
@@ -26,18 +26,31 @@
2727 */
2828
2929 require_once $IP . "/includes/GlobalFunctions.php";
30 -require_once $IP . "/includes/ParserOptions.php";
3130 require_once $IP . "/includes/EditPage.php";
3231
33 -if (version_compare("1.12", $wgVersion, "<")) {
 32+if (version_compare("1.14alpha", $wgVersion, "<=")) {
 33+ require_once $IP . "/includes/parser/ParserOptions.php";
 34+ require_once $IP . "/includes/parser/Parser.php";
 35+ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw14/Parser_OldPP.body.php";
 36+ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw12/FCKeditorParserWrapper.body.php";
 37+}
 38+else if (version_compare("1.13alpha", $wgVersion, "<=")) {
 39+ require_once $IP . "/includes/parser/ParserOptions.php";
 40+ require_once $IP . "/includes/parser/Parser_OldPP.php";
 41+ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw12/FCKeditorParserWrapper.body.php";
 42+}
 43+else if (version_compare("1.12", $wgVersion, "<")) {
 44+ require_once $IP . "/includes/ParserOptions.php";
3445 require_once $IP . "/includes/Parser_OldPP.php";
35 - require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw12/FCKeditorParser_OldPP.body.php";
 46+ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw12/FCKeditorParserWrapper.body.php";
3647 }
3748 else {
 49+ require_once $IP . "/includes/ParserOptions.php";
3850 require_once $IP . "/includes/Parser.php";
39 - require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorParser.body.php";
 51+ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "mw11/FCKeditorParserWrapper.body.php";
4052 }
4153
 54+require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorParser.body.php";
4255 require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorSajax.body.php";
4356 require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorParserOptions.body.php";
4457 require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorSkin.body.php";
@@ -46,49 +59,47 @@
4760 require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "fckeditor" . DIRECTORY_SEPARATOR . "fckeditor.php";
4861
4962 if (empty ($wgFCKEditorExtDir)) {
50 - $wgFCKEditorExtDir = "extensions/FCKeditor" ;
 63+ $wgFCKEditorExtDir = "extensions/FCKeditor";
5164 }
5265 if (empty ($wgFCKEditorDir)) {
53 - $wgFCKEditorDir = "extensions/FCKeditor/fckeditor" ;
 66+ $wgFCKEditorDir = "extensions/FCKeditor/fckeditor";
5467 }
5568 if (empty ($wgFCKEditorToolbarSet)) {
56 - $wgFCKEditorToolbarSet = "Wiki" ;
 69+ $wgFCKEditorToolbarSet = "Wiki";
5770 }
5871 if (empty ($wgFCKEditorHeight)) {
59 - $wgFCKEditorHeight = "0" ; // "0" for automatic ("300" minimum).
 72+ $wgFCKEditorHeight = "0"; // "0" for automatic ("300" minimum).
6073 }
61 -
6274 /**
6375 * Enable use of AJAX features.
6476 */
6577 $wgUseAjax = true;
6678 $wgAjaxExportList[] = 'wfSajaxSearchImageFCKeditor';
6779 $wgAjaxExportList[] = 'wfSajaxSearchArticleFCKeditor';
 80+$wgAjaxExportList[] = 'wfSajaxSearchCategoryFCKeditor';
6881 $wgAjaxExportList[] = 'wfSajaxWikiToHTML';
6982 $wgAjaxExportList[] = 'wfSajaxGetImageUrl';
7083 $wgAjaxExportList[] = 'wfSajaxGetMathUrl';
7184 $wgAjaxExportList[] = 'wfSajaxSearchTemplateFCKeditor';
7285 $wgAjaxExportList[] = 'wfSajaxSearchSpecialTagFCKeditor';
 86+$wgAjaxExportList[] = 'wfSajaxToggleFCKeditor';
7387
7488 $wgExtensionCredits['other'][] = array(
75 -"path" => __FILE__,
76 -"name" => "FCKeditor extension",
77 -"author" => "FCKeditor.net (inspired by the code written by Mafs [Meta])",
78 -"version" => 'fckeditor/mw-extension $LastChangedRevision$ 2008',
79 -"url" => "http://meta.wikimedia.org/wiki/FCKeditor",
80 -"description" => "FCKeditor extension"
 89+ 'name' => 'FCKeditor',
 90+ 'author' => array('FCKeditor.net', 'Wikia'),
 91+ 'version' => 'fckeditor/mw-extension $Rev$ 2008',
 92+ 'url' => 'http://www.mediawiki.org/wiki/Extension:FCKeditor_%28by_FCKeditor_and_Wikia%29',
 93+ 'description' => 'FCKeditor extension for editing wiki pages (WYSIWYG editor)'
8194 );
8295
8396 $fckeditor = new FCKeditor("fake");
8497 $wgFCKEditorIsCompatible = $fckeditor->IsCompatible();
8598
8699 $oFCKeditorExtension = new FCKeditor_MediaWiki();
 100+
87101 $oFCKeditorExtension->registerHooks();
88102
89 -
90 -
91 -
92 -
93 -
94 -
95 -
 103+$wgDefaultUserOptions['riched_use_toggle'] = 1;
 104+$wgDefaultUserOptions['riched_start_disabled'] = 1;
 105+$wgDefaultUserOptions['riched_use_popup'] = 1;
 106+$wgDefaultUserOptions['riched_toggle_remember_state'] = 1;
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.fa.php
@@ -0,0 +1,22 @@
 2+<?php
 3+$messages = array(
 4+'textrichditor' => 'ويرايشگر پيشرفته',
 5+'tog-riched_disable' => 'غيرفعال کردن ويرايشگر پيشرفته',
 6+'tog-riched_disable_ns_main' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام اصلي',
 7+'tog-riched_disable_ns_talk' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:Talk}}"',
 8+'tog-riched_disable_ns_user' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:User}}"',
 9+'tog-riched_disable_ns_user_talk' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:User_talk}}"',
 10+'tog-riched_disable_ns_project' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:Project}}"',
 11+'tog-riched_disable_ns_project_talk' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام
 12+"{{ns:Project_talk}}"',
 13+'tog-riched_disable_ns_image' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:Image}}"',
 14+'tog-riched_disable_ns_image_talk' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:Image_talk}}"',
 15+'tog-riched_disable_ns_mediawiki' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:MediaWiki}}"',
 16+'tog-riched_disable_ns_mediawiki_talk' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:MediaWiki_talk}}"',
 17+'tog-riched_disable_ns_template' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:Template}}"',
 18+'tog-riched_disable_ns_template_talk' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:Template_talk}}"',
 19+'tog-riched_disable_ns_help' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:Help}}"',
 20+'tog-riched_disable_ns_help_talk' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:Help_talk}}"',
 21+'tog-riched_disable_ns_category' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:Category}}"',
 22+'tog-riched_disable_ns_category_talk' => 'غيرفعال کردن ويرايشگر پيشرفته در فضاي نام "{{ns:Category_talk}}"',
 23+);
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.sv.php
@@ -0,0 +1,52 @@
 2+<?php
 3+$messages = array(
 4+ 'textrichditor' => 'Grafiskt läge',
 5+ 'tog-riched_disable' => 'Inaktivera grafiskt läge',
 6+ 'tog-riched_disable_ns_main' => 'Inaktivera grafiskt läge i huvudnamnrymden',
 7+ 'tog-riched_disable_ns_talk' => 'Inaktivera grafiskt läge i "{{ns:Talk}}" namnrymden',
 8+ 'tog-riched_disable_ns_user' => 'Inaktivera grafiskt läge i "{{ns:User}}" namnrymden',
 9+ 'tog-riched_disable_ns_user_talk' => 'Inaktivera grafiskt läge i "{{ns:User_talk}}" namnrymden',
 10+ 'tog-riched_disable_ns_project' => 'Inaktivera grafiskt läge i "{{ns:Project}}" namnrymden',
 11+ 'tog-riched_disable_ns_project_talk' => 'Inaktivera grafiskt läge i "{{ns:Project_talk}}" namnrymden',
 12+ 'tog-riched_disable_ns_image' => 'Inaktivera grafiskt läge i "{{ns:Image}}" namnrymden',
 13+ 'tog-riched_disable_ns_image_talk' => 'Inaktivera grafiskt läge i "{{ns:Image_talk}}" namnrymden',
 14+ 'tog-riched_disable_ns_mediawiki' => 'Inaktivera grafiskt läge i "{{ns:MediaWiki}}" namnrymden',
 15+ 'tog-riched_disable_ns_mediawiki_talk' => 'Inaktivera grafiskt läge i "{{ns:MediaWiki_talk}}" namnrymden',
 16+ 'tog-riched_disable_ns_template' => 'Inaktivera grafiskt läge i "{{ns:Template}}" namnrymden',
 17+ 'tog-riched_disable_ns_template_talk' => 'Inaktivera grafiskt läge i "{{ns:Template_talk}}" namnrymden',
 18+ 'tog-riched_disable_ns_help' => 'Inaktivera grafiskt läge i "{{ns:Help}}" namnrymden',
 19+ 'tog-riched_disable_ns_help_talk' => 'Inaktivera grafiskt läge i "{{ns:Help_talk}}" namnrymden',
 20+ 'tog-riched_disable_ns_category' => 'Inaktivera grafiskt läge i "{{ns:Category}}" namnrymden',
 21+ 'tog-riched_disable_ns_category_talk' => 'Inaktivera grafiskt läge i "{{ns:Category_talk}}" namnrymden',
 22+ 'rich_editor_new_window' => 'Öppna det grafiska läget i nytt fönster',
 23+ 'tog-riched_start_disabled' => 'Starta det grafiska läget inaktiverat',
 24+ 'tog-riched_use_popup' => 'Öppna det grafiska läget i ett popupfönster',
 25+ 'tog-riched_use_toggle' => 'Använd växla mellan wikitext och det grafiska läget (byter textruta mot grafiskt läge)',
 26+ 'tog-riched_toggle_remember_state' => 'Kom ihåg senaste val (i den grafiska editorn)',
 27+);
 28+<?php
 29+$messages = array(
 30+ 'textrichditor' => 'Grafiskt läge',
 31+ 'tog-riched_disable' => 'Inaktivera grafiskt läge',
 32+ 'tog-riched_disable_ns_main' => 'Inaktivera grafiskt läge i huvudnamnrymden',
 33+ 'tog-riched_disable_ns_talk' => 'Inaktivera grafiskt läge i "{{ns:Talk}}" namnrymden',
 34+ 'tog-riched_disable_ns_user' => 'Inaktivera grafiskt läge i "{{ns:User}}" namnrymden',
 35+ 'tog-riched_disable_ns_user_talk' => 'Inaktivera grafiskt läge i "{{ns:User_talk}}" namnrymden',
 36+ 'tog-riched_disable_ns_project' => 'Inaktivera grafiskt läge i "{{ns:Project}}" namnrymden',
 37+ 'tog-riched_disable_ns_project_talk' => 'Inaktivera grafiskt läge i "{{ns:Project_talk}}" namnrymden',
 38+ 'tog-riched_disable_ns_image' => 'Inaktivera grafiskt läge i "{{ns:Image}}" namnrymden',
 39+ 'tog-riched_disable_ns_image_talk' => 'Inaktivera grafiskt läge i "{{ns:Image_talk}}" namnrymden',
 40+ 'tog-riched_disable_ns_mediawiki' => 'Inaktivera grafiskt läge i "{{ns:MediaWiki}}" namnrymden',
 41+ 'tog-riched_disable_ns_mediawiki_talk' => 'Inaktivera grafiskt läge i "{{ns:MediaWiki_talk}}" namnrymden',
 42+ 'tog-riched_disable_ns_template' => 'Inaktivera grafiskt läge i "{{ns:Template}}" namnrymden',
 43+ 'tog-riched_disable_ns_template_talk' => 'Inaktivera grafiskt läge i "{{ns:Template_talk}}" namnrymden',
 44+ 'tog-riched_disable_ns_help' => 'Inaktivera grafiskt läge i "{{ns:Help}}" namnrymden',
 45+ 'tog-riched_disable_ns_help_talk' => 'Inaktivera grafiskt läge i "{{ns:Help_talk}}" namnrymden',
 46+ 'tog-riched_disable_ns_category' => 'Inaktivera grafiskt läge i "{{ns:Category}}" namnrymden',
 47+ 'tog-riched_disable_ns_category_talk' => 'Inaktivera grafiskt läge i "{{ns:Category_talk}}" namnrymden',
 48+ 'rich_editor_new_window' => 'Öppna det grafiska läget i nytt fönster',
 49+ 'tog-riched_start_disabled' => 'Starta det grafiska läget inaktiverat',
 50+ 'tog-riched_use_popup' => 'Öppna det grafiska läget i ett popupfönster',
 51+ 'tog-riched_use_toggle' => 'Använd växla mellan wikitext och det grafiska läget (byter textruta mot grafiskt läge)',
 52+ 'tog-riched_toggle_remember_state' => 'Kom ihåg senaste val (i den grafiska editorn)',
 53+);
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.he.php
@@ -0,0 +1,26 @@
 2+<?php
 3+$messages = array(
 4+'textrichditor' => 'עורך עשיר',
 5+'tog-riched_disable' => 'כבה את העורך העשיר',
 6+'tog-riched_disable_ns_main' => 'כבה את העורך העשיר במרחב השם הראשי',
 7+'tog-riched_disable_ns_talk' => 'כבה את העורך העשיר במרחב השם "{{ns:Talk}}"',
 8+'tog-riched_disable_ns_user' => 'כבה את העורך העשיר במרחב השם "{{ns:User}}"',
 9+'tog-riched_disable_ns_user_talk' => 'כבה את העורך העשיר במרחב השם "{{ns:User_talk}}"',
 10+'tog-riched_disable_ns_project' => 'כבה את העורך העשיר במרחב השם "{{ns:Project}}"',
 11+'tog-riched_disable_ns_project_talk' => 'כבה את העורך העשיר במרחב השם "{{ns:Project_talk}}"',
 12+'tog-riched_disable_ns_image' => 'כבה את העורך העשיר במרחב השם "{{ns:Image}}"',
 13+'tog-riched_disable_ns_image_talk' => 'כבה את העורך העשיר במרחב השם "{{ns:Image_talk}}"',
 14+'tog-riched_disable_ns_mediawiki' => 'כבה את העורך העשיר במרחב השם "{{ns:MediaWiki}}"',
 15+'tog-riched_disable_ns_mediawiki_talk' => 'כבה את העורך העשיר במרחב השם "{{ns:MediaWiki_talk}}"',
 16+'tog-riched_disable_ns_template' => 'כבה את העורך העשיר במרחב השם "{{ns:Template}}"',
 17+'tog-riched_disable_ns_template_talk' => 'כבה את העורך העשיר במרחב השם "{{ns:Template_talk}}"',
 18+'tog-riched_disable_ns_help' => 'כבה את העורך העשיר במרחב השם "{{ns:Help}}"',
 19+'tog-riched_disable_ns_help_talk' => 'כבה את העורך העשיר במרחב השם "{{ns:Help_talk}}"',
 20+'tog-riched_disable_ns_category' => 'כבה את העורך העשיר במרחב השם "{{ns:Category}}"',
 21+'tog-riched_disable_ns_category_talk' => 'כבה את העורך העשיר במרחב השם "{{ns:Category_talk}}"',
 22+'rich_editor_new_window' => 'פתח את העורך העשיר בחלון חדש',
 23+'tog-riched_start_disabled' => 'התחל עם העורך העשיר כבוי',
 24+'tog-riched_use_popup' => 'פתח את העורך העשיר בחלון קופץ',
 25+'tog-riched_use_toggle' => 'השתמש במתג כדי להחליף בין ויקיטקסט והעורך העשיר (החלף את אזור הטקסט עם העורך העשיר)',
 26+'tog-riched_toggle_remember_state' => 'זכור את מצב המתג האחרון',
 27+);
\ No newline at end of file

Status & tagging log