| | | | |
| |||||||
| Board-Support Wieso, Weshalb, Warum? Hilfe zum Forum und Fragen zur Funktionalität |
|
| | LinkBack | Themen-Optionen | Thema bewerten |
| | |
| PHP Code Flüsterer Registriert seit: 21.08.2005 Beiträge: 4682 PHP-Kenntnisse: Fortgeschritten | |
| | |
| Supermoderator HD Registriert seit: 16.03.2008
Beiträge: 8.705
PHP-Kenntnisse: Fortgeschritten ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Funktioniert bei mir auch, danke! Hier noch eine leicht modifizierte Version, die auch die Pfeilgrafik entfernt: Code: // ==UserScript==
// @name php.de - 1 klick lesen
// @namespace php.de
// @include *php.de/*
// ==/UserScript==
// get Threadlist table
var threadslistTable = document.getElementById('threadslist');
if(threadslistTable != null){
var images = null;
// get all image elements of the threads table
images = threadslistTable.getElementsByTagName("img");
// parse images in order to find the unread icons
for( var k=0; k<images.length ; k++ ) {
if(
images[k].src == "http://www.php.de/images/statusicon/thread_new.gif" ||
images[k].src == "http://www.php.de/images/statusicon/thread_lock_new.gif" &&
images[k].id != ""
){
// unread icon found
//Add click event, which reades the thread, changes the icon and removes the font-bold css from thread.
images[k].addEventListener('click', function (e) {
var threadID = this.id.split('_')[2];
// find table cell which contains the link
var linkTD = document.getElementById('td_threadtitle_' + threadID);
// get all links from cell and select the href attribute of the last element (for threads with more than one pages)
var links = linkTD.getElementsByTagName("a");
var link = links[links.length-1].href;
delete links;
// request last page, in order to mark it read
var xmlHttpObject = new XMLHttpRequest();
xmlHttpObject.open('GET', link);
xmlHttpObject.send(null);
delete link;
// change icon
if(this.src == "http://www.php.de/images/statusicon/thread_new.gif"){
this.src = 'http://www.php.de/images/statusicon/thread.gif';
}
else if(this.src == "http://www.php.de/images/statusicon/thread_lock_new.gif"){
this.src = "http://www.php.de/images/statusicon/thread_lock.gif";
}
// remove font-weight:bold from link
document.getElementById('thread_title_' + threadID).style.fontWeight = null;
// remove arrow
document.getElementById('thread_gotonew_' + threadID).parentNode.removeChild(document.getElementById('thread_gotonew_' + threadID));
}, false);
}
}
}
__________________ Refining Linux Advent Calendar series “24 Outstanding ZSH Gems” |
| | |
| | |
| Erfahrener Benutzer Registriert seit: 04.01.2009
Beiträge: 844
PHP-Kenntnisse: Fortgeschritten ![]() | ups die grafik is mir garnicht aufgefallen danke
__________________ Develovision Blog |
| | |
|
| Themen-Optionen | |
| Thema bewerten | |
|
|
| Besucher kamen über folgende Suchanfragen bei Google auf diese Seite |
| removearrow |