feat(users): govern profiles and access
Normalize fixed profile fields, profile actions, and the five-column capability matrix for comments, uploads, and downloads.
This commit is contained in:
@@ -194,40 +194,6 @@
|
||||
var form = document.getElementById('profile-form');
|
||||
if (!form) return;
|
||||
|
||||
var iconOptions = '<option value="">—</option>'
|
||||
+ '<option value="github">GitHub</option>'
|
||||
+ '<option value="google">Google</option>'
|
||||
+ '<option value="x">X</option>'
|
||||
+ '<option value="email">邮箱</option>'
|
||||
+ '<option value="wechat">微信</option>'
|
||||
+ '<option value="qq">QQ</option>'
|
||||
+ '<option value="weibo">微博</option>'
|
||||
+ '<option value="telegram">Telegram</option>'
|
||||
+ '<option value="discord">Discord</option>'
|
||||
+ '<option value="bilibili">Bilibili</option>'
|
||||
+ '<option value="linkedin">LinkedIn</option>'
|
||||
+ '<option value="facebook">Facebook</option>'
|
||||
+ '<option value="youtube">YouTube</option>'
|
||||
+ '<option value="instagram">Instagram</option>'
|
||||
+ '<option value="web">网站</option>';
|
||||
|
||||
var addBtn = document.getElementById('add-contact-btn');
|
||||
if (addBtn) {
|
||||
addBtn.addEventListener('click', function() {
|
||||
var list = document.getElementById('contacts-list');
|
||||
var idx = list.children.length;
|
||||
var div = document.createElement('div');
|
||||
div.className = 'contact-row';
|
||||
div.dataset.index = idx;
|
||||
div.innerHTML =
|
||||
'<select name="contacts[' + idx + '][icon]" class="profile-input contact-icon">' + iconOptions + '</select>' +
|
||||
'<input type="hidden" name="contacts[' + idx + '][name]" value="">' +
|
||||
'<input type="url" name="contacts[' + idx + '][url]" class="profile-input contact-url" placeholder="' + (i18n.contactUrlPlaceholder || '链接 URL') + '">' +
|
||||
'<button type="button" class="contact-remove" onclick="this.parentElement.remove()" title="' + (i18n.deleteLabel || '删除') + '">×</button>';
|
||||
list.appendChild(div);
|
||||
});
|
||||
}
|
||||
|
||||
form.addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
var btn = document.getElementById('profile-save-btn');
|
||||
|
||||
Reference in New Issue
Block a user