Created
November 23, 2008 21:14
-
-
Save dburger/28201 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 Outlook Web Access Extensions | |
// @namespace http://www2.hawaii.edu/~dburger | |
// @description Extensions to using the bastard child Outlook Web Access | |
// @include https://mail.camber.com/exchange/* | |
// ==/UserScript== | |
( | |
function() { | |
var tables = document.getElementsByTagName('table'); | |
for (var i = 0; i < tables.length; i++) { | |
var table = tables[i]; | |
if (table.className === 'trToolbar') { | |
var row = table.tBodies[0].rows[0]; | |
var newCell = row.insertCell(row.cells.length - 1); | |
newCell.setAttribute('valign', 'middle'); | |
newCell.setAttribute('nowrap', 'nowrap'); | |
var font = document.createElement('font'); | |
font.setAttribute('size', '2'); | |
font.appendChild(document.createTextNode('Select All')); | |
var nobr = document.createElement('nobr'); | |
nobr.appendChild(font); | |
var a = document.createElement('a'); | |
a.href = 'javascript:void(0);'; | |
a.addEventListener('click', function() { | |
var inputs = document.getElementsByTagName('input'); | |
for (var i = 0; i < inputs.length; i++) { | |
var input = inputs[i]; | |
var evt = document.createEvent('MouseEvents'); | |
if (input.type == 'checkbox' && !input.checked) { | |
// this won't fire the events to color the row | |
// input.checked = true; | |
// so dispatch as an event instead | |
evt.initEvent('click', true, false); | |
input.dispatchEvent(evt); | |
} | |
} | |
}, true); | |
a.appendChild(nobr); | |
newCell.appendChild(a); | |
} | |
} | |
} | |
)(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment