feedback mit hübschen bildern

warn fehlt noch
This commit is contained in:
troy grunt 2021-01-02 16:35:58 +01:00
parent 5ec7cb3122
commit 4e88d81874

View File

@ -22,29 +22,55 @@ function ajaxFeedback(e,url,css) {
return false;
}
function getCoords(e) {
var p = {};
p.x = e.offsetLeft;
p.y = e.offsetTop;
while (e.offsetParent) {
p.x = p.x + e.offsetParent.offsetLeft;
p.y = p.y + e.offsetParent.offsetTop;
if (e == document.getElementsByTagName("body")[0]) {
break;
}
else {
e = e.offsetParent;
}
}
return p;
}
function successMarker(e,css) {
var cursorX = e.offsetLeft || 0;
var cursorY = e.offsetTop || 0;;
var p = getCoords(e);
var cursorX = p.x
var cursorY = p.y
console.log('OK',cursorX,cursorY);
o = $('<div style="position: absolute; top:'+cursorY+'px; left: '+ cursorX +'px; width: 20px; height: 20px; background-color: #0f0; '+css+'">OK</div>');
o = $('<div style="position: absolute; top:'+cursorY+'px; left: '+ cursorX +'px; width: 40px; height: 40px; z-index: 999; fill: green; pointer-events: none;'+css+'"><svg version="1.1" x="0px" y="0px" viewBox="0 0 1000 1000" xml:space="preserve"><g><path d="M959.4,469.4c-16.9,0-30.6,13.7-30.6,30.6c0,236.4-192.3,428.7-428.7,428.7S71.3,736.4,71.3,500C71.3,263.6,263.6,71.3,500,71.3c93.7,0,182.7,29.7,257.4,85.8c13.5,10.2,32.7,7.4,42.9-6.1c10.2-13.5,7.4-32.7-6.1-42.8C708.8,43.9,607.1,10,500,10C229.8,10,10,229.8,10,500c0,270.2,219.8,490,490,490s490-219.8,490-490C990,483.1,976.3,469.4,959.4,469.4z"/><path d="M215.4,447.7c-12-12-31.3-12-43.3,0c-12,12-12,31.3,0,43.3l245,245c6,6,13.8,9,21.7,9c7.8,0,15.7-3,21.7-9L981,215.4c12-12,12-31.3,0-43.3c-12-12-31.3-12-43.3,0l-499,499L215.4,447.7z"/></g></svg></div>');
$( "body" ).append( o );
$(o).fadeOut(5000);
}
function warnMarker(e,css) {
var cursorX = e.offsetLeft || 0;
var cursorY = e.offsetTop || 0;;
var p = getCoords(e);
var cursorX = p.x
var cursorY = p.y
console.log('WARN',cursorX,cursorY);
o = $('<div style="position: absolute; top:'+cursorY+'px; left: '+ cursorX +'px; width: 20px; height: 20px; background-color: #ff0; '+css+'">!</div>');
o = $('<div style="position: absolute; top:'+cursorY+'px; left: '+ cursorX +'px; width: 40px; height: 40px; background-color: #ff0; z-index: 999; pointer-events: none;'+css+'">!</div>');
$( "body" ).append( o );
$(o).fadeOut(5000);
}
function errorMarker(e,css) {
var cursorX = e.offsetLeft || 0;
var cursorY = e.offsetTop || 0;;
var p = getCoords(e);
var cursorX = p.x
var cursorY = p.y
console.log('ERR',cursorX,cursorY);
o = $('<div style="position: absolute; top:'+cursorY+'px; left: '+ cursorX +'px; width: 20px; height: 20px; background-color: #f00; '+css+'">Err</div>');
o = $('<div style="position: absolute; top:'+cursorY+'px; left: '+ cursorX +'px; width: 40px; height: 40px; fill: red; z-index: 999; pointer-events: none;'+css+'"><svg version="1.0" x="0px" y="0px" viewBox="0 0 100 125" xml:space="preserve"><g><path fill="#000000" d="M50,14.996c-19.333,0-35.004,15.671-35.004,35.004c0,19.332,15.671,35.004,35.004,35.004 c19.332,0,35.004-15.672,35.004-35.004C85.004,30.667,69.332,14.996,50,14.996z M50,79.004c-15.993,0-29.004-13.012-29.004-29.004 c0-15.993,13.011-29.004,29.004-29.004c15.992,0,29.004,13.011,29.004,29.004C79.004,65.992,65.992,79.004,50,79.004z"/><polygon fill="#000000" points="70.578,36.423 63.578,29.419 50,42.998 36.421,29.419 29.421,36.423 43,50.002 29.421,63.576 36.421,70.58 50,57.002 63.578,70.58 70.578,63.576 57.004,50.002 "/></g></svg></div>');
$( "body" ).append( o );
$(o).fadeOut(5000);
}