Greasy Fork 还支持 简体中文。

Click to Not Edit

Prevents click-to-edit in JIRA (matches JIRA Cloud URLs by default)

目前為 2020-12-21 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name Click to Not Edit
// @match *://*.atlassian.net/*
// @version 0.0.1.20201221192427
// @namespace https://greasyfork.org/users/719533
// @description Prevents click-to-edit in JIRA (matches JIRA Cloud URLs by default)
// ==/UserScript==
//
// This is supposed to disable click-to-edit in Jira unless ctrl or cmd is held.

document.addEventListener('click',
  ((event)=>{
    if (event.cmdKey || event.ctrlKey){
      return;  // allow normal click-to-edit
    }
    var e = event.target;
    while (e != document){
      var aa = e.attributes;
      for (var i=0; i<aa.length; ++i){
        var a = aa[i];
        if(a.name=='role' && a.value=='presentation' && e.tagName!='SPAN'){
          // This is an attempt to cleanly match relevant elements (comments, description) despite class obfuscation.
          // Excluding <span> avoids inhibiting clicks on attach/link buttons.

          console.log("CLICKED TO NOT EDIT, hold ctrl/cmd if you really want the thing to happen");
          event.preventDefault(); event.stopPropagation(); return false;
        };
      }
      e = e.parentNode;
    }
  }),
  {capture: true})