-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathaddon-AssociationMc.xml
473 lines (451 loc) · 32.7 KB
/
addon-AssociationMc.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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
<?xml version="1.0" encoding="utf-8"?>
<addon addon_id="AssociationMc" title="Association Minecraft" version_string="1.1.3" version_id="17" url="https://github.com/lol768/XenForo-MCASSOC/" install_callback_class="AssociationMc_Installer" install_callback_method="install" uninstall_callback_class="AssociationMc_Installer" uninstall_callback_method="uninstall">
<admin_navigation/>
<admin_permissions/>
<admin_style_properties/>
<admin_templates>
<template title="association_custom_criteria"><![CDATA[<xen:controlunit label="{xen:phrase mc_assoc_admin_criteria_label}:">
<ul>
<xen:hook name="user_criteria_assoc_mc">
<li><label>
<input type="checkbox" name="user_criteria[mc_assoc_associated][rule]" value="mc_assoc_associated" {xen:checked $userCriteria.mc_assoc_associated} />
{xen:phrase mc_assoc_admin_criteria_associated}
</label></li>
</xen:hook>
</ul>
</xen:controlunit>
</fieldset>
]]></template>
</admin_templates>
<admin_template_modifications>
<modification template="user_extra" modification_key="user_association_info" description="Adds association status to extra tab in admin panel" execution_order="10" enabled="1" action="str_replace">
<find><![CDATA[<h3 class="textHeading">{xen:phrase active_user_upgrades}</h3>]]></find>
<replace><![CDATA[<h3 class="textHeading">{xen:phrase mc_assoc_admin_extra_title}</h3>
<p><xen:if is="{$mcAssocAssociated}">
<xen:foreach loop="$mcAssoc" value="$model">{$model.last_username} ({$model.minecraft_uuid})</p><p><xen:form action="{xen:link mc-association/delete/deleteOther }" method="POST"><input type="hidden" name="user_id" value="{$user.user_id}"><input type="hidden" name="uuid" value="{$model.minecraft_uuid}"><input type="submit" value="Remove association" class="button primary" style="min-width: 125px"></xen:form></xen:foreach><xen:else />No association.</xen:if></p>
<h3 class="textHeading">{xen:phrase active_user_upgrades}</h3>]]></replace>
</modification>
</admin_template_modifications>
<code_events/>
<code_event_listeners>
<listener event_id="criteria_user" execute_order="10" callback_class="AssociationMc_Listener_NewUserCriteria" callback_method="checkCriteria" active="1" hint="" description="Checks user criteria validity."/>
<listener event_id="init_dependencies" execute_order="10" callback_class="AssociationMc_Helpers_Listener" callback_method="init" active="1" hint="" description="Adds listener to register avatar helper."/>
<listener event_id="load_class" execute_order="10" callback_class="AssociationMc_Listener_LoadThreadController" callback_method="hook" active="1" hint="XenForo_ControllerPublic_Thread" description="Class hook to add Minecraft account to user post info in threads."/>
<listener event_id="load_class" execute_order="10" callback_class="AssociationMc_Listener_LoadPrivateMessageController" callback_method="hook" active="1" hint="XenForo_ControllerPublic_Conversation" description="Allows the addon to add in Minecraft info in private messages."/>
<listener event_id="load_class" execute_order="10" callback_class="AssociationMc_Listener_LoadAdminUserEditController" callback_method="hook" active="1" hint="XenForo_ControllerAdmin_User" description="Adds association info to user admin edit page."/>
<listener event_id="load_class" execute_order="10" callback_class="AssociationMc_Listener_UserDeleteDataWriter" callback_method="hook" active="1" hint="XenForo_DataWriter_User" description="Hook for User DataWriter, we override _preDelete"/>
<listener event_id="template_hook" execute_order="10" callback_class="AssociationMc_Listener_ProfilePage" callback_method="hook" active="1" hint="member_view_sidebar_middle1" description="Hook to add Minecraft account to user profile sidebar."/>
<listener event_id="template_hook" execute_order="10" callback_class="AssociationMc_Listener_ThreadPost" callback_method="hook" active="1" hint="message_user_info_text" description="Hook to add Minecraft account to user post info in threads."/>
<listener event_id="template_hook" execute_order="10" callback_class="AssociationMc_Listener_NewUserCriteria" callback_method="hook" active="1" hint="user_criteria_extra" description="Adds user criterion for trophies/promotions etc."/>
<listener event_id="template_hook" execute_order="10" callback_class="AssociationMc_Listener_VisitorDropdown" callback_method="hookLeft" active="1" hint="navigation_visitor_tab_links1" description="Adds manage association link to visitor dropdown (left side)."/>
<listener event_id="template_hook" execute_order="10" callback_class="AssociationMc_Listener_VisitorDropdown" callback_method="hookRight" active="1" hint="navigation_visitor_tab_links2" description="Adds manage association link to visitor dropdown (right side)."/>
<listener event_id="template_hook" execute_order="10" callback_class="AssociationMc_Listener_MemberPageTabs" callback_method="hook" active="1" hint="member_view_tabs_heading" description="Hook function for the member page tabs"/>
<listener event_id="template_hook" execute_order="10" callback_class="AssociationMc_Listener_MemberPageTabContent" callback_method="hook" active="1" hint="member_view_tabs_content" description="Hook function for the member page tab content"/>
</code_event_listeners>
<cron/>
<email_templates/>
<email_template_modifications/>
<optiongroups>
<group group_id="associationMcOpts" display_order="1" debug_only="0"/>
<option option_id="maxAccountsDisplaySidebar" edit_format="textbox" data_type="positive_integer" can_backup="1">
<default_value>5</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="100"/>
</option>
<option option_id="mcAssocAddInfo" edit_format="onofftextbox" data_type="array" can_backup="1">
<default_value>a:2:{s:7:"enabled";s:1:"0";s:3:"url";s:5:"{url}";}</default_value>
<edit_format_params>onoff=enabled
value=url
type=textbox</edit_format_params>
<sub_options>enabled
url</sub_options>
<relation group_id="associationMcOpts" display_order="110"/>
</option>
<option option_id="mcAssocApiEnable" edit_format="onoff" data_type="boolean" can_backup="1">
<default_value></default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="70"/>
</option>
<option option_id="mcAssocApiToken" edit_format="textbox" data_type="string" can_backup="1">
<default_value></default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="71"/>
</option>
<option option_id="mcAssocAvatarUrl" edit_format="textbox" data_type="string" can_backup="1">
<default_value>//crafatar.com/avatars/%u?size=%s</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="1"/>
</option>
<option option_id="mcAssocInsecure" edit_format="onoff" data_type="boolean" can_backup="1">
<default_value>0</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="50"/>
</option>
<option option_id="mcAssocInstanceSecret" edit_format="textbox" data_type="string" can_backup="1" validation_class="AssociationMc_Validation_Options" validation_method="validateSecret">
<default_value>abcdef</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="1"/>
</option>
<option option_id="mcAssocSharedSecret" edit_format="textbox" data_type="string" can_backup="1">
<default_value>abcdef</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="11"/>
</option>
<option option_id="mcAssocSiteId" edit_format="textbox" data_type="string" can_backup="1">
<default_value></default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="1"/>
</option>
<option option_id="mcAssocSkinDownload" edit_format="onofftextbox" data_type="array" can_backup="1">
<default_value>a:2:{s:7:"enabled";s:1:"0";s:3:"url";s:5:"{url}";}</default_value>
<edit_format_params>onoff=enabled
value=url
type=textbox</edit_format_params>
<sub_options>enabled
url</sub_options>
<relation group_id="associationMcOpts" display_order="120"/>
</option>
<option option_id="mcAssocStyleBoxBg" edit_format="textbox" data_type="string" can_backup="1" validation_class="AssociationMc_Validation_Options" validation_method="validateColour">
<default_value>#fff</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="62"/>
</option>
<option option_id="mcAssocStyleBoxFg" edit_format="textbox" data_type="string" can_backup="1" validation_class="AssociationMc_Validation_Options" validation_method="validateColour">
<default_value>#000</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="63"/>
</option>
<option option_id="mcAssocStyleContentBg" edit_format="textbox" data_type="string" can_backup="1" validation_class="AssociationMc_Validation_Options" validation_method="validateColour">
<default_value>#fff</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="64"/>
</option>
<option option_id="mcAssocStyleContentFg" edit_format="textbox" data_type="string" can_backup="1" validation_class="AssociationMc_Validation_Options" validation_method="validateColour">
<default_value>#000</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="65"/>
</option>
<option option_id="mcAssocStyleOuterBorderBg" edit_format="textbox" data_type="string" can_backup="1" validation_class="AssociationMc_Validation_Options" validation_method="validateColour">
<default_value>#6ba65e</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="60"/>
</option>
<option option_id="mcAssocStyleOuterBorderFg" edit_format="textbox" data_type="string" can_backup="1" validation_class="AssociationMc_Validation_Options" validation_method="validateColour">
<default_value>#fff</default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="61"/>
</option>
<option option_id="mcAssocUseColourPalette" edit_format="onoff" data_type="boolean" can_backup="1">
<default_value></default_value>
<edit_format_params></edit_format_params>
<sub_options></sub_options>
<relation group_id="associationMcOpts" display_order="66"/>
</option>
</optiongroups>
<permissions>
<permission_groups>
<permission_group permission_group_id="mcAssoc"/>
</permission_groups>
<permissions>
<permission permission_group_id="mcAssoc" permission_id="mcAssocRemoveFromAny" permission_type="flag" default_value="unset" interface_group_id="mcAssocInterface" display_order="1"/>
</permissions>
<interface_groups>
<interface_group interface_group_id="mcAssocInterface" display_order="100"/>
</interface_groups>
</permissions>
<phrases>
<phrase title="mc_assoc_admin_criteria_associated" version_id="9" version_string="0.8"><![CDATA[User is associated with a Minecraft account]]></phrase>
<phrase title="mc_assoc_admin_criteria_label" version_id="15" version_string="1.1.1"><![CDATA[Minecraft Association]]></phrase>
<phrase title="mc_assoc_admin_extra_title" global_cache="1" version_id="15" version_string="1.1.1"><![CDATA[Minecraft Association Info]]></phrase>
<phrase title="mc_assoc_associated_accounts_below" version_id="17" version_string="1.1.3"><![CDATA[You appear to be associated with the accounts listed below. You can choose up to <strong>{maxDisplayable}</strong> to display next to your posts.]]></phrase>
<phrase title="mc_assoc_associate_additional" version_id="17" version_string="1.1.3"><![CDATA[If you would like to, you may associate additional Minecraft accounts in the form below.]]></phrase>
<phrase title="mc_assoc_errors_hex_colour" version_id="0" version_string="1.0"><![CDATA[Please enter a valid colour in hexadecimal notation. Examples of acceptable values: #fff, #ffffff]]></phrase>
<phrase title="mc_assoc_errors_hex_string" version_id="0" version_string="1.0"><![CDATA[Please specify a valid hexadecmial string with even length.]]></phrase>
<phrase title="mc_assoc_managing_assoc" version_id="6" version_string="0.6"><![CDATA[Managing Minecraft Association]]></phrase>
<phrase title="mc_assoc_minecraft_account" version_id="17" version_string="1.1.3"><![CDATA[Minecraft Account]]></phrase>
<phrase title="mc_assoc_minecraft_accounts" version_id="14" version_string="1.1"><![CDATA[Minecraft Accounts]]></phrase>
<phrase title="mc_assoc_not_associated" version_id="17" version_string="1.1.3"><![CDATA[You are currently not associated with a Minecraft account. To get started, fill in the form below:]]></phrase>
<phrase title="mc_assoc_visitor_link" version_id="15" version_string="1.1.1"><![CDATA[Minecraft Association]]></phrase>
<phrase title="option_group_associationMcOpts" version_id="15" version_string="1.1.1"><![CDATA[Minecraft Association Options]]></phrase>
<phrase title="option_group_associationMcOpts_description" version_id="0" version_string="1.0"><![CDATA[Manages the settings used to communicate with <a href="http://mcassoc.lukegb.com/">MCAssoc</a>.]]></phrase>
<phrase title="option_maxAccountsDisplaySidebar" version_id="14" version_string="1.1"><![CDATA[Max accounts displayable in sidebar]]></phrase>
<phrase title="option_maxAccountsDisplaySidebar_explain" version_id="14" version_string="1.1"><![CDATA[Max number of Minecraft accounts the user can elect to display in the sidebar next to their posts and private messages.]]></phrase>
<phrase title="option_mcAssocAddInfo" version_id="17" version_string="1.1.3"><![CDATA[Additional Information URL]]></phrase>
<phrase title="option_mcAssocAddInfo_explain" version_id="17" version_string="1.1.3"><![CDATA[Tick the box to enable adding an additional information URL then place the URL in the textbox.<br />%name - Minecraft Username — %uuid - Minecraft UUID]]></phrase>
<phrase title="option_mcAssocApiEnable" version_id="7" version_string="0.6.1"><![CDATA[Enable API]]></phrase>
<phrase title="option_mcAssocApiEnable_explain" version_id="7" version_string="0.6.1"><![CDATA[Whether or not you wish to enable the JSON-based AssociationMc API.]]></phrase>
<phrase title="option_mcAssocApiToken" version_id="7" version_string="0.6.1"><![CDATA[API Token]]></phrase>
<phrase title="option_mcAssocApiToken_explain" version_id="7" version_string="0.6.1"><![CDATA[If the API is enabled, this must be passed via the 'token' parameter. Do not give this out to people you do not trust - the API can expose emails, groups and other sensitive info.]]></phrase>
<phrase title="option_mcAssocAvatarUrl" version_id="9" version_string="0.8"><![CDATA[Avatar head URL]]></phrase>
<phrase title="option_mcAssocAvatarUrl_explain" version_id="9" version_string="0.8"><![CDATA[Defines the URL where avatar images will be loaded from.<br />%s - size (in px) — %u - Minecraft username<br />Use protocol-relative URLs where possible!]]></phrase>
<phrase title="option_mcAssocInsecure" version_id="0" version_string="1.0"><![CDATA[Insecure mode]]></phrase>
<phrase title="option_mcAssocInsecure_explain" version_id="0" version_string="1.0"><![CDATA[You should not use this option in a production environment.
Running in insecure mode disables all signature verification, people will be able to fake whatever MC account they want!]]></phrase>
<phrase title="option_mcAssocInstanceSecret" version_id="0" version_string="1.0"><![CDATA[Instance secret]]></phrase>
<phrase title="option_mcAssocInstanceSecret_explain" version_id="0" version_string="1.0"><![CDATA[This is private and should not be shared! Treat it like a password.]]></phrase>
<phrase title="option_mcAssocSharedSecret" version_id="0" version_string="1.0"><![CDATA[Shared secret]]></phrase>
<phrase title="option_mcAssocSharedSecret_explain" version_id="9" version_string="0.8"><![CDATA[This is shared between you and MCAssoc. You can easily generate a shared secret by supplying your domain <a href="https://mcassoc.lukegb.com">here</a>.]]></phrase>
<phrase title="option_mcAssocSiteId" version_id="0" version_string="1.0"><![CDATA[Site ID]]></phrase>
<phrase title="option_mcAssocSiteId_explain" version_id="9" version_string="0.8"><![CDATA[Publicly displayed site id. If this isn't set, you'll get a "required parameter(s) missing" error.]]></phrase>
<phrase title="option_mcAssocSkinDownload" version_id="17" version_string="1.1.3"><![CDATA[Skin Download]]></phrase>
<phrase title="option_mcAssocSkinDownload_explain" version_id="17" version_string="1.1.3"><![CDATA[Tick the box to enable adding a skin download URL on AssociationMc's member tab then place the URL in the textbox.<br />%name - Minecraft Username — %uuid - Minecraft UUID]]></phrase>
<phrase title="option_mcAssocStyleBoxBg" version_id="0" version_string="1.0"><![CDATA[Box background colour]]></phrase>
<phrase title="option_mcAssocStyleBoxBg_explain" version_id="0" version_string="1.0"><![CDATA[See <a href="https://github.com/lol768/XenForo-MCASSOC/blob/master/STYLEREF.md">this</a> page for a reference. Your value should consist of a hexadecimal colour string, e.g. #efefef]]></phrase>
<phrase title="option_mcAssocStyleBoxFg" version_id="0" version_string="1.0"><![CDATA[Box foreground colour]]></phrase>
<phrase title="option_mcAssocStyleBoxFg_explain" version_id="0" version_string="1.0"><![CDATA[See <a href="https://github.com/lol768/XenForo-MCASSOC/blob/master/STYLEREF.md">this</a> page for a reference. Your value should consist of a hexadecimal colour string, e.g. #efefef]]></phrase>
<phrase title="option_mcAssocStyleContentBg" version_id="0" version_string="1.0"><![CDATA[Content area background colour]]></phrase>
<phrase title="option_mcAssocStyleContentBg_explain" version_id="0" version_string="1.0"><![CDATA[See <a href="https://github.com/lol768/XenForo-MCASSOC/blob/master/STYLEREF.md">this</a> page for a reference. Your value should consist of a hexadecimal colour string, e.g. #efefef]]></phrase>
<phrase title="option_mcAssocStyleContentFg" version_id="0" version_string="1.0"><![CDATA[Content area foreground colour]]></phrase>
<phrase title="option_mcAssocStyleContentFg_explain" version_id="0" version_string="1.0"><![CDATA[See <a href="https://github.com/lol768/XenForo-MCASSOC/blob/master/STYLEREF.md">this</a> page for a reference. Your value should consist of a hexadecimal colour string, e.g. #efefef]]></phrase>
<phrase title="option_mcAssocStyleOuterBorderBg" version_id="0" version_string="1.0"><![CDATA[Outer border background colour]]></phrase>
<phrase title="option_mcAssocStyleOuterBorderBg_explain" version_id="0" version_string="1.0"><![CDATA[See <a href="https://github.com/lol768/XenForo-MCASSOC/blob/master/STYLEREF.md">this</a> page for a reference. Your value should consist of a hexadecimal colour string, e.g. #efefef]]></phrase>
<phrase title="option_mcAssocStyleOuterBorderFg" version_id="0" version_string="1.0"><![CDATA[Outer border foreground colour]]></phrase>
<phrase title="option_mcAssocStyleOuterBorderFg_explain" version_id="0" version_string="1.0"><![CDATA[See <a href="https://github.com/lol768/XenForo-MCASSOC/blob/master/STYLEREF.md">this</a> page for a reference. Your value should consist of a hexadecimal colour string, e.g. #efefef]]></phrase>
<phrase title="option_mcAssocUseColourPalette" version_id="14" version_string="1.1"><![CDATA[Use XenForo colour palette]]></phrase>
<phrase title="option_mcAssocUseColourPalette_explain" version_id="14" version_string="1.1"><![CDATA[Ignore the values above and make use of the style palette with the following configuration:
<div class="baseHtml">
<dl>
<dt>Outer border background colour (<code>borderBg</code>)</dt>
<dd><strong>primaryDarker</strong> from palette</dd>
<dt>Outer border foreground colour (<code>borderFg</code>)</dt>
<dd><strong>primaryLightest</strong> from palette</dd>
<dt>Box background colour (<code>boxBg</code>)</dt>
<dd><strong>primaryDark</strong> from palette</dd>
<dt>Box foreground colour (<code>boxFg</code>)</dt>
<dd><strong>primaryLighterStill</strong> from palette</dd>
<dt>Content area background colour (<code>contentBg</code>)</dt>
<dd><strong>contentBackground</strong> from palette</dd>
<dt>Content area foreground colour (<code>contentFg</code>)</dt>
<dd><strong>contentText</strong> from palette</dd>
</dl>
</div>
<p class="hint">If necessary, these can be altered easily by editing the config in library/AssociationMc/Utility/WidgetColours.php but they should work in most circumstances.</p>]]></phrase>
<phrase title="permission_group_mcAssoc" version_id="15" version_string="1.1.1"><![CDATA[Minecraft Association Permissions]]></phrase>
<phrase title="permission_interface_mcAssocInterface" version_id="15" version_string="1.1.1"><![CDATA[Minecraft Association Permissions]]></phrase>
<phrase title="permission_mcAssoc_mcAssocRemoveFromAny" version_id="9" version_string="0.8"><![CDATA[Modify association on all users]]></phrase>
</phrases>
<route_prefixes>
<route_type type="public">
<prefix original_prefix="mc-association" class="AssociationMc_Route_Prefix_View" build_link="all"/>
</route_type>
</route_prefixes>
<style_properties/>
<templates>
<template title="association_error" version_id="0" version_string="1.0"><![CDATA[<xen:title>Association error</xen:title>
<div class="section">
<div class="primaryContent">
<p>There was an error while associating your account.</p>
<p>Additional details: {xen:raw $exceptionMessage}</p>
</div>
</div>]]></template>
<template title="association_mcassoc.js" version_id="17" version_string="1.1.3"><![CDATA[/*! Written by lukegb. See https://github.com/lukegb/mcassoc.php */
var MCAssoc=function(){var e={baseurl:"https://mcassoc.lukegb.com/"};var t;e.init=function(e,n,r,i,s){t=document.getElementById("mcassoc");i=i||null;this.url=this.baseurl+"perform?";var o={siteid:e,key:n,postback:r,mcusername:i};if(s!=null){o["c:bdr:b"]=s.borderBg;o["c:bdr:t"]=s.borderFg;o["c:box:b"]=s.boxBg;o["c:box:t"]=s.boxFg;o["c:mn:b"]=s.contentBg;o["c:mn:t"]=s.contentFg}var u="";for(var a in o){if(!o.hasOwnProperty(a))continue;var f=o[a];if(f){if(u!="")u+="&";u+=encodeURIComponent(a)+"="+encodeURIComponent(f)}}this.url+=u;t.src=this.url};return e}()]]></template>
<template title="association_profile_sidebar" version_id="14" version_string="1.1"><![CDATA[<xen:require css="association_styling.css" />
<div class="section infoBlock">
<dl class="secondaryContent pairsJustified">
<xen:foreach loop="{$mcEntries}" value="$entry">
<dl>
<dt>{$entry.title}</dt>
<dd><img src="{xen:helper headimage, $entry.minecraft_uuid, 12}" class="mcAccAvatarLarger"></img> {$entry.last_username}</dd>
</dl>
</xen:foreach>
</dl>
</div>]]></template>
<template title="association_profile_tab" version_id="14" version_string="1.1"><![CDATA[<li><a href="{$requestPaths.requestUri}#minecraftAccounts">{xen:phrase mc_assoc_minecraft_accounts} ({$count})</a></li>]]></template>
<template title="association_profile_tab_content" version_id="17" version_string="1.1.3"><![CDATA[<xen:require css="xenforo_member_list_item.css" />
<xen:require css="association_styling.css" />
<li id="minecraftAccounts" class="profileContent">
<div class="section">
<xen:if is="{$mcEntries}">
<ol class="overlayScroll">
<xen:foreach loop="{$mcEntries}" value="$entry">
<li class="primaryContent memberListItem{xen:if $extended, ' extended'}">
<xen:if is="{$addInfo.enabled}">
<a href="{xen:helper additionalinfo, $addInfo.url, $entry.last_username, $entry.minecraft_uuid}" class="avatar" target="_blank"><span class="img s" style="background-image: url('{xen:helper headimage, $entry.minecraft_uuid, 48}')"></span></a>
<xen:else />
<a class="avatar"><span class="img s" style="background-image: url('{xen:helper headimage, $entry.minecraft_uuid, 48}')"></span></a>
</xen:if>
<div class="member">
<xen:if is="{$entry.minecraft_uuid}">
<h3 class="mcusername">
<xen:if is="{$addInfo.enabled}">
<a href="{xen:helper additionalinfo, $addInfo.url, $entry.last_username, $entry.minecraft_uuid}" target="_blank"><span class="style1">{$entry.last_username}</span></a>
<xen:else />
<span class="style1">{$entry.last_username}</span>
</xen:if>
</h3>
<div class="userInfo">
<div class="userBlurb dimmed"><span class="userTitle" itemprop="title"> {xen:phrase mc_assoc_minecraft_account}</span></div>
<dl class="userStats pairsInline">
<dt title="Minecraft UUID">UUID:</dt> <dd><span id="{$entry.last_username}">{$entry.minecraft_uuid}</span> (<a onclick="copyToClipboard('#{$entry.last_username}')" href="javascript:void(0);">Copy</a>) | {xen:if '{$addInfo.enabled}', '| <a target="_blank" href="{xen:helper additionalinfo, $addInfo.url, $entry.last_username, $entry.minecraft_uuid}">Additional Information</a>'} {xen:if '{$skinDownload.enabled}', '| <a target="_blank" href="{xen:helper additionalinfo, $skinDownload.url, $entry.last_username, $entry.minecraft_uuid}" download>Download Skin</a>'}</dd>
</dl>
</div>
<xen:else />
<h3 class="username guest dimmed">Could Not Identify</h3>
</xen:if>
</div>
</li>
</xen:foreach>
</ol>
<xen:else />
<div class="primaryContent">This user does not have any associated Minecraft accounts.</div>
</xen:if>
</div>
<script>
function copyToClipboard(element) {
var $temp = $("<input>");
$("body").append($temp);
$temp.val($(element).text()).select();
document.execCommand("copy");
$temp.remove();
}
</script>
<xen:if is="{$insecure}"><p>You <strong>cannot</strong> be confident that {$user.username} has access to the accounts in question - the site administrator has misconfigured the association add-on.</p></xen:if>
</li>]]></template>
<template title="association_styling.css" version_id="15" version_string="1.1.1"><![CDATA[span.mcAccHeading {
display: block;
color: #aaa;
font-size: 9px;
padding-left: 6px;
}
span.mcAccText {
display: block;
font-size: 11px;
padding-left: 6px;
margin-top: 3px;
}
img.mcAccAvatar {
width: 11px;
height: 11px;
}
img.mcAccAvatarLarger {
width: 12px;
height: 12px;
}
.memberListItem h3.mcusername
{
{xen:property memberListItemUsername}
}
.memberListItem .mcusername.guest
{
{xen:property memberListItemGuest}
}
<xen:if is="{xen:property enableResponsive}">
@media (max-width:{xen:property maxResponsiveNarrowWidth}) {
span.mcAccText {
display: inline-block;
}
span.mcAccHeading {
display: inline-block;
}
.mcAccInfoBlock {
clear: both;
}
}
</xen:if>]]></template>
<template title="association_thread_post" version_id="17" version_string="1.1.3"><![CDATA[<xen:require css="association_styling.css" />
<xen:if is="{$mcNames.{$user.user_id}}!=null">
<div class="mcAccInfoBlock">
<span class="mcAccHeading">{xen:phrase mc_assoc_minecraft_accounts}:</span>
<xen:foreach loop="{$mcNames.{$user.user_id}}" value="$entry">
<span class="mcAccText">
<xen:if is="{$addInfo.enabled}">
<a href="{xen:helper additionalinfo, $addInfo.url, $entry.last_username, $entry.minecraft_uuid}" target="_blank"><img src="{xen:helper headimage, $entry.minecraft_uuid, 11}" class="mcAccAvatar"></img> {$entry.last_username}</a>
<xen:else />
<img src="{xen:helper headimage, $entry.minecraft_uuid, 11}" class="mcAccAvatar"></img> {$entry.last_username}
</xen:if>
</span>
</xen:foreach>
</div>
</xen:if>]]></template>
<template title="association_view" version_id="17" version_string="1.1.3"><![CDATA[<xen:require css="association_view.css" />
<xen:title>Minecraft Association</xen:title>
<xen:if is="{$associated} != true">
<div class="section">
<div class="primaryContent">
<p>{xen:phrase mc_assoc_not_associated}</p>
</div>
</div>
<xen:else />
<div class="section">
<div class="baseHtml">
<p>{xen:phrase mc_assoc_associated_accounts_below, 'maxDisplayable={$maxDisplayable}'}</p>
<noscript>You need JS to choose which accounts should show up</noscript>
<xen:if is="{$entries}">
<xen:foreach loop="$entries" value="$model">
<form action="{xen:link 'full:mc-association/delete'}" method="POST">
<p><img src="{xen:helper headimage, {$model.minecraft_uuid}, 12}"> <strong>{$model.last_username}</strong>
<input type="hidden" value="{$model.minecraft_uuid}" name="uuid">
<input class="button" type="submit" value="Remove Association" style="display:inline-block;">
<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" /></p>
</form>
<label><input type="checkbox" data-id="{$model.association_id}" class="visibilityToggle" <xen:if is="{$model.display_by_posts}">checked</xen:if>> Display Next to Posts</label>
</xen:foreach></xen:if>
<p>{xen:phrase mc_assoc_associate_additional}
</div>
</div>
</xen:if>
<div style="display: flex; align-items: center; justify-content: center;"><iframe id="mcassoc" width="600" height="400" frameBorder="0" seamless scrolling="no" style="margin-top: 20px;"></iframe></div>
<script type="application/javascript">
<xen:include template="association_mcassoc.js" />
MCAssoc.init("{xen:raw $siteId}", "{xen:raw $key}", "{xen:raw $retLink}", {xen:raw $safeUsername}, {xen:raw $colours});
jQuery("input.visibilityToggle").change(function() {
var currentNumber = jQuery(".baseHtml input[type=checkbox]:checked").length;
if (currentNumber > {$maxDisplayable} && $(this).prop("checked")) {
$(this).prop("checked", false);
return;
}
var data = {
"_xfToken": jQuery("input[name=_xfToken]").val(), "association_id": $(this).data("id"), "display_by_posts": $(this).prop("checked")
};
jQuery.post("{xen:link 'full:mc-association/visibility.json'}", data);
});
</script>
<xen:sidebar>
<div class="section">
<div class="secondaryContent">
<h3>Associated Accounts</h3>
<xen:foreach loop="$entries" value="$model">
<p><img src="{xen:helper headimage, {$model.minecraft_uuid}, 12}"> <strong>{$model.last_username}</strong>
</xen:foreach>
</div>
</div>
<div class="section">
<div class="secondaryContent">
<h3>Find Associations</h3>
<form action="{xen:link mc-association/search}" method="post" class="secondaryContent">
<input type="search" name="username" id="username" placeholder="{xen:phrase name}..." class="textCtrl" data-autoSubmit="true" />
<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
</form>
</div>
</div>
</xen:sidebar>]]></template>
<template title="association_visitor_left" version_id="9" version_string="0.8"><![CDATA[<li><a href="{xen:link mc-association/view}">{xen:phrase mc_assoc_visitor_link}</a></li>]]></template>
<template title="association_visitor_right" version_id="17" version_string="1.1.3"><![CDATA[<xen:comment>
If you prefer to have the AssociationMc navigation link appear to the right instead or with of the left, move the contents of
the template "association_visitor_left" here and remove or replace the contents of "association_visitor_left" after doing so.
</xen:comment>]]></template>
</templates>
<public_template_modifications>
<modification template="message_user_info" modification_key="add_mc_names_to_thread" description="Adds mcNames variable to template hook for thread" execution_order="10" enabled="1" action="str_replace">
<find><![CDATA[<xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">]]></find>
<replace><![CDATA[<xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'mcNames={$mcNames}', 'isQuickReply={$isQuickReply}'}">]]></replace>
</modification>
</public_template_modifications>
<bb_code_media_sites/>
<bb_codes/>
</addon>