Changeset 3449
- Timestamp:
- 12/10/06 02:44:18 (2 years ago)
- Files:
-
- trunk/Plug-Ins/JavaScript Support/JVJavaScriptChatPlugin.m (modified) (3 diffs)
- trunk/Plug-Ins/JavaScript Support/plugin.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Plug-Ins/JavaScript Support/JVJavaScriptChatPlugin.m
r3448 r3449 106 106 } 107 107 108 - (void) release { 109 if( ( [self retainCount] - 1 ) == 1 ) 110 [[_webview windowScriptObject] removeWebScriptKey:@"Plugin"]; 111 [super release]; 112 } 113 108 114 - (void) dealloc { 109 115 [[NSNotificationCenter defaultCenter] removeObserver:self]; … … 245 251 246 252 - (void) setupScriptGlobalsForWebView:(WebView *) webView { 253 [[webView windowScriptObject] setValue:self forKey:@"Plugin"]; 247 254 [[webView windowScriptObject] setValue:[JVChatController defaultController] forKey:@"ChatController"]; 248 255 [[webView windowScriptObject] setValue:[MVConnectionsController defaultController] forKey:@"ConnectionsController"]; … … 252 259 [[webView windowScriptObject] setValue:[JVNotificationController defaultController] forKey:@"NotificationController"]; 253 260 [[webView windowScriptObject] setValue:[MVChatPluginManager defaultManager] forKey:@"ChatPluginManager"]; 261 } 262 263 #pragma mark - 264 265 - (id) allocInstance:(NSString *) class { 266 return [NSClassFromString(class) allocWithZone:nil]; 254 267 } 255 268 trunk/Plug-Ins/JavaScript Support/plugin.html
r3446 r3449 3 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 4 <head> 5 <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 6 <script> 7 function JVMutableChatMessage(text, sender) { 8 var obj = Plugin.allocInstance('JVMutableChatMessage'); 9 return obj.initWithText(text, sender); 10 } 11 </script> 6 12 </head> 7 13 <body></body>
