Created
August 1, 2016 06:54
-
-
Save gaeulbyul/d0654ab42535c05c50e0adf52eb723d1 to your computer and use it in GitHub Desktop.
Add clipboard paste feature to TweetDeck. Note that this script isn't compatible with Firefox or other Gecko-based browser.
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
/* tweetdeck-paste-image.js | |
* License: WTFPL | |
*/ | |
$(document.body).on('paste', function (event) { | |
if ($('.js-add-image-button').hasClass('is-disabled')) { | |
return; | |
} | |
var items = event.originalEvent.clipboardData.items; | |
var item = items[0]; | |
if (item.kind !== 'file') return; | |
var files = [ item.getAsFile() ]; | |
// 트윗 입력창을 닫은 이후에 멘션 안 남게 | |
if (!$('.app-content').hasClass('is-open')) { | |
$(document).trigger('uiComposeTweet', { type: 'tweet' }); | |
} | |
$(document).trigger('uiFilesAdded', { files }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see also: zn/tweetdeck-paste-image.user.js (compatible with Firefox)