inherit
167927
0
Mar 31, 2016 15:21:13 GMT -8
truckmodshop
48
June 2011
truckmodshop
|
Post by truckmodshop on Jan 16, 2013 12:44:11 GMT -8
I need this badly for v5. Thanks.
I just tried adding the code from v4 and it doesn't work anymore.
|
|
inherit
167927
0
Mar 31, 2016 15:21:13 GMT -8
truckmodshop
48
June 2011
truckmodshop
|
Post by truckmodshop on Jan 16, 2013 17:26:54 GMT -8
Bump here's the original code I had. I apologize, I can't remember the creator. <script type="text/javascript"> <!-- (function(){ /* Disable Images in Quotes */ var e,t,o,n,bones=location.search if(location.href.match(/action=(display|(user)?recent|search2|got)/i)||(location.href.split(/\//).pop().match(/index. cgi\??/) && document.title.match(/- (Preview|Search)/))){ for(t=(document.getElementById('wel')||document).getElementsByTagName('table'),o=t.length-1;o-- { if(t[o].className=='quote'){ for(bones=t[o].getElementsByTagName('img'),n=bones.length;n-- { e=document.createElement('span');e.title='click to view image'; e.innerHTML='<b>'+bones[n].alt+'</b>'; e.loc=bones[n].src; e.onclick=function(){window.open(this.loc)} e.style.cssText="cursor:pointer;cursor:hand" bones[n].parentNode.replaceChild(e,bones[n]) } } } } })()// --> </script>
|
|
inherit
167927
0
Mar 31, 2016 15:21:13 GMT -8
truckmodshop
48
June 2011
truckmodshop
|
Post by truckmodshop on Jan 17, 2013 12:49:11 GMT -8
Bump again
Can someone help me get this working? I'm gonna have to go back to v4 if I can't get it, and I don't want to. It's slowing my page loading times.
|
|
inherit
167927
0
Mar 31, 2016 15:21:13 GMT -8
truckmodshop
48
June 2011
truckmodshop
|
Post by truckmodshop on Jan 18, 2013 17:20:19 GMT -8
Bump
|
|
inherit
167927
0
Mar 31, 2016 15:21:13 GMT -8
truckmodshop
48
June 2011
truckmodshop
|
Post by truckmodshop on Jan 20, 2013 16:08:02 GMT -8
Bump.
|
|
inherit
167927
0
Mar 31, 2016 15:21:13 GMT -8
truckmodshop
48
June 2011
truckmodshop
|
Post by truckmodshop on Jan 22, 2013 6:26:38 GMT -8
Bump.
There's gotta be someone out there who also needs this.
|
|
inherit
167927
0
Mar 31, 2016 15:21:13 GMT -8
truckmodshop
48
June 2011
truckmodshop
|
Post by truckmodshop on Jan 24, 2013 23:39:26 GMT -8
Bump
|
|
inherit
126477
0
Apr 21, 2023 15:18:52 GMT -8
Shrike
Re-appeared briefly after 6 years only to no doubt disappear again.
1,569
June 2008
shrike
|
Post by Shrike on Jan 25, 2013 3:22:46 GMT -8
The original creator was Chris, so you might want to see if he replies to being tagged just now.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jan 25, 2013 14:00:12 GMT -8
I wrote up a quick script to emulate the behavior in V5 but it is untested. If you're up to it place this in the global footer of your V5 forum and see if it acts the same as the V4.5 script <script type="text/javascript"> // replace images in quotes $(document).ready(function(){ var d = $('.wysiwyg-textarea.content-html'),w=window; if(d.length && d.data().wysiwyg)d = d.data().wysiwyg.editors[d.data().wysiwyg.currentEditorName]; if(d.name && d.name == "Visual")d = d.editable; else d = document; $((d === document?'.posts .message ':'') + '.quote img',d) .each(function(i,e){ if((e=$(e)) && !e.closest('.quote_avatar_container').length){ var imgalt = $('<a>').attr({title:"(click to view image) " + e.attr("alt"), href:e.attr("src"), target:"_blank"}) .html("<b>[image]</b>") .click(function(ev){this.blur(); w.open(this.href); ev.preventDefault(); ev.stopImmediatePropagation();}); e.replaceWith(imgalt); } })}) </script>
A few things to keep in mind - Like the original it should affect posts but not PMs
- it should not affect topic summary
- for consistency, it attempts to add the behavior to the visual tab when quoting/modifying but the ramifications have not been properly thought through or tested.
No location check exists so be on the lookout for unexplained behaviors once installed and post them here.
|
|
inherit
167927
0
Mar 31, 2016 15:21:13 GMT -8
truckmodshop
48
June 2011
truckmodshop
|
Post by truckmodshop on Jan 28, 2013 3:23:29 GMT -8
Thanks so much for the reply ChrisI installed the code into my global footer and nothing is happening.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jan 28, 2013 5:32:01 GMT -8
I'm seeing the code in your footer but it looks to be a problem with copying since the browser is automatically changing & into & so could you go through that code in your footer and change back all the & & you see back into &&
|
|
inherit
167927
0
Mar 31, 2016 15:21:13 GMT -8
truckmodshop
48
June 2011
truckmodshop
|
Post by truckmodshop on Jan 28, 2013 8:08:03 GMT -8
Ahh there we go, success!
Thanks so much! You sir, are a gentleman and a god amongst men. Just one thing. Smileys are also disabled. Any way around that? I'm not too picky about it.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,018
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Jan 28, 2013 17:26:11 GMT -8
I didn't even consider that so in order to exclude smiley emoticons the script would need to have a list of possible emoticons and that gets tricky. In order to identify smileys that may have been added/changed from admin panel it will first look for a shoutbox and if present grab the smileys from that shoutbox. If no shoutbox exists then it will look for a wysiwyg component and if present grab the smileys from there and finally if both attempts fail it will use the plain vanilla list of standard smileys. That last option however will have no knowledge of any smiley changes that the forum has made. Here's the updated code <script type="text/javascript"> // replace images in quotes $(document).ready(function () { var d = $('.wysiwyg-textarea.content-html'), w = window, s = proboards.shoutbox && proboards.shoutbox.smiles? proboards.shoutbox.smiles: ($('.smiley-menu').has('img').length?$('.smiley-menu').has('img').eq(0).find('img').map(function(i,e){return [this.alt,this.src]}).get(): [ "", "/images/smiley/smiley.png", "", "/images/smiley/tongue.png", "", "/images/smiley/plain.png", "", "/images/smiley/cry.png", "", "/images/smiley/angry.png", "", "/images/smiley/grin.png", "", "/images/smiley/sad.png", "", "/images/smiley/eyesroll.png", "", "/images/smiley/wink.png", "", "/images/smiley/cool.png", "", "/images/smiley/squint.png", "", "/images/smiley/huh.png", "", "/images/smiley/shocked.png", "", "/images/smiley/rofl.png", "", "/images/smiley/dead.png", "", "/images/smiley/insane.png", "", "/images/smiley/sick.png", "", "/images/smiley/cheesy.png", "", "/images/smiley/browraise.png", "", "/images/smiley/superangry.png", "", "/images/smiley/lipssealed.png", "", "/images/smiley/kiss.png", "", "/images/smiley/nerd.png", "", "/images/smiley/notamused.png", "", "/images/smiley/undecided.png", "(atrb_partsz)", "/images/smiley/asleep.png", "", "/images/smiley/embarrassed.png", "", "/images/smiley/wavey.png", "", "/images/smiley/pirate.png", "", "/images/smiley/ninja.png" ] ) if (d.length && d.data().wysiwyg) d = d.data().wysiwyg.editors[d.data().wysiwyg.currentEditorName]; if (d.name && d.name == "Visual") d = d.editable; else d = document; $((d === document ? '.posts .message ' : '') + '.quote img', d) .each(function (i, e) { if ((e = $(e)) && e.closest('.quote_avatar_container').length==0 && $.inArray(e.attr("src"),s) == -1 ) { var imgalt = $('<a>').attr({ title : "(click to view image) " + e.attr("alt"), href : e.attr("src"), target : "_blank" }) .html("<b>[image]</b>") .click(function (ev) { this.blur(); w.open(this.href); ev.preventDefault(); ev.stopImmediatePropagation(); }); e.replaceWith(imgalt); } }) }) </script> In any event if you have smileys added through another code/plugin this code won't know about it unless it is instructed to look for an identifying trait (should it exist) which it is currently not doing. Edit:
I've specifically made it look for image SRC rather than image ALT since V5 now allows specifying ALT which could lead to false positives
|
|
inherit
167927
0
Mar 31, 2016 15:21:13 GMT -8
truckmodshop
48
June 2011
truckmodshop
|
Post by truckmodshop on Jan 29, 2013 12:17:42 GMT -8
Wow. I dunno how you guys do this stuff. Works like a charm!
Thank you so much, I really appreciate your work, and the time and effort you took out of your day to help!
Someone should move this to the header and footers board so other people can find it. I know it's one of the more useful codes, considering the amount of pics being posted on my forum.
|
|