Last active
January 5, 2019 11:23
-
-
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
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
// ==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