MediaWiki:Gadget-FilterAlteredClicks.js:修订间差异

MediaWiki系统消息页面
(Git commit b7b1c61: chore: remove unused globals and update dependencies)
(Git commit 315405d: feat: sync upstream with Qiuwen)
 
第24行: 第24行:


// dist/FilterAlteredClicks/FilterAlteredClicks.js
// dist/FilterAlteredClicks/FilterAlteredClicks.js
function _createForOfIteratorHelper(o, allowArrayLike) {
function _createForOfIteratorHelper(r, e) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (!it) {
if (!t) {
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
if (it) o = it;
t && (r = t);
var i = 0;
var n = 0, F = function() {
var F = function() {
};
};
return { s: F, n: function() {
return { s: F, n: function() {
if (i >= o.length) return { done: true };
return n >= r.length ? { done: true } : { done: false, value: r[n++] };
return { done: false, value: o[i++] };
}, e: function(r2) {
}, e: function(e) {
throw r2;
throw e;
}, f: F };
}, f: F };
}
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
}
var normalCompletion = true, didErr = false, err;
var o, a = true, u = false;
return { s: function() {
return { s: function() {
it = it.call(o);
t = t.call(r);
}, n: function() {
}, n: function() {
var step = it.next();
var r2 = t.next();
normalCompletion = step.done;
return a = r2.done, r2;
}, e: function(r2) {
return step;
u = true, o = r2;
}, e: function(e) {
didErr = true;
err = e;
}, f: function() {
}, f: function() {
try {
try {
if (!normalCompletion && it.return != null) it.return();
a || null == t.return || t.return();
} finally {
} finally {
if (didErr) throw err;
if (u) throw o;
}
}
} };
} };
}
}
function _unsupportedIterableToArray(o, minLen) {
function _unsupportedIterableToArray(r, a) {
if (!o) return;
if (r) {
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
if ("string" == typeof r) return _arrayLikeToArray(r, a);
var n = Object.prototype.toString.call(o).slice(8, -1);
var t = {}.toString.call(r).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
}
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
}
function _arrayLikeToArray(arr, len) {
function _arrayLikeToArray(r, a) {
if (len == null || len > arr.length) len = arr.length;
(null == a || a > r.length) && (a = r.length);
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return arr2;
return n;
}
}
var __defProp = Object.defineProperty;
var __defProp = Object.defineProperty;
第124行: 第119行:
/* </nowiki> */
/* </nowiki> */


//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL0ZpbHRlckFsdGVyZWRDbGlja3MvRmlsdGVyQWx0ZXJlZENsaWNrcy50cyIsICJub2RlX21vZHVsZXMvLnBucG0vZmlsdGVyLWFsdGVyZWQtY2xpY2tzQDIuMC4xL25vZGVfbW9kdWxlcy9maWx0ZXItYWx0ZXJlZC1jbGlja3MvaW5kZXguanMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImV4cG9ydCB7ZGVmYXVsdCBhcyBmaWx0ZXJBbHRlcmVkQ2xpY2tzfSBmcm9tICdmaWx0ZXItYWx0ZXJlZC1jbGlja3MnO1xuIiwgImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZpbHRlckFsdGVyZWRDbGlja3MoY2FsbG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EO0FBRUEsV0FBT1YsU0FBU1csS0FBSyxNQUFNVCxLQUFLO0VBQ2pDO0FBQ0Q7IiwKICAibmFtZXMiOiBbIkZpbHRlckFsdGVyZWRDbGlja3NfZXhwb3J0cyIsICJfX2V4cG9ydCIsICJmaWx0ZXJBbHRlcmVkQ2xpY2tzIiwgIm1vZHVsZSIsICJleHBvcnRzIiwgIl9fdG9Db21tb25KUyIsICJjYWxsYmFjayIsICJvbmx5UGh5c2ljYWwiLCAiZXZlbnQiLCAib3JpZ2luYWxFdmVudCIsICJNb3VzZUV2ZW50IiwgIndoaWNoIiwgInNoaWZ0S2V5IiwgImFsdEtleSIsICJtZXRhS2V5IiwgImN0cmxLZXkiLCAiZGVmYXVsdFByZXZlbnRlZCIsICJjYWxsIl0KfQo=

2024年5月31日 (五) 15:57的最新版本

/**
 * SPDX-License-Identifier: MIT
 * _addText: '{{Gadget Header|license=MIT}}'
 *
 * @base {@link https://github.com/fregante/filter-altered-clicks}
 * @source {@link https://github.com/TopRealm/YsArchives-Gadgets/tree/master/src/FilterAlteredClicks}
 */
/**
 * +------------------------------------------------------------+
 * |            === WARNING: GLOBAL GADGET FILE ===             |
 * +------------------------------------------------------------+
 * |       All changes should be made in the repository,        |
 * |                otherwise they will be lost.                |
 * +------------------------------------------------------------+
 * |        Changes to this page may affect many users.         |
 * | Please discuss changes by opening an issue before editing. |
 * +------------------------------------------------------------+
 */
/* <nowiki> */

(() => {

"use strict";

// dist/FilterAlteredClicks/FilterAlteredClicks.js
function _createForOfIteratorHelper(r, e) {
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (!t) {
    if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
      t && (r = t);
      var n = 0, F = function() {
      };
      return { s: F, n: function() {
        return n >= r.length ? { done: true } : { done: false, value: r[n++] };
      }, e: function(r2) {
        throw r2;
      }, f: F };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  var o, a = true, u = false;
  return { s: function() {
    t = t.call(r);
  }, n: function() {
    var r2 = t.next();
    return a = r2.done, r2;
  }, e: function(r2) {
    u = true, o = r2;
  }, f: function() {
    try {
      a || null == t.return || t.return();
    } finally {
      if (u) throw o;
    }
  } };
}
function _unsupportedIterableToArray(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray(r, a);
    var t = {}.toString.call(r).slice(8, -1);
    return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
  }
}
function _arrayLikeToArray(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
  return n;
}
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all) __defProp(target, name, {
    get: all[name],
    enumerable: true
  });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    var _iterator = _createForOfIteratorHelper(__getOwnPropNames(from)), _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done; ) {
        let key = _step.value;
        if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
          get: () => from[key],
          enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
        });
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", {
  value: true
}), mod);
//! src/FilterAlteredClicks/FilterAlteredClicks.ts
var FilterAlteredClicks_exports = {};
__export(FilterAlteredClicks_exports, {
  filterAlteredClicks: () => filterAlteredClicks
});
module.exports = __toCommonJS(FilterAlteredClicks_exports);
function filterAlteredClicks(callback, onlyPhysical) {
  return function(event) {
    event = event.originalEvent || event;
    if (event instanceof MouseEvent && event.which > 1 || event.shiftKey || event.altKey || event.metaKey || event.ctrlKey || !onlyPhysical && event.defaultPrevented) {
      return;
    }
    return callback.call(this, event);
  };
}

})();

/* </nowiki> */

//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL0ZpbHRlckFsdGVyZWRDbGlja3MvRmlsdGVyQWx0ZXJlZENsaWNrcy50cyIsICJub2RlX21vZHVsZXMvLnBucG0vZmlsdGVyLWFsdGVyZWQtY2xpY2tzQDIuMC4xL25vZGVfbW9kdWxlcy9maWx0ZXItYWx0ZXJlZC1jbGlja3MvaW5kZXguanMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImV4cG9ydCB7ZGVmYXVsdCBhcyBmaWx0ZXJBbHRlcmVkQ2xpY2tzfSBmcm9tICdmaWx0ZXItYWx0ZXJlZC1jbGlja3MnO1xuIiwgImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGZpbHRlckFsdGVyZWRDbGlja3MoY2FsbGJhY2ssIG9ubHlQaHlzaWNhbCkge1xuXHRyZXR1cm4gZnVuY3Rpb24gKGV2ZW50KSB7XG5cdFx0ZXZlbnQgPSBldmVudC5vcmlnaW5hbEV2ZW50IHx8IGV2ZW50OyAvLyBKUXVlcnkgc3VwcG9ydFxuXHRcdGlmIChcblx0XHRcdChldmVudCBpbnN0YW5jZW9mIE1vdXNlRXZlbnQgJiYgZXZlbnQud2hpY2ggPiAxKVxuXHRcdFx0fHwgZXZlbnQuc2hpZnRLZXlcblx0XHRcdHx8IGV2ZW50LmFsdEtleVxuXHRcdFx0fHwgZXZlbnQubWV0YUtleVxuXHRcdFx0fHwgZXZlbnQuY3RybEtleVxuXHRcdFx0fHwgKCFvbmx5UGh5c2ljYWwgJiYgZXZlbnQuZGVmYXVsdFByZXZlbnRlZClcblx0XHQpIHtcblx0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