[Lights, Camera, Action]

Home    Forums    Tutorials    Search    Books    Links 

Windows Movie Maker tips, tutorials, forums and more...



 
Windows Movie Maker Home   Search   Login   Register   Member List  
Free for all, Anything Goes Forums  > Off Topic Discussions  > Re: embed images into forum posts with firefox+greasemonkey    
Previous Thread :: Next Thread 
 Author Thread: embed images into forum posts with firefox+greasemonkey
glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
embed images into forum posts with firefox+greasemonkey
Posted: 29 Mar 2006 07:59 AM
I've been having a play with the firefox plug-in called greasemonkey which allows you to run user-side scripts to modify web pages.

I started off actually wanting to fix the problem with the color tag not displaying properly in firefox due a syntax error.
Unfortunately I haven't got it to work yet because the offending tag gets removed before greasemonkey gets to it.

However I have some other ideas for improving the way this forum behaves
- embedded images
- pick emoticons from a list
- download/play sample videos
- extract XML code to a file
- convert un-hyperlinked URLs to clickable links (there are already greasemonkey scripts to do this)
- ...

So let's have a go at embedded images...

I've noticed that some posters have tried to embed images into their posts with a tag like

[img]http://www.windowsmoviemakers.net/Images/WindowsMovieMakers.gif[/img]

This syntax may work on other boards but not with the current forum software used here.

I've hacked up a greasemonkey script to display such embedded images in-line.

To see it in action you'll need Firefox 1.5 and the plug-in greasemonkey

Once Greasemonkey is installed, you'll have to restart firefox.
Copy this script into a file like windowsmoviemakerimg.user.js then load into firefox and install it.
Hopefully you'll see the embedded image in this and other posts.


// WindowsMovieMakers.net greasemonkey script to display in-line images in posts with [IMG] tag
// Author: glow March 2006 Version 1
// Greasemonkey User Script
// Requires Firefox 1.5 and greasemonkey http://greasemonkey.mozdev.org/
// Inspired by VOIP Dial Linkify http://www.muehlen.com/projects/voip/voip_dial.user.js
//
// The windowsmoviemaker.net forum software cannot embed images
// This script changes the pseudo tag
// [IMG]picture.jpg[/IMG] or <img>picture.jpg</img>
// to
// <img src="picture.jpg" alt="picture.jpg">
// which displays the image in-line
//
// History
// -------
// 29/03/2006 Version 1 tested with http://www.windowsmoviemakers.net/Forums/ShowPost.aspx?PostID=48985
// ==UserScript==
// @name windowsmoviemakers.net img
// @namespace http://www.windowsmoviemakers.net
// @description Displays embedded images in http://www.windowsmoviemakers.net forum posts
// @include http://www.windowsmoviemakers.net/Forums/*
// ==/UserScript==

(function () {
const trackRegex = /(<img>.*<\/img>)|(\[IMG..*\/IMG\])/ig;

function trackUrl(t) {
return String(t).replace(/[<\[][\/]?IMG[>\]]/ig, "");
}

// tags we will scan looking for un-hyperlinked data
var allowedParents = [
"abbr", "acronym", "address", "applet", "b", "bdo", "big", "blockquote", "body",
"caption", "center", "cite", "code", "dd", "del", "div", "dfn", "dt", "em",
"fieldset", "font", "form", "h1", "h2", "h3", "h4", "h5", "h6", "i", "iframe",
"ins", "kdb", "li", "object", "pre", "p", "q", "samp", "small", "span", "strike",
"s", "strong", "sub", "sup", "td", "th", "tt", "u", "var", "nowrap"
];

var xpath = "//text()[(parent::" + allowedParents.join(" or parent::") + ")" +
"]";

var candidates = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);

for (var cand = null, i = 0; (cand = candidates.snapshotItem(i)); i++) {
if (trackRegex.test(cand.nodeValue)) {
var span = document.createElement("span");
var source = cand.nodeValue;

cand.parentNode.replaceChild(span, cand);

trackRegex.lastIndex = 0;
for (var match = null, lastLastIndex = 0; (match = trackRegex.exec(source)); ) {
span.appendChild(document.createTextNode(source.substring(lastLastIndex, match.index)));

var a = document.createElement("img");
a.setAttribute("alt", trackUrl(match[0]));
a.setAttribute("src", trackUrl(match[0]));
a.appendChild(document.createTextNode(match[0]));
span.appendChild(a);

lastLastIndex = trackRegex.lastIndex;
}

span.appendChild(document.createTextNode(source.substring(lastLastIndex)));
span.normalize();
}
}

})();

I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
dlk is not online. Last active: 7/2/2011 1:14:29 PM dlk
Top 25 Poster
Joined: 11 Sep 2004
Total Posts: 2027
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 29 Mar 2006 08:04 PM
Glow, I wasn't sure how to "load it into Firefox", so for
anyone slow on the uptake like me, I right clicked on the file
and selected "open with" Firefox. Then it gave me the option
to load the script. I assume there is a way to do it within firefox.
Anyway...it worked! I see the logo. But...where can it go from here?
And I would say, this script is just a tad bit more complex than XML.

DLK
master of the obvious

glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 29 Mar 2006 09:03 PM
Sorry about the vague loading instructions.
Like most windows apps there are many ways of loading a file.
I just tend to drag and drop the file.
You could also use File - Open or Control-o from within firefox.

I'm just starting with greasemonkey - I've used it to make clickable telephone numbers from the white pages and other sites which display plain-text phone numbers.

I want to automate some of the things I do everyday or fix annoyances with particular web sites.
For example putfile doesn't always work for me streaming videos in a browser window so I like to download the wmv file by looking through the source for the file, copy and paste it in another tab and save it to disk. I reckon I could get greasemonkey to do this for me in a single click.

For this particular forum, as I said I really would like to fix the colour bug and make it easier to type in emoticons.

If it became more widespread you could even incorporate personal avatars.

One common and controversial use of greasemonkey is to block or replace ads - I don't think I'll go there.





I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
dlk is not online. Last active: 7/2/2011 1:14:29 PM dlk
Top 25 Poster
Joined: 11 Sep 2004
Total Posts: 2027
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 30 Mar 2006 07:21 AM
Now that last thing has some appeal. I will have to google that.

dlk
dlk is not online. Last active: 7/2/2011 1:14:29 PM dlk
Top 25 Poster
Joined: 11 Sep 2004
Total Posts: 2027
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 30 Mar 2006 08:55 AM
Ok...so I found Butler and I am going to try that.
I also noticed that it says:
" Under Tools, there will be a new menu item to "Install User Script"."
I found that last night, but when I clicked on it...nothing happened.
So that's when I manually installed. I also find that I cannot install
extension automatically. I need to download the extension, and
drag it onto firefox. But that's a different issue I guess.
We will see how "butler" works.

dlk


glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 05 Apr 2006 10:17 PM
Ok, so I've had a go at a greasemonkey script for emoticons

Here's a screen shot

...or if you installed the previous script you should see it in-line:

[IMG]http://img89.imageshack.us/img89/408/windowsmoviemakersemoticons0ca.gif[/IMG]


I'll put the script in the next post...

I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 05 Apr 2006 11:20 PM
Well the greasemonkey script didn't paste very well into a forum post so here's a link
windowsmoviemakers-emoticons.user.js

If you've got firefox+greasemonkey installed, you should be able to just left or right-click the link and choose "Install User Script.."

Enjoy Wink

p.s. the embedded images script is also available
windowsmoviemakers-img.user.js

Edit: 5/2/2010 Fixed up links to point to new site.

I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 06 Apr 2006 10:15 AM
dlk

If you don't get joy out of Butler, you might like to try the firefox extension Adblock.
I tried it and it made short work of hotmail banner ads.
The problem is if we abuse this, then some of our favourite free sites supported by advertising might fold.

Another nice firefox extension I'm using is Tab Mix Plus
I like the duplicate tab feature and session manager (can open all the tabs you had in the previous session even when it crashed).



I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
dlk is not online. Last active: 7/2/2011 1:14:29 PM dlk
Top 25 Poster
Joined: 11 Sep 2004
Total Posts: 2027
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 06 Apr 2006 12:35 PM
Glow,
I am pretty pleased with Butler, it does exactly what I want. I use google groups
a lot, and Butler removes those annoying links off to the right for the search list.
I never clicked on them anyway, and they take up almost half of the viewing space.
Groups has become useful(again...I have been using it since the dejanews days)

I admit that Google and it's advertisers may not appreciate such tools, but
it's certainly no worse than time-shifting with Tivo, and zipping past the
commercials. I also don't buy into Google's altruistic motives, so anybody is
fare game, as long as I control my machine. It may not always be that way.


I will have to look into the tab mix plus.

dlk

glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 13 Aug 2006 09:21 AM
I've made a few changes to the emoticons script.
It now has a button to insert the standard instructions for WMM XML.
It also has a FAQ drop-down list to insert frequently used text such as how to reverse video.

Here's a screenshot

[IMG]http://sites.google.com/site/glowwindowsmoviemaker/greasemonkey-1/windowsmoviemakers-emoticons.gif[/IMG]


If you had the first version , uninstall it with
Tools > Manage User Scripts > windowsmoviemakers.net emoticons > Uninstall

The link to the new script is the same as the old link
windowsmoviemakers-emoticons.user.js

As before, if you've got firefox+greasemonkey installed, you should be able to just left or right-click the link and choose "Install User Script.."


The embedded images script is unchanged
windowsmoviemakers-img.user.js


Feedback, bugs, suggestions welcome...
(I already know it doesn't return the cursor nicely if the text is beyond the end of the text box.)


Enjoy Wink

Edit: 5/2/2010 Fixed up links to point to new site.

I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
hitthebongo is not online. Last active: 10/29/2011 8:39:42 AM hitthebongo
www.hitthebongo.co.uk
Top 25 Poster
Joined: 29 Jun 2005
Total Posts: 1227
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 27 Oct 2006 03:56 AM
Glow - Your Greasemonkey script still works very nicely in Firefox 2 !

Al
glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 28 Oct 2006 06:34 AM
Thanks for the feedback Al.
I haven't tried Firefox 2 yet.
Maybe I'll have a play with the portable version first.
How do you find it compared to 1.5?
Can it overcome the colour bug and display the colours in this forum?

I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 30 Oct 2006 07:36 AM
Update for version 3 at suggestion of Al:
Added FAQ How to make custom icons/thumbnails for WMM effects/transitions using free tools

If you had an earlier version , uninstall it with
Tools > Greasemonkey > Manage User Scripts > windowsmoviemakers.net emoticons > Uninstall

The link to the new script is the same as the old link
windowsmoviemakers-emoticons.user.js

Greasemonkey has changed a bit - you can't install with right click.
You can just left click on the link to install.

The embedded images script is unchanged
windowsmoviemakers-img.user.js


Enjoy Wink

Edit: 5/2/2010 Fixed up links to point to new site.

I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
Rehan is not online. Last active: 5/8/2012 5:49:17 PM Rehan
www.rehanfx.org
Top 25 Poster
Joined: 21 Apr 2004
Total Posts: 2176
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 21 May 2007 01:55 PM
Hi Glow,

I liked your greasemonkey scripts. What could be better is that these scripts are independent of the user having firefox and having greasemonkey installed so that all users of this webiste can benefit!

I just discovered just the thing: MonkeyGrease which is a server side extension for doing the same thing. Lets hope Rob sees this info and tries to incorporate it on this website. This would allow us to embed all sorts of media on these pages without them to be uploaded on the central server.



www.rehanfx.org - do more with Windows Movie Maker...
rehanfx.x10hosting.com - mirror site
glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 22 May 2007 09:26 AM

Hi Rehan

Indeed it would be easier if it was handled on the server side.
Looks like it's some effort to install MonkeyGrease but presumably easier than setting up new forum software.

I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
Nicholas is not online. Last active: 4/28/2012 5:13:15 PM Nicholas
nickswmmsource.windowsmoviemaker.info
Top 25 Poster
Joined: 10 Jul 2006
Total Posts: 1991
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 11 Sep 2007 06:20 PM
Hey Glow, you might not of known, but for a few months now I have been using your scripts and they work very well!

I have improved your scripts as I have come out with my own new version...version 4.

Go to this post to see it.

Hi! I'm Nick!

Visit My Site - Nicks WMM Source
Need Help? Contact Me

Movie Makers Unite!
glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 11 Sep 2007 10:20 PM
Hi Nick

Yes I noticed you were using my stock answers a few times.

I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
derfman24 is not online. Last active: 4/29/2008 6:34:31 PM derfman24
Joined: 30 Dec 2007
Total Posts: 1
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 29 Apr 2008 06:26 PM
I just installed your scripts. They work great. I use Firefox with Linux rather than Windows. The scripts work great under Linux. I also use Windows XP, but I use Linux for internet.
glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 29 Apr 2008 10:08 PM
thanks for the feedback derfman24 Big Smile

I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
glow is not online. Last active: 2/28/2016 4:07:11 AM glow
Top 25 Poster
Joined: 17 Jan 2005
Total Posts: 1441
 
Re: embed images into forum posts with firefox+greasemonkey
Posted: 04 Feb 2010 08:19 AM
I've updated the links in my earlier posts because I was hosting them at geocities but yahoo closed that down last year. Let's hope google sites lasts longer Smiley

I use Firefox+Greasemonkey scripts for easier editing of forum posts, FAQs and displaying embedded images Wink
Previous Thread :: Next Thread 
Goto to page:  Prev Next
 
Movie Maker Forums  > Free for all, Anything Goes Forums  > Off Topic Discussions  > Re: embed images into forum posts with firefox+greasemonkey