mchdev / metadev-operations-validation-ext

// ==UserScript==
// @name         metadev-operations-validation-ext
// @namespace    https://openuserjs.org/users/mchdev
// @description  adds button for operations validation
// @homepageURL  https://openuserjs.org/scripts/mchdev/metadev-operations-validation-ext
// @updateURL    https://openuserjs.org/meta/mchdev/metadev-operations-validation-ext.meta.js
// @downloadURL  https://openuserjs.org/install/mchdev/metadev-operations-validation-ext.user.js
// @copyright    2024, mchdev (https://openuserjs.org/users/mchdev)
// @license      MIT
// @version      0.2
// @author       mchdev
// @match        https://meta.vub.sk/*;v=*/Operation/
// @match        https://meta2.vub.sk/*;v=*/Operation/
// @run-at       document-end
// ==/UserScript==

(function() {
  'use strict';
  $(document).ready(function() {
    setTimeout(function() {
      $('.tabmenu').append('<li id="validate-operations-link"><a class="pill">Validate operations</a></li>');
      $("#validate-operations-link a").click(function(e) {
        e.preventDefault();
        var contextmodel = $("#append-helper").attr("data-contextmodel");
        $("#append-helper").attr("data-contextmodel", contextmodel + '&validation=1');
        startValidate(getBoxParams(window));
        $("#append-helper").attr("data-contextmodel", contextmodel);
      });
    }, 1000);
  });
})();