1
2
3
4
5
6
7
8
9
10
  function socialbutton(target) {    $(.socialbuttons).css(height, 1em);    $(.section, target).each(function() {      var...
12
13
   function socialbutton(target) {     $(.socialbuttons).css(height, 1em);     $(.section, target).each(function() {      ...
15
add_js_setting($tDiary.plugin.socialbutton)# convert array to jsonadd_js_setting($tDiary.plugin.socialbutton.enables,   %Q...
17
$([name= +document.location.hash.substr(1) + ])                                     18
19
20
21
22
23
24
25
Upcoming SlideShare
Loading in …5
×

RubyからJavaScriptへ (!tDiary会議 2011)

1,467 views
1,409 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,467
On SlideShare
0
From Embeds
0
Number of Embeds
128
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

RubyからJavaScriptへ (!tDiary会議 2011)

  1. 1. 1
  2. 2. 2
  3. 3. 3
  4. 4. 4
  5. 5. 5
  6. 6. 6
  7. 7. 7
  8. 8. 8
  9. 9. 9
  10. 10. 10
  11. 11.   function socialbutton(target) {    $(.socialbuttons).css(height, 1em);    $(.section, target).each(function() {      var url = $(this).children(h3).children(a).get(0).href;      var title = $(this).children(h3).children(a).attr(title);      var socialbuttons = $(this).find(.socialbuttons);      append_button(url, title, socialbuttons);    });  }  function append_button(url, title, socialbuttons) {    $.each(config.enables, function(i, service) {      var options = callbacks[service](url, title.replace(/"/g, &quot;));      $.extend(options, config.options[service]);      $(<div class="socialbutton"></div>)        .css("float", "left")        .css("margin-right", "0.5em")        .appendTo(socialbuttons)        .socialbutton(service, options);    });  } 11
  12. 12. 12
  13. 13. 13
  14. 14.    function socialbutton(target) {     $(.socialbuttons).css(height, 1em);     $(.section, target).each(function() {       var url = $(this).children(h3).children(a).get(0).href;       var title = $(this).children(h3).children(a).attr(title);       var socialbuttons = $(this).find(.socialbuttons);       append_button(url, title, socialbuttons);     });   }   function append_button(url, title, socialbuttons) {     $.each(config.enables, function(i, service) {       var options = callbacks[service](url, title.replace(/"/g, &quot;));       $.extend(options, config.options[service]);       $(<div class="socialbutton"></div>)         .css("float", "left")         .css("margin-right", "0.5em")         .appendTo(socialbuttons)         .socialbutton(service, options);     });   } 14
  15. 15. 15
  16. 16. add_js_setting($tDiary.plugin.socialbutton)# convert array to jsonadd_js_setting($tDiary.plugin.socialbutton.enables,   %Q|["#{@conf[socialbutton.enables].split(,).join(", ")}"]|)options = "{ twitter: { via: #{@conf[socialbutton.twitter.via]} } }" 16
  17. 17. 17
  18. 18. $([name= +document.location.hash.substr(1) + ]) 18
  19. 19. 19
  20. 20. 20
  21. 21. 21
  22. 22. 22
  23. 23. 23
  24. 24. 24
  25. 25. 25

×