forked from alice0775/userChrome.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addSplitterToGreasemonkeyManageWindow.uc.js
56 lines (52 loc) · 2 KB
/
addSplitterToGreasemonkeyManageWindow.uc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// ==UserScript==
// @name addSplitterToGreasemonkeyManageWindow.uc.js
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description add Splitter To Greasemonkey Manage Window
// @include chrome://greasemonkey/content/manage.xul
// @compatibility Firefox 2.0 3.0
// @author Alice0775
// @version 2008/04/21
// @Note
// ==/UserScript==
setTimeout(function(){
var style = <><![CDATA[
#col_left,
#col_right
{
min-width: 100px !important;
max-width: 1000px !important;
}
]]></>.toString().replace(/\s+/g, " ");
var sspi = document.createProcessingInstruction(
'xml-stylesheet',
'type="text/css" href="data:text/css,' + encodeURIComponent(style) + '"'
);
document.insertBefore(sspi, document.documentElement);
sspi.getAttribute = function(name) {
return document.documentElement.getAttribute(name);
};
var aNode = document.getElementById("col_right");
aNode.parentNode.insertBefore(document.createElement("splitter"),aNode);
var listbox = document.getElementById("lstScripts");
//listbox.appendItem(' ')
listbox.nextSibling.removeAttribute('flex');
listbox.removeAttribute('flex');
listbox.setAttribute('flex', "6");
//patch for Listbox (greasemonkey-0.8.20080415.0)
// xxx Bug 413336 - listbox scrolling behaves badly when flexed and followed by a line-wrapped label
window.populateChooser = function populateChooser() {
var scripts = config.scripts;
for (var i = 0, script = null; (script = scripts[i]); i++)
addListitem(script, i);
var listbox = document.getElementById("lstScripts");
// listbox.appendItem(' ');
};
window.populateChooser = function chooseScript(index) {
listbox.selectedIndex = index;
listbox.ensureIndexIsVisible( index )
listbox.nextSibling.removeAttribute('flex');
listbox.removeAttribute('flex');
listbox.setAttribute('flex', "6");
listbox.focus();
}
},500);