Last active
May 13, 2020 21:29
-
-
Save py4/f495aef9b8fbf6dd8b1c to your computer and use it in GitHub Desktop.
This file contains 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
// ==UserScript== | |
// @name RTL tweetdeck | |
// @namespace http://py4.ir | |
// @version 0.1 | |
// @description RTL support for tweetdeck without messing LTR. | |
// @author py4 | |
// @match https://tweetdeck.twitter.com/* | |
// @grant none | |
// @include https://tweetdeck.twitter.com/* | |
// ==/UserScript== | |
$(document).ready(function() { | |
$("p.js-tweet-text").each( function(index) { | |
if(($(this).text().match(/[\u0600-\u06FF\uFB8A\u067E\u0686\u06AF]/))) | |
$(this).css("direction","rtl"); | |
} | |
) | |
$(document).bind('DOMNodeInserted', function(event) { | |
if(event.target.classList.contains("js-stream-item")) { | |
p = $(event.target).find(".js-tweet-text"); | |
if(p.text().match(/[\u0600-\u06FF\uFB8A\u067E\u0686\u06AF]/)) | |
p.css("direction","rtl"); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment