Skip to content

Commit 06e4c4a

Browse files
authored
Merge pull request #11 from ticktackk/develop
1.0.3
2 parents c75755b + 82391ba commit 06e4c4a

File tree

10 files changed

+57
-29
lines changed

10 files changed

+57
-29
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
==========================
33

4+
## 1.0.3 (`1000370`)
5+
6+
- **Fix:** Incompatibility with XenForo 2.3 (#9)
7+
- **Fix:** Extended `avatar.js` is loaded even without permission to upload avatar from URL (#10)
8+
49
## 1.0.2 (`1000270`)
510

611
- **Change:** Minor code improvement and clean up (#7)

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 TickTackk
3+
Copyright (c) 2020-2024 TickTackk
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Requirements
1414
Permissions
1515
-----------
1616

17-
| Group | Permission |
18-
| ------------------- | ------------------------- |
19-
| General permissions | Upload an avatar from URL |
17+
#### General permissions
18+
19+
- Upload an avatar from URL
2020

2121
License
2222
-------

_dev/resource_description.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>Upload Avatar From URL for XenForo 2.1.10.2+</h1><h2>Description</h2><p>This add-on allows users with permission to upload avatar from URL.</p><h2>Requirements</h2><ul><li>PHP 7.3+</li></ul><h2>Permissions</h2><h4>General permissions</h4><ul><li>Upload an avatar from URL</li></ul><h2>License</h2>
2+
This project is licensed under the MIT License - see the <a href="https://github.com/ticktackk/UploadAvatarFromUrlForXF2/blob/master/LICENSE.md">LICENSE.md</a> file for details.

_dev/resource_description.txt

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
1-
[SIZE=6][B]Upload Avatar From URL for XenForo 2.1.10.2+[/B][/SIZE]
2-
3-
[SIZE=5][B]Description[/B][/SIZE]
1+
[HEADING=1]Upload Avatar From URL for XenForo 2.1.10.2+[/HEADING]
2+
[HEADING=1]Description[/HEADING]
43
This add-on allows users with permission to upload avatar from URL.
5-
6-
[SIZE=5][B]Requirements[/B][/SIZE]
4+
[HEADING=1]Requirements[/HEADING]
75
[LIST]
86
[*]PHP 7.3+
97
[/LIST]
10-
11-
[SIZE=5][B]Permissions[/B][/SIZE]
12-
[TABLE]
13-
[TR]
14-
[TH]Group[/TH]
15-
[TH]Permission[/TH]
16-
[/TR]
17-
[TR]
18-
[TD]General permissions[/TD]
19-
[TD]Upload an avatar from URL[/TD]
20-
[/TR]
21-
[/TABLE]
22-
23-
[SIZE=5][B]License[/B][/SIZE]
8+
[HEADING=1]Permissions[/HEADING]
9+
[HEADING=3]General permissions[/HEADING]
10+
[LIST]
11+
[*]Upload an avatar from URL
12+
[/LIST]
13+
[HEADING=1]License[/HEADING]
2414
This project is licensed under the MIT License - see the [URL='https://github.com/ticktackk/UploadAvatarFromUrlForXF2/blob/master/LICENSE.md']LICENSE.md[/URL] file for details.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
var TickTackk = window.TickTackk || {};
2+
TickTackk.UploadAvatarFromUrl = TickTackk.UploadAvatarFromUrl || {};
3+
4+
;((window, document) =>
5+
{
6+
'use strict'
7+
8+
XF.AvatarUpload = XF.extend(XF.AvatarUpload, {
9+
__backup: {
10+
'ajaxResponse': 'tckUploadAvatarFromUrl__ajaxResponse'
11+
},
12+
13+
ajaxResponse: function(e, data)
14+
{
15+
this.tckUploadAvatarFromUrl__ajaxResponse(e, data);
16+
17+
const form = this.target
18+
const customType = form.querySelector('.js-tckUploadAvatarFromUrl_customType:checked')
19+
const urlField = form.querySelector('.js-tckUploadAvatarFromUrl_urlField')
20+
const useCustom = (form.querySelector('input[name="use_custom"]:checked').value == 1)
21+
22+
if ((customType !== undefined) && (customType.value === 'url') && (urlField !== undefined) && useCustom)
23+
{
24+
urlField.value = '';
25+
}
26+
}
27+
})
28+
})(window, document)

_output/extension_hint.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
/** @noinspection PhpIllegalPsrClassPathInspection */
34
// ################## THIS IS A GENERATED FILE ##################
45
// DO NOT EDIT DIRECTLY. EDIT THE CLASS EXTENSIONS IN THE CONTROL PANEL.
56

_output/template_modifications/public/tckUploadAvatarFromUrl_account_avatar_a.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"execution_order": 10,
55
"enabled": true,
66
"action": "preg_replace",
7-
"find": "#<xf:js prod=\"xf\\/avatar-compiled\\.js\".*?\\/>#si",
8-
"replace": "$0\n<xf:js src=\"ticktackk/upload_avatar_from_url/xf/avatar.js\" min=\"1\" addon=\"TickTackk/UploadAvatarFromUrl\" />"
7+
"find": "{^<xf:js (?:src|prod)=\"xf\\/avatar(?:-compiled)?\\.js\".*?\\/>$}m",
8+
"replace": "$0\n\n<xf:if is=\"$xf.visitor.canUploadAvatarFromUrl()\">\n\t<xf:if is=\"$xf.versionId >= 2030000\">\n\t\t<xf:js src=\"ticktackk/upload_avatar_from_url/xf/avatar.23x.js\" min=\"1\" addon=\"TickTackk/UploadAvatarFromUrl\" />\n\t<xf:else />\n\t\t<xf:js src=\"ticktackk/upload_avatar_from_url/xf/avatar.js\" min=\"1\" addon=\"TickTackk/UploadAvatarFromUrl\" />\n\t</xf:if>\n</xf:if>"
99
}

addon.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"legacy_addon_id": "",
33
"title": "Upload Avatar From URL",
44
"description": "This add-on allows users with permission to upload avatar from URL.",
5-
"version_id": 1000270,
6-
"version_string": "1.0.2",
5+
"version_id": 1000370,
6+
"version_string": "1.0.3",
77
"dev": "TickTackk",
88
"dev_url": "https://xenforo.com/community/members/ticktackk.90375/",
99
"faq_url": "",

build.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"additional_files": [
3-
"js/ticktackk/upload_avatar_from_url/xf/avatar.js"
3+
"js/ticktackk/upload_avatar_from_url/xf/avatar.js",
4+
"js/ticktackk/upload_avatar_from_url/xf/avatar.23x.js"
45
],
56
"minify": [
6-
"js/ticktackk/upload_avatar_from_url/xf/avatar.js"
7+
"js/ticktackk/upload_avatar_from_url/xf/avatar.js",
8+
"js/ticktackk/upload_avatar_from_url/xf/avatar.23x.js"
79
],
810
"exec": [
911
"composer install --working-dir=_build/upload/src/addons/{addon_id}/ --no-dev --optimize-autoloader"

0 commit comments

Comments
 (0)