Initial commit, at version α 1 (0.0.1). 0.0.1
authorJoseph Spiros <joseph.spiros@ithinksw.com>
Tue, 8 Jun 2010 14:33:02 +0000 (10:33 -0400)
committerJoseph Spiros <joseph.spiros@ithinksw.com>
Tue, 8 Jun 2010 14:33:02 +0000 (10:33 -0400)
.gitignore [new file with mode: 0644]
Info.plist [new file with mode: 0644]
Settings.plist [new file with mode: 0644]
URLBarReloadButton.png [new file with mode: 0644]
URLBarStopButton.png [new file with mode: 0644]
toolbar.html [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..e43b0f9
--- /dev/null
@@ -0,0 +1 @@
+.DS_Store
diff --git a/Info.plist b/Info.plist
new file mode 100644 (file)
index 0000000..a52e649
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>Author</key>
+       <string>iThink Software</string>
+       <key>CFBundleDisplayName</key>
+       <string>Delicious</string>
+       <key>CFBundleIdentifier</key>
+       <string>com.ithinksw.safariextensions.delicious</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleShortVersionString</key>
+       <string>α 1</string>
+       <key>CFBundleVersion</key>
+       <string>0.0.1</string>
+       <key>Chrome</key>
+       <dict>
+               <key>Bars</key>
+               <array>
+                       <dict>
+                               <key>Filename</key>
+                               <string>toolbar.html</string>
+                               <key>Identifier</key>
+                               <string>com.ithinksw.safariextensions.delicious.bar</string>
+                               <key>Label</key>
+                               <string>Delicious</string>
+                       </dict>
+               </array>
+       </dict>
+       <key>Content</key>
+       <dict>
+               <key>Scripts</key>
+               <dict/>
+       </dict>
+       <key>Description</key>
+       <string>Integrates Safari with the Delicious social bookmarking service.</string>
+       <key>ExtensionInfoDictionaryVersion</key>
+       <string>1.0</string>
+       <key>Permissions</key>
+       <dict>
+               <key>Website Access</key>
+               <dict/>
+       </dict>
+       <key>Update Manifest URL</key>
+       <string>http://download.ithinksw.com/safariextensions/.update.plist</string>
+       <key>Website</key>
+       <string>http://ithinksw.com/</string>
+</dict>
+</plist>
diff --git a/Settings.plist b/Settings.plist
new file mode 100644 (file)
index 0000000..4f05ddf
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<array>
+       <dict>
+               <key>DefaultValue</key>
+               <string></string>
+               <key>Key</key>
+               <string>com.ithinksw.safariextensions.delicious.username</string>
+               <key>Title</key>
+               <string>Delicious username</string>
+               <key>Type</key>
+               <string>TextField</string>
+       </dict>
+</array>
+</plist>
diff --git a/URLBarReloadButton.png b/URLBarReloadButton.png
new file mode 100644 (file)
index 0000000..25fab47
Binary files /dev/null and b/URLBarReloadButton.png differ
diff --git a/URLBarStopButton.png b/URLBarStopButton.png
new file mode 100644 (file)
index 0000000..b7c61d7
Binary files /dev/null and b/URLBarStopButton.png differ
diff --git a/toolbar.html b/toolbar.html
new file mode 100644 (file)
index 0000000..9c5511c
--- /dev/null
@@ -0,0 +1,102 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+
+body {
+       overflow: hidden;
+}
+
+.reloading {
+       background-image: url(URLBarStopButton.png) !important;
+}
+
+a#reload {
+       float: left;
+       width: 16px;
+       height: 16px;
+       margin-right: 1px;
+       cursor: default;
+       background-image: url(URLBarReloadButton.png);
+}
+
+.hidden {
+       display: none !important;
+}
+
+a.bookmark {
+       display: block;
+       float: left;
+       color: rgba(0, 0, 0, 0.796875);
+       text-decoration: none;
+       padding-top: 2px;
+       padding-bottom: 2px;
+       padding-left: 7px;
+       padding-right: 7px;
+       margin-right: 1px;
+       cursor: default;
+}
+
+a.bookmark:hover {
+       color: white;
+       background-color: rgba(0, 0, 0, 0.2);
+       -webkit-border-radius: 10px;
+       text-shadow: rgba(0, 0, 0, 0.398438) 0px 1px 0px;
+}
+
+
+</style>
+<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
+<script type="text/javascript">
+
+function windowResized() {
+       $('.bookmark').removeClass('to-be-hidden')
+       $('.bookmark').removeClass('hidden');
+       $('.bookmark').each(function() {
+               if ($(this).offset().top > 10) {
+                       $(this).addClass('to-be-hidden');
+               }
+       });
+       $('.to-be-hidden').addClass('hidden').removeClass('to-be-hidden');
+}
+
+var username = safari.extension.settings.getItem('com.ithinksw.safariextensions.delicious.username');
+
+function reloadBookmarks(username) {
+       $('#reload').addClass('reloading');
+       $.getJSON("http://feeds.delicious.com/v2/json/" + username + "?callback=?", function (responseObj) {
+               var output = '';
+               for (var i = 0; i < responseObj.length; i++) {
+                       var bmark = responseObj[i];
+                       var label = bmark['d']
+                       if (label.length > 27) {
+                               var firstPart = label.substr(0, 12);
+                               var secondPart = label.substr(label.length - 12, 12);
+                               label = firstPart + "&hellip;" + secondPart;
+                       }
+                       output += '<a class="bookmark" href="' + bmark['u'] + '">' + label + '</a>';
+               }
+               document.getElementById('bookmarks').innerHTML = output;
+               windowResized();
+               $('#reload').removeClass('reloading');
+       });
+}
+
+function settingsChanged(event) {
+       if (event.key == 'com.ithinksw.safariextensions.delicious.username') {
+               username = event.newValue;
+               reloadBookmarks(username);
+       }
+}
+
+$(function() {
+       reloadBookmarks(username);
+       $(window).resize(windowResized);
+       safari.extension.settings.addEventListener('change', settingsChanged, false);
+});
+
+</script>
+<title>Toolbar</title>
+</head>
+<body><a id="reload" href="javascript:reloadBookmarks(username);"></a><div id="bookmarks"></div></body>
+</html>
\ No newline at end of file