Last active
October 6, 2022 07:27
-
-
Save schoettl/67f37a1430b68d4ce33e1ece05d43247 to your computer and use it in GitHub Desktop.
Termine aus Tabelle einfach in HiOrg anlegen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name New script - hiorg-server.de | |
// @namespace Violentmonkey Scripts | |
// @match https://www.hiorg-server.de/termin.php | |
// @grant none | |
// @version 1.0 | |
// @author - | |
// @description 16.6.2021, 23:20:58 | |
// ==/UserScript== | |
$(document).ready(function() { | |
var fillBtnClick = function() { | |
if (navigator.clipboard && navigator.clipboard.readText) { | |
navigator.clipboard.readText().then(text => { | |
if (!text) { | |
text = prompt('Hier per Copy & Paste eine Terminzeile aus der Tabelle eingeben.'); | |
} | |
fillForm(text); | |
}); | |
} else { | |
var text = prompt('Hier per Copy & Paste eine Terminzeile aus der Tabelle eingeben.'); | |
fillForm(text); | |
} | |
} | |
var fillForm = function(rawData) { | |
var data = rawData.split('\t'); | |
if (!rawData || data.length < 5) { | |
alert('Keine korrekten Eingabedaten. Abbruch.'); | |
return; | |
} | |
$('input[name=verbez]').prop('value', data[0]); | |
$('#datum').prop('value', data[1]); | |
$('#zeit').prop('value', data[2]); | |
$('#verzeitbis').prop('value', data[3]); | |
$('input[name=treff]').prop('value', data[4]); | |
$('#cpy').prop('checked', true); | |
}; | |
$('h1').first().append($('<button>Aus Excel-Zeile ausfüllen</button>').click(fillBtnClick)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Servus Jakob, die Petra hat mich auf dein Tool hingewiesen. Richtig coole Sache!! 💯 👍