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 @@ |
33 | 33 | FCKToolbarItems.RegisterItem( 'Source', new FCKToolbarButton( 'Source', 'Wikitext', null, FCK_TOOLBARITEM_ICONTEXT, true, true, 1 ) ) ; |
34 | 34 | |
35 | 35 | // 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') ; |
37 | 37 | tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_template.gif' ; |
38 | 38 | FCKToolbarItems.RegisterItem( 'MW_Template', tbButton ) ; |
39 | 39 | |
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' ) ; |
41 | 42 | tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_ref.gif' ; |
42 | 43 | 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 | +} |
43 | 49 | |
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' ) ; |
45 | 99 | tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_math.gif' ; |
46 | 100 | FCKToolbarItems.RegisterItem( 'MW_Math', tbButton ) ; |
47 | 101 | |
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' ) ; |
49 | 112 | tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_special.gif' ; |
50 | 113 | FCKToolbarItems.RegisterItem( 'MW_Special', tbButton ) ; |
51 | 114 | |
| 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 | + |
52 | 119 | // 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 ) ) ; |
57 | 125 | 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 ) ) ; |
58 | 127 | FCKCommands.RegisterCommand( 'Image', new FCKDialogCommand( 'Image', FCKLang.DlgImgTitle, FCKConfig.PluginsPath + 'mediawiki/dialogs/image.html', 450, 300 ) ) ; |
59 | 128 | |
| 129 | +FCKToolbarItems.OldGetItem = FCKToolbarItems.GetItem; |
60 | 130 | |
| 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 | + |
61 | 182 | // MediaWiki Wikitext Data Processor implementation. |
62 | 183 | FCK.DataProcessor = |
63 | 184 | { |
64 | 185 | _inPre : false, |
65 | | - _inLSpace : false, |
| 186 | + _inLSpace : false, |
66 | 187 | |
67 | 188 | /* |
68 | 189 | * Returns a string representing the HTML format of "data". The returned |
— | — | @@ -176,14 +297,14 @@ |
177 | 298 | if ( !FCKRegexLib.ElementName.test( sNodeName ) ) |
178 | 299 | return ; |
179 | 300 | |
180 | | - if ( sNodeName == 'br' && ( this._inPre || this._inLSpace ) ) |
| 301 | + if ( sNodeName == 'br' && ( this._inPre || this._inLSpace ) ) |
181 | 302 | { |
182 | 303 | stringBuilder.push( "\n" ) ; |
183 | 304 | if ( this._inLSpace ) |
184 | 305 | stringBuilder.push( " " ) ; |
185 | 306 | return ; |
186 | 307 | } |
187 | | - |
| 308 | + |
188 | 309 | // Remove the <br> if it is a bogus node. |
189 | 310 | if ( sNodeName == 'br' && htmlNode.getAttribute( 'type', 2 ) == '_moz' ) |
190 | 311 | return ; |
— | — | @@ -221,8 +342,20 @@ |
222 | 343 | if ( basic0 ) |
223 | 344 | stringBuilder.push( basic0 ) ; |
224 | 345 | |
| 346 | + var len = stringBuilder.length ; |
| 347 | + |
225 | 348 | if ( !basicElement[2] ) |
| 349 | + { |
226 | 350 | 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 | + } |
227 | 360 | |
228 | 361 | if ( basic1 ) |
229 | 362 | stringBuilder.push( basic1 ) ; |
— | — | @@ -251,10 +384,10 @@ |
252 | 385 | if ( sLastStr != ";" && sLastStr != ":" && sLastStr != "#" && sLastStr != "*") |
253 | 386 | stringBuilder.push( '\n' + prefix ) ; |
254 | 387 | } |
255 | | - |
| 388 | + |
256 | 389 | var parent = htmlNode.parentNode ; |
257 | 390 | var listType = "#" ; |
258 | | - |
| 391 | + |
259 | 392 | while ( parent ) |
260 | 393 | { |
261 | 394 | if ( parent.nodeName.toLowerCase() == 'ul' ) |
— | — | @@ -272,35 +405,56 @@ |
273 | 406 | |
274 | 407 | parent = parent.parentNode ; |
275 | 408 | } |
276 | | - |
| 409 | + |
277 | 410 | stringBuilder.push( listType ) ; |
278 | 411 | this._AppendChildNodes( htmlNode, stringBuilder, prefix + listType ) ; |
279 | | - |
| 412 | + |
280 | 413 | break ; |
281 | 414 | |
282 | 415 | case 'a' : |
283 | 416 | |
| 417 | + var pipeline = true; |
284 | 418 | // Get the actual Link href. |
285 | 419 | var href = htmlNode.getAttribute( '_fcksavedurl' ) ; |
286 | 420 | var hrefType = htmlNode.getAttribute( '_fck_mw_type' ) || '' ; |
287 | | - |
| 421 | + |
288 | 422 | if ( href == null ) |
289 | 423 | href = htmlNode.getAttribute( 'href' , 2 ) || '' ; |
290 | 424 | |
291 | 425 | var isWikiUrl = true ; |
292 | | - |
| 426 | + |
293 | 427 | if ( hrefType == "media" ) |
294 | 428 | stringBuilder.push( '[[Media:' ) ; |
295 | 429 | else if ( htmlNode.className == "extiw" ) |
| 430 | + { |
296 | 431 | stringBuilder.push( '[[' ) ; |
| 432 | + var isWikiUrl = true; |
| 433 | + } |
297 | 434 | else |
298 | 435 | { |
299 | 436 | var isWikiUrl = !( href.StartsWith( 'mailto:' ) || /^\w+:\/\//.test( href ) ) ; |
300 | 437 | stringBuilder.push( isWikiUrl ? '[[' : '[' ) ; |
301 | 438 | } |
| 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( /&/, "&" ) ; |
| 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 | + } |
302 | 457 | 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:"))) |
305 | 459 | { |
306 | 460 | stringBuilder.push( isWikiUrl? '|' : ' ' ) ; |
307 | 461 | this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ; |
— | — | @@ -308,18 +462,18 @@ |
309 | 463 | stringBuilder.push( isWikiUrl ? ']]' : ']' ) ; |
310 | 464 | |
311 | 465 | break ; |
312 | | - |
| 466 | + |
313 | 467 | case 'dl' : |
314 | | - |
| 468 | + |
315 | 469 | this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ; |
316 | 470 | var isFirstLevel = !htmlNode.parentNode.nodeName.IEquals( 'ul', 'ol', 'li', 'dl', 'dd', 'dt' ) ; |
317 | 471 | if ( isFirstLevel && stringBuilder[ stringBuilder.length - 1 ] != "\n" ) |
318 | 472 | stringBuilder.push( '\n') ; |
319 | | - |
| 473 | + |
320 | 474 | break ; |
321 | 475 | |
322 | 476 | case 'dt' : |
323 | | - |
| 477 | + |
324 | 478 | if( stringBuilder.length > 1) |
325 | 479 | { |
326 | 480 | var sLastStr = stringBuilder[ stringBuilder.length - 1 ] ; |
— | — | @@ -328,11 +482,11 @@ |
329 | 483 | } |
330 | 484 | stringBuilder.push( ';' ) ; |
331 | 485 | this._AppendChildNodes( htmlNode, stringBuilder, prefix + ";") ; |
332 | | - |
| 486 | + |
333 | 487 | break ; |
334 | 488 | |
335 | 489 | case 'dd' : |
336 | | - |
| 490 | + |
337 | 491 | if( stringBuilder.length > 1) |
338 | 492 | { |
339 | 493 | var sLastStr = stringBuilder[ stringBuilder.length - 1 ] ; |
— | — | @@ -341,9 +495,9 @@ |
342 | 496 | } |
343 | 497 | stringBuilder.push( ':' ) ; |
344 | 498 | this._AppendChildNodes( htmlNode, stringBuilder, prefix + ":" ) ; |
345 | | - |
| 499 | + |
346 | 500 | break ; |
347 | | - |
| 501 | + |
348 | 502 | case 'table' : |
349 | 503 | |
350 | 504 | var attribs = this._GetAttributesStr( htmlNode ) ; |
— | — | @@ -374,7 +528,7 @@ |
375 | 529 | attribs = this._GetAttributesStr( htmlNode.rows[r].cells[c] ) ; |
376 | 530 | |
377 | 531 | if ( htmlNode.rows[r].cells[c].tagName.toLowerCase() == "th" ) |
378 | | - stringBuilder.push( '!' ) ; |
| 532 | + stringBuilder.push( '!' ) ; |
379 | 533 | else |
380 | 534 | stringBuilder.push( '|' ) ; |
381 | 535 | |
— | — | @@ -413,10 +567,24 @@ |
414 | 568 | var imgLocation = htmlNode.getAttribute( '_fck_mw_location' ) || '' ; |
415 | 569 | var imgWidth = htmlNode.getAttribute( '_fck_mw_width' ) || '' ; |
416 | 570 | 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' ) || '' ) + '' ; |
417 | 575 | |
418 | | - stringBuilder.push( '[[Image:' ) |
419 | | - stringBuilder.push( imgName ) |
| 576 | + stringBuilder.push( '[[Image:' ) ; |
| 577 | + stringBuilder.push( imgName ) ; |
420 | 578 | |
| 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 | + |
421 | 589 | if ( imgType.length > 0 ) |
422 | 590 | stringBuilder.push( '|' + imgType ) ; |
423 | 591 | |
— | — | @@ -436,13 +604,23 @@ |
437 | 605 | if ( imgCaption.length > 0 ) |
438 | 606 | stringBuilder.push( '|' + imgCaption ) ; |
439 | 607 | |
440 | | - stringBuilder.push( ']]' ) |
| 608 | + stringBuilder.push( ']]' ) ; |
441 | 609 | |
442 | 610 | break ; |
443 | 611 | |
444 | 612 | case 'span' : |
445 | 613 | switch ( htmlNode.className ) |
446 | 614 | { |
| 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 | + |
447 | 625 | case 'fck_mw_ref' : |
448 | 626 | var refName = htmlNode.getAttribute( 'name' ) ; |
449 | 627 | |
— | — | @@ -465,10 +643,14 @@ |
466 | 644 | stringBuilder.push( '<references />' ) ; |
467 | 645 | return ; |
468 | 646 | |
| 647 | + case 'fck_mw_signature' : |
| 648 | + stringBuilder.push( FCKConfig.WikiSignature ) ; |
| 649 | + return ; |
| 650 | + |
469 | 651 | case 'fck_mw_template' : |
470 | 652 | stringBuilder.push( FCKTools.HTMLDecode(htmlNode.innerHTML).replace(/fckLR/g,'\r\n') ) ; |
471 | 653 | return ; |
472 | | - |
| 654 | + |
473 | 655 | case 'fck_mw_magic' : |
474 | 656 | stringBuilder.push( htmlNode.innerHTML ) ; |
475 | 657 | return ; |
— | — | @@ -477,6 +659,10 @@ |
478 | 660 | sNodeName = 'nowiki' ; |
479 | 661 | break ; |
480 | 662 | |
| 663 | + case 'fck_mw_html' : |
| 664 | + sNodeName = 'html' ; |
| 665 | + break ; |
| 666 | + |
481 | 667 | case 'fck_mw_includeonly' : |
482 | 668 | sNodeName = 'includeonly' ; |
483 | 669 | break ; |
— | — | @@ -488,10 +674,10 @@ |
489 | 675 | case 'fck_mw_gallery' : |
490 | 676 | sNodeName = 'gallery' ; |
491 | 677 | break ; |
492 | | - |
| 678 | + |
493 | 679 | case 'fck_mw_onlyinclude' : |
494 | 680 | sNodeName = 'onlyinclude' ; |
495 | | - |
| 681 | + |
496 | 682 | break ; |
497 | 683 | } |
498 | 684 | |
— | — | @@ -501,15 +687,26 @@ |
502 | 688 | |
503 | 689 | case 'pre' : |
504 | 690 | var attribs = this._GetAttributesStr( htmlNode ) ; |
505 | | - |
| 691 | + |
506 | 692 | if ( htmlNode.className == "_fck_mw_lspace") |
507 | 693 | { |
508 | 694 | stringBuilder.push( "\n " ) ; |
509 | 695 | this._inLSpace = true ; |
510 | 696 | this._AppendChildNodes( htmlNode, stringBuilder, prefix ) ; |
511 | 697 | 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 | + } |
514 | 711 | } |
515 | 712 | else |
516 | 713 | { |
— | — | @@ -518,17 +715,21 @@ |
519 | 716 | |
520 | 717 | if ( attribs.length > 0 ) |
521 | 718 | 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 ; |
522 | 727 | |
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 | + } |
527 | 733 | |
528 | | - stringBuilder.push( '<\/' ) ; |
529 | | - stringBuilder.push( sNodeName ) ; |
530 | | - stringBuilder.push( '>' ) ; |
531 | | - } |
532 | | - |
533 | 734 | break ; |
534 | 735 | default : |
535 | 736 | var attribs = this._GetAttributesStr( htmlNode ) ; |
— | — | @@ -554,17 +755,24 @@ |
555 | 756 | // Text Node. |
556 | 757 | case 3 : |
557 | 758 | |
558 | | - var parentIsSpecialTag = htmlNode.parentNode.getAttribute( '_fck_mw_customtag' ) ; |
| 759 | + var parentIsSpecialTag = htmlNode.parentNode.getAttribute( '_fck_mw_customtag' ) ; |
559 | 760 | var textValue = htmlNode.nodeValue; |
560 | | - |
561 | | - if ( !parentIsSpecialTag ) |
| 761 | + if ( !parentIsSpecialTag ) |
562 | 762 | { |
563 | 763 | 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 | + } |
565 | 768 | } |
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 | + |
569 | 777 | textValue = FCKTools.HTMLEncode( textValue ) ; |
570 | 778 | textValue = textValue.replace( /\u00A0/g, ' ' ) ; |
571 | 779 | |
— | — | @@ -582,14 +790,30 @@ |
583 | 791 | |
584 | 792 | if ( this._inLSpace && textValue.length == 1 && textValue.charCodeAt(0) == 13 ) |
585 | 793 | 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 | + } |
587 | 809 | textValue = textValue.replace( /\|/g, '|' ) ; |
| 810 | + textValue = textValue.replace( /<!--LINK_PIPE-->/g, '|' ) ; |
| 811 | + } |
588 | 812 | } |
589 | | - else |
| 813 | + else |
590 | 814 | { |
591 | 815 | textValue = FCKTools.HTMLDecode(textValue).replace(/fckLR/g,'\r\n'); |
592 | 816 | } |
593 | | - |
| 817 | + |
594 | 818 | stringBuilder.push( textValue ) ; |
595 | 819 | return ; |
596 | 820 | |
— | — | @@ -659,7 +883,13 @@ |
660 | 884 | else |
661 | 885 | sAttValue = htmlNode.getAttribute( sAttName, 2 ) ; // We must use getAttribute to get it exactly as it is defined. |
662 | 886 | |
663 | | - attStr += ' ' + sAttName + '="' + String(sAttValue).replace( '"', '"' ) + '"' ; |
| 887 | + // leave templates |
| 888 | + if ( sAttName.StartsWith( '{{' ) && sAttName.EndsWith( '}}' ) ) { |
| 889 | + attStr += ' ' + sAttName ; |
| 890 | + } |
| 891 | + else { |
| 892 | + attStr += ' ' + sAttName + '="' + String(sAttValue).replace( '"', '"' ) + '"' ; |
| 893 | + } |
664 | 894 | } |
665 | 895 | } |
666 | 896 | return attStr ; |
— | — | @@ -670,42 +900,105 @@ |
671 | 901 | // switching from Wikitext. |
672 | 902 | (function() |
673 | 903 | { |
| 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 | + } |
674 | 914 | var original = FCK.SwitchEditMode ; |
675 | | - |
| 915 | + window.parent.oFCKeditor.ready = true; |
676 | 916 | FCK.SwitchEditMode = function() |
677 | 917 | { |
678 | 918 | var args = arguments ; |
679 | | - |
| 919 | + window.parent.oFCKeditor.ready = false; |
680 | 920 | var loadHTMLFromAjax = function( result ) |
681 | 921 | { |
682 | 922 | FCK.EditingArea.Textarea.value = result.responseText ; |
683 | 923 | original.apply( FCK, args ) ; |
| 924 | + window.parent.oFCKeditor.ready = true; |
684 | 925 | } |
| 926 | + var edittools_markup = parent.document.getElementById ('editpage-specialchars') ; |
685 | 927 | |
686 | 928 | if ( FCK.EditMode == FCK_EDITMODE_SOURCE ) |
687 | 929 | { |
688 | 930 | // Hide the textarea to avoid seeing the code change. |
689 | 931 | FCK.EditingArea.Textarea.style.visibility = 'hidden' ; |
690 | | - |
691 | 932 | var loading = document.createElement( 'span' ) ; |
692 | | - loading.innerHTML = ' Loading Wikitext. Please wait... ' ; |
| 933 | + loading.innerHTML = ' '+ (FCKLang.wikiLoadingWikitext || 'Loading Wikitext. Please wait...' )+' '; |
693 | 934 | loading.style.position = 'absolute' ; |
694 | 935 | loading.style.left = '5px' ; |
695 | 936 | // loading.style.backgroundColor = '#ff0000' ; |
696 | 937 | 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 | + } |
697 | 942 | |
698 | 943 | // 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 | + } |
701 | 950 | } |
702 | | - else |
| 951 | + else { |
703 | 952 | original.apply( FCK, args ) ; |
| 953 | + if (edittools_markup) { |
| 954 | + edittools_markup.style.display = '' ; |
| 955 | + } |
| 956 | + window.parent.oFCKeditor.ready = true; |
| 957 | + } |
704 | 958 | } |
705 | 959 | })() ; |
706 | 960 | |
707 | 961 | // MediaWiki document processor. |
708 | 962 | FCKDocumentProcessor.AppendNew().ProcessDocument = function( document ) |
709 | 963 | { |
| 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 | + |
710 | 1003 | // Templates and magic words. |
711 | 1004 | var aSpans = document.getElementsByTagName( 'SPAN' ) ; |
712 | 1005 | |
— | — | @@ -716,8 +1009,11 @@ |
717 | 1010 | var className = null ; |
718 | 1011 | switch ( eSpan.className ) |
719 | 1012 | { |
| 1013 | + case 'fck_mw_source' : |
| 1014 | + className = 'FCK__MWSource' ; |
720 | 1015 | case 'fck_mw_ref' : |
721 | | - className = 'FCK__MWRef' ; |
| 1016 | + if (className == null) |
| 1017 | + className = 'FCK__MWRef' ; |
722 | 1018 | case 'fck_mw_references' : |
723 | 1019 | if ( className == null ) |
724 | 1020 | className = 'FCK__MWReferences' ; |
— | — | @@ -736,6 +1032,9 @@ |
737 | 1033 | case 'fck_mw_nowiki' : |
738 | 1034 | if ( className == null ) |
739 | 1035 | className = 'FCK__MWNowiki' ; |
| 1036 | + case 'fck_mw_html' : |
| 1037 | + if ( className == null ) |
| 1038 | + className = 'FCK__MWHtml' ; |
740 | 1039 | case 'fck_mw_includeonly' : |
741 | 1040 | if ( className == null ) |
742 | 1041 | className = 'FCK__MWIncludeonly' ; |
— | — | @@ -748,7 +1047,7 @@ |
749 | 1048 | case 'fck_mw_onlyinclude' : |
750 | 1049 | if ( className == null ) |
751 | 1050 | className = 'FCK__MWOnlyinclude' ; |
752 | | - |
| 1051 | + |
753 | 1052 | var oImg = FCKDocumentProcessor_CreateFakeImage( className, eSpan.cloneNode(true) ) ; |
754 | 1053 | oImg.setAttribute( '_' + eSpan.className, 'true', 0 ) ; |
755 | 1054 | |
— | — | @@ -757,8 +1056,23 @@ |
758 | 1057 | break ; |
759 | 1058 | } |
760 | 1059 | } |
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 |
763 | 1077 | var aHrefs = document.getElementsByTagName( 'A' ) ; |
764 | 1078 | var a ; |
765 | 1079 | var i = aHrefs.length - 1 ; |
— | — | @@ -766,9 +1080,20 @@ |
767 | 1081 | { |
768 | 1082 | if (a.className == 'extiw') |
769 | 1083 | { |
770 | | - a.href = a.innerHTML = ":" + a.title ; |
771 | | - a.setAttribute( '_fcksavedurl', ":" + a.title ) ; |
| 1084 | + a.href = a.title ; |
| 1085 | + a.setAttribute( '_fcksavedurl', a.href ) ; |
772 | 1086 | } |
| 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 | + } |
773 | 1098 | } |
774 | 1099 | } |
775 | 1100 | |
— | — | @@ -781,27 +1106,37 @@ |
782 | 1107 | if ( tag.getAttribute( '_fck_mw_template' ) ) |
783 | 1108 | { |
784 | 1109 | contextMenu.AddSeparator() ; |
785 | | - contextMenu.AddItem( 'MW_Template', 'Template Properties' ) ; |
| 1110 | + contextMenu.AddItem( 'MW_Template', FCKLang.wikiMnuTemplate || 'Template Properties' ) ; |
786 | 1111 | } |
787 | 1112 | if ( tag.getAttribute( '_fck_mw_magic' ) ) |
788 | 1113 | { |
789 | 1114 | contextMenu.AddSeparator() ; |
790 | | - contextMenu.AddItem( 'MW_MagicWord', 'Modify Magic Word' ) ; |
| 1115 | + contextMenu.AddItem( 'MW_MagicWord', FCKLang.wikiMnuMagicWord || 'Modify Magic Word' ) ; |
791 | 1116 | } |
792 | 1117 | if ( tag.getAttribute( '_fck_mw_ref' ) ) |
793 | 1118 | { |
794 | 1119 | contextMenu.AddSeparator() ; |
795 | | - contextMenu.AddItem( 'MW_Ref', 'Reference Properties' ) ; |
| 1120 | + contextMenu.AddItem( 'MW_Ref', FCKLang.wikiMnuReference || 'Reference Properties' ) ; |
796 | 1121 | } |
| 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 | + } |
797 | 1132 | if ( tag.getAttribute( '_fck_mw_math' ) ) |
798 | 1133 | { |
799 | 1134 | contextMenu.AddSeparator() ; |
800 | | - contextMenu.AddItem( 'MW_Math', 'Edit Formula' ) ; |
| 1135 | + contextMenu.AddItem( 'MW_Math', FCKLang.wikiMnuFormula || 'Edit Formula' ) ; |
801 | 1136 | } |
802 | 1137 | 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 |
803 | 1138 | { |
804 | 1139 | contextMenu.AddSeparator() ; |
805 | | - contextMenu.AddItem( 'MW_Special', 'Special Tag Properties' ) ; |
| 1140 | + contextMenu.AddItem( 'MW_Special', FCKLang.wikiMnuSpecial || 'Special Tag Properties' ) ; |
806 | 1141 | } |
807 | 1142 | } |
808 | 1143 | } |
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 = ' Konwertuję format wiki. Proszę czekać... ';
|
| 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 obrazek';
|
| 57 | +FCKLang.wikiImgSearchSeveral = 'znaleziono %1 obrazki';
|
| 58 | +FCKLang.wikiImgSearchALot = 'znaleziono %1 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 @@ |
61 | 61 | // Activate the "OK" button. |
62 | 62 | window.parent.SetOkButton( true ) ; |
63 | 63 | window.parent.SetAutoSize( true ) ; |
| 64 | + GetE('xTemplateRaw').focus(); |
64 | 65 | } |
65 | 66 | |
66 | 67 | function LoadSelection() |
— | — | @@ -73,35 +74,50 @@ |
74 | 75 | function Ok() |
75 | 76 | { |
76 | 77 | var formula = GetE('xTemplateRaw').value.Trim() ; |
77 | | - |
| 78 | + |
78 | 79 | if ( formula.length == 0 ) |
79 | 80 | { |
80 | | - alert( 'Please type the formula' ) ; |
| 81 | + alert( FCKLang.wikiTeXEmpty || 'Please type the formula' ) ; |
81 | 82 | return false ; |
82 | 83 | } |
83 | 84 | |
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 | + } |
86 | 89 | |
87 | 90 | oEditor.window.parent.sajax_request_type = 'GET' ; |
88 | 91 | oEditor.window.parent.sajax_do_call( 'wfSajaxGetMathUrl', [formula], UpdateImageFromAjax ) ; |
89 | | - |
| 92 | + |
90 | 93 | return false ; |
91 | 94 | } |
92 | 95 | |
93 | 96 | function UpdateImageFromAjax( response ) |
94 | 97 | { |
| 98 | + oEditor.FCKUndo.SaveUndoStep() ; |
| 99 | + |
95 | 100 | if ( !oMathImage ) |
| 101 | + { |
96 | 102 | oMathImage = FCK.CreateElement( 'IMG' ) ; |
| 103 | + oMathImage.className = 'FCK__MWMath' ; |
| 104 | + oMathImage.src = FCKConfig.PluginsPath + 'mediawiki/images/icon_math.gif' ; |
| 105 | + } |
97 | 106 | 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 | + |
100 | 119 | SetAttribute( oMathImage, "_fck_mw_math", GetE('xTemplateRaw').value.Trim() ) ; |
101 | 120 | SetAttribute( oMathImage, "_fckfakelement", 'true' ) ; |
102 | 121 | |
103 | | - oMathImage.src = response.responseText ; |
104 | | - SetAttribute( oMathImage, "_fcksavedurl", response.responseText ) ; |
105 | | - |
106 | 122 | // Call it using setTimeout to avoid a strange behavior in Firefox. |
107 | 123 | window.setTimeout( window.parent.Cancel, 0 ) ; |
108 | 124 | } |
— | — | @@ -113,7 +129,7 @@ |
114 | 130 | <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"> |
115 | 131 | <tr> |
116 | 132 | <td> |
117 | | - <span>Formula (TeX markup)</span> |
| 133 | + <span fcklang="wikiTeX">Formula (TeX markup)</span> |
118 | 134 | </td> |
119 | 135 | </tr> |
120 | 136 | <tr> |
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/template.html |
— | — | @@ -43,8 +43,8 @@ |
44 | 44 | //#### Dialog Tabs |
45 | 45 | |
46 | 46 | // 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' ) ; |
49 | 49 | |
50 | 50 | function OnDialogTabChange( tabCode ) |
51 | 51 | { |
— | — | @@ -75,6 +75,7 @@ |
76 | 76 | // Activate the "OK" button. |
77 | 77 | window.parent.SetOkButton( true ) ; |
78 | 78 | window.parent.SetAutoSize( true ) ; |
| 79 | + GetE('xTemplateRaw').focus(); |
79 | 80 | } |
80 | 81 | |
81 | 82 | function LoadSearchResults( result ) |
— | — | @@ -95,18 +96,19 @@ |
96 | 97 | var empty = ''; |
97 | 98 | oEditor.window.parent.sajax_request_type = 'GET' ; |
98 | 99 | oEditor.window.parent.sajax_do_call( 'wfSajaxSearchTemplateFCKeditor',[empty], LoadSearchResults ) ; |
99 | | - |
| 100 | + |
100 | 101 | if ( !oTemplateSpan ) return ; |
101 | 102 | |
102 | 103 | 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 ) |
104 | 106 | { |
105 | 107 | var templateName = inputText.substring(2,inputText.indexOf('fckLR')); |
106 | | - if (inputText.indexOf('fckLR')<1) |
| 108 | + if (inputText.indexOf('fckLR')<1) |
107 | 109 | templateName = inputText.substring(2,inputText.indexOf('|')); |
108 | | - if (inputText.indexOf('|')<1) |
| 110 | + if (inputText.indexOf('|')<1) |
109 | 111 | templateName = inputText.substring(2,inputText.indexOf('}}')); |
110 | | - |
| 112 | + |
111 | 113 | SetUrl(templateName.charAt(0).toUpperCase() + templateName.substr(1)); |
112 | 114 | } |
113 | 115 | GetE('xTemplateRaw').value = inputText.replace(/fckLR/g,'\r\n').replace( /"/g, '"' ); |
— | — | @@ -127,15 +129,16 @@ |
128 | 130 | oTemplateSpan = FCK.EditorDocument.createElement( 'SPAN' ) ; |
129 | 131 | oTemplateSpan.className = 'fck_mw_template' ; |
130 | 132 | } |
131 | | - |
132 | | - var templateData = FCKTools.HTMLEncode(GetE('xTemplateRaw').value.Trim().replace(/(\r\n|\n)/g, 'fckLR')).replace( /"/g, '"' ) ; |
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, '"' ) ; |
| 136 | + |
134 | 137 | if ( !( /^{{[\s\S]+}}$/.test( templateData ) ) ) |
135 | 138 | { |
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.' ) ; |
137 | 140 | return false ; |
138 | 141 | } |
139 | | - |
| 142 | + |
140 | 143 | oTemplateSpan.innerHTML = templateData ; |
141 | 144 | |
142 | 145 | if ( !oFakeImage ) |
— | — | @@ -156,7 +159,7 @@ |
157 | 160 | <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"> |
158 | 161 | <tr> |
159 | 162 | <td> |
160 | | - <span>Template raw definition (from {{ to }})</span><br /> |
| 163 | + <span fcklang="wikiTmpl">Template raw definition (from {{ to }})</span><br /> |
161 | 164 | </td> |
162 | 165 | </tr> |
163 | 166 | <tr> |
— | — | @@ -176,7 +179,7 @@ |
177 | 180 | <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"> |
178 | 181 | <tr> |
179 | 182 | <select id="xWikiResults" style="width: 100%;" onchange="SetUrl( this.value );"> |
180 | | - <option value=""><Pick up a template manual here></option> |
| 183 | + <option fcklang="wikiTmpsel" value=""><Pick up a template manual here></option> |
181 | 184 | </select> |
182 | 185 | </tr> |
183 | 186 | <tr> |
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/ref.html |
— | — | @@ -63,6 +63,7 @@ |
64 | 64 | // Activate the "OK" button. |
65 | 65 | window.parent.SetOkButton( true ) ; |
66 | 66 | window.parent.SetAutoSize( true ) ; |
| 67 | + GetE('xRefText').focus(); |
67 | 68 | } |
68 | 69 | |
69 | 70 | function LoadSelection() |
— | — | @@ -81,7 +82,7 @@ |
82 | 83 | oRef = FCK.EditorDocument.createElement( 'SPAN' ) ; |
83 | 84 | oRef.className = 'fck_mw_ref' ; |
84 | 85 | } |
85 | | - |
| 86 | + |
86 | 87 | var refData = FCKTools.HTMLEncode( GetE('xRefText').value ).Trim().replace( /"/g, '"' ) ; |
87 | 88 | oRef.innerHTML = refData ; |
88 | 89 | SetAttribute( oRef, "name", GetE('xRefName').value ) ; |
— | — | @@ -103,7 +104,7 @@ |
104 | 105 | <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"> |
105 | 106 | <tr> |
106 | 107 | <td> |
107 | | - <span>Reference text (Wikitext)</span> |
| 108 | + <span fcklang="wikiRef">Reference text (Wikitext)</span> |
108 | 109 | </td> |
109 | 110 | </tr> |
110 | 111 | <tr> |
— | — | @@ -114,7 +115,7 @@ |
115 | 116 | </tr> |
116 | 117 | <tr> |
117 | 118 | <td> |
118 | | - Reference name (optional)<br /> |
| 119 | + <span fcklang="wikiRefName">Reference name (optional)</span><br /> |
119 | 120 | <input id="xRefName" type="text" size="15" /> |
120 | 121 | </td> |
121 | 122 | </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 @@ |
47 | 47 | FCK.Selection.SelectNode( oLink ) ; |
48 | 48 | |
49 | 49 | var bLinkEqualsName = false ; |
50 | | - |
| 50 | + |
51 | 51 | window.onload = function() |
52 | 52 | { |
53 | 53 | // Translate the dialog box texts. |
— | — | @@ -58,6 +58,7 @@ |
59 | 59 | // Activate the "OK" button. |
60 | 60 | window.parent.SetOkButton( true ) ; |
61 | 61 | window.parent.SetAutoSize( true ) ; |
| 62 | + GetE('txtUrl').focus(); |
62 | 63 | } |
63 | 64 | |
64 | 65 | function LoadSelection() |
— | — | @@ -68,10 +69,15 @@ |
69 | 70 | var sHRef = oLink.getAttribute( '_fcksavedurl' ) ; |
70 | 71 | if ( sHRef == null ) |
71 | 72 | sHRef = oLink.getAttribute( 'href' , 2 ) || '' ; |
72 | | - |
| 73 | + |
| 74 | + sHRef = FCKConfig.ProtectedSource.Revert(sHRef, 0); //#2509 |
| 75 | + |
73 | 76 | if ( sHRef == oLink.innerHTML ) |
74 | 77 | bLinkEqualsName = true ; |
75 | 78 | |
| 79 | + if ( sHRef.toLowerCase().StartsWith( 'rtecolon' ) ) |
| 80 | + sHRef = ":" + sHRef.substring(8) ; |
| 81 | + |
76 | 82 | GetE('txtUrl').value = sHRef ; |
77 | 83 | } |
78 | 84 | |
— | — | @@ -84,22 +90,22 @@ |
85 | 91 | |
86 | 92 | if ( searchTimer ) |
87 | 93 | window.clearTimeout( searchTimer ) ; |
88 | | - |
| 94 | + |
89 | 95 | if ( link.StartsWith( '#' ) ) |
90 | 96 | { |
91 | | - SetSearchMessage( 'anchor link... no search for it' ) ; |
| 97 | + SetSearchMessage( FCKLang.wikiLnkNoSearchAnchor || 'anchor link... no search for it' ) ; |
92 | 98 | return ; |
93 | | - } |
94 | | - |
| 99 | + } |
| 100 | + |
95 | 101 | if ( link.StartsWith( 'mailto:' ) ) |
96 | 102 | { |
97 | | - SetSearchMessage( 'e-mail link... no search for it' ) ; |
| 103 | + SetSearchMessage( FCKLang.wikiLnkNoSearchMail || 'e-mail link... no search for it' ) ; |
98 | 104 | return ; |
99 | | - } |
100 | | - |
| 105 | + } |
| 106 | + |
101 | 107 | if( /^\w+:\/\//.test( link ) ) |
102 | 108 | { |
103 | | - SetSearchMessage( 'external link... no search for it' ) ; |
| 109 | + SetSearchMessage( FCKLang.wikiLnkNoSearchExt || 'external link... no search for it' ) ; |
104 | 110 | return ; |
105 | 111 | } |
106 | 112 | |
— | — | @@ -108,13 +114,13 @@ |
109 | 115 | ClearSearch() ; |
110 | 116 | |
111 | 117 | if ( link.length == 0 ) |
112 | | - SetSearchMessage( 'start typing in the above field' ) ; |
| 118 | + SetSearchMessage( FCKLang.wikiLnkStartTyping || 'start typing in the above field' ) ; |
113 | 119 | else |
114 | | - SetSearchMessage( 'too short... type more' ) ; |
| 120 | + SetSearchMessage( FCKLang.wikiLnkTooShort || 'too short... type more' ) ; |
115 | 121 | return ; |
116 | 122 | } |
117 | | - |
118 | | - SetSearchMessage( 'stop typing to search' ) ; |
| 123 | + |
| 124 | + SetSearchMessage( FCKLang.wikiLnkStopTyping || 'stop typing to search' ) ; |
119 | 125 | searchTimer = window.setTimeout( StartSearch, 500 ) ; |
120 | 126 | } |
121 | 127 | |
— | — | @@ -125,7 +131,7 @@ |
126 | 132 | if ( link.length < 3 ) |
127 | 133 | return ; |
128 | 134 | |
129 | | - SetSearchMessage( 'searching...' ) ; |
| 135 | + SetSearchMessage( FCKLang.wikiLnkSearching || 'searching...' ) ; |
130 | 136 | |
131 | 137 | // Make an Ajax search for the pages. |
132 | 138 | oEditor.window.parent.sajax_request_type = 'GET' ; |
— | — | @@ -136,19 +142,19 @@ |
137 | 143 | { |
138 | 144 | var results = result.responseText.Trim().split( '\n' ) ; |
139 | 145 | var select = GetE( 'xWikiResults' ) ; |
140 | | - |
| 146 | + |
141 | 147 | ClearSearch() ; |
142 | 148 | |
143 | 149 | if ( results.length == 0 || ( results.length == 1 && results[0].length == 0 ) ) |
144 | 150 | { |
145 | | - SetSearchMessage( 'no articles found' ) ; |
| 151 | + SetSearchMessage( FCKLang.wikiLnkSearchNothing || 'no articles found' ) ; |
146 | 152 | } |
147 | 153 | else |
148 | 154 | { |
149 | 155 | if ( results.length == 1 ) |
150 | | - SetSearchMessage( 'one article found' ) ; |
| 156 | + SetSearchMessage( FCKLang.wikiLnkSearch1Found || 'one article found' ) ; |
151 | 157 | else |
152 | | - SetSearchMessage( results.length + ' articles found' ) ; |
| 158 | + SetSearchMessage( (FCKLang.wikiLnkSearchSeveral || '%1 articles found').replace( /%1/g, results.length ) ) ; |
153 | 159 | |
154 | 160 | for ( var i = 0 ; i < results.length ; i++ ) |
155 | 161 | FCKTools.AddSelectOption( select, results[i], results[i] ) ; |
— | — | @@ -160,7 +166,7 @@ |
161 | 167 | var select = GetE( 'xWikiResults' ) ; |
162 | 168 | |
163 | 169 | while ( select.options.length > 0 ) |
164 | | - select.remove( 0 ) |
| 170 | + select.remove( 0 ) |
165 | 171 | } |
166 | 172 | |
167 | 173 | function SetSearchMessage( message ) |
— | — | @@ -177,22 +183,28 @@ |
178 | 184 | function Ok() |
179 | 185 | { |
180 | 186 | 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"); |
181 | 191 | var sInnerHtml ; |
182 | 192 | |
183 | 193 | // If no link is selected, create a new one (it may result in more than one link creation - #220). |
184 | 194 | var aLinks = oLink ? [ oLink ] : oEditor.FCK.CreateLink( sUri ) ; |
185 | 195 | |
186 | 196 | // If no selection, no links are created, so use the uri as the link text (by dom, 2006-05-26) |
| 197 | + var noTitle = false; |
187 | 198 | var aHasSelection = ( aLinks.length > 0 ) ; |
188 | 199 | if ( !aHasSelection ) |
189 | 200 | { |
190 | | - sInnerHtml = sUri; |
| 201 | + sInnerHtml = realUri; |
| 202 | + noTitle = true; |
191 | 203 | |
192 | 204 | var oLinkPathRegEx = new RegExp("//?([^?\"']+)([?].*)?$") ; |
193 | | - var asLinkPath = oLinkPathRegEx.exec( sUri ) ; |
| 205 | + var asLinkPath = oLinkPathRegEx.exec( realUri ) ; |
194 | 206 | if (asLinkPath != null) |
195 | 207 | sInnerHtml = asLinkPath[1]; // use matched path |
196 | | - |
| 208 | + |
197 | 209 | // Create a new (empty) anchor. |
198 | 210 | aLinks = [ oEditor.FCK.InsertElement( 'a' ) ] ; |
199 | 211 | } |
— | — | @@ -210,10 +222,12 @@ |
211 | 223 | SetAttribute( oLink, '_fcksavedurl', sUri ) ; |
212 | 224 | |
213 | 225 | if ( bLinkEqualsName ) |
214 | | - oLink.innerHTML = sUri ; |
| 226 | + oLink.innerHTML = realUri ; |
215 | 227 | else |
216 | 228 | oLink.innerHTML = sInnerHtml ; // Set (or restore) the innerHTML |
217 | 229 | |
| 230 | + if ( noTitle ) |
| 231 | + SetAttribute( oLink, '_fcknotitle','true'); |
218 | 232 | } |
219 | 233 | |
220 | 234 | // Select the (first) link. |
— | — | @@ -227,10 +241,10 @@ |
228 | 242 | <body scroll="no" style="overflow: hidden"> |
229 | 243 | <div id="divInfo"> |
230 | 244 | <div id="divLinkTypeUrl"> |
231 | | - <span>Link</span><br /> |
| 245 | + <span fcklang="wikiLnk">Link</span><br /> |
232 | 246 | <input id="txtUrl" style="width: 100%" type="text" onkeyup="OnUrlChange();" /> |
233 | 247 | <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 /> |
235 | 249 | <select id="xWikiResults" size="10" style="width: 100%; height:150px" onclick="SetUrl( this.value );"> |
236 | 250 | </select> |
237 | 251 | </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( /"/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, '"' ) ;
|
| 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 @@ |
56 | 56 | oTemplateSpan = FCK.GetRealElement( oFakeImage ) ; |
57 | 57 | sFakeClass = 'FCK__MWSpecial'; |
58 | 58 | } |
| 59 | + else if ( oFakeImage.getAttribute('_fck_mw_html') ) |
| 60 | + { |
| 61 | + oTemplateSpan = FCK.GetRealElement( oFakeImage ) ; |
| 62 | + sFakeClass = 'FCK__MWHtml'; |
| 63 | + } |
59 | 64 | else if ( oFakeImage.getAttribute('_fck_mw_nowiki') ) |
60 | 65 | { |
61 | 66 | oTemplateSpan = FCK.GetRealElement( oFakeImage ) ; |
— | — | @@ -99,6 +104,7 @@ |
100 | 105 | // Activate the "OK" button. |
101 | 106 | window.parent.SetOkButton( true ) ; |
102 | 107 | window.parent.SetAutoSize( true ) ; |
| 108 | + GetE('xTemplateRaw').focus(); |
103 | 109 | } |
104 | 110 | |
105 | 111 | function LoadSearchResults( result ) |
— | — | @@ -111,7 +117,7 @@ |
112 | 118 | for ( var i = 0 ; i < results.length ; i++ ) |
113 | 119 | FCKTools.AddSelectOption( select, results[i], results[i] ) ; |
114 | 120 | } |
115 | | - |
| 121 | + |
116 | 122 | if ( sSelectedTag ) { |
117 | 123 | select.value = sSelectedTag ; |
118 | 124 | } |
— | — | @@ -129,7 +135,7 @@ |
130 | 136 | |
131 | 137 | GetE('xTemplateRaw').value = FCKTools.HTMLDecode(oTemplateSpan.innerHTML).replace(/fckLR/g,'\r\n' ).replace( /"/g, '"' ) ; |
132 | 138 | var tagName = oTemplateSpan.getAttribute('_fck_mw_tagname').toLowerCase(); |
133 | | - |
| 139 | + |
134 | 140 | sSelectedTag = tagName ; |
135 | 141 | GetE('xSelectTag').value = tagName; |
136 | 142 | } |
— | — | @@ -138,10 +144,15 @@ |
139 | 145 | { |
140 | 146 | var tagName = GetE('xSelectTag').value; |
141 | 147 | 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 | + } |
144 | 152 | 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 | + } |
146 | 157 | } |
147 | 158 | |
148 | 159 | //#### The OK button was hit. |
— | — | @@ -153,11 +164,11 @@ |
154 | 165 | oTemplateSpan.className = 'fck_mw_special' ; |
155 | 166 | SetAttribute( oTemplateSpan, '_fck_mw_customtag', 'true' ) ; |
156 | 167 | } |
157 | | - |
| 168 | + |
158 | 169 | var templateData = FCKTools.HTMLEncode(GetE('xTemplateRaw').value.Trim().replace(/(\r\n|\n)/g, 'fckLR' )).replace( /"/g, '"' ) ; |
159 | | - |
| 170 | + |
160 | 171 | oTemplateSpan.innerHTML = templateData ; |
161 | | - SetAttribute( oTemplateSpan, '_fck_mw_tagname', GetE('xSelectTag').value ) ; |
| 172 | + SetAttribute( oTemplateSpan, '_fck_mw_tagname', GetE('xSelectTag').value ) ; |
162 | 173 | |
163 | 174 | switch (GetE('xSelectTag').value) |
164 | 175 | { |
— | — | @@ -173,6 +184,9 @@ |
174 | 185 | case 'includeonly': |
175 | 186 | sFakeClass = 'FCK__MWIncludeonly'; |
176 | 187 | break; |
| 188 | + case 'html': |
| 189 | + sFakeClass = 'FCK__MWHtml'; |
| 190 | + break; |
177 | 191 | case 'onlyinclude': |
178 | 192 | sFakeClass = 'FCK__MWOnlyinclude'; |
179 | 193 | break; |
— | — | @@ -180,14 +194,14 @@ |
181 | 195 | sFakeClass = 'FCK__MWSpecial'; |
182 | 196 | break; |
183 | 197 | } |
184 | | - |
| 198 | + |
185 | 199 | if ( !oFakeImage ) |
186 | 200 | { |
187 | 201 | oFakeImage = oEditor.FCKDocumentProcessor_CreateFakeImage( sFakeClass, oTemplateSpan ) ; |
188 | 202 | oFakeImage.setAttribute( '_fck_mw_special', 'true', 0 ) ; |
189 | 203 | oFakeImage = FCK.InsertElement( oFakeImage ) ; |
190 | 204 | } |
191 | | - else |
| 205 | + else |
192 | 206 | oFakeImage.className = sFakeClass ; |
193 | 207 | |
194 | 208 | return true ; |
— | — | @@ -200,7 +214,7 @@ |
201 | 215 | <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"> |
202 | 216 | <tr> |
203 | 217 | <td> |
204 | | - <span>Current Special Tag:</span> |
| 218 | + <span fcklang="wikiSpTag">Current Special Tag</span>: |
205 | 219 | <select id="xSelectTag" onchange="LoadDocumentation()"> |
206 | 220 | </select><br> |
207 | 221 | <i><span id="xDefinition"></span></i> |
— | — | @@ -209,7 +223,7 @@ |
210 | 224 | <tr> |
211 | 225 | <td> |
212 | 226 | <hr> |
213 | | - Special tag parameters: |
| 227 | + <span fcklang="wikiSpParam">Special tag parameters</span>: |
214 | 228 | </tr> |
215 | 229 | <tr> |
216 | 230 | <td height="100%"> |
Index: trunk/extensions/FCKeditor/plugins/mediawiki/dialogs/image.html |
— | — | @@ -58,6 +58,7 @@ |
59 | 59 | |
60 | 60 | window.parent.SetAutoSize( true ) ; |
61 | 61 | window.parent.SetOkButton( true ) ; |
| 62 | + GetE('txtUrl').focus(); |
62 | 63 | } |
63 | 64 | |
64 | 65 | function LoadSelection() |
— | — | @@ -88,8 +89,10 @@ |
89 | 90 | return false ; |
90 | 91 | } |
91 | 92 | |
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 | + } |
94 | 97 | |
95 | 98 | var imgName = GetE('txtUrl').value ; |
96 | 99 | var imgCaption = GetE('txtAlt').value ; |
— | — | @@ -191,13 +194,13 @@ |
192 | 195 | ClearSearch() ; |
193 | 196 | |
194 | 197 | if ( link.length == 0 ) |
195 | | - SetSearchMessage( 'start typing in the above field' ) ; |
| 198 | + SetSearchMessage( FCKLang.wikiImgStartTyping || 'start typing in the above field' ) ; |
196 | 199 | else |
197 | | - SetSearchMessage( 'too short... type more' ) ; |
| 200 | + SetSearchMessage( FCKLang.wikiImgTooShort || 'too short... type more' ) ; |
198 | 201 | return ; |
199 | 202 | } |
200 | 203 | |
201 | | - SetSearchMessage( 'stop typing to search' ) ; |
| 204 | + SetSearchMessage( FCKLang.wikiImgStopTyping || 'stop typing to search' ) ; |
202 | 205 | searchTimer = window.setTimeout( StartSearch, 500 ) ; |
203 | 206 | } |
204 | 207 | |
— | — | @@ -208,7 +211,7 @@ |
209 | 212 | if ( link.length < 3 ) |
210 | 213 | return ; |
211 | 214 | |
212 | | - SetSearchMessage( 'searching...' ) ; |
| 215 | + SetSearchMessage( FCKLang.wikiLnkSearching || 'searching...' ) ; |
213 | 216 | |
214 | 217 | // Make an Ajax search for the pages. |
215 | 218 | oEditor.window.parent.sajax_request_type = 'GET' ; |
— | — | @@ -224,20 +227,21 @@ |
225 | 228 | |
226 | 229 | if ( results.length == 0 || ( results.length == 1 && results[0].length == 0 ) ) |
227 | 230 | { |
228 | | - SetSearchMessage( 'no images found' ) ; |
| 231 | + SetSearchMessage( FCKLang.wikiImgSearchNothing || 'no images found' ) ; |
229 | 232 | } |
230 | 233 | else |
231 | 234 | { |
232 | 235 | if ( results.length == 1 ) |
233 | | - SetSearchMessage( 'one image found' ) ; |
| 236 | + SetSearchMessage( FCKLang.wikiImgSearch1Found || 'one image found' ) ; |
234 | 237 | else |
235 | | - SetSearchMessage( results.length + ' images found' ) ; |
| 238 | + SetSearchMessage( (FCKLang.wikiImgSearchSeveral || '%1 images found').replace( /%1/g, results.length ) ) ; |
236 | 239 | |
237 | 240 | for ( var i = 0 ; i < results.length ; i++ ) |
238 | 241 | FCKTools.AddSelectOption( select, results[i], results[i] ) ; |
239 | 242 | } |
240 | 243 | } |
241 | 244 | |
| 245 | + |
242 | 246 | function ClearSearch() |
243 | 247 | { |
244 | 248 | var select = GetE( 'xWikiResults' ) ; |
— | — | @@ -280,10 +284,10 @@ |
281 | 285 | <table cellspacing="1" cellpadding="1" border="0" width="100%"> |
282 | 286 | <tr valign="center"> |
283 | 287 | <td> |
284 | | - <span>Image file name</span><br /> |
| 288 | + <span fcklang="wikiImgFileName">Image file name</span><br /> |
285 | 289 | <input id="txtUrl" style="width: 100%" type="text" onkeyup="OnUrlChange();" /> |
286 | 290 | <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 /> |
288 | 292 | <select id="xWikiResults" size="5" style="width: 100%; height: 70px" onclick="SetUrl( this.value );UpdatePreview();"> |
289 | 293 | </select> |
290 | 294 | </td> |
— | — | @@ -293,7 +297,7 @@ |
294 | 298 | </tr> |
295 | 299 | <tr> |
296 | 300 | <td colspan="2"> |
297 | | - <span>Caption</span><br /> |
| 301 | + <span fcklang="wikiImgCaption">Caption</span><br /> |
298 | 302 | <input id="txtAlt" style="width: 100%" type="text"><br /> |
299 | 303 | </td> |
300 | 304 | </tr> |
— | — | @@ -302,12 +306,12 @@ |
303 | 307 | <table cellspacing="0" cellpadding="0" border="0"> |
304 | 308 | <tr> |
305 | 309 | <td nowrap="nowrap"> |
306 | | - Special Type<br /> |
| 310 | + <span fcklang="wikiImgType">Special Type</span><br /> |
307 | 311 | <select id="xType"> |
308 | 312 | <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> |
312 | 316 | </select> |
313 | 317 | </td> |
314 | 318 | <td style="padding-left:7px;"> |
— | — | @@ -316,7 +320,7 @@ |
317 | 321 | <option value="" selected></option> |
318 | 322 | <option fcklang="DlgImgAlignRight" value="right">Right</option> |
319 | 323 | <option fcklang="DlgImgAlignLeft" value="left">Left</option> |
320 | | - <option value="center">Center</option> |
| 324 | + <option fcklang="wikiImgAlignCenter" value="center">Center</option> |
321 | 325 | </select> |
322 | 326 | </td> |
323 | 327 | <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 �H a��f��e��i��j��n�⇜��w�䇠㈡�|�拧Ձ�惫牪熮舮膯靮�苳ꍳ鎳莳饱̔�闷ꔸ졵锹왻쨸餺ꥻ짿뮿�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!� |
| 3 | + , ��. ���,�� CFG��C ��F?@�:82G1��GBDBB>93GA?�7
+$(BA=4�G 0FC@: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 |
1 | 3 | + .settings |
.project |
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.fr.php |
— | — | @@ -19,4 +19,9 @@ |
20 | 20 | 'tog-riched_disable_ns_help_talk' => 'Désactiver \'\'Rich Editor\'\' dans l\'espace de noms \'\'{{ns:Help_talk}}\'\'.', |
21 | 21 | 'tog-riched_disable_ns_category' => 'Désactiver \'\'Rich Editor\'\' dans l\'espace de noms \'\'{{ns:Category}}\'\'.', |
22 | 22 | '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', |
23 | 28 | ); |
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 @@ |
3 | 3 | |
4 | 4 | $messages = array( |
5 | 5 | 'textrichditor' => 'Rich Editor', |
| 6 | +'rich_editor_new_window' => 'Otwórz rich editor w nowym oknie', |
6 | 7 | 'tog-riched_disable' => 'Wyłącz Rich Editora', |
7 | 8 | 'tog-riched_disable_ns_main' => 'Wyłącz Rich Editora wewątrz głównej przestrzeni nazw', |
8 | 9 | 'tog-riched_disable_ns_talk' => 'Wyłącz Rich Editora wewątrz przestrzeni nazw "{{ns:Talk}}"', |
— | — | @@ -19,4 +20,8 @@ |
20 | 21 | 'tog-riched_disable_ns_help_talk' => 'Wyłącz Rich Editora wewątrz przestrzeni nazw "{{ns:Help_talk}}"', |
21 | 22 | 'tog-riched_disable_ns_category' => 'Wyłącz Rich Editora wewątrz przestrzeni nazw "{{ns:Category}}"', |
22 | 23 | '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', |
23 | 28 | ); |
Index: trunk/extensions/FCKeditor/FCKeditorParser.body.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -class FCKeditorParser extends Parser |
| 4 | +class FCKeditorParser extends FCKeditorParserWrapper |
5 | 5 | { |
6 | 6 | public static $fkc_mw_makeImage_options; |
7 | 7 | protected $fck_mw_strtr_span; |
— | — | @@ -25,19 +25,8 @@ |
26 | 26 | "__NOGALLERY__", |
27 | 27 | ); |
28 | 28 | |
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 | | - |
40 | 29 | /** |
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 |
42 | 31 | * that will remain unchanged during whole parsing operation. |
43 | 32 | * At the end we'll replace all this unique strings with original content |
44 | 33 | * |
— | — | @@ -66,8 +55,19 @@ |
67 | 56 | function maybeDoSubpageLink($target, &$text) { |
68 | 57 | return $target; |
69 | 58 | } |
70 | | - |
| 59 | + |
71 | 60 | /** |
| 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 | + /** |
72 | 72 | * Callback function for custom tags: feed, ref, references etc. |
73 | 73 | * |
74 | 74 | * @param string $str Input |
— | — | @@ -75,13 +75,13 @@ |
76 | 76 | * @return string |
77 | 77 | */ |
78 | 78 | 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"))) { |
80 | 80 | $class = $this->fck_mw_taghook; |
81 | 81 | } |
82 | 82 | else { |
83 | 83 | $class = "special"; |
84 | 84 | } |
85 | | - |
| 85 | + |
86 | 86 | if (empty($argv)) { |
87 | 87 | $ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">"; |
88 | 88 | } |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | $ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">"; |
119 | 119 | } |
120 | 120 | 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."\""; |
122 | 122 | foreach ($argv as $key=>$value) { |
123 | 123 | $ret .= " ".$key."=\"".$value."\""; |
124 | 124 | } |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | * @private |
156 | 156 | */ |
157 | 157 | function strip( $text, $state, $stripcomments = false , $dontstrip = array () ) { |
158 | | - global $wgContLang; |
| 158 | + global $wgContLang, $wgUseTeX, $wgScriptPath, $wgVersion, $wgHooks, $wgExtensionFunctions; |
159 | 159 | |
160 | 160 | wfProfileIn( __METHOD__ ); |
161 | 161 | $render = ($this->mOutputType == OT_HTML); |
— | — | @@ -164,16 +164,19 @@ |
165 | 165 | $nowikiItems = array(); |
166 | 166 | $generalItems = array(); |
167 | 167 | |
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 | + } |
171 | 177 | global $wgRawHtml; |
172 | 178 | if( $wgRawHtml ) { |
173 | 179 | $elements[] = 'html'; |
174 | 180 | } |
175 | | - if( $this->mOptions->getUseTeX() ) { |
176 | | - $elements[] = 'math'; |
177 | | - } |
178 | 181 | |
179 | 182 | # Removing $dontstrip tags from $elements list (currently only 'gallery', fixing bug 2700) |
180 | 183 | foreach ( $elements AS $k => $v ) { |
— | — | @@ -181,8 +184,14 @@ |
182 | 185 | unset ( $elements[$k] ); |
183 | 186 | } |
184 | 187 | |
| 188 | + $elements = array_unique($elements); |
185 | 189 | $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 | + } |
187 | 196 | |
188 | 197 | foreach( $matches as $marker => $data ) { |
189 | 198 | list( $element, $content, $params, $tag ) = $data; |
— | — | @@ -200,17 +209,28 @@ |
201 | 210 | $output = "$tag-->"; |
202 | 211 | } |
203 | 212 | 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; |
204 | 222 | case 'html': |
205 | 223 | if( $wgRawHtml ) { |
206 | | - $output = $content; |
207 | | - break; |
| 224 | + $output = $this->fck_wikiTag('html', $content, $params); |
208 | 225 | } |
209 | | - // Shouldn't happen otherwise. :) |
| 226 | + break; |
210 | 227 | case 'nowiki': |
211 | 228 | $output = $this->fck_wikiTag('nowiki', $content, $params); //required by FCKeditor |
212 | 229 | break; |
213 | 230 | 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" />'; |
215 | 235 | break; |
216 | 236 | case 'gallery': |
217 | 237 | $output = $this->fck_wikiTag('gallery', $content, $params); //required by FCKeditor |
— | — | @@ -307,7 +327,12 @@ |
308 | 328 | } |
309 | 329 | |
310 | 330 | 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; |
312 | 337 | } |
313 | 338 | |
314 | 339 | function makeImage( $nt, $options ) { |
— | — | @@ -318,10 +343,10 @@ |
319 | 344 | /** |
320 | 345 | * Replace templates with unique text to preserve them from parsing |
321 | 346 | * |
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, |
323 | 348 | * e.g. <noinclude>{{template}}</noinclude> |
324 | 349 | * {{template}} replaced with Fckmw[n]fckmw which is wrong... |
325 | | - * |
| 350 | + * |
326 | 351 | * @param string $text |
327 | 352 | * @return string |
328 | 353 | */ |
— | — | @@ -374,6 +399,14 @@ |
375 | 400 | $strtr_span = array(); |
376 | 401 | foreach ($tags as $pos=>$type) { |
377 | 402 | $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 | + } |
378 | 411 | if ($sum == 1 && $lastSum == 0) { |
379 | 412 | $stringToParse .= strtr(substr($text, $startingPos, $pos - $startingPos), $strtr); |
380 | 413 | $startingPos = $pos; |
— | — | @@ -382,7 +415,11 @@ |
383 | 416 | $stringToParse .= 'Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw'; |
384 | 417 | $inner = htmlspecialchars(strtr(substr($text, $startingPos, $pos - $startingPos + 19), $strtr)); |
385 | 418 | $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 | + } |
387 | 424 | $startingPos = $pos + 19; |
388 | 425 | $this->fck_mw_strtr_span_counter++; |
389 | 426 | } |
— | — | @@ -444,6 +481,10 @@ |
445 | 482 | return strtr( $text, $strtr ); |
446 | 483 | } |
447 | 484 | |
| 485 | + function doDoubleUnderscore( $text ) { |
| 486 | + return $text; |
| 487 | + } |
| 488 | + |
448 | 489 | function parse( $text, &$title, $options, $linestart = true, $clearState = true, $revid = null ) { |
449 | 490 | $text = preg_replace("/^#REDIRECT/", "<!--FCK_REDIRECT-->", $text); |
450 | 491 | $parserOutput = parent::parse($text, $title, $options, $linestart , $clearState , $revid ); |
— | — | @@ -452,15 +493,31 @@ |
453 | 494 | if ($categories) { |
454 | 495 | $appendString = ""; |
455 | 496 | 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 | + } |
457 | 508 | } |
458 | 509 | $parserOutput->setText($parserOutput->getText() . $appendString); |
459 | 510 | } |
460 | 511 | |
461 | 512 | 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)); |
463 | 521 | } |
464 | | - |
465 | 522 | if (!empty($this->fck_matches)) { |
466 | 523 | $text = $parserOutput->getText() ; |
467 | 524 | foreach ($this->fck_matches as $key => $m) { |
— | — | @@ -468,7 +525,7 @@ |
469 | 526 | } |
470 | 527 | $parserOutput->setText($text); |
471 | 528 | } |
472 | | - |
| 529 | + |
473 | 530 | if (!empty($parserOutput->mLanguageLinks)) { |
474 | 531 | foreach ($parserOutput->mLanguageLinks as $l) { |
475 | 532 | $parserOutput->setText($parserOutput->getText() . "\n" . "<a href=\"".$l."\">".$l."</a>") ; |
Index: trunk/extensions/FCKeditor/fckeditor_config.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | |
6 | 6 | // When using the modified image dialog you must set this variable. It must |
7 | 7 | // correspond to $wgScriptPath in LocalSettings.php. |
8 | | -FCKConfig.mwScriptPath = '' ; |
| 8 | +FCKConfig.mwScriptPath = '' ; |
9 | 9 | |
10 | 10 | // Setup the editor toolbar. |
11 | 11 | FCKConfig.ToolbarSets['Wiki'] = [ |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | ['Cut','Copy','Paste',/*'PasteText','PasteWord',*/'-','Print'], |
14 | 14 | ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], |
15 | 15 | ['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'], |
17 | 17 | '/', |
18 | 18 | ['FontFormat'], |
19 | 19 | ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], |
— | — | @@ -25,24 +25,32 @@ |
26 | 26 | |
27 | 27 | // Load the extension plugins. |
28 | 28 | FCKConfig.PluginsPath = FCKConfig.EditorPath + '../plugins/' ; |
29 | | -FCKConfig.Plugins.Add( 'mediawiki' ) ; |
| 29 | +FCKConfig.Plugins.Add( 'mediawiki', 'en,he,pl') ; |
30 | 30 | |
31 | 31 | FCKConfig.ForcePasteAsPlainText = true ; |
32 | 32 | FCKConfig.FontFormats = 'p;h1;h2;h3;h4;h5;h6;pre' ; |
33 | 33 | |
34 | | -FCKConfig.AutoDetectLanguage = false ; |
| 34 | +FCKConfig.AutoDetectLanguage = true ; |
35 | 35 | FCKConfig.DefaultLanguage = 'en' ; |
36 | 36 | |
| 37 | +FCKConfig.WikiSignature = '--~~~~'; |
| 38 | + |
37 | 39 | // FCKConfig.DisableObjectResizing = true ; |
38 | 40 | |
39 | 41 | 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 \ |
41 | 43 | { \ |
42 | 44 | border: 1px dotted #00F; \ |
43 | 45 | background-position: center center; \ |
44 | 46 | background-repeat: no-repeat; \ |
45 | 47 | vertical-align: middle; \ |
46 | 48 | } \ |
| 49 | +.FCK__MWSource \ |
| 50 | +{ \ |
| 51 | + background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_source.gif); \ |
| 52 | + width: 59px; \ |
| 53 | + height: 15px; \ |
| 54 | +} \ |
47 | 55 | .FCK__MWTemplate \ |
48 | 56 | { \ |
49 | 57 | background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_template.gif); \ |
— | — | @@ -67,6 +75,18 @@ |
68 | 76 | width: 66px; \ |
69 | 77 | height: 15px; \ |
70 | 78 | } \ |
| 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 | +} \ |
71 | 91 | .FCK__MWIncludeonly \ |
72 | 92 | { \ |
73 | 93 | background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_includeonly.gif); \ |
— | — | @@ -91,6 +111,12 @@ |
92 | 112 | width: 66px; \ |
93 | 113 | height: 15px; \ |
94 | 114 | } \ |
| 115 | +.FCK__MWSignature \ |
| 116 | +{ \ |
| 117 | + background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_signature.gif); \ |
| 118 | + width: 66px; \ |
| 119 | + height: 15px; \ |
| 120 | +} \ |
95 | 121 | .FCK__MWReferences \ |
96 | 122 | { \ |
97 | 123 | background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_references.gif); \ |
Property changes on: trunk/extensions/FCKeditor/fckeditor |
___________________________________________________________________ |
Added: svn:ignore |
98 | 124 | + * |
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.en.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | $messages = array( |
5 | | -'textrichditor' => 'Rich editor', |
| 5 | +'textrichditor' => 'Rich Editor', |
6 | 6 | 'tog-riched_disable' => 'Disable rich editor', |
7 | 7 | 'tog-riched_disable_ns_main' => 'Disable rich editor within the main namespace', |
8 | 8 | 'tog-riched_disable_ns_talk' => 'Disable rich editor within the "{{ns:Talk}}" namespace', |
— | — | @@ -19,4 +19,9 @@ |
20 | 20 | 'tog-riched_disable_ns_help_talk' => 'Disable rich editor within the "{{ns:Help_talk}}" namespace', |
21 | 21 | 'tog-riched_disable_ns_category' => 'Disable rich editor within the "{{ns:Category}}" namespace', |
22 | 22 | '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', |
23 | 28 | ); |
Index: trunk/extensions/FCKeditor/FCKeditor.i18n.gl.php |
— | — | @@ -19,4 +19,9 @@ |
20 | 20 | 'tog-riched_disable_ns_help_talk' => 'Desactivar o editor rico no espazo de nomes "{{ns:Help_talk}}"', |
21 | 21 | 'tog-riched_disable_ns_category' => 'Desactivar o editor rico no espazo de nomes "{{ns:Category}}"', |
22 | 22 | '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', |
23 | 28 | ); |
Index: trunk/extensions/FCKeditor/FCKeditorSkin.body.php |
— | — | @@ -1,7 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -class FCKeditorSkin |
5 | | -{ |
| 4 | +class FCKeditorSkin { |
6 | 5 | private $skin; |
7 | 6 | |
8 | 7 | /** |
— | — | @@ -16,16 +15,19 @@ |
17 | 16 | * @param boolean $thumb shows image as thumbnail in a frame |
18 | 17 | * @param string $manual_thumb image name for the manual thumbnail |
19 | 18 | * @param string $valign vertical alignment: baseline, sub, super, top, text-top, middle, bottom, text-bottom |
20 | | - * @return string * |
| 19 | + * @return string * |
21 | 20 | */ |
22 | 21 | function makeImageLinkObj( $nt, $label, $alt, $align = '', $params = array(), $framed = false, |
23 | | - $thumb = false, $manual_thumb = '', $valign = '' ) |
24 | | - { |
| 22 | + $thumb = false, $manual_thumb = '', $valign = '' ) { |
25 | 23 | $orginal = $nt->getText(); |
26 | 24 | $img = new Image( $nt ); |
27 | 25 | $imgName = $img->getName(); |
28 | 26 | $found = $img->getURL(); |
29 | 27 | |
| 28 | + if (!is_null($alt) && ( $alt == 'RTENOTITLE' )) { //2223 |
| 29 | + $alt = ''; |
| 30 | + } |
| 31 | + |
30 | 32 | if ($found) { |
31 | 33 | //trick to get real Url for image: |
32 | 34 | $originalLink = strip_tags(Linker::makeImageLinkObj($nt, $label, $alt, $align , $params , $framed , $thumb , $manual_thumb , $valign ), "<img>"); |
— | — | @@ -103,7 +105,7 @@ |
104 | 106 | * @param File $file File object, or false if it doesn't exist |
105 | 107 | * |
106 | 108 | * @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 |
108 | 110 | * will often be false. |
109 | 111 | * thumbnail If present, downscale and frame |
110 | 112 | * manualthumb Image name to use as a thumbnail, instead of automatic scaling |
— | — | @@ -113,13 +115,13 @@ |
114 | 116 | * upright_factor Fudge factor for "upright" tweak (default 0.75) |
115 | 117 | * border If present, show a border around the image |
116 | 118 | * 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, |
118 | 120 | * bottom, text-bottom) |
119 | 121 | * alt Alternate text for image (i.e. alt attribute). Plain text. |
120 | 122 | * caption HTML for image caption. |
121 | 123 | * |
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". |
124 | 126 | */ |
125 | 127 | function makeImageLink2( Title $nt, $file, $frameParams = array(), $handlerParams = array() ) { |
126 | 128 | $orginal = $nt->getText(); |
— | — | @@ -127,6 +129,9 @@ |
128 | 130 | $imgName = $img->getName(); |
129 | 131 | $found = $img->getURL(); |
130 | 132 | |
| 133 | + if (!empty($frameParams['alt']) && $frameParams['alt'] == 'RTENOTITLE' ){ //2223 |
| 134 | + $frameParams['alt'] = ''; |
| 135 | + } |
131 | 136 | if ($found) { |
132 | 137 | $linker = new Linker(); |
133 | 138 | $originalLink = $linker->makeImageLink2( $nt, $file, $frameParams, $handlerParams); |
— | — | @@ -199,7 +204,7 @@ |
200 | 205 | $class .= ($class?" ":"") . "fck_mw_notfound"; |
201 | 206 | } |
202 | 207 | |
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) { |
204 | 209 | $ret .= "alt=\"".htmlspecialchars($fp['alt'])."\" "; |
205 | 210 | } |
206 | 211 | else { |
— | — | @@ -215,18 +220,60 @@ |
216 | 221 | return $ret; |
217 | 222 | } |
218 | 223 | |
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 = '' ) { |
221 | 265 | $fname = 'FCKeditorSkin::makeKnownLinkObj'; |
222 | 266 | wfProfileIn( $fname ); |
223 | 267 | |
| 268 | + $args = ''; |
224 | 269 | if ( !is_object( $nt ) ) { |
225 | 270 | wfProfileOut( $fname ); |
226 | 271 | return $text; |
227 | 272 | } |
228 | 273 | |
229 | 274 | //$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); |
231 | 278 | |
232 | 279 | if ( $nt->getFragment() != '' ) { |
233 | 280 | if( $nt->getPrefixedDbkey() == '' ) { |
— | — | @@ -235,7 +282,7 @@ |
236 | 283 | $text = htmlspecialchars( $nt->getFragment() ); |
237 | 284 | } |
238 | 285 | } |
239 | | - |
| 286 | + |
240 | 287 | /* |
241 | 288 | * See tickets 1386 and 1690 before changing anything |
242 | 289 | */ |
— | — | @@ -252,23 +299,34 @@ |
253 | 300 | } |
254 | 301 | |
255 | 302 | 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}"; |
257 | 313 | wfProfileOut( $fname ); |
258 | 314 | return $r; |
259 | 315 | } |
260 | 316 | |
261 | | - function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) |
262 | | - { |
| 317 | + function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
263 | 318 | # Fail gracefully |
264 | 319 | if ( ! isset($nt) ) { |
265 | 320 | # throw new MWException(); |
266 | 321 | return "<!-- ERROR -->{$prefix}{$text}{$trail}"; |
267 | 322 | } |
| 323 | + $args = ''; |
268 | 324 | |
269 | 325 | $fname = 'FCKeditorSkin::makeBrokenLinkObj'; |
270 | 326 | wfProfileIn( $fname ); |
271 | 327 | |
272 | | - $u = $nt->getFullText(); |
| 328 | + $u = $nt->getFullText(); |
| 329 | + //#Updating links tables -> #Updating_links_tables |
| 330 | + $u = str_replace("#".$nt->getFragment(), $nt->getFragmentForURL(), $u); |
273 | 331 | |
274 | 332 | if ( '' == $text ) { |
275 | 333 | $text = htmlspecialchars( $nt->getPrefixedText() ); |
— | — | @@ -278,12 +336,34 @@ |
279 | 337 | } |
280 | 338 | |
281 | 339 | list( $inside, $trail ) = Linker::splitTrail( $trail ); |
282 | | - $s = "<a href=\"{$u}\">{$prefix}{$text}{$inside}</a>{$trail}"; |
| 340 | + $title = "{$prefix}{$text}{$inside}"; |
283 | 341 | |
| 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 | + |
284 | 350 | wfProfileOut( $fname ); |
285 | 351 | return $s; |
286 | 352 | } |
287 | 353 | |
| 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 | + |
288 | 368 | /** |
289 | 369 | * Create a direct link to a given uploaded file. |
290 | 370 | * |
— | — | @@ -299,6 +379,7 @@ |
300 | 380 | ### HOTFIX. Instead of breaking, return empty string. |
301 | 381 | return $text; |
302 | 382 | } else { |
| 383 | + $args = ''; |
303 | 384 | $orginal = $title->getPartialURL(); |
304 | 385 | // Mediawiki 1.11 |
305 | 386 | if ( function_exists('wfFindFile') ) { |
— | — | @@ -328,8 +409,13 @@ |
329 | 410 | if( $text == '' ) { |
330 | 411 | $text = $alt; |
331 | 412 | } |
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>"; |
334 | 420 | } |
335 | 421 | } |
336 | 422 | |
— | — | @@ -338,19 +424,23 @@ |
339 | 425 | if( $escape ) { |
340 | 426 | $text = htmlspecialchars( $text ); |
341 | 427 | } |
| 428 | + $url = preg_replace("/^RTECOLON/", ":", $url); //change 'RTECOLON' => ':' |
342 | 429 | if ($linktype == 'autonumber') { |
343 | 430 | return '<a href="'.$url.'">[n]</a>'; |
344 | 431 | } |
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>'; |
346 | 438 | } |
347 | 439 | |
348 | | - function __call( $m, $a) |
349 | | - { |
| 440 | + function __call( $m, $a) { |
350 | 441 | return call_user_func_array( array( $this->skin, $m ), $a ); |
351 | 442 | } |
352 | 443 | |
353 | | - function __construct( &$skin ) |
354 | | - { |
| 444 | + function __construct( &$skin ) { |
355 | 445 | $this->skin = $skin; |
356 | 446 | } |
357 | 447 | } |
Index: trunk/extensions/FCKeditor/FCKeditorSajax.body.php |
— | — | @@ -1,7 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -function wfSajaxGetMathUrl( $term ) |
5 | | -{ |
| 4 | +function wfSajaxGetMathUrl( $term ) { |
6 | 5 | $originalLink = MathRenderer::renderMath( $term ); |
7 | 6 | |
8 | 7 | if (false == strpos($originalLink, "src=\"")) { |
— | — | @@ -14,8 +13,7 @@ |
15 | 14 | return $url; |
16 | 15 | } |
17 | 16 | |
18 | | -function wfSajaxGetImageUrl( $term ) |
19 | | -{ |
| 17 | +function wfSajaxGetImageUrl( $term ) { |
20 | 18 | global $wgExtensionFunctions, $wgTitle; |
21 | 19 | |
22 | 20 | $options = new FCKeditorParserOptions(); |
— | — | @@ -38,21 +36,28 @@ |
39 | 37 | return $url; |
40 | 38 | } |
41 | 39 | |
42 | | -function wfSajaxSearchSpecialTagFCKeditor($empty) |
43 | | -{ |
44 | | - global $wgParser; |
| 40 | +function wfSajaxSearchSpecialTagFCKeditor($empty) { |
| 41 | + global $wgParser, $wgRawHtml; |
45 | 42 | |
46 | 43 | $ret = "nowiki\nincludeonly\nonlyinclude\nnoinclude\ngallery\n"; |
| 44 | + if( $wgRawHtml ) |
| 45 | + { |
| 46 | + $ret.="html\n"; |
| 47 | + } |
| 48 | + $wgParser->firstCallInit(); |
47 | 49 | foreach ($wgParser->getTags() as $h) { |
48 | 50 | if (!in_array($h, array("pre", "math", "ref", "references"))) { |
49 | 51 | $ret .= $h ."\n"; |
50 | 52 | } |
51 | 53 | } |
| 54 | + $arr = explode("\n", $ret); |
| 55 | + sort($arr); |
| 56 | + $ret = implode("\n", $arr); |
| 57 | + |
52 | 58 | return $ret; |
53 | 59 | } |
54 | 60 | |
55 | | -function wfSajaxSearchImageFCKeditor( $term ) |
56 | | -{ |
| 61 | +function wfSajaxSearchImageFCKeditor( $term ) { |
57 | 62 | global $wgContLang, $wgOut; |
58 | 63 | $limit = 10; |
59 | 64 | |
— | — | @@ -60,21 +65,25 @@ |
61 | 66 | $term1 = str_replace( ' ', '_', $wgContLang->ucfirst( $term ) ); |
62 | 67 | $term2 = str_replace( ' ', '_', $wgContLang->lc( $term ) ); |
63 | 68 | $term3 = str_replace( ' ', '_', $wgContLang->uc( $term ) ); |
| 69 | + $term4 = str_replace( ' ', '_', $wgContLang->ucfirst( $term2 ) ); |
64 | 70 | $term = $term1; |
65 | 71 | |
66 | 72 | if ( strlen( str_replace( '_', '', $term ) )<3 ) |
67 | 73 | return ""; |
68 | 74 | |
69 | | - $db =& wfGetDB( DB_SLAVE ); |
| 75 | + $db = wfGetDB( DB_SLAVE ); |
70 | 76 | $res = $db->select( 'page', 'page_title', |
71 | 77 | 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 ) ."%') " ), |
73 | 82 | "wfSajaxSearch", |
74 | 83 | array( 'LIMIT' => $limit+1 ) |
75 | 84 | ); |
76 | 85 | |
77 | 86 | $ret = ""; |
78 | | - $i=0; |
| 87 | + $i = 0; |
79 | 88 | while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) { |
80 | 89 | $ret .= $row->page_title ."\n"; |
81 | 90 | } |
— | — | @@ -84,44 +93,66 @@ |
85 | 94 | return $ret; |
86 | 95 | } |
87 | 96 | |
88 | | -function wfSajaxSearchArticleFCKeditor( $term ) |
89 | | -{ |
90 | | - global $wgContLang, $wgOut; |
| 97 | +function wfSajaxSearchArticleFCKeditor( $term ) { |
| 98 | + global $wgContLang, $wgOut, $wgExtraNamespaces; |
91 | 99 | $limit = 10; |
92 | 100 | $ns = NS_MAIN; |
93 | 101 | |
94 | 102 | $term = $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) ); |
95 | 103 | |
96 | | - if (strpos($term, "Category:") === 0) { |
| 104 | + if (strpos(strtolower($term), "category:") === 0) { |
97 | 105 | $ns = NS_CATEGORY; |
98 | 106 | $term = substr($term, 9); |
99 | 107 | $prefix = "Category:"; |
100 | 108 | } |
101 | | - else if (strpos($term, ":Category:") === 0) { |
| 109 | + else if (strpos(strtolower($term), ":category:") === 0) { |
102 | 110 | $ns = NS_CATEGORY; |
103 | 111 | $term = substr($term, 10); |
104 | 112 | $prefix = ":Category:"; |
105 | 113 | } |
| 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 | + } |
106 | 133 | |
107 | 134 | $term1 = str_replace( ' ', '_', $wgContLang->ucfirst( $term ) ); |
108 | 135 | $term2 = str_replace( ' ', '_', $wgContLang->lc( $term ) ); |
109 | 136 | $term3 = str_replace( ' ', '_', $wgContLang->uc( $term ) ); |
| 137 | + $term4 = str_replace( ' ', '_', $wgContLang->ucfirst( $term2 ) ); |
110 | 138 | $term = $term1; |
111 | 139 | |
112 | 140 | if ( strlen( str_replace( '_', '', $term ) )<3 ) { |
113 | 141 | return ""; |
114 | 142 | } |
115 | 143 | |
116 | | - $db =& wfGetDB( DB_SLAVE ); |
| 144 | + $db = wfGetDB( DB_SLAVE ); |
117 | 145 | $res = $db->select( 'page', 'page_title', |
118 | 146 | 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 ) ."%') " ), |
120 | 151 | "wfSajaxSearch", |
121 | 152 | array( 'LIMIT' => $limit+1 ) |
122 | 153 | ); |
123 | 154 | |
124 | 155 | $ret = ""; |
125 | | - $i=0; |
| 156 | + $i = 0; |
126 | 157 | while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) { |
127 | 158 | if (isset($prefix) && !is_null($prefix)) { |
128 | 159 | $ret .= $prefix; |
— | — | @@ -134,15 +165,66 @@ |
135 | 166 | return $ret; |
136 | 167 | } |
137 | 168 | |
138 | | -function wfSajaxSearchTemplateFCKeditor($empty) |
| 169 | +function wfSajaxSearchCategoryFCKeditor() |
139 | 170 | { |
140 | 171 | 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; |
141 | 221 | $ns = NS_TEMPLATE; |
142 | 222 | |
143 | | - $db =& wfGetDB( DB_SLAVE ); |
| 223 | + $db = wfGetDB( DB_SLAVE ); |
| 224 | + $options['ORDER BY'] = 'page_title'; |
144 | 225 | $res = $db->select( 'page', 'page_title', |
145 | | - array( 'page_namespace' => $ns), |
146 | | - "wfSajaxSearch" |
| 226 | + array( 'page_namespace' => $ns), |
| 227 | + "wfSajaxSearch", |
| 228 | + $options |
147 | 229 | ); |
148 | 230 | |
149 | 231 | $ret = ""; |
— | — | @@ -153,8 +235,7 @@ |
154 | 236 | return $ret; |
155 | 237 | } |
156 | 238 | |
157 | | -function wfSajaxWikiToHTML( $wiki ) |
158 | | -{ |
| 239 | +function wfSajaxWikiToHTML( $wiki ) { |
159 | 240 | global $wgTitle; |
160 | 241 | |
161 | 242 | $options = new FCKeditorParserOptions(); |
— | — | @@ -162,5 +243,18 @@ |
163 | 244 | $parser = new FCKeditorParser(); |
164 | 245 | $parser->setOutputType(OT_HTML); |
165 | 246 | |
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()); |
167 | 249 | } |
| 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 @@ |
2 | 2 | <?php |
3 | 3 | |
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; } |
8 | 7 | |
9 | 8 | function getSkin() { |
10 | 9 | 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 @@ |
2 | 2 | <?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); |
3 | 18 | |
4 | | -class FCKeditor_MediaWiki |
5 | | -{ |
| 19 | +class FCKeditor_MediaWiki { |
| 20 | + public $showFCKEditor; |
6 | 21 | private $count = array(); |
7 | 22 | private $wgFCKBypassText = ""; |
8 | 23 | private $debug = 0; |
— | — | @@ -28,8 +43,7 @@ |
29 | 44 | |
30 | 45 | static $messagesLoaded = false; |
31 | 46 | |
32 | | - function __call($m,$a) |
33 | | - { |
| 47 | + function __call($m, $a) { |
34 | 48 | print "\n#### " . $m . "\n"; |
35 | 49 | if (!isset($this->count[$m])) { |
36 | 50 | $this->count[$m] = 0; |
— | — | @@ -38,57 +52,138 @@ |
39 | 53 | return true; |
40 | 54 | } |
41 | 55 | |
42 | | - function onMonoBookTemplateToolboxEnd() |
43 | | - { |
| 56 | + function onMonoBookTemplateToolboxEnd() { |
44 | 57 | if ($this->debug) { |
45 | 58 | print_r($this->count); |
46 | 59 | } |
47 | 60 | } |
48 | 61 | |
49 | | - private function getExcludedNamespaces() |
50 | | - { |
51 | | - global $wgUser; |
| 62 | + private function getExcludedNamespaces() { |
| 63 | + global $wgUser,$wgDefaultUserOptions, $wgFCKEditorExcludedNamespaces; |
52 | 64 | |
53 | 65 | if ( is_null( $this->excludedNamespaces ) ) { |
54 | 66 | $this->excludedNamespaces = array(); |
55 | 67 | foreach ( self::$nsToggles as $toggle ) { |
56 | | - if ( $wgUser->getOption( $toggle ) ) { |
| 68 | + $default = isset($wgDefaultUserOptions[$toggle]) ? $wgDefaultUserOptions[$toggle] : ""; |
| 69 | + if ( $wgUser->getOption( $toggle, $default) ) { |
57 | 70 | $this->excludedNamespaces[] = constant(strtoupper(str_replace("riched_disable_", "", $toggle))); |
58 | 71 | } |
59 | 72 | } |
| 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 | + } |
60 | 80 | } |
61 | 81 | |
62 | 82 | return $this->excludedNamespaces; |
63 | 83 | } |
64 | 84 | |
65 | | - public function onLanguageGetMagic(&$magicWords, $langCode) |
66 | | - { |
| 85 | + public function onLanguageGetMagic(&$magicWords, $langCode) { |
67 | 86 | $magicWords['NORICHEDITOR'] = array( 0, '__NORICHEDITOR__' ); |
68 | | - |
| 87 | + |
69 | 88 | return true; |
70 | 89 | } |
71 | | - |
72 | | - public function onParserBeforeInternalParse(&$parser, &$text, &$strip_state) |
73 | | - { |
| 90 | + |
| 91 | + public function onParserBeforeInternalParse(&$parser, &$text, &$strip_state) { |
74 | 92 | MagicWord::get( 'NORICHEDITOR' )->matchAndRemove( $text ); |
75 | | - |
| 93 | + |
76 | 94 | return true; |
77 | 95 | } |
78 | 96 | |
| 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 | + |
79 | 164 | public function registerHooks() { |
80 | | - global $wgHooks, $wgExtensionFunctions; |
| 165 | + global $wgHooks, $wgExtensionFunctions, $wgVersion; |
81 | 166 | |
82 | 167 | $wgHooks['UserToggles'][] = array($this, 'onUserToggles'); |
83 | 168 | $wgHooks['MessagesPreLoad'][] = array($this, 'onMessagesPreLoad'); |
84 | 169 | $wgHooks['ParserAfterTidy'][] = array($this, 'onParserAfterTidy'); |
85 | 170 | $wgHooks['EditPage::showEditForm:initial'][] = array($this, 'onEditPageShowEditFormInitial'); |
| 171 | + $wgHooks['EditPage::showEditForm:fields'][] = array($this, 'onEditPageShowEditFormFields'); |
86 | 172 | $wgHooks['EditPageBeforePreviewText'][] = array($this, 'onEditPageBeforePreviewText'); |
| 173 | + if (version_compare("1.14alpha", $wgVersion, "<=")) { |
| 174 | + $wgHooks['ParserBeforeStrip'][] = array($this, 'onParserBeforeStrip'); |
| 175 | + } |
87 | 176 | $wgHooks['EditPagePreviewTextEnd'][] = array($this, 'onEditPagePreviewTextEnd'); |
88 | 177 | $wgHooks['CustomEditor'][] = array($this, 'onCustomEditor'); |
89 | 178 | $wgHooks['LanguageGetMagic'][] = array($this, "onLanguageGetMagic"); |
90 | 179 | $wgHooks['ParserBeforeInternalParse'][] = array($this, "onParserBeforeInternalParse"); |
| 180 | + $wgHooks['EditPageBeforeConflictDiff'][] = array($this, 'onEditPageBeforeConflictDiff'); |
| 181 | + $wgHooks['SanitizerAfterFixTagAttributes'][] = array($this, 'onSanitizerAfterFixTagAttributes'); |
91 | 182 | |
92 | 183 | 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 | + */ |
93 | 188 | $opcje = array('ArticleSave', |
94 | 189 | 'ArticleInsertComplete', 'ArticleSaveComplete', 'TitleMoveComplete', 'ArticleProtect', 'ArticleProtectComplete', 'ArticleDelete', 'ArticleDeleteComplete', 'AlternateEdit', 'ArticleFromTitle', 'ArticleAfterFetchContent', |
95 | 190 | 'ArticlePageDataBefore', 'ArticlePageDataAfter', 'ParserBeforeStrip', 'ParserAfterStrip', 'ParserBeforeInternalParse', 'InternalParseBeforeLinks', 'ParserBeforeTidy', 'ParserAfterTidy', 'ParserClearState', 'ParserGetVariableValueSwitch', |
— | — | @@ -108,8 +203,7 @@ |
109 | 204 | } |
110 | 205 | } |
111 | 206 | |
112 | | - public function onCustomEditor(&$article, &$user) |
113 | | - { |
| 207 | + public function onCustomEditor(&$article, &$user) { |
114 | 208 | global $wgRequest, $mediaWiki; |
115 | 209 | |
116 | 210 | $action = $mediaWiki->getVal('Action'); |
— | — | @@ -131,8 +225,7 @@ |
132 | 226 | return false; |
133 | 227 | } |
134 | 228 | |
135 | | - public function onEditPageBeforePreviewText(&$editPage, $previewOnOpen) |
136 | | - { |
| 229 | + public function onEditPageBeforePreviewText(&$editPage, $previewOnOpen) { |
137 | 230 | global $wgUser, $wgRequest; |
138 | 231 | |
139 | 232 | if ($wgUser->getOption( 'showtoolbar' ) && !$wgUser->getOption( 'riched_disable' ) && !$previewOnOpen ) { |
— | — | @@ -143,8 +236,7 @@ |
144 | 237 | return true; |
145 | 238 | } |
146 | 239 | |
147 | | - public function onEditPagePreviewTextEnd(&$editPage, $previewOnOpen) |
148 | | - { |
| 240 | + public function onEditPagePreviewTextEnd(&$editPage, $previewOnOpen) { |
149 | 241 | global $wgUser; |
150 | 242 | |
151 | 243 | if ($wgUser->getOption( 'showtoolbar' ) && !$wgUser->getOption( 'riched_disable' ) && !$previewOnOpen ) { |
— | — | @@ -154,8 +246,7 @@ |
155 | 247 | return true; |
156 | 248 | } |
157 | 249 | |
158 | | - public function onParserAfterTidy(&$parser, &$text) |
159 | | - { |
| 250 | + public function onParserAfterTidy(&$parser, &$text) { |
160 | 251 | global $wgUseTeX, $wgUser, $wgTitle, $wgFCKEditorIsCompatible; |
161 | 252 | |
162 | 253 | if (!$wgUser->getOption( 'showtoolbar' ) || $wgUser->getOption( 'riched_disable' ) || !$wgFCKEditorIsCompatible) { |
— | — | @@ -175,8 +266,7 @@ |
176 | 267 | return true; |
177 | 268 | } |
178 | 269 | |
179 | | - public function onMessagesPreLoad() |
180 | | - { |
| 270 | + public function onMessagesPreLoad() { |
181 | 271 | global $wgMessageCache, $wgUser, $wgContLanguageCode; |
182 | 272 | |
183 | 273 | if ( !self::$messagesLoaded ) { |
— | — | @@ -199,17 +289,41 @@ |
200 | 290 | |
201 | 291 | /** |
202 | 292 | * Add FCK script |
203 | | - * |
| 293 | + * |
204 | 294 | * @param unknown_type $q |
205 | 295 | * @return unknown |
206 | 296 | */ |
207 | 297 | public function onEditPageShowEditFormInitial( $form ) { |
208 | | - global $wgOut, $wgTitle, $wgScriptPath; |
| 298 | + global $wgOut, $wgTitle, $wgScriptPath, $wgContLang; |
209 | 299 | global $wgFCKEditorToolbarSet, $wgFCKEditorIsCompatible; |
210 | 300 | global $wgFCKEditorExtDir, $wgFCKEditorDir, $wgFCKEditorHeight, $wgUser; |
211 | 301 | global $wgStylePath, $wgStyleVersion, $wgDefaultSkin, $wgExtensionFunctions; |
| 302 | + global $wgFCKWikiTextBeforeParse; |
| 303 | + global $wgHooks, $wgDefaultUserOptions; |
212 | 304 | |
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) { |
214 | 328 | return true; |
215 | 329 | } |
216 | 330 | |
— | — | @@ -221,11 +335,15 @@ |
222 | 336 | return true; |
223 | 337 | } |
224 | 338 | |
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 | + } |
230 | 348 | |
231 | 349 | $printsheet = htmlspecialchars( "$wgStylePath/common/wikiprintable.css?$wgStyleVersion" ); |
232 | 350 | |
— | — | @@ -233,10 +351,11 @@ |
234 | 352 | $skin = $wgUser->getSkin(); |
235 | 353 | $skin->loggedin = $wgUser->isLoggedIn(); |
236 | 354 | $skin->mTitle =& $wgTitle; |
| 355 | + $skin->initPage($wgOut); |
237 | 356 | //$skin->skinname = 'monobook'; |
238 | 357 | $skin->userpage = $wgUser->getUserPage()->getPrefixedText(); |
239 | 358 | if (method_exists($skin, "setupUserCss")) { |
240 | | - $skin->setupUserCss(); |
| 359 | + $skin->setupUserCss($wgOut); |
241 | 360 | } |
242 | 361 | |
243 | 362 | if (!empty($skin->usercss) && preg_match_all('/@import "([^"]+)";/', $skin->usercss, $matches)) { |
— | — | @@ -246,7 +365,7 @@ |
247 | 366 | |
248 | 367 | $script = <<<HEREDOC |
249 | 368 | <script type="text/javascript" src="$wgScriptPath/$wgFCKEditorDir/fckeditor.js"></script> |
250 | | -<script type="text/javascript"> |
| 369 | +<script type="text/javascript"> |
251 | 370 | var sEditorAreaCSS = '$printsheet,/mediawiki/skins/monobook/main.css?{$wgStyleVersion}'; |
252 | 371 | </script> |
253 | 372 | <!--[if lt IE 5.5000]><script type="text/javascript">sEditorAreaCSS += ',/mediawiki/skins/monobook/IE50Fixes.css?{$wgStyleVersion}'; </script><![endif]--> |
— | — | @@ -256,35 +375,83 @@ |
257 | 376 | <!--[if lt IE 7]><script type="text/javascript">sEditorAreaCSS += ',/mediawiki/skins/monobook/IEFixes.css?{$wgStyleVersion}'; </script><![endif]--> |
258 | 377 | HEREDOC; |
259 | 378 | |
| 379 | + $script .= '<script type="text/javascript"> '; |
260 | 380 | if (!empty($userStyles)) { |
261 | | - $script .= ' |
262 | | -<script type="text/javascript"> |
263 | | -sEditorAreaCSS += ",'.implode(',', $userStyles).'"; |
264 | | -</script>'; |
| 381 | + $script .= 'sEditorAreaCSS += ",'.implode(',', $userStyles).'";'; |
265 | 382 | } |
266 | 383 | |
| 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'); |
267 | 428 | $script .= <<<HEREDOC |
268 | | -<script type="text/javascript"> |
| 429 | +<script type="text/javascript"> |
269 | 430 | |
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 | +} |
277 | 440 | |
278 | 441 | function onLoadFCKeditor() |
279 | 442 | { |
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 ) |
281 | 448 | { |
282 | 449 | var height = $wgFCKEditorHeight ; |
283 | | - |
| 450 | + realTextarea.style.display = 'none'; |
284 | 451 | if ( height == 0 ) |
285 | 452 | { |
286 | 453 | // Get the window (inner) size. |
287 | 454 | var height = window.innerHeight || ( document.documentElement && document.documentElement.clientHeight ) || 550 ; |
288 | | - |
| 455 | + |
289 | 456 | // Reduce the height to the offset of the toolbar. |
290 | 457 | var offset = document.getElementById('wikiPreview') || document.getElementById('toolbar') ; |
291 | 458 | while ( offset ) |
— | — | @@ -292,62 +459,307 @@ |
293 | 460 | height -= offset.offsetTop ; |
294 | 461 | offset = offset.offsetParent ; |
295 | 462 | } |
296 | | - |
| 463 | + |
297 | 464 | // Add a small space to be left in the bottom. |
298 | 465 | height -= 20 ; |
299 | 466 | } |
300 | 467 | |
301 | 468 | // Enforce a minimum height. |
302 | 469 | height = ( !height || height < 300 ) ? 300 : height ; |
303 | | - |
| 470 | + |
304 | 471 | // 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" ; |
309 | 472 | oFCKeditor.Height = height ; |
310 | | - oFCKeditor.ToolbarSet = '$wgFCKEditorToolbarSet' ; |
311 | 473 | oFCKeditor.ReplaceTextarea() ; |
312 | | - |
| 474 | + |
313 | 475 | // 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 | + } |
315 | 602 | } |
316 | 603 | } |
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 ); |
318 | 623 | |
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"; |
330 | 626 | } |
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; |
332 | 659 | } |
| 660 | +addOnloadHook( initEditor ); |
333 | 661 | |
334 | | -var sajax_debug_mode = false; |
335 | | -var sajax_request_type = "GET"; |
| 662 | +HEREDOC; |
336 | 663 | |
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) |
338 | 669 | { |
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; |
341 | 746 | } |
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) |
343 | 755 | { |
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; |
346 | 760 | } |
347 | | - |
348 | | -addOnloadHook(showSource); |
349 | | -*/ |
350 | | -</script> |
351 | 761 | HEREDOC; |
| 762 | +} |
| 763 | +$script .= "</script>"; |
352 | 764 | |
353 | 765 | $wgOut->addScript($script); |
354 | 766 | |
— | — | @@ -355,7 +767,25 @@ |
356 | 768 | } |
357 | 769 | |
358 | 770 | public function onUserToggles( &$extraToggles ) { |
| 771 | + global $wgUser,$wgDefaultUserOptions; |
359 | 772 | $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 | + |
360 | 790 | $extraToggles = array_merge($extraToggles, self::$nsToggles); |
361 | 791 | return true; |
362 | 792 | } |
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 |
1 | 84 | + native |
Index: trunk/extensions/FCKeditor/FCKeditor.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | # Not a valid entry point, skip unless MEDIAWIKI is defined |
5 | 5 | if (!defined('MEDIAWIKI')) { |
6 | 6 | 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: |
8 | 8 | require_once( "\$IP/extensions/FCKeditor/FCKeditor.php" ); |
9 | 9 | HEREDOC; |
10 | 10 | exit( 1 ); |
— | — | @@ -26,18 +26,31 @@ |
27 | 27 | */ |
28 | 28 | |
29 | 29 | require_once $IP . "/includes/GlobalFunctions.php"; |
30 | | -require_once $IP . "/includes/ParserOptions.php"; |
31 | 30 | require_once $IP . "/includes/EditPage.php"; |
32 | 31 | |
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"; |
34 | 45 | 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"; |
36 | 47 | } |
37 | 48 | else { |
| 49 | + require_once $IP . "/includes/ParserOptions.php"; |
38 | 50 | 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"; |
40 | 52 | } |
41 | 53 | |
| 54 | +require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorParser.body.php"; |
42 | 55 | require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorSajax.body.php"; |
43 | 56 | require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorParserOptions.body.php"; |
44 | 57 | require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "FCKeditorSkin.body.php"; |
— | — | @@ -46,49 +59,47 @@ |
47 | 60 | require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "fckeditor" . DIRECTORY_SEPARATOR . "fckeditor.php"; |
48 | 61 | |
49 | 62 | if (empty ($wgFCKEditorExtDir)) { |
50 | | - $wgFCKEditorExtDir = "extensions/FCKeditor" ; |
| 63 | + $wgFCKEditorExtDir = "extensions/FCKeditor"; |
51 | 64 | } |
52 | 65 | if (empty ($wgFCKEditorDir)) { |
53 | | - $wgFCKEditorDir = "extensions/FCKeditor/fckeditor" ; |
| 66 | + $wgFCKEditorDir = "extensions/FCKeditor/fckeditor"; |
54 | 67 | } |
55 | 68 | if (empty ($wgFCKEditorToolbarSet)) { |
56 | | - $wgFCKEditorToolbarSet = "Wiki" ; |
| 69 | + $wgFCKEditorToolbarSet = "Wiki"; |
57 | 70 | } |
58 | 71 | if (empty ($wgFCKEditorHeight)) { |
59 | | - $wgFCKEditorHeight = "0" ; // "0" for automatic ("300" minimum). |
| 72 | + $wgFCKEditorHeight = "0"; // "0" for automatic ("300" minimum). |
60 | 73 | } |
61 | | - |
62 | 74 | /** |
63 | 75 | * Enable use of AJAX features. |
64 | 76 | */ |
65 | 77 | $wgUseAjax = true; |
66 | 78 | $wgAjaxExportList[] = 'wfSajaxSearchImageFCKeditor'; |
67 | 79 | $wgAjaxExportList[] = 'wfSajaxSearchArticleFCKeditor'; |
| 80 | +$wgAjaxExportList[] = 'wfSajaxSearchCategoryFCKeditor'; |
68 | 81 | $wgAjaxExportList[] = 'wfSajaxWikiToHTML'; |
69 | 82 | $wgAjaxExportList[] = 'wfSajaxGetImageUrl'; |
70 | 83 | $wgAjaxExportList[] = 'wfSajaxGetMathUrl'; |
71 | 84 | $wgAjaxExportList[] = 'wfSajaxSearchTemplateFCKeditor'; |
72 | 85 | $wgAjaxExportList[] = 'wfSajaxSearchSpecialTagFCKeditor'; |
| 86 | +$wgAjaxExportList[] = 'wfSajaxToggleFCKeditor'; |
73 | 87 | |
74 | 88 | $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)' |
81 | 94 | ); |
82 | 95 | |
83 | 96 | $fckeditor = new FCKeditor("fake"); |
84 | 97 | $wgFCKEditorIsCompatible = $fckeditor->IsCompatible(); |
85 | 98 | |
86 | 99 | $oFCKeditorExtension = new FCKeditor_MediaWiki(); |
| 100 | + |
87 | 101 | $oFCKeditorExtension->registerHooks(); |
88 | 102 | |
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 |