add "Send This Link..." contextual menu item. b=227803 r=joshmoz sr=pinkerton

This commit is contained in:
joshmoz%gmail.com 2005-03-06 01:33:21 +00:00
Родитель 2d760f8a14
Коммит fd8473ff70
5 изменённых файлов: 35 добавлений и 3 удалений

Просмотреть файл

@ -140,6 +140,7 @@
saveLinkAs = id; saveLinkAs = id;
savePageAs = id; savePageAs = id;
sendURL = id; sendURL = id;
sendURLFromLink = id;
smallerTextSize = id; smallerTextSize = id;
stop = id; stop = id;
toggleBookmarkManager = id; toggleBookmarkManager = id;

Просмотреть файл

@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>215 376 538 485 0 0 1600 1002 </string> <string>56 16 538 485 0 0 1280 832 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>1014</key> <key>1014</key>
@ -15,9 +15,9 @@
<key>314</key> <key>314</key>
<string>55 435 213 150 0 0 1280 832 </string> <string>55 435 213 150 0 0 1280 832 </string>
<key>336</key> <key>336</key>
<string>698 803 213 187 0 0 1600 1002 </string> <string>122 534 213 206 0 0 1280 832 </string>
<key>365</key> <key>365</key>
<string>97 563 93 162 0 0 1280 832 </string> <string>97 563 93 168 0 0 1280 832 </string>
<key>463</key> <key>463</key>
<string>268 375 213 264 0 0 1280 832 </string> <string>268 375 213 264 0 0 1280 832 </string>
<key>56</key> <key>56</key>
@ -37,6 +37,10 @@
<integer>910</integer> <integer>910</integer>
<integer>889</integer> <integer>889</integer>
</array> </array>
<key>IBOpenObjects</key>
<array>
<integer>336</integer>
</array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>7U16</string> <string>7U16</string>
</dict> </dict>

Двоичные данные
camino/resources/localized/English.lproj/BrowserWindow.nib/keyedobjects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -232,6 +232,7 @@ typedef enum
- (IBAction)pageSetup:(id)aSender; - (IBAction)pageSetup:(id)aSender;
- (IBAction)performSearch:(id)aSender; - (IBAction)performSearch:(id)aSender;
- (IBAction)sendURL:(id)aSender; - (IBAction)sendURL:(id)aSender;
- (IBAction)sendURLFromLink:(id)aSender;
- (void)startThrobber; - (void)startThrobber;
- (void)stopThrobber; - (void)stopThrobber;

Просмотреть файл

@ -1728,6 +1728,32 @@ enum BWCOpenDest {
CFRelease(escapedTitle); CFRelease(escapedTitle);
} }
- (IBAction)sendURLFromLink:(id)aSender
{
nsCOMPtr<nsIDOMElement> linkContent;
nsAutoString href;
GeckoUtils::GetEnclosingLinkElementAndHref(mContextMenuNode, getter_AddRefs(linkContent), href);
// XXXdwh Handle simple XLINKs if we want to be compatible with Mozilla, but who
// really uses these anyway? :)
if (!linkContent || href.IsEmpty())
return;
NSString* urlString = [NSString stringWith_nsAString: href];
// we need to encode entities in the title and url strings first. For some reason
// CFURLCreateStringByAddingPercentEscapes is only happy with UTF-8 strings.
CFStringRef urlUTF8String = CFStringCreateWithCString(kCFAllocatorDefault, [urlString UTF8String], kCFStringEncodingUTF8);
CFStringRef escapedURL = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, urlUTF8String, NULL, CFSTR("&?="), kCFStringEncodingUTF8);
NSString* mailtoURLString = [NSString stringWithFormat:@"mailto:?body=%@", (NSString*)escapedURL];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:mailtoURLString]];
CFRelease(urlUTF8String);
CFRelease(escapedURL);
}
- (NSToolbarItem*)throbberItem - (NSToolbarItem*)throbberItem
{ {
// find our throbber toolbar item. // find our throbber toolbar item.