Skip to content

Instantly share code, notes, and snippets.

@kriegaex
Last active December 17, 2015 01:49
Show Gist options
  • Save kriegaex/5530984 to your computer and use it in GitHub Desktop.
Save kriegaex/5530984 to your computer and use it in GitHub Desktop.
Sorry for my bad JavaScript, it is my first try to use this language.
// ==UserScript==
// @name Backlog Filter
// @namespace myproject.telekom.de
// @description MyProject ein paar Buttons schenken, mit denen sich Backlogs filtern lassen
// @include https://myproject.telekom.de/pi/rb/master_backlogs/hmp
// @require http://code.jquery.com/jquery-1.9.1.min.js
// @version 3.15
// @grant none
// ==/UserScript==
function filterTo(text) {
return function() {
window.jQuery('.backlog').hide().filter(function(){
return window.jQuery(this).find('.name').text().match(text);
}).show();
};
}
var $h2 = window.jQuery('#content > h2');
var labels = [
"S&C",
"ProSyst",
"B&R",
];
var filters = [
/Setup/i,
/mPRM|ProSyst/i,
/Billing|Back-?End/i,
];
for (var i=0, label, filter; label = labels[i], filter = filters[i]; i++) {
window.jQuery('<button>')
.text(label)
.click(filterTo(filter))
.insertAfter($h2);
}
window.jQuery('<button>')
.text("Alle")
.click(function() {
window.jQuery('.backlog').show();
})
.insertAfter($h2);
// Activate to pre-select a specific filter
//window.jQuery("button:contains('B&R')").click();
// ==UserScript==
// @name MyProject KeepAlive
// @namespace myproject.telekom.de
// @description Make a request every 5 minutes to prevent the session from timing out
// @include https://myproject.telekom.de/*
// @require http://code.jquery.com/jquery-1.9.1.min.js
// @version 3.14
// @grant none
// ==/UserScript==
function keepAlive() {
window.jQuery.ajax({ method: 'get', url: 'https://myproject.telekom.de/pi/projects?' + (Math.random()) })
.always(function() {
setTimeout(keepAlive, 5 * 60 * 1000);
});
}
keepAlive();
// ==UserScript==
// @name OWA KeepAlive
// @namespace myproject.telekom.de
// @description Make a request every 5 minutes to prevent the session from timing out
// @include https://owa.t-online.net/owa/
// @include https://owa.t-online.net/owa/*
// @require http://code.jquery.com/jquery-1.9.1.min.js
// @version 1.34
// @grant none
// ==/UserScript==
function keepAlive() {
window.jQuery.ajax({ method: 'get', url: 'https://owa.t-online.net/owa/?' + (Math.random()) })
.always(function() {
setTimeout(keepAlive, 1000);
});
}
keepAlive();
// ==UserScript==
// @name OWA/MyProject AntiSecurity
// @namespace myproject.telekom.de
// @description Form-Speicherschutz aufheben für MyProject und OWA
// @include https://myproject.telekom.de/pi/login
// @include https://owa.t-online.net/owa/auth/logon*
// @version 1.34
// @grant none
// ==/UserScript==
var elems, i, l;
elems = window.document.forms;
for (i=0, l=elems.length; i < l; i++) {
elems[i].setAttribute('autocomplete', 'on');
elems[i].autocomplete = true;
}
elems = window.document.getElementsByTagName('input');
for (i=0, l=elems.length; i < l; i++) {
elems[i].setAttribute('autocomplete', 'on');
elems[i].autocomplete = true;
}
@kriegaex
Copy link
Author

  • Filtering is now done based on RegEx instead of simple text match.
  • Added button labels (can be different from filter conditions).
  • Removed Shop, Portal, SDK (they are no longer in the same project as S&C, mPRM, B&R).
  • Changed unsafeWindow to just windowso as to avoid problems in Chrome with Tampermonkey.
  • jQuery require added to each script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment