swachtma / CSM Salesforce Quick Edits

// ==UserScript==
// @namespace     https://openuserjs.org/users/swachtma
// @name          CSM Salesforce Quick Edits
// @description   Hide non-essential fields for frequent CSM updates
// @copyright     2019, swachtma (https://openuserjs.org/users/swachtma)
// @license       MIT
// @version       1.1.5
// @include       https://cloudinary.lightning.force.com/*
// @match         https://cloudinary.lightning.force.com/*
// @grant         none
// ==/UserScript==

// ==OpenUserJS==
// @author swachtma
// ==/OpenUserJS==

(function() {
  "use strict";

  // first rules hide all edit menus
  let newStyles =
    `
.forcePageBlockSectionEdit {display: none;}
.forcePageBlockSectionEdit:nth-of-type(9), .forcePageBlockSectionEdit:nth-of-type(19) {display: block;}` +
    // Rehide uneeded items in CS Edit Menu (Leave CSM Comment + Use Case)
    `    .forcePageBlockSectionEdit:nth-of-type(9) > .slds-section__content > .slds-form > .slds-grid > .slds-grid
{display: none !important;}
.forcePageBlockSectionEdit:nth-of-type(9) > .slds-section__content > .slds-form > .slds-grid:nth-of-type(2) > .slds-grid:nth-of-type(1),
.forcePageBlockSectionEdit:nth-of-type(9) > .slds-section__content > .slds-form > .slds-grid:nth-of-type(8) > .slds-grid:nth-of-type(2)
{display: block !important}
` +
    // Misc Display Cleanup
    `.forcePageBlockSectionEdit .slds-form {display: table; width: 100%}
.tooltip {display: none !important;}
.tooltip-trigger {display: none !important;}
.forcePageBlockSectionEdit .slds-form .slds-grid:nth-child(7) {display: table-header-group;}
.forcePageBlockSectionEdit .slds-grid {display: block;}

.mdp .forcePageBlockSectionEdit {display: block !important;}

.modal-container {width: 100% important!; max-width: 80% !important;}
`;
  var style = document.createElement("style");
  style.type = "text/css";
  if (style.styleSheet) {
    style.styleSheet.cssText = newStyles;
  } else {
    style.appendChild(document.createTextNode(newStyles));
  }
  document.getElementsByTagName("head")[0].appendChild(style);
})();