Skip to content

Instantly share code, notes, and snippets.

@tolmasky
Created May 25, 2009 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tolmasky/117444 to your computer and use it in GitHub Desktop.
Save tolmasky/117444 to your computer and use it in GitHub Desktop.
@implementation OpenPanel (WebScripting)
+ (NSString *)webScriptNameForSelector:(SEL)aSelector
{NSLog(@"asdf");
if (aSelector == @selector(beginForDirectory:file:types:callback:))
return @"begin";
if (aSelector == @selector(runModalForDirectory:file:types:))
return @"runModal";
return nil;
}
+ (BOOL)isKeyExcludedFromWebScript:(const char *)name
{NSLog(@"hello");
if (strcmp(name, "filenames") == 0)
return NO;
return [super isKeyExcludedFromWebScript:name];
}
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
{NSLog(@"fasd %@", NSStringFromSelector(aSelector));
if (aSelector == @selector(toString))
return NO;
if (aSelector == @selector(beginForDirectory:file:types:callback:))
return NO;
if (aSelector == @selector(runModalForDirectory:file:types:))
return NO;
if (aSelector == @selector(valueForKey:))
return NO;
return [super isSelectorExcludedFromWebScript:aSelector];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment