bryanwaddington / InTime

// ==UserScript==
// @name         InTime
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  InTime utilities
// @author       Bryan Waddington
// @match        http://intime.open.ac.uk/timesheet.php
// @grant        none
// ==/UserScript==

window.onload = function() {
    // ----- config -----
    // Row height.
    var rows = 650;
    // Set sortBy to either project, item, subItem or budget.
    var sortBy = 'project';
    // ------------------

    // Row height.
    parent.document.getElementsByTagName( 'frameset' )[ 0 ].rows="60," + rows + ", *";

    // Sort order.
    sort = {
        project: 'sp_StaffTagListProjectOrder',
        item:    'sp_StaffTagListItemOrder',
        subItem: 'sp_StaffTagListSubItemOrder',
        budget:  'sp_StaffTagListBudgetOrder'
    };
    var profiletagFrame = parent.document.getElementsByTagName('frameset')[0].getElementsByTagName('frameset')[0].getElementsByTagName('frame')[1];
    profiletagFrame.contentWindow.changeTagOrder(sort[sortBy]);
};