Skip to content

Instantly share code, notes, and snippets.

View toddfreese's full-sized avatar

Todd Freese toddfreese

View GitHub Profile
uploadButton = [[CPButton alloc] initWithFrame:CGRectMake(490 + folderWidth, 13, 120, 24)];
[uploadButton setTitle:@"Asset Upload"];
[uploadButton setTarget:self];
[uploadButton setAction:@selector(upload:)];
[bottomButtonView addSubview:uploadButton];
if (typeof navigator !== "undefined") {
if ((/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)))
isFirefox = true;
isWinSafari = navigator.userAgent.indexOf("Windows") > 0 && navigator.userAgent.indexOf("AppleWebKit") > 0;
}
@import <AppKit/CPPanel.j>
/*
DCFileDropControllerDropDelegate protocol
- (void)fileDropUploadController:(DCFileDropController)theController setState:(BOOL)visible;
*/
var DCFileDropableTargets = [ ],
@implementation SearchCloseCell : CPView
{
CPDictionary viewStyleDict @accessors;
CPString presentationMode @accessors;
CPString company @accessors;
CPButton closeButton;
CPImage icon;
CPImage icon2;
}
ivar_getTypeEncoding.displayName = "ivar_getTypeEncoding";
objj_msgSend = function( aReceiver, aSelector)
{
if (aReceiver == nil)
return nil;
var isa = aReceiver.isa;
if (!((((isa.info & (CLS_META))) ? isa : isa.isa).info & (CLS_INITIALIZED))) _class_initialize(isa); var method = isa.method_dtable[aSelector]; var implementation = method ? method.method_imp : _objj_forward;;
switch(arguments.length)
{
{
var origin = _frame.origin;
if (!aPoint || (origin.x == aPoint.x && origin.y == aPoint.y))
return;
origin.x = aPoint.x;
origin.y = aPoint.y;
if (_postsFrameChangedNotifications && !_inhibitFrameAndBoundsChangedNotifications)
objj_msgSend(CachedNotificationCenter, "postNotificationName:object:", CPViewFrameDidChangeNotification, self);
var transform = _superview ? _superview._boundsTransform : NULL;
if (transform) var ____p = { x:CGPointMake(origin.x, origin.y).x * transform.a + CGPointMake(origin.x, origin.y).y * transform.c + transform.tx, y:CGPointMake(origin.x, origin.y).x * transform.b + CGPointMake(origin.x, origin.y).y * transform.d + transform.ty }; else var ____p = { x:origin.x, y:origin.y }; _DOMElement.style.left = ROUND(____p.x) + "px";_DOMElement.style.top = ROUND(____p.y) + "px";;
if (_postsFrameChangedNotifications && !_inhibitFrameAndBoundsChangedNotifications)
objj_msgSend(CachedNotificationCenter, "postNotificationName:object:", CPViewFrameDidChangeNotification, self);
var transform = _superview ? _superview._boundsTransform : NULL;
if (transform) var ____p = { x:CGPointMake(origin.x, origin.y).x * transform.a + CGPointMake(origin.x, origin.y).y * transform.c + transform.tx, y:CGPointMake(origin.x, origin.y).x * transform.b + CGPointMake(origin.x, origin.y).y * transform.d + transform.ty }; else var ____p = { x:origin.x, y:origin.y }; _DOMElement.style.left = ROUND(____p.x) + "px";_DOMElement.style.top = ROUND(____p.y) + "px";;
}
IE is giving an SCRIPT87: Invalid argument.
anonymous code (107), line 376 character 360
@toddfreese
toddfreese / gist:1513053
Created December 23, 2011 03:37
CPOutlineView dataView
@implementation FolderListCell : CPView
{
CPString folderNameText;
CPImage icon;
CPImageView iconView;
CPTextField label;
BOOL isSelected;
JSObject folderObject;
}
/*
* AppController.j
* Testing
*
* Created by You on April 21, 2011.
* Copyright 2011, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
backgroundImageView = [[CPImageView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([splashContentView bounds]), CGRectGetHeight([splashContentView bounds]))];
[backgroundImageView setImageScaling:CPScaleNone];
[backgroundImageView setHasShadow:NO];
[backgroundImageView setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
[splashContentView addSubview:backgroundImageView];