Posted By

iloveitaly on 07/12/09


Tagged

javascript js confirm window cocoa panel webview


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

davidsi
illogic


Custom Cocoa WebView JavaScript Confirm Window


 / Published in: Objective C
 

URL: http://github.com/marshall/titanium/blob/292086a450efae607c9c5e54db03b2bcb94252b4/runtime/webkit_shell/osx_new/src/TIBrowserWindowController.m

  1. - (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {
  2. NSInteger result = NSRunInformationalAlertPanel(NSLocalizedString(@"JavaScript", @""), // title
  3. message, // message
  4. NSLocalizedString(@"OK", @""), // default button
  5. NSLocalizedString(@"Cancel", @""), // alt button
  6. nil);
  7. return NSAlertDefaultReturn == result;
  8. }

Report this snippet  

You need to login to post a comment.