/
-Click chat URL's to insert into the editbox for easy copy. |
Change Log: |
v2.1 |
-Updates for the ChatFrame edit box. |
v2.0 |
-ChatFrame_OnEvent hook removed in favor of ChatFrame#.AddMessage hooks |
v1.0 |
function ReURL_SetItemRef(link, text, button) |
if (strsub(link, 1, 3) == "url") then |
local url = strsub(link, 5); |
if (not ChatFrameEditBox:IsShown()) then |
ChatFrame_OpenChat(url, DEFAULT_CHAT_FRAME); |
local activeWindow = ChatEdit_GetActiveWindow(); |
if ( activeWindow ) then |
activeWindow:Insert(url); |
ChatEdit_FocusActiveWindow(); |
else |
ChatFrameEditBox:Insert(url); |
activeWindow = ChatEdit_GetLastActiveWindow(); |
activeWindow:Show(); |
activeWindow:Insert(url); |
activeWindow:SetFocus(); |
end |
else |
SetItemRef_orig(link, text, button); |
--Hook all the AddMessage funcs |
for i=1, NUM_CHAT_WINDOWS do |
local frame = getglobal("ChatFrame"..i) |
local frame = _G["ChatFrame"..i] |
local addmessage = frame.AddMessage |
frame.AddMessage = function(self, text, ...) addmessage(self, ReURL_AddLinkSyntax(text), ...) end |
end |
## Interface: 30000 |
## Interface: 40000 |
## Title: ReURL |
## Author: AnduinLothar |
## Notes: Click chat URL's to insert into the editbox. |
## Author: Karl Isenberg (AnduinLothar) |
## Version: 2.0 |
## X-Date: Oct 18 2008 |
## Version: 2.1 |
## X-Date: Oct 27 2010 |
## X-Category: Chat |
## X-Website: http://www.wowinterface.com/downloads/info5181-ReURL.html |
## X-Email: karlkfi@yahoo.com |
## OptionalDeps: Sky, CT_RaidAssist, TellTrack |
ReURL.lua |