nesta-plugin-sharethis 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,112 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.8.2.1
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index</a> &raquo;
35
+
36
+
37
+ <span class="title">Top Level Namespace</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Top Level Namespace
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ </dl>
82
+ <div class="clear"></div>
83
+
84
+ <h2>Defined Under Namespace</h2>
85
+ <p class="children">
86
+
87
+
88
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Nesta.html" title="Nesta (module)">Nesta</a></span>
89
+
90
+
91
+
92
+
93
+ </p>
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ </div>
104
+
105
+ <div id="footer">
106
+ Generated on Thu Aug 23 14:25:01 2012 by
107
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
+ 0.8.2.1 (ruby-1.9.3).
109
+ </div>
110
+
111
+ </body>
112
+ </html>
@@ -0,0 +1,3 @@
1
+ require "nesta-plugin-sharethis/version"
2
+
3
+ Nesta::Plugin.register(__FILE__)
@@ -0,0 +1,71 @@
1
+ module Nesta
2
+ module Plugin
3
+ module Sharethis
4
+ # Load yaml file with share this mappings.
5
+
6
+ BUTTONS = lambda {
7
+ default = YAML.load_file( File.expand_path( "sharethis.yml", File.dirname(__FILE__)) )
8
+
9
+ override_file = File.expand_path( "config/sharethis.yml", Nesta::Env.root )
10
+ override = ( File.exists?(override_file) ? YAML.load_file(override_file) : {} )
11
+
12
+ default.merge(override)
13
+ }.call.freeze
14
+
15
+ #BUTTONS = load_sharethis_config
16
+
17
+ #def self.load_sharethis_config
18
+ #default = YAML.load_file( File.expand_path( "sharethis.yml", File.dirname(__FILE__)) )
19
+
20
+ #override_file = File.expand_path( "config/sharethis.yml", Nesta::Env.root )
21
+ #override = ( File.exists?(override_file) ? YAML.load_file(override_file) : {} )
22
+
23
+ #default.merge(override)
24
+ #end
25
+ #private_instance_method :load_sharethis_config
26
+
27
+ module Helpers
28
+ def sharethis_javascript
29
+ %{
30
+ <script type="text/javascript">var switchTo5x=true;</script>
31
+ <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
32
+ <script type="text/javascript">stLight.options({publisher: "#{Nesta::Config.sharethis}"}); </script>
33
+ }
34
+ end
35
+
36
+ def sharethis_buttons
37
+ buttons = []
38
+ STDOUT.puts Nesta::Config.sharethis_buttons.inspect
39
+ Nesta::Config.sharethis_buttons.each do |button|
40
+ buttons << Nesta::Plugin::Sharethis::BUTTONS[button]
41
+ end
42
+ buttons.join("\n")
43
+ end
44
+ end
45
+
46
+ end
47
+ end
48
+
49
+ class App
50
+ helpers Nesta::Plugin::Sharethis::Helpers
51
+ end
52
+
53
+ class Config
54
+ @settings += %w[ sharethis sharethis_buttons ]
55
+
56
+ def self.sharethis_buttons
57
+ from_yaml("sharethis_buttons") || default_buttons
58
+ end
59
+
60
+ def self.default_buttons
61
+ %w[
62
+ twitter
63
+ linkedin
64
+ reddit
65
+ facebook_like
66
+ ]
67
+ end
68
+ private_class_method :default_buttons
69
+ end
70
+ end
71
+
@@ -0,0 +1,19 @@
1
+ # Notes:
2
+ # - I rmeoved displayText attribute, as it was causing
3
+ # the provider name to show up on my page, which is
4
+ # not want I want.
5
+ # - To override this easily within nesta, create a
6
+ # 'sharethis.yml' file in your config directory and
7
+ # hack away.
8
+ delicious: "<span class='st_delicious'></span>"
9
+ digg: "<span class='st_digg'></span>"
10
+ dzone: "<span class='st_dzone'></span>"
11
+ email: "<span class='st_email'></span>"
12
+ facebook: "<span class='st_facebook'></span>"
13
+ facebook_like: "<span class='st_fblike'></span>"
14
+ google: "<span class='st_google'></span>"
15
+ google_reader: "<span class='st_google_reader'></span>"
16
+ linkedin: "<span class='st_linkedin'></span>"
17
+ reddit: "<span class='st_reddit'></span>"
18
+ tumblr: "<span class='st_tumblr'></span>"
19
+ twitter: "<span class='st_twitter'></span>"
@@ -0,0 +1,7 @@
1
+ module Nesta
2
+ module Plugin
3
+ module Sharethis
4
+ VERSION = "0.0.1"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,20 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/nesta-plugin-sharethis/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Joshua Mervine"]
6
+ gem.email = ["joshua@mervine.net"]
7
+ gem.description = %q{Adds ShareThis features to Nesta CMS.}
8
+ gem.summary = gem.description
9
+ gem.homepage = "http://github.com/jmervine/nesta-plugin-sharethis"
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "nesta-plugin-sharethis"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Nesta::Plugin::Sharethis::VERSION
17
+ gem.add_dependency("nesta", ">= 0.9.11")
18
+ gem.add_development_dependency("yard")
19
+ gem.add_development_dependency("rake")
20
+ end
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nesta-plugin-sharethis
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Joshua Mervine
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: nesta
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.9.11
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.9.11
30
+ - !ruby/object:Gem::Dependency
31
+ name: yard
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ description: Adds ShareThis features to Nesta CMS.
63
+ email:
64
+ - joshua@mervine.net
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files: []
68
+ files:
69
+ - .gitignore
70
+ - Gemfile
71
+ - LICENSE
72
+ - README.md
73
+ - Rakefile
74
+ - doc/Nesta.html
75
+ - doc/Nesta/App.html
76
+ - doc/Nesta/Config.html
77
+ - doc/Nesta/Plugin.html
78
+ - doc/Nesta/Plugin/Sharethis.html
79
+ - doc/Nesta/Plugin/Sharethis/Helpers.html
80
+ - doc/_index.html
81
+ - doc/class_list.html
82
+ - doc/css/common.css
83
+ - doc/css/full_list.css
84
+ - doc/css/style.css
85
+ - doc/file.README.html
86
+ - doc/file_list.html
87
+ - doc/frames.html
88
+ - doc/index.html
89
+ - doc/js/app.js
90
+ - doc/js/full_list.js
91
+ - doc/js/jquery.js
92
+ - doc/method_list.html
93
+ - doc/top-level-namespace.html
94
+ - lib/nesta-plugin-sharethis.rb
95
+ - lib/nesta-plugin-sharethis/init.rb
96
+ - lib/nesta-plugin-sharethis/sharethis.yml
97
+ - lib/nesta-plugin-sharethis/version.rb
98
+ - nesta-plugin-sharethis.gemspec
99
+ homepage: http://github.com/jmervine/nesta-plugin-sharethis
100
+ licenses: []
101
+ post_install_message:
102
+ rdoc_options: []
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ requirements: []
118
+ rubyforge_project:
119
+ rubygems_version: 1.8.24
120
+ signing_key:
121
+ specification_version: 3
122
+ summary: Adds ShareThis features to Nesta CMS.
123
+ test_files: []
124
+ has_rdoc: