Posts that dob is monitoring

Subscribe to Posts that dob is monitoring 8 posts found

Jun 29, 2008
Webb 39 posts

Topic: Remove NewsDesk from IMDb.com

2 thumbs up Mikado. Thanks!

 
Jun 29, 2008
Mikado 563 posts

Topic: Remove NewsDesk from IMDb.com

I never understood people who care about writing licence blocks and copyrights in their scripts instead of writing better code.

var nd = document.evaluate('//h5[./text()[1]="NewsDesk:"]', document, null, 8, null).singleNodeValue;
if (nd) nd.parentNode.parentNode.removeChild(nd.parentNode);

 
Jun 29, 2008
Webb 39 posts

Topic: Remove NewsDesk from IMDb.com

Imdb.com has added more useless content. I have been removing selected .info items using a modified version of http://userscripts.org/scripts/show/9702 but it won't remove the NewsDesk. The code that doesn't work is


// Imdb.com News Removal Script
// version 1.0
// 2007-06-07
//
// ==UserScript==
// @name Imdb.com News Removal Script
// @description Remove the news section from Imdb.com pages.
// @include http://imdb.com/title/*
// @include http://*.imdb.com/title/*
// ==/UserScript==

// Fill an array with all div objects
var arrDiv = document.getElementsByTagName('div');

// Iterate through div objects
for( var i=0; i<arrdiv>
{
// Only test div objects which contain exactly one

tag
if( arrDiv[ i ].getElementsByTagName('h5').length == 1 )
{
// Test for the appropriate string
if( arrDiv[ i ].getElementsByTagName('h5')[0].textContent == "NewsDesk:" )
{
// Remove desired object, then exit
arrDiv[ i ].parentNode.removeChild( arrDiv[ i ] );
return;
}
}
}

Can someone fix this for me?

 
Apr 7, 2008
znerp 477 posts

Topic: Watching Topic

Well if you know about the solution, you could submit a patch: http://userscripts.devjavu.com/.

 
Mar 25, 2008
scriptprogram 2 posts

Topic: Gmail window popup

Hi...I would like to have a window popup when ever i place my mouse on some link with a button,link and image. Just like the way we get in Gmail...

I am able to achieve to some extent using window.createPopup() and innerHTML in javascript, but not the way it is....

Can some one help me to achieve this functionality in javascript

Thanks in advance

 
Mar 22, 2008
Joel H 347 posts

Topic: Passing on variables to functions

The 'g' flag shouldn't make much of a difference, as the regex should only appear once in the string. If it does appear twice for some reason, then it would replace it in both places and Mikado is right. In general, though, it's unlikely that it will matter.

-Joel

 
Mar 22, 2008
Mikado 563 posts

Topic: Passing on variables to functions

BTW, why would you need "g" flag in the regexp? I'd rewrite it that way:

var links = document.links, urls = new Array(), re = /imdb\.com\/title\//i;
for (var i=0; i < links.length; i++) {
	if (re.test(links[i].href)) {

 
Mar 21, 2008
Mikado 563 posts

Topic: Passing on variables to functions

			onload: rs(i)
		});
	}
}
function rs(i) {
	return function(e) {
		var title = e.responseText.split("<title>")[1].split("</title>")[0];
		links[i].setAttribute("title", title);
	};
}