User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Official TWW GreaseMonkey repository Page 1 [2], Prev  
Locutus Zero
All American
13575 Posts
user info
edit post

I used agentlion's stuff as a template and made an all black and white version of TWW. I changed the images like My Topics and the "old" and "new" pics as well. If I missed anything let me know.

http://www4.ncsu.edu/~jlmason/twwatworkblack.user.js

[Edited on July 6, 2005 at 1:12 AM. Reason : ]

7/6/2005 1:01:30 AM

NCstateBen
All American
3045 Posts
user info
edit post

The "my topics", "add to my topics" and "reply" images are still red.

It also seems a bit hard on the eyes. Too much contrast.

7/6/2005 1:30:39 AM

Locutus Zero
All American
13575 Posts
user info
edit post

Those buttons are all black for me. Is that happening for anyone else?

And yeah, I'm not sure if I'm gonna keep this color scheme myself, but hey, it's something different.

[Edited on July 6, 2005 at 1:34 AM. Reason : ]

7/6/2005 1:32:57 AM

agentlion
All American
13936 Posts
user info
edit post

^^ it has to do with the picture URLs in the script.

The script uses the prefix http://www.thewolfweb.com/
If you're browsing using any of the other combinations, the URLs of the pictures won't match. The other combinations, as far as I know, are
http://thewolfweb.com/
http://www.brentroad.com/
http://brentroad.com/

the script should be updated to check for all those, or it should just use a regex really, because the /images/*.jpg is reall the only important part. Also, you can use relative URLs for the replacement pictures, so instead of
http://www.thewolfweb.com/photos/00414969.jpg
just use
photos/00414969.jpg

7/6/2005 10:59:19 AM

Locutus Zero
All American
13575 Posts
user info
edit post

I updated the script, it can be found at the same address.

[Edited on July 6, 2005 at 12:21 PM. Reason : ]

7/6/2005 12:18:56 PM

agentlion
All American
13936 Posts
user info
edit post

does that script actually work for you? now it doesn't replace the buttons for any URLs. I think you need some kind of regex or wildcard in the image URL

7/6/2005 2:09:48 PM

Locutus Zero
All American
13575 Posts
user info
edit post

idk what the problem is, it's working for me

7/6/2005 3:22:26 PM

NCstateBen
All American
3045 Posts
user info
edit post

TWW image gallery relinker is now complete. The code below will link all gallery thumbnails to the actual image rather than another page with the image.

Potential uses: Use in conjunction with downTHEMall! extension to quickly download an entire gallery.

Things to improve: Add code so that when an image is clicked its url is automatically coppied to the clipboard.

Please let me know if you encounter any bugs.



// ==UserScript==
// @name TWW Gallery Image Relinker
// @namespace http://needsahome.com/
// @description Rewrites TWW Gallery image links to point straight to the pictures
// @include http://*brentroad.com/photo_folder.aspx*
// @include http://*thewolfweb.com/photo_folder.aspx*
// ==/UserScript==

(function()
{
function selectNodes(doc, context, xpath)
{
var nodes = doc.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var result = new Array( nodes.snapshotLength );

for (var x=0; x < result.length; x++)
{
result[x] = nodes.snapshotItem(x);
}

return result;
}

doc = window.document;

// Get a list of all A tags that have an href attribute containing the start and stop key strings.
var imgLinks = selectNodes(doc, doc.body, "//A[contains(@href,'photo_photo.aspx?user=')][contains(@href,'&photo=')]");

for (var x=0; x < imgLinks.length; x++)
{
var imgsrc = imgLinks[x].childNodes[0].src;
imgsrc = imgsrc.replace(/t\./,'.');
imgLinks[x].href = imgsrc;
}
})();

7/6/2005 11:26:53 PM

agentlion
All American
13936 Posts
user info
edit post

^gg

here is a link - http://www.thalions.com/greasemonkey/twwgalleryrelinker.user.js

i don't know if this is a bug or "feature" but the script does not work in your own gallery when you are logged in, because the links are javascript links instead of direct page links.

7/6/2005 11:50:58 PM

scud
All American
10803 Posts
user info
edit post

ahaha mark winnie

7/6/2005 11:53:54 PM

NCstateBen
All American
3045 Posts
user info
edit post

^^oh, i didn't even think about that.

7/7/2005 12:23:39 AM

Stein
All American
19842 Posts
user info
edit post

(function() 
{
function selectNodes(doc, context, xpath)
{
var nodes = doc.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var result = new Array( nodes.snapshotLength );

for (var x=0; x < result.length; x++)
{
result[x] = nodes.snapshotItem(x);
}

return result;
}

doc = window.document;

// Get a list of all A tags that have an href attribute containing the start and stop key strings.
var imgLinks = selectNodes(doc, doc.body, "//A[contains(@href,'photo_photo.aspx?user=')][contains(@href,'&photo=')]");


You know that instead you could just do...

imgLinks = document.getElementById('_ctl0_items').getElementsByTagName('A');


Then change

imgLinks.length


to

imgLinks.childNodes.length

7/7/2005 12:34:19 AM

NCstateBen
All American
3045 Posts
user info
edit post

Can you be more specific about how that would work? I tried it out and I get an error that the getElementById() method has no properties.

7/7/2005 12:55:50 AM

NCstateBen
All American
3045 Posts
user info
edit post

Fixed code so that it works in "MyGallery"



// ==UserScript==
// @name TWW Gallery Image Relinker
// @namespace http://needsahome.com/
// @description Rewrites TWW Gallery image links to point straight to the pictures
// @include http://*brentroad.com/photo_*.aspx*
// @include http://*thewolfweb.com/photo_*.aspx*
// ==/UserScript==

(function()
{
function selectNodes(doc, context, xpath)
{
var nodes = doc.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var result = new Array( nodes.snapshotLength );

for (var x=0; x < result.length; x++)
{
result[x] = nodes.snapshotItem(x);
}

return result;
}

doc = window.document;

// Get a list of all A tags that have an href attribute containing the start and stop key strings.
var imgLinks = selectNodes(doc, doc.body, "//A[contains(@href,'photo_photo.aspx?user=')][contains(@href,'&photo=')]");
var imgLinks2 = selectNodes(doc, doc.body, "//A[contains(@href,'javascript:__doPostBack(')][contains(@href, '_ctl0$items$_ctl')]");
imgLinks = imgLinks.concat(imgLinks2);
for (var x=0; x < imgLinks.length; x++)
{
var imgsrc = imgLinks[x].childNodes[0].src;
if(!imgsrc.match('images/folder.gif')) {
imgsrc = imgsrc.replace(/t\./,'.');
imgLinks[x].href = imgsrc;
}
}
})();

7/7/2005 1:16:55 AM

agentlion
All American
13936 Posts
user info
edit post

nice - the script here is updated -
http://www.thalions.com/greasemonkey/twwgalleryrelinker.user.js

7/7/2005 10:40:41 AM

NCstateBen
All American
3045 Posts
user info
edit post

TWW image resizer. Resizes images so that they don't cause a side scroller. Limits width of images to 860 px. This works well for a maximized firefox window on 1024x768 res. If you are running a different res you will have to play around with the number a bit to see what works best.

I'm sure there is a way to grab the users native screen resolution and resize accordingly, but I'm not sure how to do it.


// ==UserScript==
// @name TWWMaxImageWidth
// @namespace http://needsahome.com
// @description Limits Maximum Image Width to 860px
// @include http://*brentroad.com*
// @include http://*thewolfweb.com*
// ==/UserScript==

(function() {
window.addEventListener("load", function(e) {
var imgList = document.getElementsByTagName("img");
for (i=0; i < imgList.length; i++)
{
var maxWidth = 860;
var width = imgList[i].width;
var height = imgList[i].height;

if (width > maxWidth)// || height > maxHeight)
{
imgList[i].width = maxWidth;
//imgList[i].height = Math.min(imgList[i].width * height / width, maxHeight);
imgList[i].height = imgList[i].width * height / width;

//imgList[i].width = imgList[i].height * width / height;
window.status = ("GreaseMonkey - MaxImageSize Re-sized " + imgList[i].src + " to be " + imgList[i].width + " x " + imgList[i].height);
alert(imgList[i].src + "\nis now " + imgList[i].width + " x " + imgList[i].height);
}
}
return;
}, false);
})();


Next up: Replace long text words and links that cause sidescrolling.

[Edited on July 7, 2005 at 7:11 PM. Reason : ]

7/7/2005 7:09:46 PM

zorthage
1+1=5
17148 Posts
user info
edit post

^gg with the past few scripts



as for detecting the screen size, its

screen.width
, so instead of hardcoding 860 you might want
(0.84)*screen.width
where the 0.84 is roughly 860/1024

7/7/2005 8:26:20 PM

Locutus Zero
All American
13575 Posts
user info
edit post

Is there a way to do window size?

7/7/2005 8:29:44 PM

zorthage
1+1=5
17148 Posts
user info
edit post

http://www.javascripter.net/faq/browserw.htm

window.innerWidth
or
document.body.offsetWidth
depending on browser

7/7/2005 8:57:24 PM

NCstateBen
All American
3045 Posts
user info
edit post

changing the 860 to (.84)*screen.width works well on my setup, but I can't really test how it works for other resolutions.

I wish firefox's rendering of resized images didn't have so much distortion, but the image zoom extension works well to quickly bring images that I care to look at back to their larger size.

using window.innerWidth work as well with different sized windows as I would like.

[Edited on July 8, 2005 at 2:18 AM. Reason : ]

7/8/2005 2:07:49 AM

agentlion
All American
13936 Posts
user info
edit post

here's some more GreaseMonkey news (non-TWW related).
First, a major security hole - i haven't read into the whole thing, but the discussion is in this long thread - http://mozdev.org/pipermail/greasemonkey/2005-July/003994.html
From what I gather, scripts can use the GM_setValue object to hold sensitive data, such as private keys for encryption or passwords. Due to a vunlerability, somehow any data stored in GM_setValue can be released to the public at large..... i think.

The reaction here from Mark Pilgram - http://mozdev.org/pipermail/greasemonkey/2005-July/004033.html - is to uninstall GM completely until it is taken care of. If you don't want to do that, perhaps juts disable it, and uninstall all scripts that are applied to * sites (all sites).

but if you want to continue using it, here's another script that I think i'm going to try -
http://www.benjaminadam.com/archives/2005/07/18/sorting-rows-in-wordpress-with-greasemonkey
It just so happens that I was planning on installing WordPress tonight anyway, and I'm gonna try out that GM script with it. That concept can be applied to lots of pages, like TWW message boards, where you could dynamically sort the thread tables based on different columns, like thread name or "created by" name.

7/19/2005 2:19:42 PM

agentlion
All American
13936 Posts
user info
edit post

here's an updated version of GM that fixes the fatal flaw discovered yesterday. The creator of GM strongly encourages everyone to upgrade to this version. This version simply turns off most of the GM API, so many GM scripts will stop working, but at least it will be safe. He's working on a new, safe version.

http://greaseblog.blogspot.com/2005/07/mandatory-greasemonkey-update.html

7/20/2005 12:05:30 PM

smoothcrim
Universal Magnetic!
18918 Posts
user info
edit post

right so apparently opera does this natively, and has for a really long time. there are "stylesheets" that can be used to eliminate ads and all sorts of shit too.




[Edited on July 29, 2005 at 8:21 PM. Reason : k]

7/29/2005 8:21:24 PM

Stein
All American
19842 Posts
user info
edit post

Uh, yeah -- you can probably do it natively in Firefox as well.

But you know, PLUGINS ARE SO AWESOME

7/29/2005 10:38:30 PM

schmitter5
All American
2169 Posts
user info
edit post

can anyone help me with a script for allmusic.com?

i want to be able to view the album names when i hover the mouse over, basically i want to view the alt tags just like in IE

(yes i realize that this is bad coding, but allmusic doesn't seem to care and it's annoying to me)

i tried this script:
http://www.arantius.com/article/arantius/alt+tooltips+for+firefox/

with the websites:
http://www.allmusic.com*
http://allmusic.com*

and it didn't work, any help would be appreciated

[Edited on October 14, 2005 at 2:59 AM. Reason : .]

10/14/2005 2:56:07 AM

schmitter5
All American
2169 Posts
user info
edit post

bump

10/15/2005 5:58:39 PM

zorthage
1+1=5
17148 Posts
user info
edit post

bttt

12/17/2005 11:44:10 AM

zorthage
1+1=5
17148 Posts
user info
edit post

not sure if anyone's seen this, but the image small image fixer script wouldn't work always.
Here's my fix


/*

TWW [image] fixer
By Ben Reese (NCStateBen)

Those who pay the bandwidth bill for TWW will hate this, but
those small images that appear when someone posts an [image]
really annoy me.

Things to fix: Images are larger, but are still linked to themselves.
Not sure how to remove the link but keep the image that it contains.

*/

// ==UserScript==
// @name TWW Small Image Fixer
// @namespace http://thalions.com/greasemonkey
// @description Rewrites TWW [image] pictures to show big pics
// @include http://*brentroad.com/*
// @include http://*thewolfweb.com/*
// ==/UserScript==

(function()
{
function selectNodes(doc, context, xpath)
{
var nodes = doc.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
var result = new Array( nodes.snapshotLength );

for (var x=0; x < result.length; x++)
{
result[x] = nodes.snapshotItem(x);
}

return result;
}

doc = window.document;

// Get a list of all A tags that have an href attribute containing the start and stop key strings.
var allImages = selectNodes(doc, doc.body, "//IMG[contains(@src,'t.jpg')]");

//Find the images with links to the larger and replace with larger.
for (var x=0; x < allImages.length; x++)
{
var match2 = (allImages[x].parentNode.tagName == "A");
var match3 = allImages[x].parentNode.href != undefined && allImages[x].parentNode.href.match(/\/*.jpg/);

// If it matched successfully...
if (match2 && match3)
{
// Replace the image's src with parent's href and repace parent with image
allImages[x].src = allImages[x].parentNode.href;
allImages[x].parentNode.parentNode.replaceChild(allImages[x], allImages[x].parentNode);
}
}
})();

1/18/2006 8:18:12 PM

 Message Boards » Tech Talk » Official TWW GreaseMonkey repository Page 1 [2], Prev  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.