// ==UserScript== // @name JIRA Cloud // @namespace http://tampermonkey.net/ // @version 0.5 // @description Re-theming script for JIRA Cloud // @author You // @match https://*.atlassian.net/* // @icon https://www.google.com/s2/favicons?sz=64&domain=atlassian.net // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; var css = document.createElement('style'); css.type = 'text/css'; css.name = "custom-css"; css.innerHTML = ` html, html body#jira { background-color: #eee; } body .cWzlMc, body .css-zvta6n, body .jsSCtF, body .cSnBhI, body .kCUjSv, body .kZKcTI { background-color: #eee; } body .izWGlW { background-color: #fff; } body .dgbPQn { background-color: #fff; margin: 24px 12px 32px 24px; border-radius: 4px; border: solid 1px #ccc; } body .bzpsgq { overflow: visible; width: calc(100% - 720px); } body .kfVduZ { width: auto; overflow: visible; } body .ihzd { display: none; } body .yjkY { min-width: 0; } body .dgMUBn { display: inline-block; position: absolute; } body .bzpsgq { padding-left: 0; } body .klZhqF { padding: 0; } body .kZKcTI /* ticket icon container (above fields widget) */ { float: right; margin: 0; padding: 0; } body .kZKcTI > div > div > div { margin: 0; } body .kZKcTI button .css-1ncnk3i, /* ticket icon (above fields widget) */ body .kZKcTI button .css-1ncnk3i > svg /* SVG for ticket icons (above fields widget) */ { width: 16px; height: 16px; } body .hlFJLM /* Collapsed custom fields widget's content */ { max-width: 20ex; } body .jkTZZQ /* widget content frame */ { padding-bottom: 4px; } body table.issue-table tbody tr.issuerow /* ticket table row */ { border-bottom: solid 1px #eee; } .ioAami { /* section heading containers */ border-bottom: solid #0052CC; margin-bottom: 8px; margin-top: 56px; padding-bottom: 4px; font-size: 1.2em; } body .mffpf0-0.dgbPQn .qwux5g-0.lpaOtj /* "activity header */ { display: none; } body .ss4jvk-4.gycPRd /* chat message */ { border-top: solid 1px #eee; padding-top: 8px; margin-top: 0px; } body .eANdKV /* initial chat box container */ { box-shadow: none; } /******************************************* ********** Confluence ************** ********************************************/ body .kkPmar, /* page header frame */ body .e1vqopgf0 /* page content frame */ { margin: 0 0 0 0; max-width: none; } body .rAVIf /* floating table header */ { display: none; } /****************************************** ******** editor *************** *******************************************/ .wcw-edit-container { margin: 16px 0; } .wcw-editor { width: 100%; height: 10em; border: solid 1px #eee; border-radius: 4px; } `; document.getElementsByTagName('head')[0].appendChild(css); // Add Mark-up Editor jQuery(document).onLoad( setTimeout(function(){ var ticket = jQuery('#jira-issue-header .css-47yo1b .css-1we84oz').text(); console.log(ticket); jQuery('.czMqAP').append(``); jQuery('.wcw-old').on('click', function(){ jQuery('.mEYYF, .dHydut').parent().html(`
`); jQuery('.wcw-edit-submit').on('click', function(){ jQuery.ajax({ type: 'POST', url: '../rest/api/2/issue/'+ticket+'/comment', data: JSON.stringify({body: jQuery('.wcw-editor').val()}), contentType: "application/json", dataType: "json", success: function(){ location.reload(); } }); }); }); }, 1000)); })();