Apr 062020
 

Auf die schnelle ein kurzes Tampermonkey oder Greasemonkey Script, um die Gängelung durch die Arbeitssicherheitsunterweisung abzukürzen. Keine Gewähr, bin absoluter JavaScript Laie!

// ==UserScript==
// @name         EstarGmbH impatient script
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Press 1 to stop the Nav Timer, Press 2 to show the solutions. Need to reload page after pressing 2
// @author       Marco
// @match        https://*.estargmbh.de/admin/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

   window.addEventListener('keydown', function(e) {
        var digit = e.keyCode - 48;
        // 48 is the code for '0'
        if (digit = 1  && //if 1 is pressed stop timer
            // don't intercept if a modifier key is held
            !e.altKey && !e.ctrlKey && !e.shiftKey && !e.metaKey &&
            // don't intercept 1-9 in the search input
            e.target.localName != 'input')
           {
            // test code
            // alert("Running!");

             $('#btnNext').prop('disabled',false);
             $('#btnNext').html('<i class="fa fa-chevron-right fa-fw"></i>');
             $('#btnNext').focus();
             clearInterval(countDownIntervall);

           }
       if (digit = 2 && //if 2 is pressed show solution
            // don't intercept if a modifier key is held
            !e.altKey && !e.ctrlKey && !e.shiftKey && !e.metaKey &&
            // don't intercept 1-9 in the search input
            e.target.localName != 'input')
       {
    document.body.innerHTML= document.body.innerHTML.replace(/_aw_0\" value=\"1\">/g,"_aw_0\" value=\"1\">SOLUTION (Please Reload Page):");
    document.body.innerHTML= document.body.innerHTML.replace(/_aw_1\" value=\"1\">/g,"_aw_1\" value=\"1\">SOLUTION (Please Reload Page):");
    document.body.innerHTML= document.body.innerHTML.replace(/_aw_2\" value=\"1\">/g,"_aw_2\" value=\"1\">SOLUTION (Please Reload Page):");
    document.body.innerHTML= document.body.innerHTML.replace(/_aw_3\" value=\"1\">/g,"_aw_3\" value=\"1\">SOLUTION (Please Reload Page):");
    document.body.innerHTML= document.body.innerHTML.replace(/_aw_4\" value=\"1\">/g,"_aw_4\" value=\"1\">SOLUTION (Please Reload Page):");
    document.body.innerHTML= document.body.innerHTML.replace(/_aw_5\" value=\"1\">/g,"_aw_5\" value=\"1\">SOLUTION (Please Reload Page):");
    document.body.innerHTML= document.body.innerHTML.replace(/_aw_6\" value=\"1\">/g,"_aw_6\" value=\"1\">SOLUTION (Please Reload Page):");
       }
    }, true);
}
)();

 Antworten

Du kannst diese HTML Tags und Attribute benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(Pflichtfeld)

(Pflichtfeld)