/*------------------------------------------------------------------------- HTML-Kit hkScript plugin created on 16-mars-2004 13:29:36 Version Information: HKPGEN 2.96, HKPAPI 1.0.50 -------------------------------------------------------------------------*/ /*------------------------------------------------------------------------- HTML-Kit will call the following function whenever user clicks on the the plugin's icon, selects one of its drop-down menu items or otherwise invokes the plugin. -------------------------------------------------------------------------*/ function hkp_Main(pDataIn, pDataOut) { var nPluginID = 0; var nMenuItemID = 0; var nOutputMode = 1; var sOutput = ""; var sSelText = ""; var nSelText = 0; var nMoveCursor = 0; var nFormatTags = 0; var nFullText = 0; var sFullText = ""; var sArray = ""; var uArray = ""; nSelText = hkp_DataGet( pDataIn, "INPUT_SELECTION", &sSelText ); if(!nSelText || ("" == sSelText)) { nSelText = 0; } nFullText = hkp_DataGet( pDataIn, "INPUT", &sFullText ); if(!nFullText || ("" == sFullText)) { nFullText = 0; } /*---------------------------------------------------------- Get the 1 based plugin ID. Useful when there are two or more plugins registered within a single file. ----------------------------------------------------------*/ nPluginID = hkp_DataGetInt( pDataIn, "P_ID", 1 ); if(nSelText) { sOutput = sSelText; } else if(nFullText) { sOutput = sFullText; nOutputMode = 6; } { var aFind = new array ( " \\!"," \\?"," \\:"," \\;"," \\%"," « "," » "," « "," » "," \\!=", ); var aRepl = new array ( " !"," ?"," :"," ;"," % "," « "," » "," « "," » "," !=" ); var j = 0; for (j=0; j