Archive for April, 2008
Microsoft is going to disable WebDav access to Hotmail
Weird characters in the previous post
WebView woes
- (unsigned)webView:(WebView *)sender dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo {
NSPasteboard* pb = [draggingInfo draggingPasteboard];
if([pb availableTypeFromArray: [NSArray arrayWithObject: NSFilenamesPboardType]]) {
// @TODO: this code assumes that any file dragged in is an image! Bad things will probably happen if they aren’t
NSArray* filenames = [pb propertyListForType: NSFilenamesPboardType];
NSMutableString* html = [NSMutableString string];
for(NSString* filename in filenames) {
[html appendFormat: @"<img src=\"%@\"/>", [[[NSURL alloc] initFileURLWithPath: filename] absoluteString]];
}
[pb declareTypes: [NSArray arrayWithObject: NSHTMLPboardType] owner: self];
[pb setString: html forType: NSHTMLPboardType];
}
return WebDragDestinationActionAny;
}
Dreamhost