
trau dich ruhig, ist nur software, kann nicht töten!
Gruß
Thomas
Und was kann ich noch alles löschen?ts-soft hat geschrieben:schmeiß auch raus![]()
trau dich ruhig, ist nur software, kann nicht töten!
Code: Alles auswählen
// ==UserScript==
// @name Code Helper for PureBasic Forums
// @description Code Helper
// @include http://www.purebasic.fr/german/viewtopic.php*
// @include http://www.purebasic.fr/english/viewtopic.php*
// @include http://www.purebasic.fr/french/viewtopic.php*
// ==/UserScript==
var plus = "http://www.realsource.de/images/icons/plus.gif";
var minus = "http://www.realsource.de/images/icons/minus.gif";
var hoch = "95px";
var col_col = "#EFEFEF";
var exp_col = "#FAFAFA";
var expandfunc = '\n';
expandfunc += 'function expand_code(img_id)\n';
expandfunc += '{\n';
expandfunc += ' var node = document.getElementById(img_id);\n';
expandfunc += ' node.src = "'+minus+'" ;\n';
expandfunc += ' node.onclick = function() { collapse_code(img_id); };\n';
expandfunc += ' var node = document.getElementById("c"+img_id);\n';
expandfunc += ' node.removeAttribute("style");\n';
expandfunc += ' node.style.backgroundColor = "'+exp_col+'";\n';
expandfunc += '}\n';
var collapsefunc = '\n';
collapsefunc += 'function collapse_code(img_id)\n';
collapsefunc += '{\n';
collapsefunc += ' var node = document.getElementById(img_id);\n';
collapsefunc += ' node.src = "'+plus+'" ;\n';
collapsefunc += ' node.onclick = function() { expand_code(img_id); };\n';
collapsefunc += ' var node = document.getElementById("c"+img_id);\n';
collapsefunc += ' node.style.height = "'+hoch+'";\n';
collapsefunc += ' node.style.overflow = "scroll";\n';
collapsefunc += ' node.style.backgroundColor = "'+col_col+'";\n';
collapsefunc += '}\n';
var img_id = 0;
function walk_node(node)
{
if (node.nodeType == 1)
{
if (node.className == "code" && node.tagName == "TD")
{
var html = node.innerHTML;
var count = 0;
for(var i = 0;i < html.length; i++)
{
if (html[i] == '\n')
count ++;
if (count == 10)
{
var img = document.getElementById(img_id).parentNode;
var tr_node = null;
tr_node = node.parentNode;
node.innerHTML = "";
var div = document.createElement('div');
div.innerHTML = html;
node.appendChild(div);
div.style.height = hoch;
div.style.overflow = "scroll";
div.id = "c"+img_id;
img.style.display = "inline";
div.style.backgroundColor = col_col;
break;
}
}
}
else if (node.textContent == "Code:" && node.className == "genmed")
{
img_id += 1;
var s = document.createElement('span');
s.style.display = 'none';
s.style.margin = "0px 0px 0px 8px";
s.innerHTML = '<img id="'+ img_id +'" src="'+plus+'" onclick="expand_code('+img_id+')" />';
node.appendChild(s);
}
if (node.hasChildNodes())
{
for (var i=0; i<node.childNodes.length; i++)
{
walk_node(node.childNodes.item(i));
}
}
}
}
function install()
{
var script = document.createElement('script');
script.innerHTML = expandfunc;
document.body.appendChild(script);
var script = document.createElement('script');
script.innerHTML = collapsefunc;
document.body.appendChild(script);
walk_node(document.body);
}
install()
Wollte ich auch grade sagen.DarkDragon hat geschrieben:Danke. Funktioniert prima.
Code: Alles auswählen
\AppData\Roaming\Mozilla\Firefox\Profiles\0yzh9x2p.default\gm_scripts