QuickQuote Opera button: Modified to work with this forum! [Archive] - Team17 Forum

PDA

View Full Version : QuickQuote Opera button: Modified to work with this forum!

Muzer
10 May 2008, 12:47
A while back, I found this quick quote button on the opera wiki (http://operawiki.info/CustomButtons) that let you quickly select text in a thread and click the button and it appeared in the QuickReply box in quote tags. You could do it more than once, the quotes would always appear at the end. However, there was one problem: It only worked in phpBB forums.
However, after a few small modifications I finally managed to get it to work in this forums. I am aiming for 100% compatibility not only in the main section with quick reply, but also in the post reply screen on those forums that list the posts below the box.
It now also works with Firefox.
Anyhow, it should work with most forums with a quick reply function, or with posts below the add reply box.
Here is the button. Installation is simple on both browsers.
Opera
Go to This page (http://myweb.tiscali.co.uk/digitaltv/Opera2.html). On that page are two links. Find the one under "Opera" and then click + drag that link onto any toolbar.
Firefox/Other Gecko-based browsers
Go to This page (http://myweb.tiscali.co.uk/digitaltv/Opera2.html). On that page are two links. Find the one under "Firefox" and then click + drag that link onto a toolbar that accepts bookmarklets (as this is a bookmarklet and not an extension, you cannot install it on ordinary toolbars, only the one with bookmarks on it).
Konqueror
Konqueror has a bug whereby any bookmarklets added that contain Javascript get searched for by google instead of executed. There is nothing I can do about this. Also note that when I tried directly dragging the link to the bookmarklets toolbar, it caused a MASSIVE rapid memory leak - don't try it!
Google Chrome
I have not tested it on Chrome. It might work, or it might behave like Konqueror. Try it out and report back.
Internet Explorer
I have not yet ported this to IE, and due to IE's horribleness and my 100% switch to Linux, I never will. If someone wants to brave it, go ahead, but I warn you, IE is horrible for JS development.
Other browsers
Untested.
List of known working forums:
Team17 forum (quickreply and post reply)
Retro gamer (the forum only has post reply)
Opera community forum (the forum only has quickreply on the same screen as posts)
Digital Spy forum (only quickreply tested)
ABXY (forum only has post reply)
NTSC-UK (only QR tested)
computerhelpforum.org (Only QR tested)
Team17.tk (Only QR tested)
Zetaboards including Piezone (only QR tested)
List of known broken forums:
*none*
Changelog:
1.0: 10th May '08 12:47: Code released
1.1: 10th May '08 18:55: Updated to maintain compatibility with forums that don't use the activate_qr function (ie all non-VB forums)
1.2: 13th May '08 18:28: Now officially supports the post reply screen of forums (although it did with some since version 1.1), but now it also works with those post reply screens where the posts are listed in an iframe (so long as the posts are in the last iframe element on the page, and no text is selected outside of the iframe. This also means if you don't select any text and there isn't an iframe it no longer gives you empty tags)
2.0: 15th May '08 21:00: Based on new code, located here (the one right at the bottom, Quote+) (http://lexi.ucoz.ru/index/buttons.html), which has much more features including partial style support and on some forums name support. Since I've added some of my own code in it should have the same compatibility rate as the old one, plus extra compatibility from the new base. NB: New download link! I've also merged the names, it is now called QuickQuote+.
2.1: 18th June '08 18:00: It was impossible to install under 9.5 (but it still worked if you had it installed before hand). This is now fixed.
2.2: 19th June '08 18:56: Added support for NTSC-UK (by not calling qr_activate if the textarea is enabled) and computerhelpforum.org (by adding its own code to unhide the Quick Reply box)
2.3: 19th June '08 19:54: Added support for styles in iframed posts, previously the style wouldn't be added.
2.4: 22nd July '08 18:15: Added [code] tag support for forums which use <font face=monospace> (such as this one)
2.5: 3rd August '08 20:55: Added team17.tk support (by setting a specific style attribute if it detects the general QR activate/deactivate script used in computerhelp forum but cannot call the specific script)
2.6: 4th August '08 16:57: FireFox support. This version is very similar to the Opera one, and so will be updated in parallel. All the features should work (but I didn't have time to test them, so just report here if there are any bugs or omissions).
2.7: 4th August '08 19:25: Firefox only bugfix: A certain group of forums which worked in Opera failed in Firefox because I had some redundant code which doesn't like Firefox.
2.8: 12th September '08 18:00: Opera only bugfix: On vB fourms, line breaks were doubling. This has been fixed by using my firefox code. It will also make it easier to maintain.
2.9: 12th October '08 14:20: Both browsers: Added a simple workaround for the small reply box in http://vogons.zetafleet.com (textareas below a certain size are not counted)
2.10: 9th June '09, 17:45: Both browsers: Extended the workaround above to the EA forum (UNTESTED) and YGOTAS forum (now obsolete anyway as they switched to vB, d'oh!). Fixed the long-standing line break issue properly (the fix in 2.8 had the unwanted side effect of no linebreaks whatsoever in forums that only used <br />. Now they should be copied as displayed in browsers.)
2.11: 10th June '09, 19:00: Both browsers: Added code to open the QR box on Simple Machines Forums, Removed obsolete code for YGOTAS and EA forums - both have changed and no longer require it, Fixed crash in Firefox (introduced in 2.10) when quoting code with a linebreak in it by changing innerHTML to textContent. Fixed a bug caused by Windows with the line break code, where Windows-style line breaks would be doubled.

Shadowmoon
10 May 2008, 12:49
Well i don't use opera, but maybe this should have gone in the browser thread?

Muzer
10 May 2008, 18:55
I've made a version that checks if the activate_qr function exists thereby stopping the script from halting if on a non-VB forum. Will reupload now, I'll edit this post when done.
EDIT: Reuploaded, revisit the link and re-click and drag the button. If it is the same as before, flush your cache.

robowurmz
10 May 2008, 19:14
Muzer, you are truly king. This is great! Of course, now the button works with most Vbulletin Forums providing they have a quick reply. Thanks man!

Muzer
10 May 2008, 19:19
Good :)
Remember to report if you find a forum it doesn't work in, and I'll try my best to include it. Please note that forums without quickreply will obviously not work. Also, if the textarea isn't actually displayed at all until activate_qr is called, it will also not work, I may change that if someone finds such a forum, it's a simple matter of changing the order of the commands.

Muzer
10 May 2008, 22:27
I've tested it, and it works in the post reply mode in some forums, where you have the tree of posts below the box. However, it doesn't work in the following situations:
Where there is more than one textarea, the last textarea will get the quotes. (some have a multiple file upload)
Where the posts are in a separate frame or iframe to the textarea.
The second is easily fixable (I will do it right now, in fact, and the same fix will fix the bug I said in post #6) but the first is a lot harder, since I barely know JS (I can't believe I've actually managed to make this with my limited skillz).
EDIT: I have not been able to fix it :(. More investigation is needed. Basically, it is either not setting the variable because no text on the parent page is selected, or it is only setting the variable for the frame/iframe. Could someone who is 1337er at javascript help me?

worMatty
10 May 2008, 23:33
Nice idea, but vBulletin already has a multiquote feature. Did you know that? Does your script thing offer an advantage? Or am I confused?

franpa
11 May 2008, 09:12
it lets you quote without going to a seperate page to preview the quote before posting thus making it easier/quicker to apply bold and italics tags to parts of the quote etc. for emphasis.

Muzer
11 May 2008, 09:25
And you can easily quote only part of a post! And when I get this next thing working it'll let you quote from most forums in the post reply page, where all the posts are listed below (NB: It already works in this forum)

Xinos
11 May 2008, 12:24
And you can easily quote only part of a post!
Indeed. This is kinda cool, but it doesn't show who is quoted.

worMatty
11 May 2008, 22:28
Or, I guess, give readers a link to the quoted post, like vB does?

franpa
12 May 2008, 10:52
can't be done... the script i assume just copes what you highlight and add's quote tags around it. To do what you want would require said code to be present on the page somewhere which is also why it doesnt say who was quoted.

Muzer
4 Jun 2008, 19:17
Yes, indeed. It also checks if qr_activate exists and if so calls it (this is part of what I did to modify it for this forum, otherwise Quick Reply would be disabled still)
Merged by me
NEW VERSION OUT! Will upload now, will edit when done.
Changelog: Now specifically designed to also work on the post reply screen (though it did with a few before), now works on forums with the posts in a separate iframe to the reply box on the post new reply screen (Thanks to M3NTAL, but it only works when the posts are in the last iframe element in the page)
EDIT: Uploaded, have fun.
Merged by me
New version released, see first post for changelog. New download link, see the first post.
Merged by me
I would like to know of any bugreports. Please try the new version, it's really good.

franpa
18 Jun 2008, 11:12
So how do you install in Opera 9.50? I can drag the link to the moon and back but it wont let me place it anywhere on a menu as a button.

Muzer
18 Jun 2008, 17:57
OK, it turns out for some weird reason I forgot to apply the declaration that tells Opera it actually is a button in version 2.0, which causes it to not work with 9.5. I will update it now.

Muzer
18 Jun 2008, 18:00
OK, it turns out for some weird reason I forgot to apply the declaration that tells Opera it actually is a button in version 2.0, which causes it to not work with 9.5. I will update it now.
Fixed, now uploading...
EDIT: Done, go to the link and flush your cache. Follow the previous instructions and it will work.

franpa
19 Jun 2008, 08:27
Working now =)

Muzer
19 Jun 2008, 18:25
I've just added support to NTSC-uk (and possible other VB forums which use the same quick reply hack as it), which actually broke if qr_activate is called (since the quick reply box does not require activation), by making sure that the textarea is disabled before calling qr_activate. I will also add computerhelpforum.org support, as this seems to be quite simple (it uses a script to activate QR)

Muzer
19 Jun 2008, 18:51
OK, I've added computerhelpforum.org support (not as easy as I anticipated but still pretty easy). A new version will appear shortly.

Muzer
19 Jun 2008, 18:56
Uploaded .
EDIT: Remember, (in)compatibility reports are welcome.

Muzer
19 Jun 2008, 19:51
Yet another new version, this one adds style support to post reply screens with the posts in an iframe (previously, only plain text would be copied, and no style would be added like in ordinary cases). It will be uploaded shortly.
EDIT: Uploaded

Muzer
22 Jul 2008, 18:17
New version, uploaded now, which adds [ code] support for forums that denote [ code] with <font face=monospace> (such as this one)

Muzer
3 Aug 2008, 19:59
Prepare for full Team17.tk support (currently you have to manually open QuickReply, it uses a script)

Muzer
3 Aug 2008, 20:56
New version out, only change is adding Team17.tk support. Why does every forum have to use a different script?

Muzer
4 Aug 2008, 10:08
BIG BIG NEWS!
I am currently looking at FireFox support. So anyone who hates Opera, feel free to rejoice. I will open a new thread for reasons that otherwise, FireFox users wouldn't see this because it has "Opera" in the title.

Muzer
4 Aug 2008, 11:42
I Have Firefox Support! Creating New Thread...

yauhui
4 Aug 2008, 13:14
...And it links to this thread?
New version out, only change is adding Team17.tk support. Why does every forum have to use a different script?
The QR can be activated using a Javascript in InvisionFree.
ALSO: You forgot to add Team17.tk to the working forums list.
You can experiment on Piezone (http://s1.zetaboards.com/piezone) if you would the code to work with ZetaBoards.

Muzer
4 Aug 2008, 16:51
The QR can be activated using a Javascript in InvisionFree.
Yeah I know, it works now. The trouble is, if you use the javascript and use the button when the QR is already open, it closes again, so I had to do it quite low-level.
Anyway, I'm uploading now.
WE HAVE UPLOAD!

yauhui
7 Aug 2008, 14:21
I was browsing my forum when I used the Quick Quote (already available in my forum, which I added). Then I thought about this QuickQuote of yours, so I thought this might come in handy with the InvisionFree QR quote.
The code I used (for Quick Quoting) is hosted on my Geocities here:
http://www.geocities.com/lyauh/quick-quote.js
I'll appreciate if you can edit the code for me (ignore creator's warning), because when Quick Quoting, any symbols like " or ' will appear as #%39
EDIT: auto code parsing >_>
A weird bug, no fix so far.

Muzer
7 Aug 2008, 18:40
It may just be me, but that QuickQuote system seems to be completely different from mine. Mine does it in real-time, and works with parts of a post, yours is more like the one on this forum.

franpa
8 Aug 2008, 14:25
The trouble is, if you use the javascript and use the button when the QR is already open, it closes again
Thats a intended behavior on some forums though.

Muzer
8 Aug 2008, 15:35
By "the button" I meant my button, not the forum's.

franpa
9 Aug 2008, 08:51
Ah, ok then.

Muzer
12 Sep 2008, 17:26
Bug with doubling of linebreaks was spotted by franpa. I have found out it does not occur in 1.2, but I have no other versions to test. Any one else have any old versions?
EDIT: I found it still works in firefox.
EDIT2: It seems to be only vB forums. I'm wondering if it was actually an Opera update, but I'm not sure exactly how to test this, short of downgrading.
EDIT3: I actually tried the Firefox version in Opera, and it actually works fine, so I might just use the firefox code with the Opera button wrapper and call it a day. In fact, yes, I think I will do that. After a test of course.

Muzer
12 Sep 2008, 18:00
New version!
Made Opera code be the firefox code but wrapped in the button code, so that the line doubling bug is fixed, which I did not understand. Any more bugs with this, tell me.

WeXzuZ
17 Sep 2008, 19:49
Do you think there is a possibility to make it work with Google Chrome?
Just curious :D

Muzer
17 Sep 2008, 19:57
Do you think there is a possibility to make it work with Google Chrome?
Just curious
Since it is currently unavailable in linux, as far as I know, I probably can't.
wait, is that doubling glitch happening again?
EDIT: No, I just had an old version for some reason...

franpa
12 Oct 2008, 13:18
http://vogons.zetafleet.com/index.php
QuickQuote" (Firefox) does not work with these forums.

Muzer
12 Oct 2008, 13:45
/me debugs
EDIT@ Fix'd

franpa
12 Oct 2008, 14:19
fixed and uploaded? ;)

Muzer
12 Oct 2008, 14:25
fixed and uploaded? http://forum.team17.co.uk/images/newsmilies/wink.gif
Indeed .

franpa
12 Oct 2008, 15:16
It does not work still, I am using Frefox 3.0.3 with Windows XP, Flashblock, DownloadHelper, IETab, BitcometHelper, Australian Dictionary and Adblock+

Muzer
12 Oct 2008, 16:13
Try redownloading it though, I announced it before the upload, and you might have gotten in there early.

franpa
13 Oct 2008, 01:01
I cleared my cache and just tried it again, I can't get it to work. I highlight some tesxt in a message and click it and it doesn't add anything to the QR box.

FutureWorm
13 Oct 2008, 08:56
honestly what is it with you people and opera

franpa
13 Oct 2008, 12:09
Opera works, but firefox still doesn't work with zetafleet.

SupSuper
13 Oct 2008, 21:39
honestly what is it with you people and operaIt's a browser. :cool:

*Splinter*
13 Oct 2008, 23:12
It's a browser. :cool:
...HE is a GUY
Can I make it ANYmore OBvious?
*kills self*

Muzer
14 Oct 2008, 20:13
Opera works, but firefox still doesn't work with zetafleet.
Hmm, does it work with other forums? I didn't actually test it in firefox, but I just copied the code, maybe it doesn't like firefox. Also, can you paste anything from the JS error console that seems relevant to the script?

franpa
15 Oct 2008, 02:46
Error: uncaught exception: [Exception... "Index or size is negative or greater than the allowed amount" code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)" location: "javascript:{(function(){var%20sel%20=%20document.c reateElement('div');var%20s%20=%20window.getSelect ion();if(s.toString()%20==%20''){%20%20frm%20=%20d ocument.getElementsByTagName('iframe')[document.getElementsByTagName('iframe').length%20-%201];%20%20s%20=%20frm.contentWindow.getSelection();}i f(s%20!=%20'')sel.appendChild(s.getRangeAt(0).clon eContents());var%20ele%20=%20sel.getElementsByTagN ame('*');for(var%20i=0,%20e;%20e=ele;%20i++){%20%2 0switch(e.tagName.toUpperCase())%20%20{%20%20%20%2 0case%20'A'%20:%20e.innerHTML=''+e.innerHTML+' ('+e.href+')';%20%20%20%20break;%20%20%20%20case%2 0'FONT'%20:%20if(/(?:^|,)\s*monospace\s*(?:,|$)/i.test(e.getAttribute('face')))%20%20%20%20{%20%20 %20%20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20 %20};%20%20%20%20break;%20%20%20%20case%20'DIV'%20 :%20if(e.className=='code')%20%20%20%20{%20%20%20% 20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20%20} %20%20%20%20else%20%20%20%20%20{%20%20%20%20%20%20 if(e.className=='quote')%20%20%20%20%20%20{e.inner HTML=''+e.innerHTML+''%20%20%20%20%20%20}%20%20%20 %20%20%20else%20%20%20%20%20%20{e.innerHTML='<br>'+e.innerHTML%20%20%20%20%20%20}%20%20%20%20};%20% 20%20%20break;%20%20%20%20case%20'B'%20:%20e.inner HTML=''+e.innerHTML+'';%20%20%20%20break;%20%20%20 %20case%20'STRONG'%20:%20e.innerHTML=''+e.innerHTM L+'';%20%20%20%20break;%20%20%20%20case%20'I'%20:% 20e.innerHTML='[i]'+e.innerHTML+'';%20%20%20%20break;%20%20%20%20cas e%20'U'%20:%20e.innerHTML=''+e.innerHTML+'';%20%20 %20%20break;%20%20%20%20case%20'PRE'%20:%20e.inner HTML=''+e.innerHTML+'';%20%20%20%20break;%20%20%20 %20case%20'BLOCKQUOTE'%20:%20e.innerHTML=''+e.inne rHTML+'';%20%20%20%20break;%20%20%20%20case%20'IMG '%20:%20e.outerHTML+=''+e.src+'';%20%20%20%20break ;%20%20}};var%20txt%20=%20sel.textContent;var%20n% 20=%20txt.split('\n').length;if(txt.toString()%20= ==%20''){%20%20frm%20=%20document.getElementsByTag Name('iframe')[document.getElementsByTagName('iframe').length%20-%201];%20%20txt%20=%20frm.contentDocument.getSelection( );}var%20ta%20=%20document.getElementsByTagName('t extarea');var%20tl=ta.length-1;if(typeof%20window.qr_activate%20==%20'function' ){%20%20if(ta[tl].disabled)%20%20{%20%20%20%20qr_activate(1);%20%20 }}%20if(document.getElementById('qr_open')){%20%20 itm%20=%20document.getElementById('qr_open');%20%2 0itm.style.display%20=%20'';}%20var%20t;var%20l=lo cation.hostname;var%20c=s.focusNode;do{%20%20t=ta[tl];%20%20%20tl--}%20while(t%20&&%20(t.rows<5%20||%20t.offsetHeight==0));if(l=='vogons.zetafle et.com'){%20%20t=ta[0];}if(!t){%20%20prompt('Please%20copy%20BBCode',%20 txt);%20%20exit(0);}if(t.rows%20<%2015){%20%20t.rows%20+%20n%20<=%2015%20?%20t.rows%20+=%20n%20:%20t.rows%20=%2015 };var%20nam='';var%20url='';if(c%20&&%20l=='forum.ru-board.com'){%20%20while(c.className!='tpc'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20if(c.className!='tpc')exit(0);%20%20var% 20tn=c.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[1];%20%20nam=''+c.parentNode.firstChild.textContent. replace(/\n.*/g,'')+'%20';%20%20url='.href+']'+tn.childNodes[7].textContent.replace(/^%20+/,'').replace(/%20+$/,'')+' ('+tn.childNodes[5)%20'};if(c%20&&%20l=='operafan.net'||l=='opera-ac.com'||l=='bit-center.ru'){%20%20while(c.className!='windowbg'&&c.className!='windowbg2'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20var%20dv=c.getElementsByTagName('div');% 20%20for(var%20i=0,di;%20di=dv[i];%20i++)%20%20{%20%20%20%20if(di.className=='post' )%20%20%20%20{%20%20%20%20%20%20c=di;%20%20%20%20% 20%20break%20%20%20%20}%20%20};%20%20if(c.classNam e!='post')exit(0);%20%20var%20pn=c.parentNode.chil dNodes[1].firstChild.firstChild;%20%20nam=''+c.parentNode.p arentNode.firstChild.childNodes[1].textContent+'%20';%20%20url=''+/(\d\d\D\d.*\d).*$/.exec(pn.childNodes[1].textContent)[1]+' ('+pn.firstChild.firstChild.href+')%20'};if(t.valu e.indexOf(nam)!=-1){nam=''};if(nam==''){var%20qtg=''+txt+'\r\n'+%20 t.value.substring(endPos,%20t.value.length);t.setS electionRange(t.selectionEnd+n-1,%20t.selectionEnd+n-1);})()} Line: 1"]
bah, do tags work here? yes they do!

Muzer
15 Oct 2008, 18:58
Ugh... heavy stuff...

franpa
16 Nov 2008, 01:45
Still doesn't work on Vogons, won't work with "quick reply" but you can use it to quickly quote things in the Topic Review that is present when doing a "advanced reply".

Muzer
16 Nov 2008, 09:45
Still doesn't work on Vogons, won't work with "quick reply" but you can use it to quickly quote things in the Topic Review that is present when doing a "advanced reply".
Oh yeah, I had forgotten about that actually because a more important bug came up (which I still haven't fixed). I'll try to work on it now.

Paul.Power
16 Nov 2008, 11:35
Still doesn't work on VogonsWell, if the opening notes of Beethoven's 5th symphony won't work on them...

Plasma
17 Nov 2008, 10:49
Y'know, I kept forgetting that I had opera now...
And that there's a Quick Reply feature...

franpa
18 Nov 2008, 13:27
Oh yeah, I had forgotten about that actually because a more important bug came up (which I still haven't fixed). I'll try to work on it now.
was the other bug, trailing TABs in the quote?

Muzer
18 Nov 2008, 18:20
was the other bug, trailing TABs in the quote?
No, that only happens if you select too much. The bug is that some forums use <br /> without a linebreak, and some forums use <br /> with a linebreak (eg this one). With <br />s interpreted as linebreaks, the latter forums get double spacing, and with <br />s ignored, the former forums get line breaks removed. Ideally, I'll get it to ignore line breaks and parse the <br />s, but I haven't really had time for that.

SupSuper
18 Nov 2008, 20:11
If you've got it all in a string, just do this:
// Removes \n (linebreaks)
string = string.replace(new RegExp("\\n", "g"), "");
// Turns br's into linebreaks
string = string.replace(new RegExp("< *br *\/? *>", "g"), "\n");

franpa
12 Dec 2008, 10:00
http://forums.electronicarts.co.uk/
also doesn't work with the quickquote+ feature. possibly the same issue that affects Vogons.

Muzer
12 Dec 2008, 19:57
Well, the issue with the Vogons is that the reply box is too small (it has a limit of what it constitutes as the reply box and what it doesn't). I suppose I could remove that, but then it might do false positives in other forums.

Plasma
12 Dec 2008, 23:23
Speaking of Opera, is anyone else having trouble using the New Post button? The page won't load at all for me most of the time (it works for a while, then stops for a while, etc. "while" being a few hours)
Although it could be because I have the New Posts page on the Speed Dial, and the refresh is messing up something.

shadowman
12 Dec 2008, 23:27
It worked perfectly fine for me. I don't know how I managed to miss this thread after I made the switch to Opera.

franpa
13 Dec 2008, 01:54
I've yet to see a forum that has multiple boxes for user input, just make sure that the minimum size accepted is bigger then the username and password boxes :)

Muzer
13 Dec 2008, 12:19
Error: uncaught exception: [Exception... "Index or size is negative or greater than the allowed amount" code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)" location: "javascript:{(function(){var%20sel%20=%20document.c reateElement('div');var%20s%20=%20window.getSelect ion();if(s.toString()%20==%20''){%20%20frm%20=%20d ocument.getElementsByTagName('iframe')[document.getElementsByTagName('iframe').length%20-%201];%20%20s%20=%20frm.contentWindow.getSelection();}i f(s%20!=%20'')sel.appendChild(s.getRangeAt(0).clon eContents());var%20ele%20=%20sel.getElementsByTagN ame('*');for(var%20i=0,%20e;%20e=ele;%20i++){%20%2 0switch(e.tagName.toUpperCase())%20%20{%20%20%20%2 0case%20'A'%20:%20e.innerHTML=''+e.innerHTML+' ('+e.href+')';%20%20%20%20break;%20%20%20%20case%2 0'FONT'%20:%20if(/(?:^|,)\s*monospace\s*(?:,|$)/i.test(e.getAttribute('face')))%20%20%20%20{%20%20 %20%20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20 %20};%20%20%20%20break;%20%20%20%20case%20'DIV'%20 :%20if(e.className=='code')%20%20%20%20{%20%20%20% 20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20%20} %20%20%20%20else%20%20%20%20%20{%20%20%20%20%20%20 if(e.className=='quote')%20%20%20%20%20%20{e.inner HTML=''%20%20%20%20%20%20}%20%20%20%20%20%20else%2 0%20%20%20%20%20{e.innerHTML='<br>'+e.innerHTML%20%20%20%20%20%20}%20%20%20%20};%20% 20%20%20break;%20%20%20%20case%20'B'%20:%20e.inner HTML=''+e.innerHTML+'';%20%20%20%20break;%20%20%20 %20case%20'STRONG'%20:%20e.innerHTML=''+e.innerHTM L+'';%20%20%20%20break;%20%20%20%20case%20'I'%20:% 20e.innerHTML='[i]'+e.innerHTML+'';%20%20%20%20break;%20%20%20%20cas e%20'U'%20:%20e.innerHTML=''+e.innerHTML+'';%20%20 %20%20break;%20%20%20%20case%20'PRE'%20:%20e.inner HTML=''+e.innerHTML+'';%20%20%20%20break;%20%20%20 %20case%20'BLOCKQUOTE'%20:%20e.innerHTML='';%20%20 %20%20break;%20%20%20%20case%20'IMG'%20:%20e.outer HTML+=''+e.src+'';%20%20%20%20break;%20%20}};var%2 0txt%20=%20sel.textContent;var%20n%20=%20txt.split ('\n').length;if(txt.toString()%20===%20''){%20%20 frm%20=%20document.getElementsByTagName('iframe')[document.getElementsByTagName('iframe').length%20-%201];%20%20txt%20=%20frm.contentDocument.getSelection( );}var%20ta%20=%20document.getElementsByTagName('t extarea');var%20tl=ta.length-1;if(typeof%20window.qr_activate%20==%20'function' ){%20%20if(ta[tl].disabled)%20%20{%20%20%20%20qr_activate(1);%20%20 }}%20if(document.getElementById('qr_open')){%20%20 itm%20=%20document.getElementById('qr_open');%20%2 0itm.style.display%20=%20'';}%20var%20t;var%20l=lo cation.hostname;var%20c=s.focusNode;do{%20%20t=ta[tl];%20%20%20tl--}%20while(t%20&&%20(t.rows<5%20||%20t.offsetHeight==0));if(l=='vogons.zetafle et.com'){%20%20t=ta[0];}if(!t){%20%20prompt('Please%20copy%20BBCode',%20 txt);%20%20exit(0);}if(t.rows%20<%2015){%20%20t.rows%20+%20n%20<=%2015%20?%20t.rows%20+=%20n%20:%20t.rows%20=%2015 };var%20nam='';var%20url='';if(c%20&&%20l=='forum.ru-board.com'){%20%20while(c.className!='tpc'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20if(c.className!='tpc')exit(0);%20%20var% 20tn=c.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[1];%20%20nam=''+c.parentNode.firstChild.textContent. replace(/\n.*/g,'')+'%20';%20%20url='.href+']'+tn.childNodes[7].textContent.replace(/^%20+/,'').replace(/%20+$/,'')+' ('+tn.childNodes[5)%20'};if(c%20&&%20l=='operafan.net'||l=='opera-ac.com'||l=='bit-center.ru'){%20%20while(c.className!='windowbg'&&c.className!='windowbg2'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20var%20dv=c.getElementsByTagName('div');% 20%20for(var%20i=0,di;%20di=dv[i];%20i++)%20%20{%20%20%20%20if(di.className=='post' )%20%20%20%20{%20%20%20%20%20%20c=di;%20%20%20%20% 20%20break%20%20%20%20}%20%20};%20%20if(c.classNam e!='post')exit(0);%20%20var%20pn=c.parentNode.chil dNodes[1].firstChild.firstChild;%20%20nam=''+c.parentNode.p arentNode.firstChild.childNodes[1].textContent+'%20';%20%20url=''+/(\d\d\D\d.*\d).*$/.exec(pn.childNodes[1].textContent)[1]+' ('+pn.firstChild.firstChild.href+')%20'};if(t.valu e.indexOf(nam)!=-1){nam=''};if(nam==''){var%20qtg='[quote'}else{var%20qtg='\r\n'+%20t.value.substring( endPos,%20t.value.length);t.setSelectionRange(t.se lectionEnd+n-1,%20t.selectionEnd+n-1);})()} Line: 1"]
bah, do tags work here? yes they do!
Actually, that error might have also been happening before. I have an idea to fix it.
I may have to use a javascript debugger, as that error log is just not good enough (I know the error appears SOMEWHERE IN THE SCRIPT, ****ing firefox ;p)

Muzer
13 Dec 2008, 12:29
OK, I've managed to fix franpa's bug. I want to look at the linebreak bug (which is a pretty major one) and the EA forums (will probably need a similarly easy workaround) before I release it though.

franpa
14 Dec 2008, 05:05
EA forums error.
Error: uncaught exception: [Exception... "Index or size is negative or greater than the allowed amount" code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)" location: "javascript:{(function(){var%20sel%20=%20document.c reateElement('div');var%20s%20=%20window.getSelect ion();if(s.toString()%20==%20''){%20%20frm%20=%20d ocument.getElementsByTagName('iframe')[document.getElementsByTagName('iframe').length%20-%201];%20%20s%20=%20frm.contentWindow.getSelection();}i f(s%20!=%20'')sel.appendChild(s.getRangeAt(0).clon eContents());var%20ele%20=%20sel.getElementsByTagN ame('*');for(var%20i=0,%20e;%20e=ele;%20i++){%20%2 0switch(e.tagName.toUpperCase())%20%20{%20%20%20%2 0case%20'A'%20:%20e.innerHTML=''+e.innerHTML+' ('+e.href+')';%20%20%20%20break;%20%20%20%20case%2 0'FONT'%20:%20if(/(?:^|,)\s*monospace\s*(?:,|$)/i.test(e.getAttribute('face')))%20%20%20%20{%20%20 %20%20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20 %20};%20%20%20%20break;%20%20%20%20case%20'DIV'%20 :%20if(e.className=='code')%20%20%20%20{%20%20%20% 20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20%20} %20%20%20%20else%20%20%20%20%20{%20%20%20%20%20%20 if(e.className=='quote')%20%20%20%20%20%20{e.inner HTML=''+e.innerHTML+''%20%20%20%20%20%20}%20%20%20 %20%20%20else%20%20%20%20%20%20{e.innerHTML='<br>'+e.innerHTML%20%20%20%20%20%20}%20%20%20%20};%20% 20%20%20break;%20%20%20%20case%20'B'%20:%20e.inner HTML=''+e.innerHTML+'';%20%20%20%20break;%20%20%20 %20case%20'STRONG'%20:%20e.innerHTML=''+e.innerHTM L+'';%20%20%20%20break;%20%20%20%20case%20'I'%20:% 20e.innerHTML='[i]'+e.innerHTML+'';%20%20%20%20break;%20%20%20%20cas e%20'U'%20:%20e.innerHTML=''+e.innerHTML+'';%20%20 %20%20break;%20%20%20%20case%20'PRE'%20:%20e.inner HTML=''+e.innerHTML+'';%20%20%20%20break;%20%20%20 %20case%20'BLOCKQUOTE'%20:%20e.innerHTML=''+e.inne rHTML+'';%20%20%20%20break;%20%20%20%20case%20'IMG '%20:%20e.outerHTML+=''+e.src+'';%20%20%20%20break ;%20%20}};var%20txt%20=%20sel.textContent;var%20n% 20=%20txt.split('\n').length;if(txt.toString()%20= ==%20''){%20%20frm%20=%20document.getElementsByTag Name('iframe')[document.getElementsByTagName('iframe').length%20-%201];%20%20txt%20=%20frm.contentDocument.getSelection( );}var%20ta%20=%20document.getElementsByTagName('t extarea');var%20tl=ta.length-1;if(typeof%20window.qr_activate%20==%20'function' ){%20%20if(ta[tl].disabled)%20%20{%20%20%20%20qr_activate(1);%20%20 }}%20if(document.getElementById('qr_open')){%20%20 itm%20=%20document.getElementById('qr_open');%20%2 0itm.style.display%20=%20'';}%20var%20t;var%20l=lo cation.hostname;var%20c=s.focusNode;do{%20%20t=ta[tl];%20%20%20tl--}%20while(t%20&&%20(t.rows<5%20||%20t.offsetHeight==0));if(l=='vogons.zetafle et.com'){%20%20t=ta[0];}if(!t){%20%20prompt('Please%20copy%20BBCode',%20 txt);%20%20exit(0);}if(t.rows%20<%2015){%20%20t.rows%20+%20n%20<=%2015%20?%20t.rows%20+=%20n%20:%20t.rows%20=%2015 };var%20nam='';var%20url='';if(c%20&&%20l=='forum.ru-board.com'){%20%20while(c.className!='tpc'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20if(c.className!='tpc')exit(0);%20%20var% 20tn=c.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[1];%20%20nam=''+c.parentNode.firstChild.textContent. replace(/\n.*/g,'')+'%20';%20%20url='.href+']'+tn.childNodes[7].textContent.replace(/^%20+/,'').replace(/%20+$/,'')+' ('+tn.childNodes[5)%20'};if(c%20&&%20l=='operafan.net'||l=='opera-ac.com'||l=='bit-center.ru'){%20%20while(c.className!='windowbg'&&c.className!='windowbg2'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20var%20dv=c.getElementsByTagName('div');% 20%20for(var%20i=0,di;%20di=dv[i];%20i++)%20%20{%20%20%20%20if(di.className=='post' )%20%20%20%20{%20%20%20%20%20%20c=di;%20%20%20%20% 20%20break%20%20%20%20}%20%20};%20%20if(c.classNam e!='post')exit(0);%20%20var%20pn=c.parentNode.chil dNodes[1].firstChild.firstChild;%20%20nam=''+c.parentNode.p arentNode.firstChild.childNodes[1].textContent+'%20';%20%20url=''+/(\d\d\D\d.*\d).*$/.exec(pn.childNodes[1].textContent)[1]+' ('+pn.firstChild.firstChild.href+')%20'};if(t.valu e.indexOf(nam)!=-1){nam=''};if(nam==''){var%20qtg=''+txt+'\r\n'+%20 t.value.substring(endPos,%20t.value.length);t.setS electionRange(t.selectionEnd+n-1,%20t.selectionEnd+n-1);})()} Line: 1"]

Muzer
14 Dec 2008, 19:41
OK, that's exactly the same bug. I will fix that as well.

franpa
11 Jan 2009, 13:55
any updates on this Muzer?

Muzer
11 Jan 2009, 14:46
I haven't been workng on it much lately.

franpa
9 Jun 2009, 14:11
how 'bout now? :)

Muzer
9 Jun 2009, 17:03
how 'bout now? http://forum.team17.co.uk/images/newsmilies/happy.gif
I have a day off school, so I'll do it just for you :p
EDIT: OK, I've on paper fixed both bugs. Now, time for testing...
EDIT: Is it just me, or do comments not work in Javascript? Once I removed those comments, the code that sup posted above worked flawlessly, but before that, Opera was complaining about an unmatched '{' (really weird...)
EDIT: OK, I've completely fixed everything. It's a REALLY hackish solution due to my limited knowledge of Javascript, but it work flawlessly (unless someone happens to have exactly the string "LAEN BREEEK WOZ EEEEER" in their post... and please don't put that in your signature now I've said that :p). Will upload.
EDIT: Oh, and by the way, I still haven't tested it in firefox, so I've no idea what will happen. Or in either of those two broken forums (which I don't want to sign up to), but I've fixed that on paper. Report back franpa!
EDIT: Upload'd

SupSuper
9 Jun 2009, 19:34
EDIT: Is it just me, or do comments not work in Javascript? Once I removed those comments, the code that sup posted above worked flawlessly, but before that, Opera was complaining about an unmatched '{' (really weird...)It's probably because it all gets squished into one line, you'd have to use /* */ comments instead.

Muzer
9 Jun 2009, 20:11
It's probably because it all gets squished into one line, you'd have to use /* */ comments instead.
Ah, I'd never thought of that. I removed the comments anyway now. I had to modify your code quite a bit because originally it was not stored in a string (dunno what it was stored in), and by the time it gets put into a string, all the HTML is gone. Check the source of the page if you want to see what I did, as I said, it's very hackish :p

franpa
10 Jun 2009, 06:01
http://forums.electronicarts.co.uk/need-speed-undercover/
Firefox 3.0.10 for Windows.
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLTextAreaElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: javascript:{(function(){var%20sel%20=%20document.c reateElement('div');var%20s%20=%20window.getSelect ion();if(s.toString()%20==%20''){%20%20frm%20=%20d ocument.getElementsByTagName('iframe')[document.getElementsByTagName('iframe').length%20-%201];%20%20s%20=%20frm.contentWindow.getSelection();}i f(s%20!=%20'')sel.appendChild(s.getRangeAt(0).clon eContents());var%20ele%20=%20sel.getElementsByTagN ame('*');for(var%20i=0,%20e;%20e=ele;%20i++){%20%2 0switch(e.tagName.toUpperCase())%20%20{%20%20%20%2 0case%20'A'%20:%20e.innerHTML=''+e.innerHTML+' ('+e.href+')';%20%20%20%20break;%20%20%20%20case%2 0'FONT'%20:%20if(/(?:^|,)\s*monospace\s*(?:,|$)/i.test(e.getAttribute('face')))%20%20%20%20{%20%20 %20%20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20 %20};%20%20%20%20break;%20%20%20%20case%20'DIV'%20 :%20if(e.className=='code')%20%20%20%20{%20%20%20% 20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20%20} %20%20%20%20else%20%20%20%20%20{%20%20%20%20%20%20 if(e.className=='quote')%20%20%20%20%20%20{e.inner HTML=''+e.innerHTML+''%20%20%20%20%20%20}%20%20%20 %20%20%20else%20%20%20%20%20%20{e.innerHTML='<br>'+e.innerHTML%20%20%20%20%20%20}%20%20%20%20};%20% 20%20%20break;%20%20%20%20case%20'BR'%20:%20e.inne rHTML='LAEN%20BREEEK%20WOZ%20EEEEER'+e.innerHTML;% 20%20%20%20break;%20%20%20%20case%20'B'%20:%20e.in nerHTML=''+e.innerHTML+'';%20%20%20%20break;%20%20 %20%20case%20'STRONG'%20:%20e.innerHTML=''+e.inner HTML+'';%20%20%20%20break;%20%20%20%20case%20'I'%2 0:%20e.innerHTML='[i]'+e.innerHTML+'';%20%20%20%20break;%20%20%20%20cas e%20'U'%20:%20e.innerHTML=''+e.innerHTML+'';%20%20 %20%20break;%20%20%20%20case%20'PRE'%20:%20e.inner HTML=''+e.innerHTML+'';%20%20%20%20break;%20%20%20 %20case%20'BLOCKQUOTE'%20:%20e.innerHTML=''+e.inne rHTML+'';%20%20%20%20break;%20%20%20%20case%20'IMG '%20:%20e.outerHTML+=''+e.src+'';%20%20%20%20break ;%20%20}};var%20txt%20=%20sel.textContent;txt%20=% 20txt.replace(new%20RegExp('\\n',%20'g'),%20'');tx t%20=%20txt.replace(new%20RegExp('LAEN%20BREEEK%20 WOZ%20EEEEER',%20'g'),%20'\n');var%20n%20=%20txt.s plit('\n').length;if(txt.toString()%20===%20''){%2 0%20frm%20=%20document.getElementsByTagName('ifram e')[document.getElementsByTagName('iframe').length%20-%201];%20%20txt%20=%20frm.contentDocument.getSelection( );}var%20ta%20=%20document.getElementsByTagName('t extarea');var%20tl=ta.length-1;if(typeof%20window.qr_activate%20==%20'function' ){%20%20if(ta[tl].disabled)%20%20{%20%20%20%20qr_activate(1);%20%20 }}%20if(document.getElementById('qr_open')){%20%20 itm%20=%20document.getElementById('qr_open');%20%2 0itm.style.display%20=%20'';}%20var%20t;var%20l=lo cation.hostname;var%20c=s.focusNode;if(l!='vogons. zetafleet.com'%20&&%20l!='www.yugiohtheabridgedseries.com'%20&&%20l!='yugiohtheabridgedseries.com'%20&&%20l!='forums.electronicarts.co.uk'){%20%20do%20%2 0{%20%20%20%20t=ta[tl];%20%20%20%20%20tl--%20%20}%20%20%20while(t%20&&%20(t.rows<5%20||%20t.offsetHeight==0));}if(l=='vogons.zetafl eet.com'){%20%20t=ta[0];}if(l=='www.yugiohtheabridgedseries.com'){%20%20t =ta[0];}if(l=='yugiohtheabridgedseries.com'){%20%20t=ta[0];}if(l=='forums.electronicarts.co.uk'){%20%20t=ta[0];}if(!t){%20%20prompt('Please%20copy%20BBCode',%20 txt);%20%20exit(0);}if(t.rows%20<%2015){%20%20t.rows%20+%20n%20<=%2015%20?%20t.rows%20+=%20n%20:%20t.rows%20=%2015 };var%20nam='';var%20url='';if(c%20&&%20l=='forum.ru-board.com'){%20%20while(c.className!='tpc'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20if(c.className!='tpc')exit(0);%20%20var% 20tn=c.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[1];%20%20nam=''+c.parentNode.firstChild.textContent. replace(/\n.*/g,'')+'%20';%20%20url='.href+']'+tn.childNodes[7].textContent.replace(/^%20+/,'').replace(/%20+$/,'')+' ('+tn.childNodes[5)%20'};if(c%20&&%20l=='operafan.net'||l=='opera-ac.com'||l=='bit-center.ru'){%20%20while(c.className!='windowbg'&&c.className!='windowbg2'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20var%20dv=c.getElementsByTagName('div');% 20%20for(var%20i=0,di;%20di=dv[i];%20i++)%20%20{%20%20%20%20if(di.className=='post' )%20%20%20%20{%20%20%20%20%20%20c=di;%20%20%20%20% 20%20break%20%20%20%20}%20%20};%20%20if(c.classNam e!='post')exit(0);%20%20var%20pn=c.parentNode.chil dNodes[1].firstChild.firstChild;%20%20nam=''+c.parentNode.p arentNode.firstChild.childNodes[1].textContent+'%20';%20%20url=''+/(\d\d\D\d.*\d).*$/.exec(pn.childNodes[1].textContent)[1]+' ('+pn.firstChild.firstChild.href+')%20'};if(t.valu e.indexOf(nam)!=-1){nam=''};if(nam==''){var%20qtg=''+txt+'\r\n'+%20 t.value.substring(endPos,%20t.value.length);t.setS electionRange(t.selectionEnd+n-1,%20t.selectionEnd+n-1);})()} :: anonymous :: line 1" data: no]

Muzer
10 Jun 2009, 08:39
Do other forums work?

franpa
10 Jun 2009, 09:50
Working
- Aramgeddeongames
- Purezc
- Team17
- Nvidia
Not working (nothing happens under FF 3.0.10 and the script gets stuck in a loop in FF 3.5 beta 4)
- Simple Machines Forum
- Dosbox forum
- NFS:U forum

Muzer
10 Jun 2009, 16:53
Hmm. A few questions:
1) Is it the whole EA forum or just the NFS:U bit?
2) Is the DosBox forum the VOGONS?
3) By Simple Machines Forum, do you mean this (http://www.simplemachines.org/community/index.php)?
4) Have any of these forums changed their layout (or provider) any time since the last update?
I'll investigate a bit, see if it does the same in Opera. It's odd since I'm sure Vogons was working before.

Muzer
10 Jun 2009, 17:38
OK, they all work fine in Opera (apart from SMF which uses a new JS function I hadn't come across until now - I'll have a look at that) - I'll try to fix them in Fx but no promises, since Fx's JS debugger sucks for bookmarklets.

Muzer
10 Jun 2009, 18:11
Thanks to Windows, there was another bug (now fixed) under that same linebreak umbrella (because windows uses CR + LF rather than just CR, there were still linebreaks even after removing all the CRs). I've fixed that one. I've fixed the issue with Simple Machines. I haven't been able to reproduce Franpa's issue in the Vogons, I'll try in EA now. Once I've done that, I'll upload a new version.
EDIT: OK, that's rather odd, the problem with the Vogons wouldn't reproduce before, but it did just now. Hmm, more investigation.
EDIT2: It seems to be only when you quote something with line breaks in it when Firefox crashes (yes, it does actually *CRASH*. Stupid firefox.)
EDIT3: OK, that happens in every forum under firefox. Any takers to why this is? Does firefox hate regexps or something?
EDIT4: Seems to be before the regexps. Hmm... maybe it doesn't like something I did?

Muzer
10 Jun 2009, 18:58
Stupid W3C! They are saying that Opera doesn't support the textContent property for an element object, when in reality, it does! This solves all the problems. Expect a release in the next few minutes.
Detailed changelog:
* Added code to open the QR box on Simple Machines Forums
* Removed obsolete code for YGOTAS and EA forums - both have changed and no longer require it
* Fixed crash in Firefox when quoting code with a linebreak in it by changing innerHTML to textContent.
* Because windows uses CR + LF rather than just CR, there were still linebreaks even after removing all the CRs. This has now been fixed; it removes both CRs and LFs.
EDIT: Upload'd, editing first post now.

franpa
11 Jun 2009, 02:29
I am now only using Firefox 3.5 beta 4, I did a clean install of it yesterday to fix some obscurities between it and 3.0.10.
Doesn't work
- all UK EA Forums
Works
- SMF
- Vogons (Dosbox)
UK EA forum error.
Error: uncaught exception: [Exception... "Index or size is negative or greater than the allowed amount" code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)" location: "javascript:{(function(){var%20sel%20=%20document.c reateElement('div');var%20s%20=%20window.getSelect ion();if(s.toString()%20==%20''){%20%20frm%20=%20d ocument.getElementsByTagName('iframe')[document.getElementsByTagName('iframe').length%20-%201];%20%20s%20=%20frm.contentWindow.getSelection();}i f(s%20!=%20'')sel.appendChild(s.getRangeAt(0).clon eContents());var%20ele%20=%20sel.getElementsByTagN ame('*');for(var%20i=0,%20e;%20e=ele;%20i++){%20%2 0switch(e.tagName.toUpperCase())%20%20{%20%20%20%2 0case%20'A'%20:%20e.innerHTML=''+e.innerHTML+' ('+e.href+')';%20%20%20%20break;%20%20%20%20case%2 0'FONT'%20:%20if(/(?:^|,)\s*monospace\s*(?:,|$)/i.test(e.getAttribute('face')))%20%20%20%20{%20%20 %20%20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20 %20};%20%20%20%20break;%20%20%20%20case%20'DIV'%20 :%20if(e.className=='code')%20%20%20%20{%20%20%20% 20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20%20} %20%20%20%20else%20%20%20%20%20{%20%20%20%20%20%20 if(e.className=='quote')%20%20%20%20%20%20{e.inner HTML=''+e.innerHTML+''%20%20%20%20%20%20}%20%20%20 %20%20%20else%20%20%20%20%20%20{e.innerHTML='<br>'+e.innerHTML%20%20%20%20%20%20}%20%20%20%20};%20% 20%20%20break;%20%20%20%20case%20'BR'%20:%20e.text Content='LAEN%20BREEEK%20WOZ%20EEEEER'+e.textConte nt;%20%20%20%20break;%20%20%20%20case%20'B'%20:%20 e.innerHTML=''+e.innerHTML+'';%20%20%20%20break;%2 0%20%20%20case%20'STRONG'%20:%20e.innerHTML=''+e.i nnerHTML+'';%20%20%20%20break;%20%20%20%20case%20' I'%20:%20e.innerHTML='[i]'+e.innerHTML+'';%20%20%20%20break;%20%20%20%20cas e%20'U'%20:%20e.innerHTML=''+e.innerHTML+'';%20%20 %20%20break;%20%20%20%20case%20'PRE'%20:%20e.inner HTML=''+e.innerHTML+'';%20%20%20%20break;%20%20%20 %20case%20'BLOCKQUOTE'%20:%20e.innerHTML=''+e.inne rHTML+'';%20%20%20%20break;%20%20%20%20case%20'IMG '%20:%20e.outerHTML+=''+e.src+'';%20%20%20%20break ;%20%20}};var%20txt%20=%20sel.textContent;txt%20=% 20txt.replace(new%20RegExp('\\n',%20'g'),%20'');tx t%20=%20txt.replace(new%20RegExp('\\r',%20'g'),%20 '');txt%20=%20txt.replace(new%20RegExp('LAEN%20BRE EEK%20WOZ%20EEEEER',%20'g'),%20'\n');var%20n%20=%2 0txt.split('\n').length;if(txt.toString()%20===%20 ''){%20%20frm%20=%20document.getElementsByTagName( 'iframe')[document.getElementsByTagName('iframe').length%20-%201];%20%20txt%20=%20frm.contentDocument.getSelection( );}var%20ta%20=%20document.getElementsByTagName('t extarea');var%20tl=ta.length-1;if(typeof%20window.qr_activate%20==%20'function' ){%20%20if(ta[tl].disabled)%20%20{%20%20%20%20qr_activate(1);%20%20 }}if(typeof%20QuickReply%20==%20'function'){%20%20 if(oQuickReply.bCollapsed){%20%20%20%20oQuickReply .swap();%20%20}}if(document.getElementById('qr_ope n')){%20%20itm%20=%20document.getElementById('qr_o pen');%20%20itm.style.display%20=%20'';}%20var%20t ;var%20l=location.hostname;var%20c=s.focusNode;if( l!='vogons.zetafleet.com'){%20%20do%20%20{%20%20%2 0%20t=ta[tl];%20%20%20%20%20tl--%20%20}%20%20%20while(t%20&&%20(t.rows<5%20||%20t.offsetHeight==0));}if(l=='vogons.zetafl eet.com'){%20%20t=ta[0];}if(!t){%20%20prompt('Please%20copy%20BBCode',%20 txt);%20%20exit(0);}if(t.rows%20<%2015){%20%20t.rows%20+%20n%20<=%2015%20?%20t.rows%20+=%20n%20:%20t.rows%20=%2015 };var%20nam='';var%20url='';if(c%20&&%20l=='forum.ru-board.com'){%20%20while(c.className!='tpc'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20if(c.className!='tpc')exit(0);%20%20var% 20tn=c.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[1];%20%20nam=''+c.parentNode.firstChild.textContent. replace(/\n.*/g,'')+'%20';%20%20url='.href+']'+tn.childNodes[7].textContent.replace(/^%20+/,'').replace(/%20+$/,'')+' ('+tn.childNodes[5)%20'};if(c%20&&%20l=='operafan.net'||l=='opera-ac.com'||l=='bit-center.ru'){%20%20while(c.className!='windowbg'&&c.className!='windowbg2'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20var%20dv=c.getElementsByTagName('div');% 20%20for(var%20i=0,di;%20di=dv[i];%20i++)%20%20{%20%20%20%20if(di.className=='post' )%20%20%20%20{%20%20%20%20%20%20c=di;%20%20%20%20% 20%20break%20%20%20%20}%20%20};%20%20if(c.classNam e!='post')exit(0);%20%20var%20pn=c.parentNode.chil dNodes[1].firstChild.firstChild;%20%20nam=''+c.parentNode.p arentNode.firstChild.childNodes[1].textContent+'%20';%20%20url=''+/(\d\d\D\d.*\d).*$/.exec(pn.childNodes[1].textContent)[1]+' ('+pn.firstChild.firstChild.href+')%20'};if(t.valu e.indexOf(nam)!=-1){nam=''};if(nam==''){var%20qtg=''+txt+'\r\n'+%20 t.value.substring(endPos,%20t.value.length);t.setS electionRange(t.selectionEnd+n-1,%20t.selectionEnd+n-1);})()} Line: 1"]

Muzer
11 Jun 2009, 10:30
Hmm, that code I removed must have been important in Fx. I'll add it back at lunch.

franpa
7 Jul 2009, 02:23
Can you please fix the bug with Firefox 3.5 where it lags the browser causing it to warn me about the script and ask if I should stop it?
Nvidia forums cause it, not sure of what else. Since the script is stopped (else Firefox stays unresponsive) there is no error logged.

Muzer
7 Jul 2009, 07:26
Odd, I'll have to investigate. Stupid firefox.
And thanks for bumping, you've reminded me to get around to fixing that other problem you had :p

Muzer
9 Jul 2009, 22:59
So does the script actually work in those cases? Or does it just go into an infinite loop?
I'll have to have a look at it when I have time. School is over soon (the Tuesday after next), but I'll try to take a look before that if I have the chance.

franpa
10 Jul 2009, 05:06
Do you have a summary of the cases I reported? ._. Nvidia forum definitely causes it and so does the Vogons forum.
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
Script: javascript:{(function(){var%20sel%20=%20document.c reateElement('div');var%20s%20=%20window.getSelect ion();if(s.toString()%20==%20''){%20%20frm%20=%20d ocument.getElementsByTagName('iframe')[document.getElementsByTagName('iframe').length%20-%201];%20%20s%20=%20frm.contentWindow.getSelection();}i f(s%20!=%20'')sel.appendChild(s.getRangeAt(0).clon eContents());var%20ele%20=%20sel.getElementsByTagN ame('*');for(var%20i=0,%20e;%20e=ele;%20i++){%20%2 0switch(e.tagName.toUpperCase())%20%20{%20%20%20%2 0case%20'A'%20:%20e.innerHTML=''+e.innerHTML+' ('+e.href+')';%20%20%20%20break;%20%20%20%20case%2 0'FONT'%20:%20if(/(?:^|,)\s*monospace\s*(?:,|$)/i.test(e.getAttribute('face')))%20%20%20%20{%20%20 %20%20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20 %20};%20%20%20%20break;%20%20%20%20case%20'DIV'%20 :%20if(e.className=='code')%20%20%20%20{%20%20%20% 20%20%20e.innerHTML=''+e.innerHTML+''%20%20%20%20} %20%20%20%20else%20%20%20%20%20{%20%20%20%20%20%20 if(e.className=='quote')%20%20%20%20%20%20{e.inner HTML=''+e.innerHTML+''%20%20%20%20%20%20}%20%20%20 %20%20%20else%20%20%20%20%20%20{e.innerHTML='<br>'+e.innerHTML%20%20%20%20%20%20}%20%20%20%20};%20% 20%20%20break;%20%20%20%20case%20'BR'%20:%20e.inne rHTML='LAEN%20BREEEK%20WOZ%20EEEEER'+e.innerHTML;% 20%20%20%20break;%20%20%20%20case%20'B'%20:%20e.in nerHTML=''+e.innerHTML+'';%20%20%20%20break;%20%20 %20%20case%20'STRONG'%20:%20e.innerHTML=''+e.inner HTML+'';%20%20%20%20break;%20%20%20%20case%20'I'%2 0:%20e.innerHTML='[i]'+e.innerHTML+'';%20%20%20%20break;%20%20%20%20cas e%20'U'%20:%20e.innerHTML=''+e.innerHTML+'';%20%20 %20%20break;%20%20%20%20case%20'PRE'%20:%20e.inner HTML=''+e.innerHTML+'';%20%20%20%20break;%20%20%20 %20case%20'BLOCKQUOTE'%20:%20e.innerHTML=''+e.inne rHTML+'';%20%20%20%20break;%20%20%20%20case%20'IMG '%20:%20e.outerHTML+=''+e.src+'';%20%20%20%20break ;%20%20}};var%20txt%20=%20sel.textContent;txt%20=% 20txt.replace(new%20RegExp('\\n',%20'g'),%20'');tx t%20=%20txt.replace(new%20RegExp('LAEN%20BREEEK%20 WOZ%20EEEEER',%20'g'),%20'\n');var%20n%20=%20txt.s plit('\n').length;if(txt.toString()%20===%20''){%2 0%20frm%20=%20document.getElementsByTagName('ifram e')[document.getElementsByTagName('iframe').length%20-%201];%20%20txt%20=%20frm.contentDocument.getSelection( );}var%20ta%20=%20document.getElementsByTagName('t extarea');var%20tl=ta.length-1;if(typeof%20window.qr_activate%20==%20'function' ){%20%20if(ta[tl].disabled)%20%20{%20%20%20%20qr_activate(1);%20%20 }}%20if(document.getElementById('qr_open')){%20%20 itm%20=%20document.getElementById('qr_open');%20%2 0itm.style.display%20=%20'';}%20var%20t;var%20l=lo cation.hostname;var%20c=s.focusNode;if(l!='vogons. zetafleet.com'%20&&%20l!='www.yugiohtheabridgedseries.com'%20&&%20l!='yugiohtheabridgedseries.com'%20&&%20l!='forums.electronicarts.co.uk'){%20%20do%20%2 0{%20%20%20%20t=ta[tl];%20%20%20%20%20tl--%20%20}%20%20%20while(t%20&&%20(t.rows<5%20||%20t.offsetHeight==0));}if(l=='vogons.zetafl eet.com'){%20%20t=ta[0];}if(l=='www.yugiohtheabridgedseries.com'){%20%20t =ta[0];}if(l=='yugiohtheabridgedseries.com'){%20%20t=ta[0];}if(l=='forums.electronicarts.co.uk'){%20%20t=ta[0];}if(!t){%20%20prompt('Please%20copy%20BBCode',%20 txt);%20%20exit(0);}if(t.rows%20<%2015){%20%20t.rows%20+%20n%20<=%2015%20?%20t.rows%20+=%20n%20:%20t.rows%20=%2015 };var%20nam='';var%20url='';if(c%20&&%20l=='forum.ru-board.com'){%20%20while(c.className!='tpc'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20if(c.className!='tpc')exit(0);%20%20var% 20tn=c.parentNode.parentNode.childNodes[1].childNodes[0].childNodes[1];%20%20nam=''+c.parentNode.firstChild.textContent. replace(/\n.*/g,'')+'%20';%20%20url='.href+']'+tn.childNodes[7].textContent.replace(/^%20+/,'').replace(/%20+$/,'')+' ('+tn.childNodes[5)%20'};if(c%20&&%20l=='operafan.net'||l=='opera-ac.com'||l=='bit-center.ru'){%20%20while(c.className!='windowbg'&&c.className!='windowbg2'&&c.parentNode)%20%20{%20%20%20%20c=c.parentNode%20% 20};%20%20var%20dv=c.getElementsByTagName('div');% 20%20for(var%20i=0,di;%20di=dv[i];%20i++)%20%20{%20%20%20%20if(di.className=='post' )%20%20%20%20{%20%20%20%20%20%20c=di;%20%20%20%20% 20%20break%20%20%20%20}%20%20};%20%20if(c.classNam e!='post')exit(0);%20%20var%20pn=c.parentNode.chil dNodes[1].firstChild.firstChild;%20%20nam=''+c.parentNode.p arentNode.firstChild.childNodes[1].textContent+'%20';%20%20url=''+/(\d\d\D\d.*\d).*$/.exec(pn.childNodes[1].textContent)[1]+' ('+pn.firstChild.firstChild.href+')%20'};if(t.valu e.indexOf(nam)!=-1){nam=''};if(nam==''){var%20qtg=''+txt+'\r\n'+%20 t.value.substring(endPos,%20t.value.length);t.setS electionRange(t.selectionEnd+n-1,%20t.selectionEnd+n-1);})()}:1

Muzer
12 Jul 2009, 12:20
Hmmm. That's not supposed to happen. Again, I'll check when I get the chance, it might have to wait till the summer holidays, the tuesday after next.
EDIT: I thought you said Vogons worked a minute ago?

franpa
13 Jul 2009, 07:20
It might have in a beta of Firefox 3.5, but not in the final version of Firefox 3.5.

franpa
13 Jul 2009, 21:57
ArmageddonGames.net also affected.

franpa
10 Aug 2009, 13:59
(works, but you must manually activate the Quick Reply first) Simple Machine Forum 2.0 RC1-1
(doesn't work, just flickers the screen or loops) IPB 3.0.2
If you can fix these 2 then I can live with the other issues.

franpa
4 Oct 2009, 17:07
It's been working fine so far, this site doesn't work http://social.technet.microsoft.com/Forums/en-US/w7itprogeneral/threads

franpa
8 Oct 2009, 07:53
and attempting to quote on any forum (including this one) without first activating the Quick Reply myself results in a lengthy pause then FF asking me if I want to stop the script, a short while after telling it to stop it freezes for a 2nd lengthy perdiod but when that is finished all is good.

Muzer
8 Oct 2009, 20:02
I should really start working on this again... Firefox has become rather glitchy lately it seems, either that or my script breaks standards (most likely the latter)

franpa
1 Dec 2009, 09:53
vBulletin 4.00 beta 4 also doesn't function well with your Firefox bookmark.
I shall continue to ocasionally post here until you get to work on it :P

vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.