зеркало из https://github.com/mozilla/pjs.git
partial fix for bug 10904 - sample now works in M15
- moves CID/ProgID into header file - adds more calls to enablePrivilege - renames "write" callback to something that works as intended a=brendan@mozilla.org r=scc@netscape.com
This commit is contained in:
Родитель
d7d7a12251
Коммит
7eb2df8b18
|
@ -48,16 +48,4 @@ interface nsISample : nsISupports
|
|||
};
|
||||
|
||||
|
||||
%{ C++
|
||||
/**
|
||||
* {7CB5B7A0-07D7-11d3-BDE2-000064657374}
|
||||
* The CID is also a unique number that look just like the IID
|
||||
* and identifies uniquely an implementation
|
||||
*/
|
||||
#define NS_SAMPLE_CID \
|
||||
{ 0x7cb5b7a0, 0x7d7, 0x11d3, { 0xbd, 0xe2, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
|
||||
|
||||
#define NS_SAMPLE_PROGID "component://netscape/sample"
|
||||
%}
|
||||
|
||||
|
||||
|
|
|
@ -33,7 +33,18 @@
|
|||
* there can be more than one implementation of an given interface. Class
|
||||
* IDs (CIDs) uniquely identify a particular implementation of an interface.
|
||||
* Interface IDs (IIDs) uniquely identify an interface.
|
||||
*
|
||||
* The CID is also a unique number that looks just like an IID
|
||||
* and uniquely identifies an implementation
|
||||
* {7CB5B7A0-07D7-11d3-BDE2-000064657374}
|
||||
*/
|
||||
|
||||
#define NS_SAMPLE_CID \
|
||||
{ 0x7cb5b7a0, 0x7d7, 0x11d3, { 0xbd, 0xe2, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }
|
||||
|
||||
#define NS_SAMPLE_PROGID "component://netscape/sample"
|
||||
|
||||
|
||||
class nsSampleImpl : public nsISample
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -125,24 +125,28 @@ dump("sample = " + sample + "\n");
|
|||
|
||||
function get()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var field = document.getElementById('Value');
|
||||
field.value = sample.value;
|
||||
}
|
||||
|
||||
function set()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var field = document.getElementById('Value');
|
||||
sample.value = field.value;
|
||||
}
|
||||
|
||||
function poke()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var field = document.getElementById('Value');
|
||||
sample.poke(field.value);
|
||||
}
|
||||
|
||||
function write()
|
||||
function sampleWrite()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
sample.writeValue("here is what I'm writing: ");
|
||||
}
|
||||
</script>
|
||||
|
@ -153,7 +157,7 @@ function write()
|
|||
<input type="button" value="Set" onclick="set();">
|
||||
<input type="button" value="Poke" onclick="poke();">
|
||||
<input type="text" id="Value">
|
||||
<input type="button" value="Write" onclick="write();">
|
||||
<input type="button" value="Write" onclick="sampleWrite();">
|
||||
<form>
|
||||
|
||||
<hr>
|
||||
|
@ -172,24 +176,25 @@ dump("sample = " + sample + "\n");
|
|||
|
||||
function get()
|
||||
{
|
||||
var field = document.getElementById('Value');
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var field = document.getElementById('Value');
|
||||
field.value = sample.value;
|
||||
}
|
||||
|
||||
function set()
|
||||
{
|
||||
var field = document.getElementById('Value');
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var field = document.getElementById('Value');
|
||||
sample.value = field.value;
|
||||
}
|
||||
|
||||
function poke()
|
||||
{
|
||||
var field = document.getElementById('Value');
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var field = document.getElementById('Value');
|
||||
sample.poke(field.value);
|
||||
}
|
||||
|
||||
function write()
|
||||
function sampleWrite()
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
sample.writeValue("here is what I'm writing: ");
|
||||
}
|
||||
</script>
|
||||
|
@ -199,7 +204,7 @@ function write()
|
|||
<input type="button" value="Set" onclick="set();">
|
||||
<input type="button" value="Poke" onclick="poke();">
|
||||
<input type="text" id="Value">
|
||||
<input type="button" value="Write" onclick="write();">
|
||||
<input type="button" value="Write" onclick="sampleWrite();">
|
||||
<form>
|
||||
|
||||
</pre>
|
||||
|
|
Загрузка…
Ссылка в новой задаче