diff --git a/native/v8_extensions/native.js b/native/v8_extensions/native.js index f2132d8e8..08ac1f065 100644 --- a/native/v8_extensions/native.js +++ b/native/v8_extensions/native.js @@ -4,9 +4,6 @@ var $native = {}; native function exists(path); $native.exists = exists; - native function alert(message, detailedMessage, buttonNamesAndCallbacks); - $native.alert = alert; - native function read(path); $native.read = read; diff --git a/native/v8_extensions/native.mm b/native/v8_extensions/native.mm index 3c880e646..2080d9499 100644 --- a/native/v8_extensions/native.mm +++ b/native/v8_extensions/native.mm @@ -162,42 +162,6 @@ bool Native::Execute(const CefString& name, else if (name == "asyncList") { return false; } - else if (name == "alert") { - NSString *message = stringFromCefV8Value(arguments[0]); - NSString *detailedMessage = stringFromCefV8Value(arguments[1]); - - CefRefPtr buttonNamesAndCallbacks; - if (arguments.size() < 3) { - buttonNamesAndCallbacks = CefV8Value::CreateArray(0); - } - else { - buttonNamesAndCallbacks = arguments[2]; - } - - NSAlert *alert = [[[NSAlert alloc] init] autorelease]; - [alert setMessageText:message]; - [alert setInformativeText:detailedMessage]; - - for (int i = 0; i < buttonNamesAndCallbacks->GetArrayLength(); i++) { - std::string title = buttonNamesAndCallbacks->GetValue(i)->GetValue(0)->GetStringValue().ToString(); - NSString *buttonTitle = [NSString stringWithUTF8String:title.c_str()]; - NSButton *button = [alert addButtonWithTitle:buttonTitle]; - [button setTag:i]; - } - - NSUInteger buttonTag = [alert runModal]; - - if (buttonNamesAndCallbacks->GetArrayLength() == 0) { // No button title if there were no buttons specified. - return true; - } - - CefRefPtr callback = buttonNamesAndCallbacks->GetValue(buttonTag)->GetValue(1); - CefV8ValueList args; - callback->SetRethrowExceptions(true); - callback->ExecuteFunction(callback, args); - - return true; - } else if (name == "writeToPasteboard") { NSString *text = stringFromCefV8Value(arguments[0]); diff --git a/src/stdlib/native.coffee b/src/stdlib/native.coffee index e468e4026..e35b7b1b3 100644 --- a/src/stdlib/native.coffee +++ b/src/stdlib/native.coffee @@ -1,7 +1,5 @@ module.exports = class Native - @alert: (args...) -> $native.alert(args...) - @saveDialog: (args...) -> $native.saveDialog(args...) @reload: -> $native.reload()