Permalink
Browse files

Removed toolstrip and switched to a toolbar menu using Chromes "brows…

…er_action" http://code.google.com/chrome/extensions/browserAction.html

Next steps:
Create keyboard shortcut for the "Save new bookmark" menu.
Use highlighted text in the notes field when saving a bookmark.
  • Loading branch information...
1 parent c1f7fa0 commit 3c007b9f921aaea4cea8473e396b33240bed9e06 @billkeller committed Nov 17, 2009
View
@@ -2,17 +2,13 @@ var deliciousUrl = "http://delicious.com/save?v=5&noui&jump=close&ur
var url;
var title;
-// grabbed from delicious_content_script.js
-chrome.self.onConnect.addListener(function(port) {
- port.onMessage.addListener(function(data) {
- url = data.url;
- title = data.title;
- });
-});
-
-function add_delicious() {
- window.open(deliciousUrl + url + '&title=' + title +' ','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550');
- };
+ function add_delicious() {
+ chrome.tabs.getSelected( null , function(tab) {
+ url = (tab.url);
+ title = (tab.title);
+ window.open(deliciousUrl + url + '&title=' + title +' ','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550');
+ });
+ }
//sample popup URL from Delicious:
//javascript:(function(){f='http://delicious.com/save?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&v=5&';a=function(){if(!window.open(f+'noui=1&jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Deleted file not rendered
@@ -1,13 +0,0 @@
-getUrl();
-
-window.addEventListener("focus", getUrl);
-
-function getUrl() {
- if(window == top) {
- chrome.extension.connect().postMessage(
- {
- "url" : window.location.href,
- "title" : window.document.title
- });
- }
-}
View
Deleted file not rendered
View
@@ -12,7 +12,12 @@
"name": "Del.icio.us Tools",
"version": "1.0",
"description": "Del.icio.us toolbar for Chrome",
- "toolstrips": [
- "my_toolstrip.html"
- ]
+ "permissions": [
+ "tabs"
+ ],
+ "browser_action": {
+ "default_title": "Delicious",
+ "default_icon": "delicious.png",
+ "popup": { "path": "popup.html" }
+ }
}
View
@@ -1,9 +0,0 @@
-<html>
- <head>
- <script src="addDelicious.js"></script>
- </head>
- <body>
- <div class="toolstrip-button" onclick="window.open('http://del.icio.us/home/')"><img src="deliciousUp16.png" title="My Del.icio.us" /></div>
- <div class="toolstrip-button" onclick="add_delicious()"><img src="tagUp24.png" title="Bookmark on Del.icio.us" /></div>
- </body>
-</html>
View
Deleted file not rendered
View
@@ -0,0 +1,26 @@
+<html>
+ <head>
+ <script src="addDelicious.js"></script>
+ <style type="text/css">
+ div.toolstrip-button {
+ color: #000;
+ cursor: hand;
+ font: normal 12px helvetica, arial, verdana;
+ width: 150px;
+ padding: 6px;
+ border-bottom: 1px solid #eee;
+ }
+ div.toolstrip-button:last-child {border-bottom-style: none;}
+ div.toolstrip-button:hover {
+ background-color: #3274d0;
+ color: #fff;
+ }
+
+ </style>
+ </head>
+ <body>
+ <div class="toolstrip-button" onclick="add_delicious()">Save a new Bookmark</div>
+ <div class="toolstrip-button" onclick="window.open('http://del.icio.us/home/')">Bookmarks on Delicious</div>
+ <div class="toolstrip-button" onclick="window.open('http://del.icio.us/inbox/')">Delicious Inbox</div>
+ </body>
+</html>
View
Deleted file not rendered

0 comments on commit 3c007b9

Please sign in to comment.