Permalink
Browse files

Fixing Makefile to build share extension

  • Loading branch information...
1 parent 0789bf0 commit a899e49d47bf8961d5c4f1bbbcbbd55bf86c6943 @PaulKinlan committed Aug 23, 2012
View
@@ -36,12 +36,17 @@ tools/chrome/apps/hosted/picksomeipsum/manifest.json: tools/chrome/apps/hosted/p
tools/chrome/apps/hosted/picksomeipsum.crx: tools/chrome/apps/hosted/picksomeipsum/manifest.json tools/chrome/apps/hosted/picksomeipsum/128.png
./packcrx.sh tools/chrome/apps/hosted/picksomeipsum tools/chrome/key.pem
-extensions: tools/chrome/extensions/share-services/imgur.crx tools/chrome/extensions/share-services/google+.crx tools/chrome/extensions/share-services/twitter.crx tools/chrome/extensions/share-services/blogger.crx tools/chrome/extensions/share-services/tumblr.crx tools/chrome/extensions/share-services/digg.crx tools/chrome/extensions/share-services/linkedin.crx tools/chrome/extensions/share-services/delicious.crx tools/chrome/extensions/share-services/reddit.crx tools/chrome/extensions/share-services/gmail.crx tools/chrome/extensions/share-services/hackernews.crx tools/chrome/extensions/shorten-services/bit.ly.crx tools/chrome/extensions/shorten-services/goo.gl.crx tools/chrome/extensions/save-services/box.crx tools/chrome/extensions/save-services/readitlater.crx tools/chrome/extensions/save-services/instapaper.crx tools/chrome/extensions/pick-services/pickhtml.crx tools/chrome/extensions/pick-services/pickbookmark.crx tools/chrome/extensions/pick-services/pickscreenshot.crx
- ./packcrx.sh tools/chrome/extensions/share tools/chrome/key.pem
+extensions: tools/chrome/extensions/share.crx tools/chrome/extensions/share-services/imgur.crx tools/chrome/extensions/share-services/google+.crx tools/chrome/extensions/share-services/twitter.crx tools/chrome/extensions/share-services/blogger.crx tools/chrome/extensions/share-services/tumblr.crx tools/chrome/extensions/share-services/digg.crx tools/chrome/extensions/share-services/linkedin.crx tools/chrome/extensions/share-services/delicious.crx tools/chrome/extensions/share-services/reddit.crx tools/chrome/extensions/share-services/gmail.crx tools/chrome/extensions/share-services/hackernews.crx tools/chrome/extensions/shorten-services/bit.ly.crx tools/chrome/extensions/shorten-services/goo.gl.crx tools/chrome/extensions/save-services/box.crx tools/chrome/extensions/save-services/readitlater.crx tools/chrome/extensions/save-services/instapaper.crx tools/chrome/extensions/pick-services/pickhtml.crx tools/chrome/extensions/pick-services/pickbookmark.crx tools/chrome/extensions/pick-services/pickscreenshot.crx
./packcrx.sh tools/chrome/extensions/shorten tools/chrome/key.pem
./packcrx.sh tools/chrome/extensions/desktop tools/chrome/key.pem
./packcrx.sh tools/chrome/extensions/edit tools/chrome/key.pem
+tools/chrome/extensions/share/manifest.json: tools/chrome/extensions/share-manifest.json
+ cat ./tools/chrome/extensions/share-manifest.json | sed 's|"version":.*|"version": "$(NOW)",|' > ./tools/chrome/extensions/share/manifest.json
+
+tools/chrome/extensions/share.crx: tools/chrome/extensions/share/manifest.json tools/chrome/extensions/share/background.js
+ ./packcrx.sh tools/chrome/extensions/share tools/chrome/key.pem
+
tools/chrome/extensions/share-services/imgur/manifest.json: tools/chrome/extensions/share-services/imgur-manifest.json
cat ./tools/chrome/extensions/share-services/imgur-manifest.json | sed 's|"version":.*|"version": "$(NOW)",|' > ./tools/chrome/extensions/share-services/imgur/manifest.json
@@ -0,0 +1,25 @@
+{
+ "name": "Share",
+ "description" : "Share images, and links",
+ "manifest_version": 2,
+ "permissions": [
+ "contextMenus"
+ ],
+ "icons": {
+ "16": "openshareicon-16x16.png",
+ "48": "openshareicon-48x48.png",
+ "128": "openshareicon-128x128.png"
+ },
+ "browser_action": {
+ "default_icon": "openshareicon-16x16.png",
+ "default_title": "Share this page"
+ },
+ "permissions" : [
+ "contextMenus"
+ ],
+ "version": "0.0.0.4",
+ "minimum_chrome_version": "23.0.0.0",
+ "background": {
+ "scripts": ["background.js"]
+ }
+}
@@ -17,7 +17,7 @@
"permissions" : [
"contextMenus"
],
- "version": "0.0.0.3",
+ "version": "0.0.0.4",
"minimum_chrome_version": "23.0.0.0",
"background": {
"scripts": ["background.js"]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
+function clickHandler(info, tab) {
+ if(info.mediaType == "image" ||
+ info.mediaType == "video" ||
+ info.mediaType == "audio") {
+ var i = new WebKitIntent({"action": "http://webintents.org/save", "type": info.mediaType + "/*", "data": info.srcUrl});
+ window.navigator.webkitStartActivity(i);
+ }
+ else if(!!info.linkUrl) {
+ var i = new WebKitIntent({"action": "http://webintents.org/save", "type": "text/uri-list", "data": info.linkUrl });
+ window.navigator.webkitStartActivity(i, function() {}, function() {});
+ }
+};
+
+chrome.browserAction.onClicked.addListener(function(tab) {
+ clickHandler({linkUrl: tab.url}, tab);
+});
+
+chrome.contextMenus.create({
+ "title" : "Save",
+ "type" : "normal",
+ "contexts" : ["link", "image", "page", "video", "audio"],
+ "onclick" : clickHandler
+});
@@ -0,0 +1,25 @@
+{
+ "name": "Save",
+ "description" : "Saves images, and links",
+ "permissions": [
+ "contextMenus"
+ ],
+ "icons": {
+ "16": "save16.png",
+ "48": "save48.png",
+ "128": "save128.png"
+ },
+ "browser_action": {
+ "default_icon": "save16.png",
+ "default_title": "Save this page"
+ },
+ "permissions" : [
+ "contextMenus"
+ ],
+ "version": "0.0.0.4",
+ "manifest_version": 2,
+ "minimum_chrome_version": "23.0.0.0",
+ "background": {
+ "scripts": ["background.js"]
+ }
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a899e49

Please sign in to comment.