Ticket #2116: 2116.patch
File 2116.patch, 10.3 KB (added by , 15 years ago) |
---|
-
FCKeditor.body.php
370 370 $showRef = true; 371 371 } 372 372 373 $showLlink = false; 374 if (isset ($wgExtensionFunctions) && (in_array('wfFilelinkExtension',$wgExtensionFunctions) )){ 375 $showLlink = true; 376 } 377 373 378 $script .= ' 374 379 var showFCKEditor = '. $this->showFCKEditor .'; 375 380 var popup = false; //pointer to popup document … … 392 397 oFCKeditor.ToolbarSet = "'. $wgFCKEditorToolbarSet .'" ; 393 398 oFCKeditor.ready = true; 394 399 oFCKeditor.Config["showreferences"] = '.(($showRef)?'true':'false').'; 400 oFCKeditor.Config["showlocalLink"] = '.(($showLlink)?'true':'false').'; 395 401 '; 396 402 $script .= '</script>'; 397 403 -
fckeditor_config.js
12 12 ['Cut','Copy','Paste',/*'PasteText','PasteWord',*/'-','Print'], 13 13 ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], 14 14 ['SpecialChar','Table','Image','Rule'], 15 ['MW_ Template','MW_Special','MW_Ref','MW_References','MW_Math'],15 ['MW_Local_Link','MW_Template','MW_Special','MW_Ref','MW_References','MW_Math'], 16 16 '/', 17 17 ['FontFormat'], 18 18 ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], … … 25 25 26 26 // Load the extension plugins. 27 27 FCKConfig.PluginsPath = FCKConfig.EditorPath + '../plugins/' ; 28 FCKConfig.Plugins.Add( 'mediawiki', 'en,pl ') ;28 FCKConfig.Plugins.Add( 'mediawiki', 'en,pl,es') ; 29 29 30 30 FCKConfig.ForcePasteAsPlainText = true ; 31 31 FCKConfig.FontFormats = 'p;h1;h2;h3;h4;h5;h6;pre' ; -
plugins/mediawiki/dialogs/locallink.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2 <!-- 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 4 * Copyright (C) 2003-2007 Frederico Caldeira Knabben 5 * 6 * == BEGIN LICENSE == 7 * 8 * Licensed under the terms of any of the following licenses at your 9 * choice: 10 * 11 * - GNU General Public License Version 2 or later (the "GPL") 12 * http://www.gnu.org/licenses/gpl.html 13 * 14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 15 * http://www.gnu.org/licenses/lgpl.html 16 * 17 * - Mozilla Public License Version 1.1 or later (the "MPL") 18 * http://www.mozilla.org/MPL/MPL-1.1.html 19 * 20 * == END LICENSE == 21 * 22 * Local File Link 23 * 24 * written by Michael Tran (dublue@gmail.com) for MediaWiki+FCKeditor 25 --> 26 <html> 27 <head> 28 <title>Local Link</title> 29 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 30 <meta name="robots" content="noindex, nofollow" /> 31 <script type="text/javascript"> 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 window.onload = function() 42 { 43 oEditor.FCKLanguageManager.TranslatePage(document) ; 44 // Activate the "OK" button. 45 window.parent.SetOkButton(true) ; 46 window.parent.SetAutoSize(true) ; 47 48 // load the highlighted text (if any) and place 49 // into the description input field 50 oLink = FCK.Selection.MoveToAncestorNode("A"); 51 if (oLink) { 52 FCK.Selection.SelectNode(oLink); 53 // you cannot alter the value attribute of a file input!! 54 //document.getElementById("idFile").value = oLink.getAttribute("href", 2); 55 document.getElementById("idDesc").value = oLink.innerHTML; 56 } 57 else { 58 // selected text is not currently a link 59 if (document.all) 60 document.getElementById("idDesc").value = FCK.EditorDocument.selection.createRange().text; 61 else 62 document.getElementById("idDesc").value = FCK.EditorWindow.getSelection(); 63 } 64 } // end function 65 66 function Ok() 67 { 68 // check if a file has been selected 69 if (document.getElementById("idFile").value.length > 0) { 70 // add an undo step 71 oEditor.FCKUndo.SaveUndoStep(); 72 73 // obtain and cleanse data 74 strLink = "file:///" + encodeURI(document.getElementById("idFile").value); 75 // strDesc does not need to be cleansed as it will be done server side 76 // so any injection attempts will be filtered after saving 77 strDesc = document.getElementById("idDesc").value; 78 79 if (strDesc.length < 1) strDesc = document.getElementById("idFile").value; 80 81 // create an empty anchor 82 objLink = oEditor.FCK.InsertElement("a"); 83 objLink.href = strLink; 84 objLink.setAttribute('_fcklocallink','true'); 85 objLink.innerHTML = strDesc; 86 87 // add to the editor 88 oEditor.FCKSelection.SelectNode(objLink); 89 90 return true; 91 } 92 else { 93 alert(FCKLang.DlgLocalLinkNoFileSelected); 94 return false; 95 } // end if 96 } // end function 97 </script> 98 </head> 99 <body> 100 <p><span fcklang="DlgLocalLinkDescription">To insert a link to a resource on a shared group drive (eg G: or W:), browse for your resource, add a description for the link, then click OK.</span></p> 101 <p> 102 <label for="idFile" fcklang="DlgLocalLinkInputFileBrowse">File:</label> 103 <br /><input type="file" name="file" size="50" id="idFile" /> 104 </p> 105 <p> 106 <label for="idDesc"><span fcklang="DlgLocalLinkInputLinkDescription">Link Description:</span></label> 107 <br /><input type="text" name="desc" size="50" id="idDesc" /> 108 </p> 109 </body> 110 </html> -
plugins/mediawiki/fckplugin.js
74 74 } 75 75 FCKToolbarItems.RegisterItem( 'MW_References', tbButton ) ; 76 76 77 // register the local link command 78 FCKCommands.RegisterCommand( "MW_Local_Link", 79 new FCKDialogCommand(FCKLang["DlgLocalLinkTitle"] || 'Local File Link', FCKLang["DlgLocalLinkTitle"] || 'Local File Link', FCKConfig.PluginsPath + "mediawiki/dialogs/locallink.html",500, 300 ) 80 ); 81 82 // create the local link toolbar button 83 var tbButton = new FCKToolbarButton("MW_Local_Link", FCKLang["DlgLocalLinkTitle"] || 'Local File Link', null, FCK_TOOLBARITEM_ICONTEXT); 84 if ( !FCKConfig.showlocalLink ) { //hack to disable local link button 85 tbButton.Create = function() {return 0;} 86 tbButton.Disable = function() {return 0;} 87 tbButton.RefreshState = function() {return 0;} 88 } 89 tbButton.IconPath = FCKConfig.PluginsPath + "mediawiki/images/tb_locallink.gif"; 90 FCKToolbarItems.RegisterItem("MW_Local_Link", tbButton); 91 92 77 93 tbButton = new FCKToolbarButton( 'MW_Math', 'Formula', FCKLang.wikiBtnFormula || 'Insert/Edit Formula' ) ; 78 94 tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_math.gif' ; 79 95 FCKToolbarItems.RegisterItem( 'MW_Math', tbButton ) ; … … 400 416 var isWikiUrl = !( href.StartsWith( 'mailto:' ) || /^\w+:\/\//.test( href ) ) ; 401 417 stringBuilder.push( isWikiUrl ? '[[' : '[' ) ; 402 418 } 419 if ( FCKConfig.showlocalLink ) { 420 if((htmlNode.getAttribute('_fcklocallink')) || (href.toLowerCase().StartsWith( 'file://' ))){ 421 if(!isWikiUrl) stringBuilder.push( '[' ) ; 422 isWikiUrl = true; 423 } 424 } 403 425 //#2223 404 426 if (htmlNode.getAttribute( '_fcknotitle' ) && htmlNode.getAttribute( '_fcknotitle' ) == "true") 405 427 { -
plugins/mediawiki/lang/en.js
72 72 73 73 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'; 74 74 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'; 75 76 77 FCKLang.DlgLocalLinkTitle = "Local File Link"; 78 FCKLang.DlgLocalLinkDescription = "To insert a link to a resource on a shared group drive (eg G: or W:), browse for your resource, add a description for the link, then click OK."; 79 FCKLang.DlgLocalLinkInputFileBrowse = "File:"; 80 FCKLang.DlgLocalLinkInputLinkDescription = "Link Description:"; 81 FCKLang.DlgLocalLinkNoFileSelected = "Please ensure you have selected a file to link to."; -
plugins/mediawiki/lang/es.js
1 /* 2 * mediaWiki FCKeditor plugin 3 * 4 * Spanish language file. 5 */ 6 7 FCKLang.DlgLocalLinkTitle = "Enlace a archivo local"; 8 FCKLang.DlgLocalLinkDescription = "Para insertar un enlace a un recurso en una unidad de red (como G: o W:), explore el recurso compartido, an~ada una descripción para el enlace, y pulse OK."; 9 FCKLang.DlgLocalLinkInputFileBrowse = "File:"; 10 FCKLang.DlgLocalLinkInputLinkDescription = "Descripción del enlace:"; 11 FCKLang.DlgLocalLinkNoFileSelected = "Por favor, compruebe que ha seleccionado el archivo a enlazar."; -
plugins/mediawiki/lang/pl.js
73 73 FCKLang.DplHelp = 'Dynamic Page List pozwala na generowanie formatowanych list stron bazując na podanych kryteriach Zobacz %link aby dowiedzieć się więcej';; 74 74 FCKLang.inputboxHelp = 'Inputbox pozwala na stworzenie formularza dla użytkowników do tworzenia nowych stron. Zobacz %link aby dowiedzieć się więcej'; 75 75 76 FCKLang.DlgLocalLinkTitle = "Link lokalny"; 77 FCKLang.DlgLocalLinkDescription = "Aby stworzyć odnośnik do treści udostępnionej dla lokalnej grupy, wybierz plik, dodaj odpowiedni opis oraz kliknij OK."; 78 FCKLang.DlgLocalLinkInputFileBrowse = "Plik:"; 79 FCKLang.DlgLocalLinkInputLinkDescription = "Opis:"; 80 FCKLang.DlgLocalLinkNoFileSelected = "Upewnij się, że odpowiedni plik został wybrany";