Last active
September 17, 2020 15:03
-
-
Save okj579/53198f9d04072811cf0f87646f9251d8 to your computer and use it in GitHub Desktop.
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 Imos Page Timer | |
// @namespace tag://imos | |
// @description Ein Timer der anzeigt wie lange man sich auf der aktuellen Redmine/OTRS Seite befindet. | |
// @author Endlessdeath, okj579 | |
// @match *://kunden.redmine.imos.net/* | |
// @match *://intern.redmine.imos.net/* | |
// @match *://otrs.hq.imos.net/* | |
// @version 2.1.1 | |
// @downloadURL https://raw.githubusercontent.com/imosnet/userscripts/master/imos-page-timer.user.js | |
// @icon https://kunden.redmine.imos.net/favicon.ico | |
// @require https://raw.github.com/odyniec/jQuery-tinyTimer/master/jquery.tinytimer.min.js | |
// @grant none | |
// ==/UserScript== | |
jQuery(function($){ | |
if (location.host.match(/redmine/)) { | |
$('#top-menu').append('<div style="float: right; margin-right: 0.5em; font-weight: bold; color: yellow;">Time on Page: <span class="page-timer"></span></div>'); | |
$('#time_entry_hours').parent('p').append('<div style="display: inline; margin-left: 0.5em; font-weight: bold; color: #505050;">(Time on Page: <span class="page-timer"></span>)</div>'); | |
var title = $('#content h2:first').text() + ' - ' + $('#content h3:first').text(); | |
$('<input onclick="this.select()">').css({width:20}).val(title) | |
.wrap('<div class="contextual">').parent().prependTo('#content'); | |
} else if (location.host.match(/otrs/)) { | |
$('#Header').append('<div style="position:absolute; top: 50px; right: 30px;">Time on Page: <span class="page-timer"></span></div>') | |
} | |
$('.page-timer').tinyTimer({ | |
from: Date.now(), | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment