-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpinboard.patch
90 lines (90 loc) · 3.23 KB
/
pinboard.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
--- /.orig/usr/palm/applications/com.palm.app.browser/source/ActionBar.js
+++ /usr/palm/applications/com.palm.app.browser/source/ActionBar.js
@@ -24,6 +24,7 @@
onAddBookmark: "",
onAddToLauncher: "",
onShareLink: "",
+ onAddToPinboard: "",
onOpenBookmarks: "",
onNewCard: ""
},
@@ -40,7 +41,8 @@
{name: "sharePopup", className: "launch-popup", kind: "Menu", components: [
{caption: $L("Add Bookmark"), onclick: "doAddBookmark"},
{caption: $L("Share Link"), onclick: "doShareLink"},
- {caption: $L("Add to Launcher"), onclick: "doAddToLauncher"}
+ {caption: $L("Add to Launcher"), onclick: "doAddToLauncher"},
+ {caption: $L("Add to Pinboard.in"), onclick: "doAddToPinboard"}
]},
{name: "progressBar", kind: "ProgressBar", className: "url-progress invisible", animatePosition: false},
],
--- /.orig/usr/palm/applications/com.palm.app.browser/source/Browser.js
+++ /usr/palm/applications/com.palm.app.browser/source/Browser.js
@@ -14,6 +14,7 @@
onAddBookmark: "",
onAddToLauncher: "",
onShareLink: "",
+ onAddToPinboard: "",
onOpenBookmarks: "",
onPrint: "",
onUrlRedirected: "",
@@ -33,6 +34,7 @@
onAddBookmark: "doAddBookmark",
onAddToLauncher: "doAddToLauncher",
onShareLink: "doShareLink",
+ onAddToPinboard: "doAddToPinboard",
onOpenBookmarks: "doOpenBookmarks",
onNewCard: "openNewCard"
},
@@ -317,6 +319,19 @@
};
this.log(params.text);
this.$.launchApplicationService.call({id: "com.palm.app.email", params: params});
+ },
+ addToPinboard: function(inUrl, inTitle) {
+ this.log(inUrl, inTitle);
+ var params = {
+ action: "open",
+ url: 'http://www.pinboard.in/add/?url='+inUrl+'&title='+inTitle,
+ };
+
+ this.log(params.text);
+ this.$.launchApplicationService.call({id: "com.palm.app.browser", params: params});
+ },
+ addLinkToPinboard: function(inTapInfo) {
+ this.addToPinboard(inTapInfo.linkUrl);
},
copyToPhotosClick: function(inTapInfo, inPosition) {
this.viewCall("saveImageAtPoint", [inPosition.left, inPosition.top, "/media/internal",
--- /.orig/usr/palm/applications/com.palm.app.browser/source/BrowserApp.js
+++ /usr/palm/applications/com.palm.app.browser/source/BrowserApp.js
@@ -40,6 +40,7 @@
onAddBookmark: "addBookmark",
onAddToLauncher: "showAddtoLauncherDialog",
onShareLink: "shareClick",
+ onAddToPinboard: "addToPinboard",
onOpenBookmarks: "bookmarksClick",
onPrint: "printClick",
onUrlRedirected: "openResource",
@@ -580,6 +581,9 @@
},
shareClick: function() {
this.$.browser.shareLink(this.url, this.title);
+ },
+ addToPinboard: function() {
+ this.$.browser.addToPinboard(this.url, this.title);
},
bookmarksClick: function() {
this.$.toaster.open();
--- /.orig/usr/palm/applications/com.palm.app.browser/source/BrowserContextMenu.js
+++ /usr/palm/applications/com.palm.app.browser/source/BrowserContextMenu.js
@@ -11,7 +11,8 @@
linkItems: [
{caption: $L("Open In New Card"), value:"newCardClick"},
{caption: $L("Share Link"), value:"shareLinkClick"},
- {caption: $L("Copy URL"), value:"copyLinkClick"}
+ {caption: $L("Copy URL"), value:"copyLinkClick"},
+ {caption: $L("Add To Pinboard.in"), value:"addLinkToPinboard"}
],
imageItems: [
{caption: $L("Copy To Photos"), value: "copyToPhotosClick"},