Permalink
Browse files

Fixed IE9 compatibility problem with Scripting.Dictionary (thanks to …

…Hironobu Koura!)
  • Loading branch information...
sebdeckers committed Feb 27, 2011
1 parent 1350297 commit 0084278b0e9432848b4a4b823657caa018ef5940
Showing with 454 additions and 454 deletions.
  1. +16 −16 Client/src/main/ChatSession.js
  2. +30 −30 Client/src/main/ClientBrowse.js
  3. +27 −27 Client/src/main/ClientPlugin.js
  4. +140 −140 Client/src/main/ClientRoster.js
  5. +12 −12 Client/src/main/ClientRosterSearch.js
  6. +1 −1 Client/src/main/CommandLine.js
  7. +10 −10 Client/src/main/ConferenceSession.js
  8. +27 −27 Client/src/main/ContainerCode.js
  9. +8 −8 Client/src/main/Emoticon.js
  10. +1 −1 Client/src/main/Headline.js
  11. +5 −5 Client/src/main/LoadProfile.js
  12. +11 −11 Client/src/main/MenuBar.js
  13. +28 −28 Client/src/main/OnLogin.js
  14. +1 −1 Client/src/main/Reconnect.js
  15. +2 −2 Client/src/main/SaveCommonProfile.js
  16. +2 −2 Client/src/main/SettingsSave.js
  17. +2 −2 Client/src/main/Tray.js
  18. +11 −11 Client/src/main/XHTML-IM.js
  19. +1 −1 Client/src/main/XMPPOnConnected.js
  20. +3 −3 Client/src/main/XMPPOnDisconnected.js
  21. +8 −8 Client/src/main/XMPPOnDocumentStart.js
  22. +4 −4 Client/src/main/XMPPOnIQ.js
  23. +15 −15 Client/src/main/XMPPOnMessage.js
  24. +9 −9 Client/src/main/XMPPOnPresence.js
  25. +8 −8 Client/src/main/XMPPOnStream.js
  26. +3 −3 Client/src/main/dial_block.js
  27. +2 −2 Client/src/main/dial_chat.js
  28. +4 −4 Client/src/main/dial_conference.js
  29. +2 −2 Client/src/main/dial_contacts_export.js
  30. +7 −7 Client/src/main/dial_contacts_import.js
  31. +1 −1 Client/src/main/dial_file.js
  32. +2 −2 Client/src/main/dial_font.js
  33. +1 −1 Client/src/main/dial_history.js
  34. +1 −1 Client/src/main/dial_login.js
  35. +2 −2 Client/src/main/dial_mode.js
  36. +1 −1 Client/src/main/dial_service_register.js
  37. +3 −3 Client/src/main/dial_userinfo.js
  38. +1 −1 Client/src/main/dial_vcard_edit.js
  39. +1 −1 Client/src/main/dial_webbrowser.js
  40. +1 −1 Client/src/main/file2hash.js
  41. +1 −1 Client/src/main/hash2file.js
  42. +2 −2 Client/src/main/history_add.js
  43. +6 −6 Client/src/main/init.js
  44. +1 −1 Client/src/main/login.js
  45. +1 −1 Client/src/main/mode_new.js
  46. +19 −19 Client/src/main/mousemenu.js
  47. +1 −1 Client/src/main/outnit.js
  48. +5 −5 Client/src/main/vcard.js
  49. +2 −2 Client/src/plugin_list.html
  50. +2 −2 Client/src/transport_list.html
@@ -46,14 +46,14 @@ function ChatSessionPool ()
/* Parse the event right now
*/
if ( this.Trackers.Exists( ShortAddress ) )
- this.Trackers( ShortAddress ).DispatchEvent( Event );
+ this.Trackers.Item( ShortAddress ).DispatchEvent( Event );
/* Queue the event
*/
else if ( Event.Type == 'message' && Event.Payload.Body.length )
{
if ( this.Events.Exists( ShortAddress ) )
- this.Events( ShortAddress ).push( Event );
+ this.Events.Item( ShortAddress ).push( Event );
else
this.Events.Add( ShortAddress, new Array( Event ) );
@@ -63,8 +63,8 @@ function ChatSessionPool ()
/* Play a sound notification for the incoming message.
*/
- if ( external.globals( 'cfg' )( 'soundmessage' ).toString() == 'true' )
- sound_play( external.globals( 'cfg' )( 'soundmessagefile' ), false );
+ if ( external.globals( 'cfg' ).Item( 'soundmessage' ).toString() == 'true' )
+ sound_play( external.globals( 'cfg' ).Item( 'soundmessagefile' ), false );
}
}
@@ -74,16 +74,16 @@ function ChatSessionPool ()
/* Replay last messages
*/
- if ( external.globals( 'cfg' )( 'history_store' ).toString() == 'true' )
+ if ( external.globals( 'cfg' ).Item( 'history_store' ).toString() == 'true' )
{
var Buffer = new Array();
var Filename = ( new MD5() ).digest( ShortAddress );
var Limit = 10;
var Messages = new Array();
- var Path = external.globals( 'usersdir' ) + 'Profiles\\' + external.globals( 'cfg' )( 'username' ) + '@' + external.globals( 'cfg' )( 'server' ) + '\\';
+ var Path = external.globals( 'usersdir' ) + 'Profiles\\' + external.globals( 'cfg' ).Item( 'username' ) + '@' + external.globals( 'cfg' ).Item( 'server' ) + '\\';
if ( this.Events.Exists( ShortAddress ) )
- Limit += this.Events( ShortAddress ).length;
+ Limit += this.Events.Item( ShortAddress ).length;
/* Load last messages from cache
*/
@@ -143,7 +143,7 @@ function ChatSessionPool ()
/* Do not show queued messages in the history
*/
if ( this.Events.Exists( ShortAddress ) )
- Limit = Buffer.length - this.Events( ShortAddress ).length;
+ Limit = Buffer.length - this.Events.Item( ShortAddress ).length;
while ( Buffer.length > Limit )
Buffer.pop();
@@ -163,7 +163,7 @@ function ChatSessionPool ()
Message.Time = new Date( Buffer[i].substr( 0, 4 ), Buffer[i].substr( 4, 2 ) - 1, Buffer[i].substr( 6, 2 ), Buffer[i].substr( 9, 2 ), Buffer[i].substr( 12, 2 ), Buffer[i].substr( 15, 2 ) );
if ( Buffer[i].substr( 18, 3 ) == 'out' )
{
- Message.From = external.globals( 'cfg' )( 'username' ) + '@' + external.globals( 'cfg' )( 'server' );
+ Message.From = external.globals( 'cfg' ).Item( 'username' ) + '@' + external.globals( 'cfg' ).Item( 'server' );
Message.Body = unescape( Buffer[i].substr( 22 ) );
}
else
@@ -196,18 +196,18 @@ function ChatSessionPool ()
{
/* Temporarily disable sound notification
*/
- var PlaySounds = external.globals( 'cfg' )( 'soundmessage' );
- external.globals( 'cfg' )( 'soundmessage' ) = false;
+ var PlaySounds = external.globals( 'cfg' ).Item( 'soundmessage' );
+ external.globals( 'cfg' ).Item( 'soundmessage' ) = false;
/* Dispatch the messages
*/
- for ( var i = 0; i < this.Events( ShortAddress ).length; ++i )
- Tracker.DispatchEvent( this.Events( ShortAddress )[i] );
+ for ( var i = 0; i < this.Events.Item( ShortAddress ).length; ++i )
+ Tracker.DispatchEvent( this.Events.Item( ShortAddress )[i] );
this.Events.Remove( ShortAddress );
/* Reset the sound notification
*/
- external.globals( 'cfg' )( 'soundmessage' ) = PlaySounds;
+ external.globals( 'cfg' ).Item( 'soundmessage' ) = PlaySounds;
}
/* Remove the tracker address from the undo-close tab list
@@ -223,7 +223,7 @@ function ChatSessionPool ()
function GetTracker ( Address )
{
var ShortAddress = Address.ShortAddress();
- return this.Trackers.Exists( ShortAddress ) ? this.Trackers( ShortAddress ) : null;
+ return this.Trackers.Exists( ShortAddress ) ? this.Trackers.Item( ShortAddress ) : null;
}
function DeleteTracker ( Tracker )
@@ -262,7 +262,7 @@ function ChatSessionPool ()
setIcon( external.globals( 'cwd' ) + '..\\images\\chat-container\\bubble.ico' );
MinWidth = 180;
MinHeight = 210;
- setAOT( external.globals( 'cfg' )( 'aotchat' ).toString() == 'true' );
+ setAOT( external.globals( 'cfg' ).Item( 'aotchat' ).toString() == 'true' );
}
}
}
@@ -31,7 +31,7 @@ function ClientBrowseServer ()
for ( var i = 0; i < Identities.length; ++i )
{
if ( Identities.item(i).getAttribute( 'name' ) )
- this.Services( jid ).Name = Identities.item(i).getAttribute( 'name' );
+ this.Services.Item( jid ).Name = Identities.item(i).getAttribute( 'name' );
var IDCategory = Identities.item(i).getAttribute( 'category' );
var IDType = Identities.item(i).getAttribute( 'type' );
@@ -40,32 +40,32 @@ function ClientBrowseServer ()
{
switch ( IDType )
{
- case 'aim': this.Services( jid ).Options |= 0x0001 | 0x0008; break;
- case 'tlen': this.Services( jid ).Options |= 0x0001 | 0x8000; break;
- case 'x-tlen': this.Services( jid ).Options |= 0x0001 | 0x8000; break;
- case 'gadu-gadu': this.Services( jid ).Options |= 0x0001 | 0x0800; break;
- case 'icq': this.Services( jid ).Options |= 0x0001 | 0x0004; break;
- case 'msn': this.Services( jid ).Options |= 0x0001 | 0x0002; break;
- case 'sms': this.Services( jid ).Options |= 0x0001 | 0x2000; break;
- case 'smtp': this.Services( jid ).Options |= 0x0001 | 0x1008; break;
- case 'yahoo': this.Services( jid ).Options |= 0x0001 | 0x0010; break;
- default: this.Services( jid ).Options |= 0x0001;
+ case 'aim': this.Services.Item( jid ).Options |= 0x0001 | 0x0008; break;
+ case 'tlen': this.Services.Item( jid ).Options |= 0x0001 | 0x8000; break;
+ case 'x-tlen': this.Services.Item( jid ).Options |= 0x0001 | 0x8000; break;
+ case 'gadu-gadu': this.Services.Item( jid ).Options |= 0x0001 | 0x0800; break;
+ case 'icq': this.Services.Item( jid ).Options |= 0x0001 | 0x0004; break;
+ case 'msn': this.Services.Item( jid ).Options |= 0x0001 | 0x0002; break;
+ case 'sms': this.Services.Item( jid ).Options |= 0x0001 | 0x2000; break;
+ case 'smtp': this.Services.Item( jid ).Options |= 0x0001 | 0x1008; break;
+ case 'yahoo': this.Services.Item( jid ).Options |= 0x0001 | 0x0010; break;
+ default: this.Services.Item( jid ).Options |= 0x0001;
}
}
else if ( IDCategory == 'conference' )
{
- this.Services( jid ).Options |= 0x0020;
+ this.Services.Item( jid ).Options |= 0x0020;
if ( IDType == 'text' )
- this.Services( jid ).Options |= 0x0040 | 0x0080;
+ this.Services.Item( jid ).Options |= 0x0040 | 0x0080;
}
}
if ( iq.XMLDOM.selectSingleNode( '/iq/*[@xmlns="http://jabber.org/protocol/disco#info"]/feature[@var="jabber:iq:search"]' ) )
- this.Services( jid ).Options |= 0x0100;
+ this.Services.Item( jid ).Options |= 0x0100;
if ( iq.XMLDOM.selectSingleNode( '/iq/*[@xmlns="http://jabber.org/protocol/disco#info"]/feature[@var="jabber:iq:register"]' ) )
- this.Services( jid ).Options |= 0x0200;
+ this.Services.Item( jid ).Options |= 0x0200;
}
/* Parse the XML with jabber:iq:agents
@@ -82,7 +82,7 @@ function ClientBrowseServer ()
var jid = item.getAttribute( 'jid' ).toLowerCase();
if ( ! this.Services.Exists( jid ) )
this.Services.Add( jid, new ClientBrowseService( jid ) );
- with ( this.Services( jid ) )
+ with ( this.Services.Item( jid ) )
{
if ( item.selectSingleNode( 'name' ) )
Name = item.selectSingleNode( 'name' ).text;
@@ -137,7 +137,7 @@ function ClientBrowseServer ()
var jid = item.getAttribute( 'jid' ).toLowerCase();
if ( ! this.Services.Exists( jid ) )
this.Services.Add( jid, new ClientBrowseService( jid ) );
- with ( this.Services( jid ) )
+ with ( this.Services.Item( jid ) )
{
if ( item.getAttribute( 'name' ) )
Name = item.getAttribute( 'name' );
@@ -180,19 +180,19 @@ function ClientBrowseServer ()
var jid = fulljid.toLowerCase();
if ( jid.indexOf( '/' ) != -1 )
jid = jid.substr( 0, jid.indexOf( '/' ) );
- if ( this.Services.Exists( jid ) && this.Services( jid ).Options & 0x001 )
+ if ( this.Services.Exists( jid ) && this.Services.Item( jid ).Options & 0x001 )
{
var subscription = contact.getAttribute( 'subscription' );
if ( subscription == 'remove' )
{
- this.Services( jid ).TransportMode = 0;
- this.Services( jid ).TransportRosterJID = '';
+ this.Services.Item( jid ).TransportMode = 0;
+ this.Services.Item( jid ).TransportRosterJID = '';
}
else
{
- this.Services( jid ).TransportRosterJID = fulljid;
- if ( this.Services( jid ).TransportMode == 0 && ( subscription == 'from' || subscription == 'both' ) )
- this.Services( jid ).TransportMode = -1;
+ this.Services.Item( jid ).TransportRosterJID = fulljid;
+ if ( this.Services.Item( jid ).TransportMode == 0 && ( subscription == 'from' || subscription == 'both' ) )
+ this.Services.Item( jid ).TransportMode = -1;
}
if ( external.windows.Exists( 'transport_list' ) )
external.windows( 'transport_list' ).Do( 'transport_refresh', jid );
@@ -206,13 +206,13 @@ function ClientBrowseServer ()
var jid = presence.FromAddress.ShortAddress();
if ( ! this.Services.Exists( jid ) )
this.Services.Add( jid, new ClientBrowseService( jid ) );
- this.Services( jid ).Options |= 0x001;
+ this.Services.Item( jid ).Options |= 0x001;
if ( presence.Type == 'error' )
- this.Services( jid ).TransportMode = -1;
+ this.Services.Item( jid ).TransportMode = -1;
else if ( presence.Type == 'unavailable' )
- this.Services( jid ).TransportMode = 0;
+ this.Services.Item( jid ).TransportMode = 0;
else
- this.Services( jid ).TransportMode = 1;
+ this.Services.Item( jid ).TransportMode = 1;
if ( external.windows.Exists( 'transport_list' ) )
external.windows( 'transport_list' ).Do( 'transport_refresh', jid );
}
@@ -233,8 +233,8 @@ function ClientBrowseServer ()
var retval = new Array();
var jids = ( new VBArray( this.Services.Keys() ) ).toArray();
for ( var i = 0; i < jids.length; ++i )
- if ( ( this.Services( jids[i] ).Options & match ) == match )
- retval.push( this.Services( jids[i] ) );
+ if ( ( this.Services.Item( jids[i] ).Options & match ) == match )
+ retval.push( this.Services.Item( jids[i] ) );
return retval;
}
@@ -245,7 +245,7 @@ function ClientBrowseServer ()
if ( ! this.Services.Exists( jid ) )
{
this.Services.Add( jid, new ClientBrowseService( jid ) );
- this.Services( jid ).Options = options;
+ this.Services.Item( jid ).Options = options;
if ( ( options & 0x0001 ) && external.windows.Exists( 'transport_list' ) )
external.windows( 'transport_list' ).Do( 'transport_refresh', null );
}
@@ -103,7 +103,7 @@ function ClientPluginTab ( plugin )
var names = ( new VBArray( this.PluginCore.Container.Plugins.Keys() ) ).toArray();
for ( var i = 0; i < names.length; ++i )
{
- var tab = this.PluginCore.Container.Plugins( names[i] ).ClientPluginTab;
+ var tab = this.PluginCore.Container.Plugins.Item( names[i] ).ClientPluginTab;
if ( tab && tab.IsActive )
{
tab.IsActive = false;
@@ -266,7 +266,7 @@ function ClientPluginContainer ()
else if ( file && file.text.length > 0 && file.text.length < 216 && file.text.search( /\\\/\:\*\?\"\<\>\|/ ) == -1 )
pluginevent.File = file.text;
- plugin.Events( getAttribute( 'for' ) ).push( pluginevent );
+ plugin.Events.Item( getAttribute( 'for' ) ).push( pluginevent );
}
if ( ! plugin.Events.Count )
return warn( 'Plug-in contains no events\n' + path );
@@ -288,7 +288,7 @@ function ClientPluginContainer ()
data.Value = option.selectSingleNode( 'value' ).text;
if ( option.getAttribute( 'onlineonly' ) == 'yes' )
data.OnlineOnly = true;
- plugin.Menus( menuname ).push( data );
+ plugin.Menus.Item( menuname ).push( data );
}
}
@@ -379,19 +379,19 @@ function ClientPluginContainer ()
context.Add( 'plugin', name );
this.DispatchEvent( context );
- if ( this.Plugins( name ).ClientPluginTab )
+ if ( this.Plugins.Item( name ).ClientPluginTab )
{
- if ( this.Plugins( name ).ClientPluginTab.IsActive )
- this.Plugins( '/roster' ).ClientPluginTab.Activate();
- this.Plugins( name ).ClientPluginTab.HTMLArea.removeNode( true );
- this.Plugins( name ).ClientPluginTab.HTMLButton.removeNode( true );
+ if ( this.Plugins.Item( name ).ClientPluginTab.IsActive )
+ this.Plugins.Item( '/roster' ).ClientPluginTab.Activate();
+ this.Plugins.Item( name ).ClientPluginTab.HTMLArea.removeNode( true );
+ this.Plugins.Item( name ).ClientPluginTab.HTMLButton.removeNode( true );
document.getElementById( 'tab-bar-row' ).style.display = this.HTMLTabBar.children.length > 1 ? 'block' : 'none';
}
try
{
- if ( external.Directory.Exists( this.Plugins( name ).Path ) )
- external.Directory.Delete( this.Plugins( name ).Path );
+ if ( external.Directory.Exists( this.Plugins.Item( name ).Path ) )
+ external.Directory.Delete( this.Plugins.Item( name ).Path );
if ( external.FileExists( external.globals( 'usersdir' ) + 'Plugins\\' + name ) )
external.File( external.globals( 'usersdir' ) + 'Plugins\\' + name ).Delete();
@@ -432,34 +432,34 @@ function ClientPluginContainer ()
*/
function DispatchEvent ( context )
{
- if ( ! context.Exists( 'name' ) || context( 'name' ).length == 0 )
+ if ( ! context.Exists( 'name' ) || context.Item( 'name' ).length == 0 )
return false;
var names = ( new VBArray( this.Plugins.Keys() ) ).toArray();
for ( var i = 0; i < names.length; ++i )
- if ( this.Plugins( names[i] ).Events.Exists( context( 'name' ) ) )
+ if ( this.Plugins.Item( names[i] ).Events.Exists( context.Item( 'name' ) ) )
{
- if ( context.Exists( 'plugin' ) && context( 'plugin' ) != names[i] )
+ if ( context.Exists( 'plugin' ) && context.Item( 'plugin' ) != names[i] )
continue;
- var handlers = this.Plugins( names[i] ).Events( context( 'name' ) );
+ var handlers = this.Plugins.Item( names[i] ).Events.Item( context.Item( 'name' ) );
for ( var j = 0; j < handlers.length; ++j )
{
- if ( handlers[j].XPath && ! ( context.Exists( 'xmldom' ) && context( 'xmldom' ).selectSingleNode( handlers[j].XPath ) ) )
+ if ( handlers[j].XPath && ! ( context.Exists( 'xmldom' ) && context.Item( 'xmldom' ).selectSingleNode( handlers[j].XPath ) ) )
continue;
with ( handlers[j] )
{
- if ( this.Plugins( names[i] ).Type == 'tab-iframe' )
+ if ( this.Plugins.Item( names[i] ).Type == 'tab-iframe' )
{
if ( typeof URL == 'string' )
- this.Plugins( names[i] ).ClientPluginTab.HTMLArea.src = this.ParseURL( URL );
+ this.Plugins.Item( names[i] ).ClientPluginTab.HTMLArea.src = this.ParseURL( URL );
else if ( typeof File == 'string' )
- this.Plugins( names[i] ).ClientPluginTab.HTMLArea.src = this.Plugins( names[i] ).Path + File;
+ this.Plugins.Item( names[i] ).ClientPluginTab.HTMLArea.src = this.Plugins.Item( names[i] ).Path + File;
}
if ( typeof JScript == 'function' )
{
- if ( JScript.call( this.Plugins( names[i] ), context ) )
+ if ( JScript.call( this.Plugins.Item( names[i] ), context ) )
return true;
}
}
@@ -480,15 +480,15 @@ function ClientPluginContainer ()
var substitutes = {
'softwarename': function () { return encodeURIComponent( external.globals( 'softwarename' ) ) },
'softwareversion': function () { return encodeURIComponent( external.globals( 'softwareversion' ) ) },
- 'username': function () { return encodeURIComponent( external.globals( 'cfg' )( 'username' ) ) },
- 'server': function () { return encodeURIComponent( external.globals( 'cfg' )( 'server' ) ) },
- 'resource': function () { return encodeURIComponent( external.globals( 'cfg' )( 'resource' ) ) },
- 'password': function () { return encodeURIComponent( external.globals( 'cfg' )( 'password' ) ) },
+ 'username': function () { return encodeURIComponent( external.globals( 'cfg' ).Item( 'username' ) ) },
+ 'server': function () { return encodeURIComponent( external.globals( 'cfg' ).Item( 'server' ) ) },
+ 'resource': function () { return encodeURIComponent( external.globals( 'cfg' ).Item( 'resource' ) ) },
+ 'password': function () { return encodeURIComponent( external.globals( 'cfg' ).Item( 'password' ) ) },
'random': function () { return encodeURIComponent( random ) },
- 'username-sha1': function () { return external.StringToSHA1( random + external.globals( 'cfg' )( 'username' ) ) },
- 'server-sha1': function () { return external.StringToSHA1( random + external.globals( 'cfg' )( 'server' ) ) },
- 'resource-sha1': function () { return external.StringToSHA1( random + external.globals( 'cfg' )( 'resource' ) ) },
- 'password-sha1': function () { return external.StringToSHA1( random + external.globals( 'cfg' )( 'password' ) ) }
+ 'username-sha1': function () { return external.StringToSHA1( random + external.globals( 'cfg' ).Item( 'username' ) ) },
+ 'server-sha1': function () { return external.StringToSHA1( random + external.globals( 'cfg' ).Item( 'server' ) ) },
+ 'resource-sha1': function () { return external.StringToSHA1( random + external.globals( 'cfg' ).Item( 'resource' ) ) },
+ 'password-sha1': function () { return external.StringToSHA1( random + external.globals( 'cfg' ).Item( 'password' ) ) }
};
return url.replace(
/\${([^}]+)}/g,
Oops, something went wrong.

0 comments on commit 0084278

Please sign in to comment.