this.OpenILS = {};
- JSAN.use('util.sound'); this.sound = new util.sound();
+ // Only use sounds if the context window has already created a sound object
+ if (typeof xulG != 'undefined' && xulG._sound) {
+ this.sound = xulG._sound;
+ }
} catch(E) {
alert('Error in util.error constructor: ' + E);
dump('yns_alert:\n\ts = ' + s + '\n\ttitle = ' + title + '\n\tb1 = ' + b1 + '\n\tb2 = ' + b2 + '\n\tb3 = ' + b3 + '\n\tc = ' + c + '\n');
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
- this.sound.bad();
-
-
//FIXME - is that good enough of an escape job?
s = s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
if (typeof xulG != 'undefined') if (typeof xulG.url_prefix == 'function') url = xulG.url_prefix( url );
JSAN.use('util.window'); var win = new util.window();
var fancy_prompt_data = win.open(
- url, 'fancy_prompt', 'chrome,resizable,modal,width=700,height=500', { 'xml' : xml, 'title' : title }
+ url, 'fancy_prompt', 'chrome,resizable,modal,width=700,height=500', { 'xml' : xml, 'title' : title, 'sound' : 'bad' }
);
if (fancy_prompt_data.fancy_status == 'complete') {
switch(fancy_prompt_data.fancy_submit) {
dump('yns_alert_formatted:\n\ts = ' + s + '\n\ttitle = ' + title + '\n\tb1 = ' + b1 + '\n\tb2 = ' + b2 + '\n\tb3 = ' + b3 + '\n\tc = ' + c + '\n');
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect UniversalBrowserWrite");
- this.sound.bad();
-
-
//FIXME - is that good enough of an escape job?
s = s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
if (typeof xulG != 'undefined') if (typeof xulG.url_prefix == 'function') url = xulG.url_prefix( url );
JSAN.use('util.window'); var win = new util.window();
var fancy_prompt_data = win.open(
- url, 'fancy_prompt', 'chrome,resizable,modal,width=700,height=500', { 'xml' : xml, 'title' : title }
+ url, 'fancy_prompt', 'chrome,resizable,modal,width=700,height=500', { 'xml' : xml, 'title' : title, 'sound' : 'bad' }
);
if (fancy_prompt_data.fancy_status == 'complete') {
switch(fancy_prompt_data.fancy_submit) {
dump('yns_alert_original:\n\ts = ' + s + '\n\ttitle = ' + title + '\n\tb1 = ' + b1 + '\n\tb2 = ' + b2 + '\n\tb3 = ' + b3 + '\n\tc = ' + c + '\n');
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- this.sound.bad();
+ if (this.sound) { this.sound.bad(); }
// get a reference to the prompt service component.
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
}
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
- obj.sound.bad();
var xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">' +
'<groupbox><caption label="' + offlineStrings.getString('network.override.exceptions') + '"/>' +
'<grid><columns><column/><column/></columns><rows>';
//+ '?xml_in_stash=temp_override_xml'
//+ '&title=' + window.escape(override_params.title),
'fancy_prompt', 'chrome,resizable,modal,width=700,height=500',
- { 'xml' : xml, 'title' : override_params.title }
+ { 'xml' : xml, 'title' : override_params.title, 'sound' : 'bad' }
);
if (fancy_prompt_data.fancy_status == 'complete') {
req = obj._request(app,name + '.override',params);