KameSame Open Framework - Jquery module

Progress module for KameSame Open Framework

目前為 2022-10-07 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.cn-greasyfork.org/scripts/451523/1101971/KameSame%20Open%20Framework%20-%20Jquery%20module.js

  1. "use strict";
  2. // ==UserScript==
  3. // @name KameSame Open Framework - Jquery module
  4. // @namespace timberpile
  5. // @description Progress module for KameSame Open Framework
  6. // @version 1.0
  7. // @copyright 2022+, Robin Findley, Timberpile
  8. // @license MIT; http://opensource.org/licenses/MIT
  9. // ==/UserScript==
  10. // These lines are necessary to make sure that TSC does not put any exports in the
  11. // compiled js, which causes the script to crash
  12. // eslint-disable-next-line no-var, @typescript-eslint/no-unused-vars
  13. var module = {};
  14. (async (global) => {
  15. const ksof = global.ksof;
  16. await ksof.ready('document');
  17. const promises = [];
  18. try {
  19. $.fn.jquery;
  20. }
  21. catch (e) {
  22. promises.push(ksof.load_script(ksof.support_files['jquery.js'], true /* cache */));
  23. }
  24. await Promise.all(promises);
  25. ksof.Jquery = { version: $.fn.jquery };
  26. // Notify listeners that we are ready.
  27. // Delay guarantees include() callbacks are called before ready() callbacks.
  28. setTimeout(function () { ksof.set_state('ksof.Jquery', 'ready'); }, 0);
  29. })(window);
  30. module.exports = null;