aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Polak <polak@gnu.org>2010-12-31 13:16:15 +0100
committerWojciech Polak <polak@gnu.org>2010-12-31 13:16:15 +0100
commit4b76fb974d2da164747114b9fc5271c15eee6a95 (patch)
tree8048871765633edcf868ade2da8a2efef968031e
parenteab0adc6e306d15a13ee2b51b1c49ba361a412ad (diff)
downloadglifestream-4b76fb974d2da164747114b9fc5271c15eee6a95.tar.gz
glifestream-4b76fb974d2da164747114b9fc5271c15eee6a95.tar.bz2
Use CSS sprite for sites share.
-rw-r--r--static/js/glifestream.js24
-rw-r--r--static/themes/default/icons/email.pngbin641 -> 0 bytes
-rw-r--r--static/themes/default/master-share.pngbin0 -> 5391 bytes
-rw-r--r--static/themes/default/style.css16
4 files changed, 30 insertions, 10 deletions
diff --git a/static/js/glifestream.js b/static/js/glifestream.js
index b533f13..fdcf8e3 100644
--- a/static/js/glifestream.js
+++ b/static/js/glifestream.js
@@ -789,14 +789,14 @@
/* You may overwrite it in your user-scripts.js */
social_sharing_sites = window.social_sharing_sites ||
- [{ name: 'E-mail', href: 'mailto:?subject={URL}&body={TITLE}', icon: baseurl + 'static/themes/default/icons/email.png'},
- { name: 'Twitter', href: 'http://twitter.com/?status={TITLE}:%20{URL}', icon: 'http://twitter.com/favicon.ico'},
- { name: 'Facebook', href: 'http://www.facebook.com/sharer.php?u={URL}&t={TITLE}', icon: 'http://www.facebook.com/favicon.ico'},
- { name: 'FriendFeed', href: 'http://friendfeed.com/share?url={URL}&title={TITLE}', icon: 'http://friendfeed.com/favicon.ico'},
- { name: 'Delicious', href: 'http://delicious.com/save?url={URL}&title={TITLE}', icon: 'http://delicious.com/favicon.ico'},
- { name: 'Digg', href: 'http://digg.com/submit?phase=2&url={URL}&title={TITLE}', icon: 'http://digg.com/favicon.ico'},
- { name: 'Reddit', href: 'http://reddit.com/submit?url={URL}&title={TITLE}', icon: 'http://www.reddit.com/favicon.ico'},
- { name: 'Buzz', href: 'http://www.google.com/buzz/post?url={URL}', icon: 'http://www.gstatic.com/buzz/api/images/buzz-link.png'}];
+ [{ name: 'E-mail', href: 'mailto:?subject={URL}&body={TITLE}', className: 'email'},
+ { name: 'Twitter', href: 'http://twitter.com/?status={TITLE}:%20{URL}', className: 'twitter'},
+ { name: 'Facebook', href: 'http://www.facebook.com/sharer.php?u={URL}&t={TITLE}', className: 'facebook'},
+ { name: 'FriendFeed', href: 'http://friendfeed.com/share?url={URL}&title={TITLE}', className: 'friendfeed'},
+ { name: 'Delicious', href: 'http://delicious.com/save?url={URL}&title={TITLE}', className: 'delicious'},
+ { name: 'Digg', href: 'http://digg.com/submit?phase=2&url={URL}&title={TITLE}', className: 'digg'},
+ { name: 'Reddit', href: 'http://reddit.com/submit?url={URL}&title={TITLE}', className: 'reddit'},
+ { name: 'Buzz', href: 'http://www.google.com/buzz/post?url={URL}', className: 'gbuzz'}];
});
function init_settings () {
@@ -1125,11 +1125,15 @@
var href = s.href.replace ('{URL}', encodeURIComponent (url));
href = href.replace ('{TITLE}', encodeURIComponent (title));
+ if (s.className)
+ var img = DCE ('span', {className: 'share-' + s.className});
+ else if (s.icon)
+ var img = DCE ('img', {src: s.icon, width:16, height:16});
+
o.appendChild
(DCE ('div', {className: 'item'},
[DCE ('a', {href: href, target: '_blank'},
- [DCE ('img', {src: s.icon, width:16, height:16}),
- document.createTextNode (String.fromCharCode (160)),
+ [img, document.createTextNode (String.fromCharCode (160)),
document.createTextNode (s.name)])]));
}
if (reshareit) {
diff --git a/static/themes/default/icons/email.png b/static/themes/default/icons/email.png
deleted file mode 100644
index 7348aed..0000000
--- a/static/themes/default/icons/email.png
+++ /dev/null
Binary files differ
diff --git a/static/themes/default/master-share.png b/static/themes/default/master-share.png
new file mode 100644
index 0000000..7af999e
--- /dev/null
+++ b/static/themes/default/master-share.png
Binary files differ
diff --git a/static/themes/default/style.css b/static/themes/default/style.css
index 88fcd00..08fd172 100644
--- a/static/themes/default/style.css
+++ b/static/themes/default/style.css
@@ -607,6 +607,22 @@ ul.files {
padding: 2px;
float: left;
}
+#shareitbox .item span {
+ display: block;
+ float: left;
+ width: 16px;
+ height: 16px;
+}
+#shareitbox .share-gbuzz { background: transparent url(master-share.png) no-repeat 0 0; }
+#shareitbox .share-delicious { background: transparent url(master-share.png) no-repeat -16px 0px; }
+#shareitbox .share-digg { background: transparent url(master-share.png) no-repeat -32px 0px; }
+#shareitbox .share-email { background: transparent url(master-share.png) no-repeat -48px 0px; }
+#shareitbox .share-facebook { background: transparent url(master-share.png) no-repeat -64px 0px; }
+#shareitbox .share-friendfeed { background: transparent url(master-share.png) no-repeat -80px 0px; }
+#shareitbox .share-google { background: transparent url(master-share.png) no-repeat -96px 0px; }
+#shareitbox .share-reddit { background: transparent url(master-share.png) no-repeat -112px 0px; }
+#shareitbox .share-stumbleupon { background: transparent url(master-share.png) no-repeat -128px 0px; }
+#shareitbox .share-twitter { background: transparent url(master-share.png) no-repeat -144px 0px; }
#graybox {
z-index: 1010;

Return to:

Send suggestions and report system problems to the System administrator.