Skip to content

Instantly share code, notes, and snippets.

@alirezamirian
Last active January 5, 2019 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alirezamirian/daf73f0e761369a04b8f8bdf570a9d64 to your computer and use it in GitHub Desktop.
Save alirezamirian/daf73f0e761369a04b8f8bdf570a9d64 to your computer and use it in GitHub Desktop.
A script to be used in greasemonkey or similar tools to fix rtl issues in jira
// ==UserScript==
// @name jira rtl fix
// @namespace http://tampermonkey.net/
// @version 0.1
// @description fixes rtl issues in jira
// @author Alireza Mirian
// @include /^https?://jira\..*$/
// @grant none
// ==/UserScript==
(function() {
'use strict';
$(document).ajaxComplete(function(event, request, settings) {
if (settings.url.indexOf('/secure/AjaxIssueAction') === 0) {
setTimeout(()=>{
fix();
});
}
});
$(function(){
fix();
});
function fix() {
const items = document.querySelectorAll('.action-body, .user-content-block');
items.forEach((e)=>{
e.setAttribute('dir', 'auto');
});
console.info(`direction corrected for items: ${items.length}`);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment