1999-07-22 07:15:39 +04:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Strres Test</title>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<script>
|
|
|
|
var sample = Components.classes["component://netscape/sample/sample-world"].createInstance();
|
|
|
|
sample = sample.QueryInterface(Components.interfaces.nsISample);
|
|
|
|
dump("sample = " + sample + "\n");
|
|
|
|
|
|
|
|
function get()
|
|
|
|
{
|
|
|
|
var field = document.getElementById('Value');
|
|
|
|
field.value = sample.Value;
|
|
|
|
}
|
|
|
|
|
|
|
|
function set()
|
|
|
|
{
|
|
|
|
var field = document.getElementById('Value');
|
|
|
|
//sample.Value = field.value;
|
|
|
|
sample.WriteValue(field.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
function poke()
|
|
|
|
{
|
|
|
|
var field = document.getElementById('Value');
|
|
|
|
sample.Poke(field.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
function write()
|
|
|
|
{
|
|
|
|
sample.WriteValue("here is what I'm writing!");
|
|
|
|
|
1999-07-27 05:24:51 +04:00
|
|
|
var Bundle = JS_GetStrBundle("resource:/res/strres.properties", null);
|
|
|
|
var ostr1 = Bundle.GetStringFromName("file");
|
|
|
|
dump("\n--** strBundle GetStringFromName file=" + ostr1 + " **--\n");
|
|
|
|
var ostr2 = Bundle.GetStringFromID(123);
|
|
|
|
dump("\n--** strBundle GetStringFromID 123=" + ostr2 + " **--\n");
|
1999-07-22 07:15:39 +04:00
|
|
|
|
1999-07-27 05:24:51 +04:00
|
|
|
var field = document.getElementById('writeBtn');
|
|
|
|
field.value = ostr2;
|
1999-07-22 07:15:39 +04:00
|
|
|
}
|
1999-07-27 05:24:51 +04:00
|
|
|
|
1999-07-22 07:15:39 +04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<form name="form">
|
1999-07-24 07:06:15 +04:00
|
|
|
<input type="button" id="getBtn" value="Get" onclick="get();">
|
1999-07-22 07:15:39 +04:00
|
|
|
<input type="button" value="Set" onclick="set();">
|
|
|
|
<input type="button" value="Poke" onclick="poke();">
|
|
|
|
<input type="text" id="Value">
|
1999-07-24 07:06:15 +04:00
|
|
|
<input type="button" id="writeBtn" value="Write" onclick="write();">
|
1999-07-22 07:15:39 +04:00
|
|
|
<form>
|
|
|
|
</body>
|
|
|
|
</html>
|