Skip to content

Instantly share code, notes, and snippets.

View tolmasky's full-sized avatar

Francisco Ryan Tolmasky I tolmasky

View GitHub Profile
#!/usr/bin/env ruby
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'rubygems'
require 'sinatra'
set :app_file, __FILE__
require 'socratic'
@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";
+ (void)initialize
{
if (self == MyClass)
return;
unsigned int count;
objc_property_t * properties = class_copyPropertyList(self, &count);
while (count--)
{
//this is the view i use to show the selection:
_toolbarSelection = [[CPImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 57.0)];
[_toolbarSelection setImage:MediaWindowControllerToolbarSelectionImage];
[_toolbarSelection setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin];
// Here comes the hack:
[myWindow._toolbarView addSubview:_toolbarSelection];
- (void)close
{
var count=[_windowControllers count];
while(count--)
[[_windowControllers objectAtIndex:count] close];
[[CPDocumentController sharedDocumentController] removeDocument:self];
}
- (void)close
{
var count=[_windowControllers count];
while(count--)
[[_windowControllers objectAtIndex:count] close];
[[CPDocumentController sharedDocumentController] removeDocument:self];
}
- (void)setRepresentedObject:(JSObject)anObject
{
[self registerForDraggedTypes:[v]];
//...
}
- (void)performDragOperation:(x)x
{
alert("yes!");
}
- (CPWindow)window
{
if (!_window)
{
[self windowWillLoad];
[_document windowControllerWillLoadCib:self];
[self loadWindow];
org.mozilla.javascript.EcmaError: TypeError: Cannot read property "null" from undefined
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3659)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3637)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3665)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3684)
at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3697)
at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1371)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1415)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:845)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
[do it];