oulu-rails 0.5.27 → 0.5.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +0 -0
  3. data/README.md +1 -1
  4. data/lib/oulu-rails/version.rb +1 -1
  5. data/lib/oulu-rails.rb +0 -0
  6. data/vendor/assets/javascripts/oulu/plugins/jquery.autosize.min.js +0 -0
  7. data/vendor/assets/javascripts/oulu/plugins/jquery.css3form.js +0 -0
  8. data/vendor/assets/javascripts/oulu/plugins/jquery.depend.min.js +0 -0
  9. data/vendor/assets/javascripts/oulu/plugins/sns-buttons.js +339 -339
  10. data/vendor/assets/stylesheets/{_oulu-base.css.sass → _oulu-base.sass} +1 -1
  11. data/vendor/assets/stylesheets/{_oulu.css.sass → _oulu.sass} +0 -0
  12. data/vendor/assets/stylesheets/settings/mixins/_balloon-tail.sass +106 -0
  13. data/vendor/assets/stylesheets/settings/mixins/{_grids.css.sass → _grids.sass} +11 -2
  14. metadata +75 -75
  15. data/vendor/assets/stylesheets/settings/mixins/_balloon-tale.css.sass +0 -112
  16. /data/vendor/assets/stylesheets/helper/{_base-helper.css.sass → _base-helper.sass} +0 -0
  17. /data/vendor/assets/stylesheets/helper/{_margin-padding.css.sass → _margin-padding.sass} +0 -0
  18. /data/vendor/assets/stylesheets/helper/{_no-gutter-grids.css.sass → _no-gutter-grids.sass} +0 -0
  19. /data/vendor/assets/stylesheets/helper/{_typoglaphy.css.sass → _typoglaphy.sass} +0 -0
  20. /data/vendor/assets/stylesheets/options/amazlet/{_amazlet.css.sass → _amazlet.sass} +0 -0
  21. /data/vendor/assets/stylesheets/options/glitch/{_glitch.css.sass → _glitch.sass} +0 -0
  22. /data/vendor/assets/stylesheets/options/oulu-buttons/{_button-basic.css.sass → _button-basic.sass} +0 -0
  23. /data/vendor/assets/stylesheets/options/web-fonts/{_cousine.css.sass → _cousine.sass} +0 -0
  24. /data/vendor/assets/stylesheets/options/web-fonts/{_font-awsome.css.sass → _font-awsome.sass} +0 -0
  25. /data/vendor/assets/stylesheets/options/web-fonts/{_icomoon.css.sass → _icomoon.sass} +0 -0
  26. /data/vendor/assets/stylesheets/options/web-fonts/{_lato.css.sass → _lato.sass} +0 -0
  27. /data/vendor/assets/stylesheets/options/web-fonts/{_montserrat.css.sass → _montserrat.sass} +0 -0
  28. /data/vendor/assets/stylesheets/options/web-fonts/{_old-standard.css.sass → _old-standard.sass} +0 -0
  29. /data/vendor/assets/stylesheets/options/web-fonts/{_open-sans.css.sass → _open-sans.sass} +0 -0
  30. /data/vendor/assets/stylesheets/options/web-fonts/{_podkova.css.sass → _podkova.sass} +0 -0
  31. /data/vendor/assets/stylesheets/options/web-fonts/{_pt-sans.css.sass → _pt-sans.sass} +0 -0
  32. /data/vendor/assets/stylesheets/options/web-fonts/{_roboto-condensed.css.sass → _roboto-condensed.sass} +0 -0
  33. /data/vendor/assets/stylesheets/options/web-fonts/{_roboto.css.sass → _roboto.sass} +0 -0
  34. /data/vendor/assets/stylesheets/options/web-fonts/{_satisfy.css.sass → _satisfy.sass} +0 -0
  35. /data/vendor/assets/stylesheets/options/web-fonts/{_source-code-pro.css.sass → _source-code-pro.sass} +0 -0
  36. /data/vendor/assets/stylesheets/options/web-fonts/{_source-sans-pro.css.sass → _source-sans-pro.sass} +0 -0
  37. /data/vendor/assets/stylesheets/options/web-fonts/{_special-elite.css.sass → _special-elite.sass} +0 -0
  38. /data/vendor/assets/stylesheets/options/web-fonts/{_tauri.css.sass → _tauri.sass} +0 -0
  39. /data/vendor/assets/stylesheets/options/web-fonts/{_ubuntu-mono.css.sass → _ubuntu-mono.sass} +0 -0
  40. /data/vendor/assets/stylesheets/options/web-fonts/{_ubuntu.css.sass → _ubuntu.sass} +0 -0
  41. /data/vendor/assets/stylesheets/settings/functions/{_animation.css.sass → _animation.sass} +0 -0
  42. /data/vendor/assets/stylesheets/settings/functions/{_background.css.sass → _background.sass} +0 -0
  43. /data/vendor/assets/stylesheets/settings/functions/{_bool.css.sass → _bool.sass} +0 -0
  44. /data/vendor/assets/stylesheets/settings/functions/{_border.css.sass → _border.sass} +0 -0
  45. /data/vendor/assets/stylesheets/settings/functions/{_color.css.sass → _color.sass} +0 -0
  46. /data/vendor/assets/stylesheets/settings/functions/{_content.css.sass → _content.sass} +0 -0
  47. /data/vendor/assets/stylesheets/settings/functions/{_cursor.css.sass → _cursor.sass} +0 -0
  48. /data/vendor/assets/stylesheets/settings/functions/{_grid.css.sass → _grid.sass} +0 -0
  49. /data/vendor/assets/stylesheets/settings/functions/{_image.css.sass → _image.sass} +0 -0
  50. /data/vendor/assets/stylesheets/settings/functions/{_length.css.sass → _length.sass} +0 -0
  51. /data/vendor/assets/stylesheets/settings/functions/{_list.css.sass → _list.sass} +0 -0
  52. /data/vendor/assets/stylesheets/settings/functions/{_map.css.sass → _map.sass} +0 -0
  53. /data/vendor/assets/stylesheets/settings/functions/{_number.css.sass → _number.sass} +0 -0
  54. /data/vendor/assets/stylesheets/settings/functions/{_position.css.sass → _position.sass} +0 -0
  55. /data/vendor/assets/stylesheets/settings/functions/{_reverse.css.sass → _reverse.sass} +0 -0
  56. /data/vendor/assets/stylesheets/settings/functions/{_string.css.sass → _string.sass} +0 -0
  57. /data/vendor/assets/stylesheets/settings/functions/{_text.css.sass → _text.sass} +0 -0
  58. /data/vendor/assets/stylesheets/settings/initializers/{_reset.css.sass → _reset.sass} +0 -0
  59. /data/vendor/assets/stylesheets/settings/mixins/{_animation.css.sass → _animation.sass} +0 -0
  60. /data/vendor/assets/stylesheets/settings/mixins/{_background.css.sass → _background.sass} +0 -0
  61. /data/vendor/assets/stylesheets/settings/mixins/{_basic-font.css.sass → _basic-font.sass} +0 -0
  62. /data/vendor/assets/stylesheets/settings/mixins/{_block.css.sass → _block.sass} +0 -0
  63. /data/vendor/assets/stylesheets/settings/mixins/{_border.css.sass → _border.sass} +0 -0
  64. /data/vendor/assets/stylesheets/settings/mixins/{_button.css.sass → _button.sass} +0 -0
  65. /data/vendor/assets/stylesheets/settings/mixins/{_color.css.sass → _color.sass} +0 -0
  66. /data/vendor/assets/stylesheets/settings/mixins/{_filters.css.sass → _filters.sass} +0 -0
  67. /data/vendor/assets/stylesheets/settings/mixins/{_form.css.sass → _form.sass} +0 -0
  68. /data/vendor/assets/stylesheets/settings/mixins/{_ie-hacks.css.sass → _ie-hacks.sass} +0 -0
  69. /data/vendor/assets/stylesheets/settings/mixins/{_image.css.sass → _image.sass} +0 -0
  70. /data/vendor/assets/stylesheets/settings/mixins/{_line.css.sass → _line.sass} +0 -0
  71. /data/vendor/assets/stylesheets/settings/mixins/{_link.css.sass → _link.sass} +0 -0
  72. /data/vendor/assets/stylesheets/settings/mixins/{_list.css.sass → _list.sass} +0 -0
  73. /data/vendor/assets/stylesheets/settings/mixins/{_margin-padding.css.sass → _margin-padding.sass} +0 -0
  74. /data/vendor/assets/stylesheets/settings/mixins/{_overlay.css.sass → _overlay.sass} +0 -0
  75. /data/vendor/assets/stylesheets/settings/mixins/{_positions.css.sass → _positions.sass} +0 -0
  76. /data/vendor/assets/stylesheets/settings/mixins/{_rem.css.sass → _rem.sass} +0 -0
  77. /data/vendor/assets/stylesheets/settings/mixins/{_reset.css.sass → _reset.sass} +0 -0
  78. /data/vendor/assets/stylesheets/settings/mixins/{_resets.css.sass → _resets.sass} +0 -0
  79. /data/vendor/assets/stylesheets/settings/mixins/{_responsive-utilities.css.sass → _responsive-utilities.sass} +0 -0
  80. /data/vendor/assets/stylesheets/settings/mixins/{_sassmatic.css.sass → _sassmatic.sass} +0 -0
  81. /data/vendor/assets/stylesheets/settings/mixins/{_sprite-background.css.sass → _sprite-background.sass} +0 -0
  82. /data/vendor/assets/stylesheets/settings/mixins/{_table.css.sass → _table.sass} +0 -0
  83. /data/vendor/assets/stylesheets/settings/mixins/{_text.css.sass → _text.sass} +0 -0
  84. /data/vendor/assets/stylesheets/settings/variables/{_default.css.sass → _default.sass} +0 -0
@@ -1,339 +1,339 @@
1
- /*
2
- * Social Info 0.2 - jQuery plugin
3
- * written by cyokodog
4
- *
5
- * Copyright (c) 2014 cyokodog
6
- * http://www.cyokodog.net/
7
- * http://d.hatena.ne.jp/cyokodog/)
8
- * http://cyokodog.tumblr.com/
9
- * MIT LICENCE
10
- *
11
- * Built for jQuery library
12
- * http://jquery.com
13
- *
14
- */
15
-
16
- ;(function($){
17
-
18
- $.social = $.social || {};
19
- $.si = $.social.info = {
20
- jsonp : function( p ){
21
- return $.ajax({
22
- url:p.url,
23
- dataType:'jsonp',
24
- data:p.data,
25
- success:function( r ){
26
- p.callback(r);
27
- }
28
- });
29
- },
30
- reArg : function(url , callback){
31
- if(typeof url == 'object') return url;
32
- if(typeof url == 'function'){
33
- callback = url;
34
- url = '';
35
- }
36
- url = url || location.href;
37
- return {
38
- url : url,
39
- callback : callback
40
- };
41
- },
42
- cache : {
43
- twitter : {
44
- entryCount : {}
45
- }
46
- },
47
- version : '0.2',
48
- id : 'social-info',
49
- name : 'Social Info'
50
- }
51
-
52
-
53
- $.si.twitter = {
54
- getEntryCount : function(url, callback){
55
- var arg = $.extend({
56
- url : location.href,
57
- useCache : true,
58
- callback : function( count ){}
59
- }, $.si.reArg(url, callback))
60
- var cache = $.si.cache.twitter.entryCount;
61
- var eurl = encodeURIComponent(url);
62
- if(arg.useCache && cache[eurl] != undefined){
63
- arg.callback(cache[eurl]);
64
- return;
65
- }
66
- $.si.jsonp({
67
- url : 'http://urls.api.twitter.com/1/urls/count.json',
68
- data : {
69
- url : arg.url
70
- },
71
- callback : function(r){
72
- var count = r = !r ? 0 : r.count;
73
- cache[eurl] = count;
74
- arg.callback(count);
75
- }
76
- });
77
- },
78
- getEntryUrl : function(url, title ){
79
- url = url || location.href;
80
- if(title) title = '&text=' + encodeURIComponent(title);
81
- else{
82
- if(url == location.href) title = '&text=' + encodeURIComponent(document.title);
83
- }
84
- return 'https://twitter.com/intent/tweet?url=' + encodeURIComponent(url) + (title || '');
85
- },
86
- getSearchUrl : function( url ){
87
- url = url || location.href;
88
- return 'https://twitter.com/search?q=' + encodeURIComponent( url );
89
- }
90
- }
91
-
92
- $.si.facebook = {
93
- getEntryCount : function( url , callback){
94
- var arg = $.si.reArg(url, callback)
95
- $.si.jsonp({
96
- url : 'https://graph.facebook.com/',
97
- data : {
98
- id : arg.url
99
- },
100
- callback : function(r){
101
- arg.callback(r.shares || 0);
102
- }
103
- });
104
- },
105
- getEntryUrl : function( url ){
106
- url = url || location.href;
107
- return 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(url);
108
- },
109
- getSearchUrl : function( url ){
110
- url = url || location.href;
111
- return 'https://www.facebook.com/#!/search/results.php?q=' + encodeURIComponent( url );
112
- }
113
- }
114
-
115
- $.si.googleplus = {
116
- getEntryCount : function( url , callback){
117
- var arg = $.si.reArg(url, callback)
118
- $.ajax({
119
- type: "get",
120
- dataType: "xml",
121
- url: "http://query.yahooapis.com/v1/public/yql",
122
- data: {
123
- q: "SELECT content FROM data.headers WHERE url='https://plusone.google.com/_/+1/fastbutton?hl=ja&url=" + arg.url + "' and ua='#Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36'",
124
- format: "xml",
125
- env: "http://datatables.org/alltables.env"
126
- },
127
- success: function (data) {
128
- var content = $(data).find("content").text();
129
- var match = content.match(/window\.__SSR[\s*]=[\s*]{c:[\s*](\d+)/i);
130
- var count = (match != null) ? match[1] : 0;
131
- arg.callback(count);
132
- }
133
- });
134
- },
135
- getEntryUrl : function( url ){
136
- url = url || location.href;
137
- return 'https://plus.google.com/share?url=' + encodeURIComponent(url);
138
- },
139
- getSearchUrl : function( url ){
140
- url = url || location.href;
141
- return 'https://plus.google.com/u/0/?tab=mX#s/' + encodeURIComponent( url );
142
- }
143
- }
144
-
145
-
146
- $.si.hatebu = {
147
- getEntryCount : function( url , callback){
148
- var arg = $.si.reArg(url, callback)
149
- $.si.jsonp({
150
- url : 'http://api.b.st-hatena.com/entry.count',
151
- data : {
152
- url : arg.url
153
- },
154
- callback : arg.callback
155
- });
156
- },
157
- getEntryUrl : function(url){
158
- url = url || location.href;
159
- return 'http://b.hatena.ne.jp/entry/' + url.replace(/^http:\/\//,'').replace(/^https:\/\//,'s/');
160
- },
161
- getSearchUrl : function( url ){
162
- url = url || location.href;
163
- return 'http://b.hatena.ne.jp/entrylist?url=' + encodeURIComponent( url );
164
- },
165
- getEntryList : function( url, sort, callback){
166
- if(typeof sort == 'function'){
167
- callback = sort;
168
- sort = 'count';
169
- }
170
- if(typeof url == 'function'){
171
- callback = url;
172
- sort = 'count';
173
- url = '';
174
- }
175
- url = url || location.href;
176
- $.si.jsonp({
177
- url : 'http://b.hatena.ne.jp/entrylist/json',
178
- data : {
179
- sort : sort,
180
- url : url
181
- },
182
- callback : callback
183
- });
184
- },
185
- getEntry : function( url , callback){
186
- var arg = $.si.reArg(url, callback)
187
- $.si.jsonp({
188
- url : 'http://b.hatena.ne.jp/entry/jsonlite/',
189
- data : {
190
- url : arg.url
191
- },
192
- callback : arg.callback
193
- });
194
- },
195
- getProfileImgUrl : function(id, size){
196
- size = size ? '_'+size : '';
197
- return 'http://cdn.www.st-hatena.com/users/mo/'+id+'/profile'+size+'.gif';
198
- },
199
- getEntryImgUrl : function(url){
200
- return 'http://b.hatena.ne.jp/entry/image/' + url;
201
- }
202
- };
203
-
204
-
205
- })(jQuery);
206
-
207
- /*
208
- * Easy Social Buttons 0.2 - jQuery plugin
209
- * written by cyokodog
210
- *
211
- * Copyright (c) 2014 cyokodog
212
- * http://www.cyokodog.net/
213
- * http://d.hatena.ne.jp/cyokodog/)
214
- * http://cyokodog.tumblr.com/
215
- * MIT LICENCE
216
- *
217
- * Built for jQuery library
218
- * http://jquery.com
219
- *
220
- */
221
-
222
-
223
- ;(function($){
224
-
225
- var plugin = $.esb = $.easySocialButtons = function(option ){
226
- var callee = arguments.callee;
227
- if(!(this instanceof callee)) return new callee(option );
228
- var o = this, c = o.config = $.extend(true, {}, callee.defaults, option);
229
- c.orders = option.orders || c.orders;
230
- c.buttons = $('<ul class="easy-social-buttons-container sns-buttons__items"/>');
231
- if(c.inverseColor) c.buttons.addClass('esb-inverse');
232
- $.each(c.orders, function(){
233
- var sname = this.toString();
234
- var api = c[sname] = $.esb[sname](option );
235
- api.getButton().appendTo(c.buttons);
236
- });
237
- }
238
- $.extend(plugin.prototype, {
239
- getButtons : function(){ // ボタンの取得
240
- var o = this, c = o.config;
241
- return c.buttons;
242
- },
243
- getButtonAPI : function(name ){ // API の取得
244
- var o = this, c = o.config;
245
- return c[name];
246
- }
247
- });
248
- $.extend(plugin, {
249
- defaults : {
250
- autoAdd : true, // true でボタンの自動挿入を行う
251
- addMethod : 'insertAfter', // ボタンの挿入メソッドを指定
252
- callback : function(api ){}, // プラグイン実行後のコールバック処理
253
- orders : ['hatebu','twitter', 'facebook', 'googleplus'], // ボタンの表示順
254
- labels : { // サービスの表示名
255
- 'hatebu' : '<i class="fa fa-hatena sns-buttons__icon is-hatena"></i>',
256
- 'twitter' : '<i class="fa fa-twitter sns-buttons__icon is-twitter"></i>',
257
- 'facebook' : '<i class="fa fa-facebook sns-buttons__icon is-facebook"></i>',
258
- 'googleplus' : '<i class="fa fa-google-plus sns-buttons__icon is-google-plus"></i>'
259
- }
260
- },
261
- version : '0.2',
262
- id : 'easy-social-buttons',
263
- name : 'Easy Social Buttons'
264
- });
265
-
266
- $.fn.easySocialButtons = function(option ){
267
- var c = $.extend(true, {}, plugin.defaults, option);
268
- if(option) c.orders = option.orders || c.orders;
269
- return this.each(function(){
270
- var t = $(this);
271
- c.url = t.prop('href') || t.data('href') || t.data('url') || c.url;
272
- if(!c.url){
273
- c.url = location.href;
274
- c.addMethod = 'appendTo';
275
- }
276
- var api = $.easySocialButtons(c);
277
- if(c.autoAdd){
278
- api.getButtons(c)[c.addMethod](t);
279
- }
280
- c.callback.apply(t[0], [api]);
281
- });
282
- }
283
-
284
- var DF = plugin.defaults;
285
- $.each(DF.orders, function(idx){
286
- var sname = this.toString();
287
- var f = $.esb[sname] = function(option ){
288
- var callee = arguments.callee;
289
- if(!(this instanceof callee)) return new callee(option );
290
- var o = this, c = o.config = $.extend(true, {}, callee.defaults, callee.overwrite[sname] || {}, option, option[sname]);
291
- c.url = c.url || location.href;
292
- c.button = $(c.tempalte);
293
- c.wrapper = c.button.hasClass('esb') ? c.button : c.button.find('.esb');
294
- c.label = c.wrapper.find('.esb-label').html(c.label);
295
- c.counter = c.wrapper.find('.esb-counter').html(c.waitCounter);
296
- c.entryLink = c.wrapper.find('a.esb-entry');
297
- c.searchLink = c.wrapper.find('a.esb-search');
298
- if(c.useBrandColor) c.wrapper.addClass('esb-' + sname);
299
- if($.si){
300
- var SI = $.si[sname];
301
- if(c.counter.size() && SI.getEntryCount){
302
- SI.getEntryCount(c.url, function(count ){
303
- c.counter.text(count);
304
- });
305
- }
306
- !SI.getEntryUrl || c.entryLink.prop('href', SI.getEntryUrl(c.url )).prop('title', c.entryTitle);
307
- !SI.getSearchUrl || c.searchLink.prop('href', SI.getSearchUrl(c.url )).prop('title', c.searchTitle);
308
- }
309
- }
310
- $.extend(f.prototype, {
311
- getButton : function(){
312
- var o = this, c = o.config;
313
- return c.button;
314
- }
315
- });
316
- $.extend(f, {
317
- id : sname,
318
- defaults : {
319
- url : '',
320
- label : DF.labels[sname],
321
- entryTitle : '投稿する', // esb-entry クラスを持つ要素に割り当てる title 属性値
322
- searchTitle : '検索する', // esb-search クラスを持つ要素に割り当てる title 属性値
323
- waitCounter : '<span>&nbsp;</span>', // Web API の取得結果待ち時に表示するマークアップ
324
- tempalte : '<li class="esb sns-buttons__item"><a class="esb-label esb-entry sns-buttons__entry-link" target="_blank"></a><a class="esb-counter esb-search sns-buttons__search-link" target="_blank"></a></li>', // ボタンのテンプレート
325
- useBrandColor : false, // ブランドカラーの使用
326
- inverseColor : false // ブランドカラー未使用時の配色の反転
327
- },
328
- overwrite : {
329
- hatebu : {
330
- entryTitle : 'ブックマークする'
331
- }
332
- }
333
- });
334
- });
335
- })(jQuery);
336
-
337
- $(function(){
338
- $('.sns-buttons').easySocialButtons();
339
- });
1
+ /*
2
+ * Social Info 0.2 - jQuery plugin
3
+ * written by cyokodog
4
+ *
5
+ * Copyright (c) 2014 cyokodog
6
+ * http://www.cyokodog.net/
7
+ * http://d.hatena.ne.jp/cyokodog/)
8
+ * http://cyokodog.tumblr.com/
9
+ * MIT LICENCE
10
+ *
11
+ * Built for jQuery library
12
+ * http://jquery.com
13
+ *
14
+ */
15
+
16
+ ;(function($){
17
+
18
+ $.social = $.social || {};
19
+ $.si = $.social.info = {
20
+ jsonp : function( p ){
21
+ return $.ajax({
22
+ url:p.url,
23
+ dataType:'jsonp',
24
+ data:p.data,
25
+ success:function( r ){
26
+ p.callback(r);
27
+ }
28
+ });
29
+ },
30
+ reArg : function(url , callback){
31
+ if(typeof url == 'object') return url;
32
+ if(typeof url == 'function'){
33
+ callback = url;
34
+ url = '';
35
+ }
36
+ url = url || location.href;
37
+ return {
38
+ url : url,
39
+ callback : callback
40
+ };
41
+ },
42
+ cache : {
43
+ twitter : {
44
+ entryCount : {}
45
+ }
46
+ },
47
+ version : '0.2',
48
+ id : 'social-info',
49
+ name : 'Social Info'
50
+ }
51
+
52
+
53
+ $.si.twitter = {
54
+ getEntryCount : function(url, callback){
55
+ var arg = $.extend({
56
+ url : location.href,
57
+ useCache : true,
58
+ callback : function( count ){}
59
+ }, $.si.reArg(url, callback))
60
+ var cache = $.si.cache.twitter.entryCount;
61
+ var eurl = encodeURIComponent(url);
62
+ if(arg.useCache && cache[eurl] != undefined){
63
+ arg.callback(cache[eurl]);
64
+ return;
65
+ }
66
+ $.si.jsonp({
67
+ url : 'http://urls.api.twitter.com/1/urls/count.json',
68
+ data : {
69
+ url : arg.url
70
+ },
71
+ callback : function(r){
72
+ var count = r = !r ? 0 : r.count;
73
+ cache[eurl] = count;
74
+ arg.callback(count);
75
+ }
76
+ });
77
+ },
78
+ getEntryUrl : function(url, title ){
79
+ url = url || location.href;
80
+ if(title) title = '&text=' + encodeURIComponent(title);
81
+ else{
82
+ if(url == location.href) title = '&text=' + encodeURIComponent(document.title);
83
+ }
84
+ return 'https://twitter.com/intent/tweet?url=' + encodeURIComponent(url) + (title || '');
85
+ },
86
+ getSearchUrl : function( url ){
87
+ url = url || location.href;
88
+ return 'https://twitter.com/search?q=' + encodeURIComponent( url );
89
+ }
90
+ }
91
+
92
+ $.si.facebook = {
93
+ getEntryCount : function( url , callback){
94
+ var arg = $.si.reArg(url, callback)
95
+ $.si.jsonp({
96
+ url : 'https://graph.facebook.com/',
97
+ data : {
98
+ id : arg.url
99
+ },
100
+ callback : function(r){
101
+ arg.callback(r.shares || 0);
102
+ }
103
+ });
104
+ },
105
+ getEntryUrl : function( url ){
106
+ url = url || location.href;
107
+ return 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(url);
108
+ },
109
+ getSearchUrl : function( url ){
110
+ url = url || location.href;
111
+ return 'https://www.facebook.com/#!/search/results.php?q=' + encodeURIComponent( url );
112
+ }
113
+ }
114
+
115
+ $.si.googleplus = {
116
+ getEntryCount : function( url , callback){
117
+ var arg = $.si.reArg(url, callback)
118
+ $.ajax({
119
+ type: "get",
120
+ dataType: "xml",
121
+ url: "http://query.yahooapis.com/v1/public/yql",
122
+ data: {
123
+ q: "SELECT content FROM data.headers WHERE url='https://plusone.google.com/_/+1/fastbutton?hl=ja&url=" + arg.url + "' and ua='#Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36'",
124
+ format: "xml",
125
+ env: "http://datatables.org/alltables.env"
126
+ },
127
+ success: function (data) {
128
+ var content = $(data).find("content").text();
129
+ var match = content.match(/window\.__SSR[\s*]=[\s*]{c:[\s*](\d+)/i);
130
+ var count = (match != null) ? match[1] : 0;
131
+ arg.callback(count);
132
+ }
133
+ });
134
+ },
135
+ getEntryUrl : function( url ){
136
+ url = url || location.href;
137
+ return 'https://plus.google.com/share?url=' + encodeURIComponent(url);
138
+ },
139
+ getSearchUrl : function( url ){
140
+ url = url || location.href;
141
+ return 'https://plus.google.com/u/0/?tab=mX#s/' + encodeURIComponent( url );
142
+ }
143
+ }
144
+
145
+
146
+ $.si.hatebu = {
147
+ getEntryCount : function( url , callback){
148
+ var arg = $.si.reArg(url, callback)
149
+ $.si.jsonp({
150
+ url : 'http://api.b.st-hatena.com/entry.count',
151
+ data : {
152
+ url : arg.url
153
+ },
154
+ callback : arg.callback
155
+ });
156
+ },
157
+ getEntryUrl : function(url){
158
+ url = url || location.href;
159
+ return 'http://b.hatena.ne.jp/entry/' + url.replace(/^http:\/\//,'').replace(/^https:\/\//,'s/');
160
+ },
161
+ getSearchUrl : function( url ){
162
+ url = url || location.href;
163
+ return 'http://b.hatena.ne.jp/entrylist?url=' + encodeURIComponent( url );
164
+ },
165
+ getEntryList : function( url, sort, callback){
166
+ if(typeof sort == 'function'){
167
+ callback = sort;
168
+ sort = 'count';
169
+ }
170
+ if(typeof url == 'function'){
171
+ callback = url;
172
+ sort = 'count';
173
+ url = '';
174
+ }
175
+ url = url || location.href;
176
+ $.si.jsonp({
177
+ url : 'http://b.hatena.ne.jp/entrylist/json',
178
+ data : {
179
+ sort : sort,
180
+ url : url
181
+ },
182
+ callback : callback
183
+ });
184
+ },
185
+ getEntry : function( url , callback){
186
+ var arg = $.si.reArg(url, callback)
187
+ $.si.jsonp({
188
+ url : 'http://b.hatena.ne.jp/entry/jsonlite/',
189
+ data : {
190
+ url : arg.url
191
+ },
192
+ callback : arg.callback
193
+ });
194
+ },
195
+ getProfileImgUrl : function(id, size){
196
+ size = size ? '_'+size : '';
197
+ return 'http://cdn.www.st-hatena.com/users/mo/'+id+'/profile'+size+'.gif';
198
+ },
199
+ getEntryImgUrl : function(url){
200
+ return 'http://b.hatena.ne.jp/entry/image/' + url;
201
+ }
202
+ };
203
+
204
+
205
+ })(jQuery);
206
+
207
+ /*
208
+ * Easy Social Buttons 0.2 - jQuery plugin
209
+ * written by cyokodog
210
+ *
211
+ * Copyright (c) 2014 cyokodog
212
+ * http://www.cyokodog.net/
213
+ * http://d.hatena.ne.jp/cyokodog/)
214
+ * http://cyokodog.tumblr.com/
215
+ * MIT LICENCE
216
+ *
217
+ * Built for jQuery library
218
+ * http://jquery.com
219
+ *
220
+ */
221
+
222
+
223
+ ;(function($){
224
+
225
+ var plugin = $.esb = $.easySocialButtons = function(option ){
226
+ var callee = arguments.callee;
227
+ if(!(this instanceof callee)) return new callee(option );
228
+ var o = this, c = o.config = $.extend(true, {}, callee.defaults, option);
229
+ c.orders = option.orders || c.orders;
230
+ c.buttons = $('<ul class="easy-social-buttons-container sns-buttons__items"/>');
231
+ if(c.inverseColor) c.buttons.addClass('esb-inverse');
232
+ $.each(c.orders, function(){
233
+ var sname = this.toString();
234
+ var api = c[sname] = $.esb[sname](option );
235
+ api.getButton().appendTo(c.buttons);
236
+ });
237
+ }
238
+ $.extend(plugin.prototype, {
239
+ getButtons : function(){ // ボタンの取得
240
+ var o = this, c = o.config;
241
+ return c.buttons;
242
+ },
243
+ getButtonAPI : function(name ){ // API の取得
244
+ var o = this, c = o.config;
245
+ return c[name];
246
+ }
247
+ });
248
+ $.extend(plugin, {
249
+ defaults : {
250
+ autoAdd : true, // true でボタンの自動挿入を行う
251
+ addMethod : 'insertAfter', // ボタンの挿入メソッドを指定
252
+ callback : function(api ){}, // プラグイン実行後のコールバック処理
253
+ orders : ['hatebu','twitter', 'facebook', 'googleplus'], // ボタンの表示順
254
+ labels : { // サービスの表示名
255
+ 'hatebu' : '<i class="fa fa-hatena sns-buttons__icon is-hatena"></i>',
256
+ 'twitter' : '<i class="fa fa-twitter sns-buttons__icon is-twitter"></i>',
257
+ 'facebook' : '<i class="fa fa-facebook sns-buttons__icon is-facebook"></i>',
258
+ 'googleplus' : '<i class="fa fa-google-plus sns-buttons__icon is-google-plus"></i>'
259
+ }
260
+ },
261
+ version : '0.2',
262
+ id : 'easy-social-buttons',
263
+ name : 'Easy Social Buttons'
264
+ });
265
+
266
+ $.fn.easySocialButtons = function(option ){
267
+ var c = $.extend(true, {}, plugin.defaults, option);
268
+ if(option) c.orders = option.orders || c.orders;
269
+ return this.each(function(){
270
+ var t = $(this);
271
+ c.url = t.prop('href') || t.data('href') || t.data('url') || c.url;
272
+ if(!c.url){
273
+ c.url = location.href;
274
+ c.addMethod = 'appendTo';
275
+ }
276
+ var api = $.easySocialButtons(c);
277
+ if(c.autoAdd){
278
+ api.getButtons(c)[c.addMethod](t);
279
+ }
280
+ c.callback.apply(t[0], [api]);
281
+ });
282
+ }
283
+
284
+ var DF = plugin.defaults;
285
+ $.each(DF.orders, function(idx){
286
+ var sname = this.toString();
287
+ var f = $.esb[sname] = function(option ){
288
+ var callee = arguments.callee;
289
+ if(!(this instanceof callee)) return new callee(option );
290
+ var o = this, c = o.config = $.extend(true, {}, callee.defaults, callee.overwrite[sname] || {}, option, option[sname]);
291
+ c.url = c.url || location.href;
292
+ c.button = $(c.tempalte);
293
+ c.wrapper = c.button.hasClass('esb') ? c.button : c.button.find('.esb');
294
+ c.label = c.wrapper.find('.esb-label').html(c.label);
295
+ c.counter = c.wrapper.find('.esb-counter').html(c.waitCounter);
296
+ c.entryLink = c.wrapper.find('a.esb-entry');
297
+ c.searchLink = c.wrapper.find('a.esb-search');
298
+ if(c.useBrandColor) c.wrapper.addClass('esb-' + sname);
299
+ if($.si){
300
+ var SI = $.si[sname];
301
+ if(c.counter.size() && SI.getEntryCount){
302
+ SI.getEntryCount(c.url, function(count ){
303
+ c.counter.text(count);
304
+ });
305
+ }
306
+ !SI.getEntryUrl || c.entryLink.prop('href', SI.getEntryUrl(c.url )).prop('title', c.entryTitle);
307
+ !SI.getSearchUrl || c.searchLink.prop('href', SI.getSearchUrl(c.url )).prop('title', c.searchTitle);
308
+ }
309
+ }
310
+ $.extend(f.prototype, {
311
+ getButton : function(){
312
+ var o = this, c = o.config;
313
+ return c.button;
314
+ }
315
+ });
316
+ $.extend(f, {
317
+ id : sname,
318
+ defaults : {
319
+ url : '',
320
+ label : DF.labels[sname],
321
+ entryTitle : '投稿する', // esb-entry クラスを持つ要素に割り当てる title 属性値
322
+ searchTitle : '検索する', // esb-search クラスを持つ要素に割り当てる title 属性値
323
+ waitCounter : '<span>&nbsp;</span>', // Web API の取得結果待ち時に表示するマークアップ
324
+ tempalte : '<li class="esb sns-buttons__item"><a class="esb-label esb-entry sns-buttons__entry-link" target="_blank"></a><a class="esb-counter esb-search sns-buttons__search-link" target="_blank"></a></li>', // ボタンのテンプレート
325
+ useBrandColor : false, // ブランドカラーの使用
326
+ inverseColor : false // ブランドカラー未使用時の配色の反転
327
+ },
328
+ overwrite : {
329
+ hatebu : {
330
+ entryTitle : 'ブックマークする'
331
+ }
332
+ }
333
+ });
334
+ });
335
+ })(jQuery);
336
+
337
+ $(function(){
338
+ $('.sns-buttons').easySocialButtons();
339
+ });