sexy_bookmarks 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/Gemfile +12 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +202 -0
  4. data/Rakefile +14 -0
  5. data/lib/sexy_bookmarks.rb +6 -68
  6. data/lib/sexy_bookmarks/engine.rb +7 -0
  7. data/lib/sexy_bookmarks/exceptions.rb +5 -0
  8. data/lib/sexy_bookmarks/fixtures/socials.yml +328 -0
  9. data/lib/sexy_bookmarks/macros_helper.rb +67 -0
  10. data/lib/sexy_bookmarks/version.rb +3 -0
  11. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/custom-fugue-sprite.png +0 -0
  12. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/error-delete.jpg +0 -0
  13. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/flo-head.jpg +0 -0
  14. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/green-grad.png +0 -0
  15. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/information-delete.jpg +0 -0
  16. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/red-grad.png +0 -0
  17. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/share-enjoy.png +0 -0
  18. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/share-german.png +0 -0
  19. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/share-knowledge.png +0 -0
  20. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/share-love-hearts.png +0 -0
  21. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/share-wealth.png +0 -0
  22. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/shareaholic-220.png +0 -0
  23. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/sharing-caring-hearts.png +0 -0
  24. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/sharing-caring.png +0 -0
  25. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/sharing-shr.png +0 -0
  26. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/shr-sprite.png +0 -0
  27. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/shrsb-logo.png +0 -0
  28. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/success-delete.jpg +0 -0
  29. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/warning-big.png +0 -0
  30. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/warning-delete.jpg +0 -0
  31. data/{lib/sexybookmarks/assets/images/sexybookmarks → vendor/assets/images}/white-pix.jpg +0 -0
  32. data/vendor/assets/stylesheets/jquery.sexy_bookmarks.scss.erb +830 -0
  33. data/vendor/assets/stylesheets/sexy_bookmarks.css +3 -0
  34. metadata +151 -51
  35. data/README.rdoc +0 -76
  36. data/init.rb +0 -2
  37. data/lib/fixtures/socials.yml +0 -246
  38. data/lib/sexy_bookmarks_macros_helper.rb +0 -58
  39. data/lib/sexybookmarks/assets/stylesheets/sexybookmarks/style.css +0 -1
  40. data/sexy_bookmarks.gemspec +0 -17
  41. data/test/sexy_bookmarks_test.rb +0 -8
  42. data/test/test_helper.rb +0 -3
@@ -1,58 +0,0 @@
1
- module SexyBookmarksMacrosHelper
2
-
3
- def available_social_networks
4
- if @available_socials.nil?
5
- socials = File.new( File.join(File.dirname(__FILE__), 'fixtures', 'socials.yml') )
6
- @available_socials = YAML::load socials
7
- socials.close
8
- end
9
-
10
- @available_socials
11
- end
12
-
13
- def show_sexy_bookmarks( content, socials = nil, per_row = 8 )
14
- socials = available_social_networks.keys if socials.nil?
15
-
16
- list_items = socials.collect do |social|
17
-
18
- link_url = available_social_networks[social.to_s]['url'].to_s.gsub( /SHORT_TITLE|TITLE/, content[:title].to_s )
19
- link_url = link_url.gsub( /FETCH_URL|PERMALINK/, content[:permalink].to_s )
20
- link_url = link_url.gsub( /POST_SUMMARY|SEXY_TEASER/, content[:post_summary].to_s ).gsub(/SITE_NAME/, content[:site_name].to_s )
21
- link_url = link_url.gsub( /TWITT_CAT/, content[:twitt_cat].to_s ).gsub( /DEFAULT_TAGS/, content[:default_tags].to_s )
22
- link_url = link_url.gsub( /YAHOOTEASER/, content[:yahooteaser].to_s ).gsub( /YAHOOCATEGORY/, content[:yahoocategory].to_s )
23
- link_url = link_url.gsub( /YAHOOMEDIATYPE/, content[:yahoomediatype].to_s )
24
-
25
- link_options = {
26
- :href => link_url,
27
- :rel => :nofollow,
28
- :title => available_social_networks[social.to_s]['message'],
29
- :class => :external
30
- }
31
- link = content_tag( 'a', available_social_networks[social.to_s]['message'], link_options )
32
- content_tag( 'li', link, :class => 'shr-' + social.to_s )
33
- end
34
-
35
- unordered_list = content_tag( 'ul', list_items, :class => 'socials' )
36
- content_tag( 'div', unordered_list, { :class => 'shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr', :id => 'sexybookmarks' } ) + reveal_social_list(socials.count, per_row)
37
- end
38
-
39
- def include_sexy_bookmarks_if_needed
40
- stylesheet_link_tag "sexybookmarks/style.css" if @uses_sexy_bookmarks
41
- end
42
-
43
- def reveal_social_list(total, per_row)
44
- rows = ( total / Float(per_row ) % 2 == 0 ) ? total / per_row : ( total / per_row ) + 1
45
- javascript = %{
46
- $(document).ready(function() {
47
- $(".socials").hover(function(){
48
- $("#sexybookmarks").delay(500).animate({ height: "#{rows*32}px" }, 750);
49
- },
50
- function(){
51
- $("#sexybookmarks").animate({ height: "32px"}, 750);
52
- });
53
- });
54
- }
55
-
56
- content_tag('script', javascript, :type => 'text/javascript')
57
- end
58
- end
@@ -1 +0,0 @@
1
- div.shr-bookmarks{margin:20px 0;clear:both !important}div.shr-bookmarks-expand{height:32px;overflow:hidden}div.shr-bookmarks-bg-shr{padding:28px 0 0 10px !important;background:transparent url('/images/sexybookmarks/sharing-shr.png') no-repeat !important}div.shr-bookmarks-bg-caring{padding:26px 0 0 10px !important;background:transparent url('/images/sexybookmarks/sharing-caring-hearts.png') no-repeat !important}div.shr-bookmarks-bg-caring-old{padding:26px 0 0 10px !important;background:transparent url('/images/sexybookmarks/sharing-caring.png') no-repeat !important}div.shr-bookmarks-bg-love{padding:26px 0 0 10px !important;background:transparent url('/images/sexybookmarks/share-love-hearts.png') no-repeat !important}div.shr-bookmarks-bg-wealth{margin-left:15px !important;padding:35px 0 0 20px !important;background:transparent url('/images/sexybookmarks/share-wealth.png') no-repeat !important}div.shr-bookmarks-bg-enjoy{padding:26px 0 0 10px !important;background:transparent url('/images/sexybookmarks/share-enjoy.png') no-repeat !important}div.shr-bookmarks-bg-german{padding:35px 0 0 20px !important;background:transparent url('/images/sexybookmarks/share-german.png') no-repeat !important}div.shr-bookmarks-bg-knowledge{padding:35px 0 0 10px !important;background:transparent url('/images/sexybookmarks/share-knowledge.png') no-repeat !important}div.shr-bookmarks ul.socials{width:100% !important;margin:0 !important;padding:0 !important;float:left !important;background:transparent none !important;border:0 none !important;outline:0 none !important}div.shr-bookmarks ul.socials li{background-image:url('/images/sexybookmarks/shr-sprite.png') !important;background-repeat:no-repeat !important;display:inline !important;float:left !important;list-style-type:none !important;padding:0 !important;height:29px !important;width:60px !important;cursor:pointer !important;margin:3px 0 0 !important;background-color:transparent !important;border:0 none !important;outline:0 none !important;clear:none !important}div.shr-bookmarks ul.socials li:before,div.shr-bookmarks ul.socials li:after,div.shr-bookmarks ul.socials li a:before,div.shr-bookmarks ul.socials li a:after{content:'' !important}div.shr-bookmarks ul.socials a,div.shr-bookmarks ul.socials a:hover{display:block !important;width:60px !important;height:29px !important;text-indent:-9999px !important;background-color:transparent !important;text-decoration:none !important;border:0 none !important;margin:0 !important;padding:0 !important}div.shr-bookmarks ul.socials a:hover,div.shr-bookmarks ul.socials li:hover{background-color:transparent !important;border:0 none !important;outline:0 none !important}li.shr-newsvine{background-position:left bottom !important}li.shr-newsvine:hover{background-position:left top !important}li.shr-linkedin{background-position:-70px bottom !important}li.shr-linkedin:hover{background-position:-70px top !important}li.shr-googlebookmarks{background-position:-140px bottom !important}li.shr-googlebookmarks:hover{background-position:-140px top !important}li.shr-googlereader{background-position:-210px bottom !important}li.shr-googlereader:hover{background-position:-210px top !important}li.shr-scriptstyle{background-position:-280px bottom !important}li.shr-scriptstyle:hover{background-position:-280px top !important}li.shr-mail{background-position:-350px bottom !important}li.shr-mail:hover{background-position:-350px top !important}li.shr-comfeed{background-position:-420px bottom !important}li.shr-comfeed:hover{background-position:-420px top !important}li.shr-twitter{background-position:-490px bottom !important}li.shr-twitter:hover{background-position:-490px top !important}li.shr-technorati{background-position:-560px bottom !important}li.shr-technorati:hover{background-position:-560px top !important}li.shr-stumbleupon{background-position:-630px bottom !important}li.shr-stumbleupon:hover{background-position:-630px top !important}li.shr-reddit{background-position:-700px bottom !important}li.shr-reddit:hover{background-position:-700px top !important}li.shr-myspace{background-position:-770px bottom !important}li.shr-myspace:hover{background-position:-770px top !important}li.shr-mixx{background-position:-840px bottom !important}li.shr-mixx:hover{background-position:-840px top !important}li.shr-diigo{background-position:-910px bottom !important}li.shr-diigo:hover{background-position:-910px top !important}li.shr-digg{background-position:-980px bottom !important}li.shr-digg:hover{background-position:-980px top !important}li.shr-designfloat{background-position:-1050px bottom !important}li.shr-designfloat:hover{background-position:-1050px top !important}li.shr-yahoobuzz{background-position:-1120px bottom !important}li.shr-yahoobuzz:hover{background-position:-1120px top !important}li.shr-delicious{background-position:-1190px bottom !important}li.shr-delicious:hover{background-position:-1190px top !important}li.shr-blinklist{background-position:-1260px bottom !important}li.shr-blinklist:hover{background-position:-1260px top !important}li.shr-facebook{background-position:-1330px bottom !important}li.shr-facebook:hover{background-position:-1330px top !important}li.shr-misterwong{background-position:-1400px bottom !important}li.shr-misterwong:hover{background-position:-1400px top !important}li.shr-izeby{background-position:-1470px bottom !important}li.shr-izeby:hover{background-position:-1470px top !important}li.shr-twittley{background-position:-1540px bottom !important}li.shr-twittley:hover{background-position:-1540px top !important}li.shr-tipd{background-position:-1610px bottom !important}li.shr-tipd:hover{background-position:-1610px top !important}li.shr-pfbuzz{background-position:-1680px bottom !important}li.shr-pfbuzz:hover{background-position:-1680px top !important}li.shr-friendfeed{background-position:-1750px bottom !important}li.shr-friendfeed:hover{background-position:-1750px top !important}li.shr-blogmarks{background-position:-1820px bottom !important}li.shr-blogmarks:hover{background-position:-1820px top !important}li.shr-fwisp{background-position:-1890px bottom !important}li.shr-fwisp:hover{background-position:-1890px top !important}li.shr-yahoomail{background-position:-1960px bottom !important}li.shr-yahoomail:hover{background-position:-1960px top !important}li.shr-bobrdobr{background-position:-2030px bottom !important}li.shr-bobrdobr:hover{background-position:-2030px top !important}li.shr-memoryru{background-position:-2100px bottom !important}li.shr-memoryru:hover{background-position:-2100px top !important}li.shr-100zakladok{background-position:-2170px bottom !important}li.shr-100zakladok:hover{background-position:-2170px top !important}li.shr-yandex{background-position:-2240px bottom !important}li.shr-yandex:hover{background-position:-2240px top !important}li.shr-moemesto{background-position:-2310px bottom !important}li.shr-moemesto:hover{background-position:-2310px top !important}li.shr-marrows{background-position:-2380px bottom !important}li.shr-marrows:hover{background-position:-2380px top !important}li.shr-identica{background-position:-2450px bottom !important}li.shr-identica:hover{background-position:-2450px top !important}li.shr-hackernews{background-position:-2520px bottom !important}li.shr-hackernews:hover{background-position:-2520px top !important}li.shr-ning{background-position:-2590px bottom !important}li.shr-ning:hover{background-position:-2590px top !important}li.shr-designbump{background-position:-2660px bottom !important}li.shr-designbump:hover{background-position:-2660px top !important}li.shr-printfriendly{background-position:-2730px bottom !important}li.shr-printfriendly:hover{background-position:-2730px top !important}li.shr-fleck{background-position:-2800px bottom !important}li.shr-fleck:hover{background-position:-2800px top !important}li.shr-netvibes{background-position:-2870px bottom !important}li.shr-netvibes:hover{background-position:-2870px top !important}li.shr-netvouz{background-position:-2940px bottom !important}li.shr-netvouz:hover{background-position:-2940px top !important}li.shr-nujij{background-position:-3010px bottom !important}li.shr-nujij:hover{background-position:-3010px top !important}li.shr-globalgrind{background-position:-3080px bottom !important}li.shr-globalgrind:hover{background-position:-3080px top !important}li.shr-wikio{background-position:-3150px bottom !important}li.shr-wikio:hover{background-position:-3150px top !important}li.shr-xerpi{background-position:-3220px bottom !important}li.shr-xerpi:hover{background-position:-3220px top !important}li.shr-sphinn{background-position:-3290px bottom !important}li.shr-sphinn:hover{background-position:-3290px top !important}li.shr-hotmail{background-position:-3360px bottom !important}li.shr-hotmail:hover{background-position:-3360px top !important}li.shr-posterous{background-position:-3430px bottom !important}li.shr-posterous:hover{background-position:-3430px top !important}li.shr-techmeme{background-position:-3500px bottom !important}li.shr-techmeme:hover{background-position:-3500px top !important}li.shr-ekudos{background-position:-3570px bottom !important}li.shr-ekudos:hover{background-position:-3570px top !important}li.shr-pingfm{background-position:-3640px bottom !important}li.shr-pingfm:hover{background-position:-3640px top !important}li.shr-tomuse{background-position:-3710px bottom !important}li.shr-tomuse:hover{background-position:-3710px top !important}li.shr-webblend{background-position:-3780px bottom !important}li.shr-webblend:hover{background-position:-3780px top !important}li.shr-wykop{background-position:-3850px bottom !important}li.shr-wykop:hover{background-position:-3850px top !important}li.shr-blogengage{background-position:-3920px bottom !important}li.shr-blogengage:hover{background-position:-3920px top !important}li.shr-hyves{background-position:-3990px bottom !important}li.shr-hyves:hover{background-position:-3990px top !important}li.shr-pusha{background-position:-4060px bottom !important}li.shr-pusha:hover{background-position:-4060px top !important}li.shr-hatena{background-position:-4130px bottom !important}li.shr-hatena:hover{background-position:-4130px top !important}li.shr-mylinkvault{background-position:-4200px bottom !important}li.shr-mylinkvault:hover{background-position:-4200px top !important}li.shr-slashdot{background-position:-4270px bottom !important}li.shr-slashdot:hover{background-position:-4270px top !important}li.shr-squidoo{background-position:-4340px bottom !important}li.shr-squidoo:hover{background-position:-4340px top !important}li.shr-propeller{background-position:-4410px bottom !important}li.shr-propeller:hover{background-position:-4410px top !important}li.shr-faqpal{background-position:-4480px bottom !important}li.shr-faqpal:hover{background-position:-4480px top !important}li.shr-evernote{background-position:-4550px bottom !important}li.shr-evernote:hover{background-position:-4550px top !important}li.shr-meneame{background-position:-4620px bottom !important}li.shr-meneame:hover{background-position:-4620px top !important}li.shr-bitacoras{background-position:-4690px bottom !important}li.shr-bitacoras:hover{background-position:-4690px top !important}li.shr-jumptags{background-position:-4760px bottom !important}li.shr-jumptags:hover{background-position:-4760px top !important}li.shr-bebo{background-position:-4830px bottom !important}li.shr-bebo:hover{background-position:-4830px top !important}li.shr-n4g{background-position:-4900px bottom !important}li.shr-n4g:hover{background-position:-4900px top !important}li.shr-strands{background-position:-4970px bottom !important}li.shr-strands:hover{background-position:-4970px top !important}li.shr-orkut{background-position:-5040px bottom !important}li.shr-orkut:hover{background-position:-5040px top !important}li.shr-tumblr{background-position:-5110px bottom !important}li.shr-tumblr:hover{background-position:-5110px top !important}li.shr-stumpedia{background-position:-5180px bottom !important}li.shr-stumpedia:hover{background-position:-5180px top !important}li.shr-current{background-position:-5250px bottom !important}li.shr-current:hover{background-position:-5250px top !important}li.shr-blogger{background-position:-5320px bottom !important}li.shr-blogger:hover{background-position:-5320px top !important}li.shr-plurk{background-position:-5390px bottom !important}li.shr-plurk:hover{background-position:-5390px top !important}li.shr-virb{background-position:-5460px bottom !important}li.shr-virb:hover{background-position:-5460px top !important}li.shr-dzone{background-position:-5530px bottom !important}li.shr-dzone:hover{background-position:-5530px top !important}li.shr-kaevur{background-position:-5600px bottom !important}li.shr-kaevur:hover{background-position:-5600px top !important}li.shr-boxnet{background-position:-5670px bottom !important}li.shr-boxnet:hover{background-position:-5670px top !important}li.shr-oknotizie{background-position:-5740px bottom !important}li.shr-oknotizie:hover{background-position:-5740px top !important}li.shr-bonzobox{background-position:-5810px bottom !important}li.shr-bonzobox:hover{background-position:-5810px top !important}li.shr-plaxo{background-position:-5880px bottom !important}li.shr-plaxo:hover{background-position:-5880px top !important}li.shr-springpad{background-position:-5950px bottom !important}li.shr-springpad:hover{background-position:-5950px top !important}li.shr-zabox{background-position:-6020px bottom !important}li.shr-zabox:hover{background-position:-6020px top !important}li.shr-viadeo{background-position:-6090px bottom !important}li.shr-viadeo:hover{background-position:-6090px top !important}li.shr-googlebuzz{background-position:-6160px bottom !important}li.shr-googlebuzz:hover{background-position:-6160px top !important}li.shr-gmail{background-position:-6230px bottom !important}li.shr-gmail:hover{background-position:-6230px top !important}li.shr-buzzster{background-position:-6300px bottom !important}li.shr-buzzster:hover{background-position:-6300px top !important}
@@ -1,17 +0,0 @@
1
- Gem::Specification.new do |gem|
2
- gem.name = "sexy_bookmarks"
3
- gem.version = "0.1.1"
4
- gem.authors = [ "Enrique Vidal"]
5
- gem.email = "enrique@cloverinteractive.com"
6
- gem.homepage = "http://github.com/EnriqueVidal/sexy_bookmarks"
7
- gem.summary = "An easy to use rails port of sexybookmarks"
8
-
9
- gem.description = "SexyBookmarks is only a rails port of wordpress popular plugin sexy bookmarks."
10
-
11
- gem.files = Dir[ "lib/**/*.rb", "[A-Z]*", "init.rb", "sexy_bookmarks.gemspec", "lib/fixtures/*.yml", "lib/sexybookmarks/*/*/*/*" ]
12
- gem.test_files = Dir[ "test/**/*" ]
13
- gem.require_path = "lib"
14
-
15
- gem.extra_rdoc_files = Dir[ "*.rdoc" ]
16
- gem.rdoc_options = ["--charset=UTF-8", "--exclude=lib/sexy_bookmarks/assets"]
17
- end
@@ -1,8 +0,0 @@
1
- require 'test_helper'
2
-
3
- class SexyBookmarksTest < ActiveSupport::TestCase
4
- # Replace this with your real tests.
5
- test "the truth" do
6
- assert true
7
- end
8
- end
data/test/test_helper.rb DELETED
@@ -1,3 +0,0 @@
1
- require 'rubygems'
2
- require 'active_support'
3
- require 'active_support/test_case'