Hey, again.
For my Programming Languages Keyword Script (C/C++ Keywords is gone, it has now support for over 12 languages), I am working on the menus. So far so good, but I can't get it able to click something, and to add something to his/her send message bar.
On the click of item "PHP", I want it to add (but not send):
[ code=php] [/code ]
I tried this:
code:
var talkerList = new Array(
"PHP", "C/C++");
function OnGetScriptMenu(Location){
var sMenu = "<ScriptMenu>";
if(Location == 1)
{
sMenu += "<MenuEntry Id=\"Help\">Help - How to Use</MenuEntry>";
sMenu += "<MenuEntry Id=\"About\">About</MenuEntry>";
}
else if(Location == 2)
{
for(var i = 0; i < talkerList.length; i++)
sMenu += "<MenuEntry Id=\""+talkerList[i]+""+talkerList[i]+"\">"+talkerList[i]+"</MenuEntry>";
sMenu += "<Separator/>";
sMenu += "<MenuEntry Id=\"Help\">Help - How to Use</MenuEntry>";
sMenu += "<MenuEntry Id=\"About\">About</MenuEntry>";
}
sMenu += "</ScriptMenu>";
return sMenu;
}
function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd)
{
var currenttext = OriginWnd.EditText;
switch(MenuItemId)
{
case "PHP":
OriginWnd.EditText_SetCurSel (currenttext.substr(0,1), currenttext.substr(currenttext.length,1));
OriginWnd.EditText_ReplaceSel ("[ code=php] [/code ]");
break;
}
}
It's about the PHP one. How will I get it to work?
- Jon