Skip to content

Instantly share code, notes, and snippets.

@toddfreese
Created January 30, 2012 21:58
Show Gist options
  • Select an option

  • Save toddfreese/1707050 to your computer and use it in GitHub Desktop.

Select an option

Save toddfreese/1707050 to your computer and use it in GitHub Desktop.
@import <AppKit/CPPanel.j>
/*
DCFileDropControllerDropDelegate protocol
- (void)fileDropUploadController:(DCFileDropController)theController setState:(BOOL)visible;
*/
var DCFileDropableTargets = [ ],
generalDropBlockerFunction = function(anEvent)
{
if (![DCFileDropableTargets containsObject:anEvent.toElement])
{
anEvent.dataTransfer.dropEffect = "none";
anEvent.preventDefault();
return NO;
}
else
{
return YES;
}
};
isWinSafari = false;
isFirefox = false;
if ((/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)))
isFirefox = true;
if (typeof navigator !== "undefined")
isWinSafari = navigator.userAgent.indexOf("Windows") > 0 && navigator.userAgent.indexOf("AppleWebKit") > 0;
@implementation DCFileDropController : CPObject
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment