-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinksInChat.xml
356 lines (324 loc) · 15.9 KB
/
LinksInChat.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\..\FrameXML\UI.xsd">
<!-- This is the hidden frame that launches the whole addon -->
<Frame name="LinksInChatFrame" parent="UIParent" hidden="true">
<Scripts>
<OnLoad>self:RegisterEvent("PLAYER_ENTERING_WORLD");</OnLoad>
<OnEvent>LinksInChat:OnEvent(self, event, ...);</OnEvent>
</Scripts>
</Frame>
<!-- These are the custom font & button styles that we have defined -->
<Font name="LinksInChatXML_Font_Title" inherits="GameFontNormalLarge" virtual="true"/>
<Font name="LinksInChatXML_Font_Normal" inherits="SystemFont_Outline_Small" virtual="true"/>
<Font name="LinksInChatXML_Font_Small" inherits="SystemFont_Outline_Small" virtual="true"/>
<!-- This frame holds the Copy link Window -->
<Frame name="LinksInChat_Copy_Frame" parent="UIParent" movable="false" resizable="false" enableKeyboard="true" enableMouse="true" frameStrata="DIALOG" toplevel="true" hidden="true">
<!-- Size is adjusted by setting anchors relative to parent -->
<Size><AbsDimension x="500" y="80"/></Size>
<Anchors>
<Anchor point="CENTER" relativeTo="UIParent" relativePoint="CENTER"><Offset><AbsDimension x="0" y="0"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnKeyDown>if (key=="ESCAPE") then self:Hide(); end</OnKeyDown>
<OnLoad>
self:EnableMouseWheel(true);
local L = LinksInChat_Locale;
LinksInChat_Copy_Frame_Title:SetText(L["CopyFrame Title"]);
LinksInChat_Copy_Frame_Info1:SetText(L["CopyFrame Info1"]);
LinksInChat_Copy_Frame_Info2:SetText(L["CopyFrame Info2"]);
</OnLoad>
</Scripts>
<!-- The form title, info-text and background -->
<Layers>
<!-- FontStrings -->
<Layer level="ARTWORK">
<!-- At the top of the form -->
<FontString name="LinksInChat_Copy_Frame_Title" inherits="LinksInChatXML_Font_Title" text="Links in Chat">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT"><Offset><AbsDimension x="10" y="-15"/></Offset></Anchor>
</Anchors>
</FontString>
<FontString name="LinksInChat_Copy_Frame_Countdown" inherits="LinksInChatXML_Font_Small" text="8">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPRIGHT"><Offset><AbsDimension x="-24" y="-32"/></Offset></Anchor>
</Anchors>
</FontString>
<FontString name="LinksInChat_Copy_Frame_Info1" inherits="LinksInChatXML_Font_Small" text="Press Ctrl-C to copy the link.">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPRIGHT"><Offset><AbsDimension x="-265" y="-15"/></Offset></Anchor>
</Anchors>
</FontString>
<FontString name="LinksInChat_Copy_Frame_Info2" inherits="LinksInChatXML_Font_Small" text="Press ESC to close window.">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="LinksInChat_Copy_Frame_Info1" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-4"/></Offset></Anchor>
</Anchors>
</FontString>
</Layer>
<!-- Background color -->
<Layer level="BACKGROUND">
<Texture>
<Color r="0" g="0.3" b="0" a="0.7"/> <!-- A dark-green color -->
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT"><Offset><AbsDimension x="2" y="-2"/></Offset></Anchor>
<Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT"><Offset><AbsDimension x="-2" y="2"/></Offset></Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<!-- At the top of the form -->
<Button name="LinksInChat_Copy_Frame_CloseButton1" inherits="UIPanelCloseButton">
<Anchors>
<Anchor point="TOPRIGHT"><Offset><AbsDimension x="-3" y="-3" /></Offset></Anchor>
</Anchors>
<Scripts>
<OnClick>self:GetParent():Hide();</OnClick>
</Scripts>
</Button>
<!-- Edit box -->
<EditBox name="LinksInChat_Copy_Frame_EditBox" inherits="InputBoxTemplate" autoFocus="true">
<!-- Because of how Scrollframe works we need to set a .Width and .Height -->
<!-- This is dynamically adjusted in the <OnSizeChanged> event of the ScrollFrame -->
<Size><AbsDimension x="100" y="100"/></Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT"><Offset><AbsDimension x="15" y="-10"/></Offset></Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT"><Offset><AbsDimension x="-15" y="10"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnEscapePressed>self:GetParent():Hide();</OnEscapePressed>
<OnShow>self:HighlightText();</OnShow>
<OnEditFocusGained>self:HighlightText();</OnEditFocusGained>
</Scripts>
</EditBox>
</Frames>
</Frame>
<!-- This frame holds the Addon options Window -->
<Frame name="LinksInChatXML_Settings_Frame">
<Scripts>
<OnLoad>
LinksInChat:SettingsFrame_OnLoad(self);
local L = LinksInChat_Locale;
LinksInChatXML_Settings_Frame_Title:SetText(L["Settings Title"]);
LinksInChatXML_Settings_Frame_Info1:SetText(L["Settings Info1"]);
LinksInChatXML_Settings_Frame_Info2:SetText(L["Settings Info2"]);
LinksInChatXML_Settings_Frame_Info3:SetText(L["Provider Info1"]);
LinksInChatXML_Settings_Frame_Translate:SetText(L["Translator info"]);
LinksInChatXML_Settings_Frame_Btn_Color:SetText(L["Button Web link color"]);
LinksInChatXML_Settings_Frame_DropDown_AutoHideLabel:SetText(L["Label Hide window after"]);
LinksInChatXML_Settings_Frame_Chk_IgnoreHyperLinksText:SetText(L["Check Ignore hyperlinks"]);
LinksInChatXML_Settings_Frame_Chk_ExtraText:SetText(L["Check Extra"]);
LinksInChatXML_Settings_Frame_Chk_SimpleText:SetText(L["Check Simple search"]);
LinksInChatXML_Settings_Frame_Chk_UseHTTPSText:SetText(L["Check Use HTTPS"]);
LinksInChatXML_Settings_Frame_Chk_AlwaysEnglishText:SetText(L["Check Always English"]);
LinksInChatXML_Settings_Frame_DropDown_ProviderLabel:SetText(L["Label Search provider"]);
LinksInChatXML_Settings_Frame_Info2:ClearAllPoints();
LinksInChatXML_Settings_Frame_Info2:SetPoint("BOTTOMLEFT", "LinksInChatXML_Settings_Frame_Chk_IgnoreHyperLinks", "TOPLEFT", 0, 10);
LinksInChatXML_Settings_Frame_Info2:SetPoint("BOTTOMRIGHT", "$parent", "BOTTOMRIGHT", -10, 0);
LinksInChatXML_Settings_Frame_Info3:ClearAllPoints();
LinksInChatXML_Settings_Frame_Info3:SetPoint("TOPLEFT", "LinksInChatXML_Settings_Frame_DropDown_Provider", "BOTTOMLEFT", 20, -10);
LinksInChatXML_Settings_Frame_Info3:SetPoint("TOPRIGHT", "$parent", "TOPRIGHT", -10, 0);
</OnLoad>
</Scripts>
<Layers>
<Layer level="ARTWORK">
<!-- At the top of the form -->
<FontString name="LinksInChatXML_Settings_Frame_Title" inherits="LinksInChatXML_Font_Title" text="Links in Chat: X.Y.Z">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT"><Offset><AbsDimension x="10" y="-20"/></Offset></Anchor>
</Anchors>
</FontString>
<FontString name="LinksInChatXML_Settings_Frame_Info1" inherits="LinksInChatXML_Font_Normal" justifyH="LEFT" wordwrap="true" maxLines="10" text="Clicking on web-links (http:// or www.) will open a window to copy the link to your clipboard.">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_Title" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="10" y="-20"/></Offset></Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT"><Offset><AbsDimension x="-10" y="0"/></Offset></Anchor>
</Anchors>
</FontString>
<!-- Below Autohide dropdown -->
<FontString name="LinksInChatXML_Settings_Frame_Info2" inherits="LinksInChatXML_Font_Normal" justifyH="LEFT" wordwrap="true" maxLines="10" text="You can also Alt-click hyperlinks (items, spells, etc) in chat to make web-links for them.">
<Anchors>
<!-- Anchors are done in OnLoad() do align it properly -->
<!--
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_Info1" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="0" y="-130"/></Offset></Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT"><Offset><AbsDimension x="-10" y="0"/></Offset></Anchor>
-->
</Anchors>
</FontString>
<!-- Below Provider dropdown -->
<FontString name="LinksInChatXML_Settings_Frame_Info3" inherits="LinksInChatXML_Font_Small" justifyH="LEFT" wordwrap="true" maxLines="10" text="Not all search-providers can do advanced-search, and not all hyperlink-types are supported.">
<Anchors>
<!-- Anchors are done in OnLoad() do align it properly -->
<!--
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_Info2" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="10" y="-170"/></Offset></Anchor>
<Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT"><Offset><AbsDimension x="-10" y="0"/></Offset></Anchor>
-->
</Anchors>
</FontString>
<!-- Bottom -->
<FontString name="LinksInChatXML_Settings_Frame_Translate" inherits="LinksInChatXML_Font_Small" justifyH="LEFT" text="">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT"><Offset><AbsDimension x="10" y="15"/></Offset></Anchor>
</Anchors>
</FontString>
</Layer>
<Layer level="BACKGROUND">
<!-- Texture used for Color picker -->
<Texture name="LinksInChatXML_Settings_Frame_Texture_Color">
<Color r="5" g="5" b="5" a="1"/>
<Size><AbsDimension x="17" y="17"/></Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT"><Offset><AbsDimension x="25" y="-150"/></Offset></Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<Button name="LinksInChatXML_Settings_Frame_Btn_Color" inherits="UIPanelButtonTemplate" text="Web link color...">
<Size><AbsDimension x="130" y="25"/></Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT"><Offset><AbsDimension x="47" y="-147"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnShow>
LinksInChat:LinksInChatXML_Settings_Frame_Btn_Color_OnShow()
</OnShow>
<OnClick>
LinksInChat:ShowColorPicker(LinksInChatXML_Settings_Frame_Texture_Color);
</OnClick>
</Scripts>
</Button>
<Frame name="LinksInChatXML_Settings_Frame_DropDown_AutoHide" inherits="UIDropDownNoTaintMenuTemplate" enableMouse="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_Btn_Color" relativePoint="TOPLEFT"><Offset><AbsDimension x="-40" y="-50"/></Offset></Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentLabel" inherits="GameFontHighlight" text="Hide window after">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT"><Offset><AbsDimension x="18" y="3"/></Offset></Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self.type = CONTROLTYPE_DROPDOWN;
self:RegisterEvent("PLAYER_ENTERING_WORLD");
</OnLoad>
<OnEvent>LinksInChat:Settings_Frame_DropDown_AutoHide_OnEvent(self, event, ...);</OnEvent>
<OnClick>self:SetValue(self.value);</OnClick>
</Scripts>
</Frame>
<CheckButton name="LinksInChatXML_Settings_Frame_Chk_IgnoreHyperLinks" inherits="ChatConfigCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_DropDown_AutoHide" relativePoint="TOPLEFT"><Offset><AbsDimension x="10" y="-90"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnShow>if (LinksInChat:GetCurrentSetting("IgnoreHyperlinks") == true) then self:SetChecked(true); else self:SetChecked(false); end;</OnShow>
<OnClick>
local b = self:GetChecked();
self:SetChecked(b);
LinksInChat:SetCurrentSetting("IgnoreHyperlinks", b);
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="LinksInChatXML_Settings_Frame_Chk_Extra" inherits="ChatConfigCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_Chk_IgnoreHyperLinks" relativePoint="TOPLEFT"><Offset><AbsDimension x="0" y="-24"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnShow>if (LinksInChat:GetCurrentSetting("Extra") == true) then self:SetChecked(true); else self:SetChecked(false); end;</OnShow>
<OnClick>
local b = self:GetChecked();
self:SetChecked(b);
LinksInChat:SetCurrentSetting("Extra", b);
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="LinksInChatXML_Settings_Frame_Chk_Simple" inherits="ChatConfigCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_Chk_Extra" relativePoint="TOPLEFT"><Offset><AbsDimension x="0" y="-24"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnShow>if (LinksInChat:GetCurrentSetting("Simple") == true) then self:SetChecked(true); else self:SetChecked(false); end;</OnShow>
<OnClick>
local b = self:GetChecked();
self:SetChecked(b);
LinksInChat:SetCurrentSetting("Simple", b);
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="LinksInChatXML_Settings_Frame_Chk_UseHTTPS" inherits="ChatConfigCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_Chk_Simple" relativePoint="TOPLEFT"><Offset><AbsDimension x="0" y="-24"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnShow>if (LinksInChat:GetCurrentSetting("UseHTTPS") == true) then self:SetChecked(true); else self:SetChecked(false); end;</OnShow>
<OnClick>
local b = self:GetChecked();
self:SetChecked(b);
LinksInChat:SetCurrentSetting("UseHTTPS", b);
</OnClick>
</Scripts>
</CheckButton>
<CheckButton name="LinksInChatXML_Settings_Frame_Chk_AlwaysEnglish" inherits="ChatConfigCheckButtonTemplate">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_Chk_UseHTTPS" relativePoint="TOPLEFT"><Offset><AbsDimension x="0" y="-24"/></Offset></Anchor>
</Anchors>
<Scripts>
<OnShow>if (LinksInChat:GetCurrentSetting("AlwaysEnglish") == true) then self:SetChecked(true); else self:SetChecked(false); end;</OnShow>
<OnClick>
local b = self:GetChecked();
self:SetChecked(b);
LinksInChat:SetCurrentSetting("AlwaysEnglish", b);
LinksInChat:UpdateProvider();
</OnClick>
</Scripts>
</CheckButton>
<Frame name="LinksInChatXML_Settings_Frame_DropDown_Provider" inherits="UIDropDownNoTaintMenuTemplate" enableMouse="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_Chk_AlwaysEnglish" relativePoint="TOPLEFT"><Offset><AbsDimension x="-9" y="-50"/></Offset></Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentLabel" inherits="GameFontHighlight" text="Search provider for hyperlinks">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT"><Offset><AbsDimension x="18" y="3"/></Offset></Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self.type = CONTROLTYPE_DROPDOWN;
self:RegisterEvent("PLAYER_ENTERING_WORLD");
</OnLoad>
<OnEvent>LinksInChat:Settings_Frame_DropDown_Provider_OnEvent(self, event, ...);</OnEvent>
<OnClick>self:SetValue(self.value);</OnClick>
</Scripts>
</Frame>
<!--
<Frame name="LinksInChatXML_Settings_Frame_DropDown_KeyModifier" inherits="UIDropDownNoTaintMenuTemplate" enableMouse="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="LinksInChatXML_Settings_Frame_DropDown_Provider" relativePoint="TOPLEFT"><Offset><AbsDimension x="0" y="-85"/></Offset></Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentLabel" inherits="GameFontHighlight" text="Key modifier">
<Anchors>
<Anchor point="BOTTOMLEFT" relativePoint="TOPLEFT"><Offset><AbsDimension x="18" y="3"/></Offset></Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Scripts>
<OnLoad inherit="prepend">
self.type = CONTROLTYPE_DROPDOWN;
self:RegisterEvent("PLAYER_ENTERING_WORLD");
</OnLoad>
<OnEvent>LinksInChat:Settings_Frame_DropDown_KeyModifier_OnEvent(self, event, ...);</OnEvent>
<OnClick>self:SetValue(self.value);</OnClick>
</Scripts>
</Frame>
-->
</Frames>
</Frame>
</Ui>