--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\r
+<!--\r
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net\r
+ * Copyright (C) 2003-2008 Frederico Caldeira Knabben\r
+ *\r
+ * == BEGIN LICENSE ==\r
+ *\r
+ * Licensed under the terms of any of the following licenses at your\r
+ * choice:\r
+ *\r
+ * - GNU General Public License Version 2 or later (the "GPL")\r
+ * http://www.gnu.org/licenses/gpl.html\r
+ *\r
+ * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")\r
+ * http://www.gnu.org/licenses/lgpl.html\r
+ *\r
+ * - Mozilla Public License Version 1.1 or later (the "MPL")\r
+ * http://www.mozilla.org/MPL/MPL-1.1.html\r
+ *\r
+ * == END LICENSE ==\r
+ *\r
+ * This is the sample "Replace" plugin window.\r
+-->\r
+<html>\r
+ <head>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
+ <meta content="noindex, nofollow" name="robots">\r
+ <script type="text/javascript">\r
+\r
+var oEditor = window.parent.InnerDialogLoaded() ;\r
+\r
+function OnLoad()\r
+{\r
+ // First of all, translate the dialog box texts\r
+ oEditor.FCKLanguageManager.TranslatePage( document ) ;\r
+\r
+ window.parent.SetAutoSize( true ) ;\r
+}\r
+\r
+function btnStat(frm)\r
+{\r
+ document.getElementById('btnReplace').disabled =\r
+ document.getElementById('btnReplaceAll').disabled =\r
+ ( document.getElementById('txtFind').value.length == 0 ) ;\r
+}\r
+\r
+function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll, hasFound )\r
+{\r
+ for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )\r
+ {\r
+ var oNode = parentNode.childNodes[i] ;\r
+ if ( oNode.nodeType == 3 )\r
+ {\r
+ var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;\r
+ if ( oNode.nodeValue != sReplaced )\r
+ {\r
+ oNode.nodeValue = sReplaced ;\r
+ if ( ! replaceAll )\r
+ return true ;\r
+ hasFound = true ;\r
+ }\r
+ }\r
+\r
+ hasFound = ReplaceTextNodes( oNode, regex, replaceValue, replaceAll, hasFound ) ;\r
+ if ( ! replaceAll && hasFound )\r
+ return true ;\r
+ }\r
+\r
+ return hasFound ;\r
+}\r
+\r
+function GetRegexExpr()\r
+{\r
+ if ( document.getElementById('chkWord').checked )\r
+ var sExpr = '\\b' + document.getElementById('txtFind').value + '\\b' ;\r
+ else\r
+ var sExpr = document.getElementById('txtFind').value ;\r
+\r
+ return sExpr ;\r
+}\r
+\r
+function GetCase()\r
+{\r
+ return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;\r
+}\r
+\r
+function Replace()\r
+{\r
+ var oRegex = new RegExp( GetRegexExpr(), GetCase() ) ;\r
+ ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, document.getElementById('txtReplace').value, false ) ;\r
+}\r
+\r
+function ReplaceAll()\r
+{\r
+ var oRegex = new RegExp( GetRegexExpr(), GetCase() + 'g' ) ;\r
+ ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, document.getElementById('txtReplace').value, true ) ;\r
+ window.parent.Cancel() ;\r
+}\r
+ </script>\r
+ </head>\r
+ <body onload="OnLoad()" scroll="no" style="OVERFLOW: hidden">\r
+ <div align="center">\r
+ This is my Plugin!\r
+ </div>\r
+ <table cellSpacing="3" cellPadding="2" width="100%" border="0">\r
+ <tr>\r
+ <td noWrap><label for="txtFind" fckLang="DlgMyReplaceFindLbl">Find what:</label>\r
+ </td>\r
+ <td width="100%"><input id="txtFind" onkeyup="btnStat(this.form)" style="WIDTH: 100%" tabIndex="1" type="text">\r
+ </td>\r
+ <td><input id="btnReplace" style="WIDTH: 100%" disabled onclick="Replace();" type="button"\r
+ value="Replace" fckLang="DlgMyReplaceReplaceBtn">\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td vAlign="top" nowrap><label for="txtReplace" fckLang="DlgMyReplaceReplaceLbl">Replace\r
+ with:</label>\r
+ </td>\r
+ <td vAlign="top"><input id="txtReplace" style="WIDTH: 100%" tabIndex="2" type="text">\r
+ </td>\r
+ <td><input id="btnReplaceAll" disabled onclick="ReplaceAll()" type="button" value="Replace All"\r
+ fckLang="DlgMyReplaceReplAllBtn">\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td vAlign="bottom" colSpan="3"> <input id="chkCase" tabIndex="3" type="checkbox"><label for="chkCase" fckLang="DlgMyReplaceCaseChk">Match\r
+ case</label>\r
+ <br>\r
+ <input id="chkWord" tabIndex="4" type="checkbox"><label for="chkWord" fckLang="DlgMyReplaceWordChk">Match\r
+ whole word</label>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </body>\r
+</html>\r