NAME
Perlbug::JS - Object handler for Javascript methods
DESCRIPTION
Javascript wrapper for Perlbug modules usage
SYNOPSIS
use Perlbug::JS;
print Perlbug::JS->new()->menus;
METHODS
- new
-
Create new Perlbug::JS object.
my $o_js = Perlbug::JS->new;
- control
-
Return a popup, this will display the data and submit the form on the given frame/target/item.
my $control = $o_js->control('menus');
-
menu suite
- perlbug
-
perlbug display suite
- back
-
back(n) perlbug display
- sel
-
sel(1) = select all items, or sel(0) = deselect
- admin
-
Switch admin view on(1) or off(0)
- commands
-
commands suite
<form name=ws_pub_entries_list_footer> <table width=100% height=100% bgcolor=8FBC8F> <tr><td align=center valign=top> <input type=button value=" Start " onClick="check_form()"> </td> <td align=center valign=top> <select size=1 name=func > <option value="NO" selected>Functions: <option value="PUB_DM_ENTRIES_INSERTWS" >Insert single WS Entry <option value="PUB_DM_ENTRIES_DELSELWS" >Delete selected Entries <option value="PUB_DM_ENTRIES_SET" >Generate DM Set <option value="PUB_DM_ENTRIES_EXPORT" >Export to SGML List File </select> </td> <td align=center valign=top> <input type=button value=" UnSel " onClick="parent.f2.nosel_button()"> </td> <td align=center valign=top> <input type=button value=" Sel " onClick="parent.f2.sel_button()"> </td> <td align=center valign=top> <input type=button value=" Help " onClick="help_system()"> </td> <td align=center valign=top> <input type=button value=" Back " onClick="parent.f2.back_frames(0)"> </td> </tr> </table> <input type=hidden name=set_name value=""> <input type=hidden name=setdel value="NO"> </form>
<!-- function nosel_button( ) { var i = 0; for (i=0; i < document.PUB_DM_ENTRIES_2_SEARCH2.length; ++i) { if ( document.PUB_DM_ENTRIES_2_SEARCH2.elements[i].type == "checkbox" ) { document.PUB_DM_ENTRIES_2_SEARCH2.elements[i].checked = false; } } } function sel_button( ) { var i = 0; for (i=0; i < document.PUB_DM_ENTRIES_2_SEARCH2.length; ++i) { if ( document.PUB_DM_ENTRIES_2_SEARCH2.elements[i].type == "checkbox" ) { document.PUB_DM_ENTRIES_2_SEARCH2.elements[i].checked = true; } } } // --> function flag_on (flag) { flag.value = 1; return true; } function flag_off (flag) { flag.value = 0; return true; }
function cur_set (e) { var out = parse_objects(e); alert("event: " + e + ": " + out); if (this.form.general_applic.focus == 1) { alert("hi"); } if (1 == 1) { alert("setting page x: " + e.pageX + ", y: " + e.pageY); } else { alert("not setting xy"); } return true; }
function cb_on () { //alert("args: (" + arguments.length + "): " + arguments); var a = 0; while (a < arguments[0].length) { if (a >= 11) { alert("Breaking loop at " + a); break; } var arg = arguments[0][a]; arg.checked = 1; a++; } return true; }
function cb_off () { //alert("args: (" + arguments.length + "): " + arguments); var a = 0; while (a < arguments[0].length) { if (a >= 11) { alert("Breaking loop at " + a); break; } var arg = arguments[0][a]; arg.checked = 0; a++; } return true; }
/* * update_item_val (object_with_value, value_to_insert, debug, place_holding_character) * ------------------------- */ function update_item_val (target, param, debug, character) { if (debug == 1) { var out = parse_objects(target, param, character); alert("update_item_val(args):\n" + out); } var hint = ""; var orig = target.value; var output = ""; var split = orig.indexOf(character); if (split >= 0) { var pre = orig.substr(0, split); var post = orig.substr(split + 1, orig.length -1); /* alert("pre: '" + pre + "'\n\npost: '" + post + "'"); */ hint = "using '" + character + "' as the replacement character\n\n"; output = pre + param + post; } else { output = target.value + param; } if (confirm("original: '" + orig + "\n\n" + hint + "outputs: '" + output + "'") ) { target.value = output; target.focus(); } }
/* * uga * ------------------------- */ function update_general_applic (given, form, character) { var target = form.general_applic; var orig = form.general_applic.value; var param = given.options[given.options.selectedIndex].value; if (param == "z") { param = location.href; } var hint = ""; var output = ""; var split = orig.indexOf("~"); if (split >= 0) { var pre = orig.substr(0, split); var post = orig.substr(split + 1, orig.length -1); /* alert("pre: '" + pre + "'\n\npost: '" + post + "'"); */ hint = "using '~' as the replacement character\n\n"; output = pre + param + post; } else { output = target.value + param; } if (confirm("original: '" + orig + "\n\n" + hint + "outputs: '" + output + "'") ) { target.value = output; target.focus(); } }
/* * object construct, display * ------------------------- */ function thing (arg1, arg2, arg3, arg4) { this.name = arg1; this.genapp = arg2; this.modify = arg3; this.obj = arg4; }
function demo_obj (arg1, arg2, arg3, arg4) { var o = new thing(arg1, arg2, arg3, arg4); var out = ""; for (var i in o) { out += "\t" + i + "\t= " + o[i] + "\n"; } alert("new Obj (blob)\n" + out); }