ImagePreview *OLD*

Gives a preview of images linked in chat

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==   
// @name            ImagePreview *OLD*
// @namespace       skyboy@kongregate
// @author          skyboy
// @version         1.1.1
// @description     Gives a preview of images linked in chat
// @include         *://www.kongregate.com/games/*/*
// @homepage        http://userscripts-mirror.org/scripts/show/82352
// ==/UserScript==   
if (/^\/?games\/[^\/]+\/[^\/?]+(\?.*)?$/.test(window.location.pathname)) {
setTimeout(function() {
javascript:void((function(){window.location.assign("javascript:void((function(){var cont=new Element('p');cont.id='kong_game_ui',$('subwrap').insertBefore(cont, $('secondary'));cont.innerHTML=\"<div style='left: 144px; top: 58px; display: none;' class='user_rollover_container' id='user_popup'><div class='user_rollover'><div class='user_rollover_inner'><img src='' style='max-width: 101px; max-height: 200px; margin: 3px 0px 0px 7px;' id='previewpop'></div></div></div>\";holodeck.addIncomingMessageFilter(function(m,n){var REGEX=/(<\\S[^>]+>)?(\\b(?:(?:(ht|f)tp)s?:\\/\\/)?(((?:(?:[^.]+)[.])*(?:(?:[a-z0-9][a-z0-9\\-]{0,61})?[a-z0-9])[.])*(a(?:c|d|e(?:ro)?|f|g|i|l|m|n|o|q|r(?:pa)?|s(?:ia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|du|e|g|h|r|s|t|u)|f[ijkmor]|g(?:a|b|d|e|f|g|h|i|l|m|n|ov|p|q|r|s|t|u|w|y)|h[kmnrtu]|i(?:d|e|l|m|n(?:fo|t)|o|q|r|s|t)|je|jm|jo|jobs|jp|k[eghimnprwyz]|l[abcikrstuvy]|m(?:a|c|d|e|f|g|h|i?l|k|m|n|o(?:bi)?|p|q|r|s|t|u(?:seum)?|v|w|x|y|z)|n(?:a(?:me)?|c|et?|f|g|i|l|o|p|r|u|z)|om|org|p(?:a|e|f|g|h|k|l|m|n|ro?|s|t|w|y)|qa|r[eosuw]|s(?:a|b|c|d|e|g|h|i|j|k|l|m|n|o|r|t|u|v|y|z)|t(?:c|d|e?l|f|g|th|j|k|m|n|o|p|r(?:avel)?|t|v|w|z)|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw])\\b([.]\\B)?|\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3})(?::\\d+)?)?(\\/(?:\\B|\\S+)(?:\\.(?:jpe?g|jpe|gif|png|tiff?|bmp|jfif|exif|raw|p[pgbn]m|svg|ico)(?:[?](?:\\B|\\S+))?))(?:[\"'][^>]*>([\\s\\S]+?)<\\/\\1>)/gi,q=function(w,c,r,l){var t,a,d;w=w.substring(0,(t=r.lastIndex)-(a=c[0]).length)+(a=(\"<a class='\"+(l?l[1]:'poppreview')+\"' onmouseover=\\\"$('user_popup').setStyle({display:'block',top:(event.pageY-17)+'px',left:(event.pageX+5)+'px'});$('previewpop').src=this.href;\\\" onmouseout=\\\"$('user_popup').style.display='none'\\\" href='\"+(l=((((d=c[3])=='ht'||d=='f')?'':'http://')+(d=a).replace(/<a[^>]+?href=([\"'])([\\s\\S]+?)\\1[^>]*?>[\\s\\S]+<\\/a>/, '$2')))+\"' target='_blank'>\"+(c[9]||d.replace(/(.{38}(?=.{9}))/g, '$1\\n').strip())+'</a>'))+w.substring(t,w.length);REGEX.lastIndex+=(a=a.length-d.length),r.lastIndex+=a;return w},Q=function(b){var w=b,t=REGEX.lastIndex=0,a,c,d;while(c=REGEX.exec(w)){if(c[1]||(!c[5]&&!c[7])||(c[7]&&!(c[3]||c[8])))continue;w=q(w,c,REGEX)};while(c=lF.exec(w)){c[3]='ht';w=q(w,c,lF,c[0].match(/class=(['\"])([^>]+?)\\2[\\s\\S]*?>/i))};return w};return n(Q(m),n)})})())")})());
}, 1250);
}