Download
(3Kb)
Download
Updated: 07-21-18 01:42 PM
Pictures
File Info
Compatibility:
Battle for Azeroth (8.0.1)
Updated:07-21-18 01:42 PM
Created:unknown
Downloads:20,055
Favorites:72
MD5:

ReURL  Popular! (More than 5000 hits)

Version: 2.1.80000
by: AnduinLothar, Kharthus

Simple addon that highlights links in chat. Click it to put it in the chat frame edit box for easy copying, no extra frames needed!

v2.1
-Updates for the ChatFrame edit box.

v2.0
-ChatFrame_OnEvent hook removed in favor of ChatFrame#.AddMessage hooks

v1.0
-Initial Release
Post A Reply Comment Options
Unread 03-30-11, 01:48 AM  
takvaa
A Kobold Labourer

Forum posts: 1
File comments: 6
Uploads: 0
delete all in lua and paste this instead it will work


Code:
local SetItemRef_orig = SetItemRef
function ReURL_SetItemRef(link, text, button, chatFrame)
	if (strsub(link, 1, 3) == "url") then
		local ChatFrameEditBox = ChatEdit_ChooseBoxForSend()
		local url = strsub(link, 5);
		if (not ChatFrameEditBox:IsShown()) then
			ChatEdit_ActivateChat(ChatFrameEditBox)
		end
		ChatFrameEditBox:Insert(url)
		ChatFrameEditBox:HighlightText()

	else
		SetItemRef_orig(link, text, button, chatFrame)
	end
end
SetItemRef = ReURL_SetItemRef

function ReURL_AddLinkSyntax(chatstring)
	if (type(chatstring) == "string") then
		local extraspace;
		if (not strfind(chatstring, "^ ")) then
			extraspace = true;
			chatstring = " "..chatstring;
		end
		chatstring = gsub (chatstring, " www%.([_A-Za-z0-9-]+)%.(%S+)%s?", ReURL_Link("www.%1.%2"))
		chatstring = gsub (chatstring, " (%a+)://(%S+)%s?", ReURL_Link("%1://%2"))
		chatstring = gsub (chatstring, " ([_A-Za-z0-9-%.]+)@([_A-Za-z0-9-]+)(%.+)([_A-Za-z0-9-%.]+)%s?", ReURL_Link("%1@%2%3%4"))
		chatstring = gsub (chatstring, " (%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?):(%d%d?%d?%d?%d?)%s?", ReURL_Link("%1.%2.%3.%4:%5"))
		chatstring = gsub (chatstring, " (%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)%.(%d%d?%d?)%s?", ReURL_Link("%1.%2.%3.%4"))
		if (extraspace) then
			chatstring = strsub(chatstring, 2);
		end
	end
	return chatstring
end

REURL_COLOR = "16FF5D"
ReURL_Brackets = false
ReUR_CustomColor = true

function ReURL_Link(url)
	if (ReUR_CustomColor) then
		if (ReURL_Brackets) then
			url = " |cff"..REURL_COLOR.."|Hurl:"..url.."|h["..url.."]|h|r "
		else
			url = " |cff"..REURL_COLOR.."|Hurl:"..url.."|h"..url.."|h|r "
		end
	else
		if (ReURL_Brackets) then
			url = " |Hurl:"..url.."|h["..url.."]|h "
		else
			url = " |Hurl:"..url.."|h"..url.."|h "
		end
	end
	return url
end

--Hook all the AddMessage funcs
for i=1, NUM_CHAT_WINDOWS do
	local frame = getglobal("ChatFrame"..i)
	local addmessage = frame.AddMessage
	frame.AddMessage = function(self, text, ...) addmessage(self, ReURL_AddLinkSyntax(text), ...) end
end
Report comment to moderator  
Reply With Quote
Unread 09-12-10, 06:05 PM  
whateverAbC
A Kobold Labourer

Forum posts: 0
File comments: 1
Uploads: 0
Originally posted by Mortilus
doesn't work with 3.3.5

However, a quick-and-dirty fix is to find all occurrences of

ChatFrameEditBox

and replace it with

ChatFrame1EditBox
Damn, I need to read the comments before I start finding my own solutions. Anyways I created this less "dirty" fix, with a focus addition, which actually makes it a tad better imo :P.
Mortilus version does work however.

Anyways in the file: ReURL.lau at line 41-45 you will find this:
Code:
        if (not ChatFrameEditBox:IsShown()) then
            ChatFrame_OpenChat(url, DEFAULT_CHAT_FRAME);
        else
            ChatFrameEditBox:Insert(url);
        end
Replace it with this:
Code:
        local activeWindow = ChatEdit_GetActiveWindow();
        if ( activeWindow ) then
            activeWindow:Insert(url);
        else
            ChatEdit_GetLastActiveWindow():Insert(url);
            ChatEdit_GetLastActiveWindow():SetFocus();
        end

And here is the complete version of Mortilus edit if anyone happens to read these comments.
Code:
        if (not ChatFrame1EditBox:IsShown()) then
            ChatFrame_OpenChat(url, DEFAULT_CHAT_FRAME);
        else
            ChatFrame1EditBox:Insert(url);
        end

P.S.
To the author of this add, Thanx a ton This is just want Ive wanted for a long time now. Addons like Chatter is just to much imo, all I want is a link, nothing more, nothing less.
Report comment to moderator  
Reply With Quote
Unread 07-10-10, 07:39 PM  
Mortilus
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 12
File comments: 207
Uploads: 7
doesn't work with 3.3.5

However, a quick-and-dirty fix is to find all occurrences of

ChatFrameEditBox

and replace it with

ChatFrame1EditBox
Report comment to moderator  
Reply With Quote
Unread 11-25-08, 09:47 AM  
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1710
File comments: 1222
Uploads: 43
Originally posted by AnduinLothar
That would mean you have some erronious hook calling ChatFrame_OnEvent with arg1 as a table. I'm pretty sure WoW never does that on its own, you might try dissabling addons to figure out what causes it.
Got a custom piece of code in my modified oChat that does this already.
Report comment to moderator  
Reply With Quote
Unread 07-31-06, 02:40 AM  
AnduinLothar
Nobody of Importance
 
AnduinLothar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 95
File comments: 208
Uploads: 23
That would mean you have some erronious hook calling ChatFrame_OnEvent with arg1 as a table. I'm pretty sure WoW never does that on its own, you might try dissabling addons to figure out what causes it.
Report comment to moderator  
Reply With Quote
Unread 07-29-06, 12:46 AM  
Mazzlefizz
A Pyroguard Emberseer
 
Mazzlefizz's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3521
File comments: 60
Uploads: 2
Finally an elegant way to copy links from the chat window! Well done I suspect TinyURL is going to see their hits decrease now.

That said, I have been getting an error that's occurring quite frequently. I think it mostly if not always happens when zoning or logging in.

Count: 7
Error: Interface\AddOns\ReURL\ReURL.lua:53: bad argument #1 to `strfind' (string expected, got table)

Any ides on why this may be occurring?
__________________
MazzleUI Home Page: Mazzlefizz.WoWInterface.com
Info, FAQs, Forums, Download can be found at that link.
Report comment to moderator  
Reply With Quote
Unread 07-19-06, 03:45 PM  
AnduinLothar
Nobody of Importance
 
AnduinLothar's Avatar
AddOn Author - Click to view AddOns

Forum posts: 95
File comments: 208
Uploads: 23
Hot damn, why didn't I think of that!?
Report comment to moderator  
Reply With Quote
Unread 07-19-06, 05:46 AM  
Echo5ive
A Defias Bandit
AddOn Author - Click to view AddOns

Forum posts: 3
File comments: 1
Uploads: 1
Finally an easy way to share porn links in guild chat!
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: