Last active
December 20, 2015 16:38
-
-
Save fukamachi/6162605 to your computer and use it in GitHub Desktop.
はてなグループで本文のはてな記法をコピーするdotjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$('.section h3').each(function() { | |
var entry = $(this); | |
var permalink = entry.find('a').first().attr('href'); | |
$.get(permalink + '?mode=json').success(function(data) { | |
var button = $('<button>').text('コピー'); | |
button.on('click', function() { | |
window.prompt("Copy to clipboard: Ctrl+C, Enter", data['body']); | |
}); | |
entry.append(button); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment