mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
fontawesome 4 migration, closes #473
This commit is contained in:
@@ -82,10 +82,10 @@ define(['forum/accountheader'], function(header) {
|
||||
|
||||
if (data.online) {
|
||||
onlineStatus.find('span span').text('online');
|
||||
onlineStatus.find('i').attr('class', 'icon-circle');
|
||||
onlineStatus.find('i').attr('class', 'fa fa-circle');
|
||||
} else {
|
||||
onlineStatus.find('span span').text('offline');
|
||||
onlineStatus.find('i').attr('class', 'icon-circle-blank');
|
||||
onlineStatus.find('i').attr('class', 'fa fa-circle-o');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -50,14 +50,14 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
|
||||
});
|
||||
|
||||
$('#gravatar-box').on('click', function() {
|
||||
$('#gravatar-box .icon-ok').show();
|
||||
$('#uploaded-box .icon-ok').hide();
|
||||
$('#gravatar-box .fa-check').show();
|
||||
$('#uploaded-box .fa-check').hide();
|
||||
selectedImageType = 'gravatar';
|
||||
});
|
||||
|
||||
$('#uploaded-box').on('click', function() {
|
||||
$('#gravatar-box .icon-ok').hide();
|
||||
$('#uploaded-box .icon-ok').show();
|
||||
$('#gravatar-box .fa-check').hide();
|
||||
$('#uploaded-box .fa-check').show();
|
||||
selectedImageType = 'uploaded';
|
||||
});
|
||||
|
||||
@@ -211,14 +211,14 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
|
||||
|
||||
|
||||
if (currentPicture == gravatarPicture)
|
||||
$('#gravatar-box .icon-ok').show();
|
||||
$('#gravatar-box .fa-check').show();
|
||||
else
|
||||
$('#gravatar-box .icon-ok').hide();
|
||||
$('#gravatar-box .fa-check').hide();
|
||||
|
||||
if (currentPicture == uploadedPicture)
|
||||
$('#uploaded-box .icon-ok').show();
|
||||
$('#uploaded-box .fa-check').show();
|
||||
else
|
||||
$('#uploaded-box .icon-ok').hide();
|
||||
$('#uploaded-box .fa-check').hide();
|
||||
}
|
||||
|
||||
return AccountEdit;
|
||||
|
||||
@@ -18,7 +18,7 @@ define(function() {
|
||||
}
|
||||
|
||||
function select_icon(el) {
|
||||
var selected = el.attr('class').replace(' icon-2x', '');
|
||||
var selected = el.attr('class').replace(' fa-2x', '');
|
||||
jQuery('#icons .selected').removeClass('selected');
|
||||
if (selected)
|
||||
jQuery('#icons .' + selected).parent().addClass('selected');
|
||||
@@ -27,9 +27,13 @@ define(function() {
|
||||
bootbox.confirm('<h2>Select an icon.</h2>' + document.getElementById('icons').innerHTML, function(confirm) {
|
||||
if (confirm) {
|
||||
var iconClass = jQuery('.bootbox .selected').children(':first').attr('class');
|
||||
el.attr('class', iconClass + ' icon-2x');
|
||||
el.val(iconClass);
|
||||
el.attr('value', iconClass);
|
||||
|
||||
el.attr('class', iconClass + ' fa-2x');
|
||||
|
||||
// remove the 'fa ' from the class name, just need the icon name itself
|
||||
var categoryIconClass = iconClass.replace('fa ', '');
|
||||
el.val(categoryIconClass);
|
||||
el.attr('value', categoryIconClass);
|
||||
|
||||
modified(el);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ define(function() {
|
||||
|
||||
socket.on('api:admin.plugins.toggle', function(status) {
|
||||
pluginTgl = document.querySelector('.plugins li[data-plugin-id="' + status.id + '"] button');
|
||||
pluginTgl.innerHTML = '<i class="icon-off"></i> ' + (status.active ? 'Dea' : 'A') + 'ctivate';
|
||||
pluginTgl.innerHTML = '<i class="fa fa-power-off"></i> ' + (status.active ? 'Dea' : 'A') + 'ctivate';
|
||||
|
||||
app.alert({
|
||||
alert_id: 'plugin_toggled_' + status.id,
|
||||
|
||||
@@ -46,11 +46,11 @@ define(function() {
|
||||
|
||||
if(!topics.length) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var lastTid = parseInt(topics[topics.length - 1].getAttribute('data-tid'));
|
||||
|
||||
this.innerHTML = '<i class="icon-refresh icon-spin"></i> Retrieving topics';
|
||||
this.innerHTML = '<i class="fa fa-refresh fa-spin"></i> Retrieving topics';
|
||||
socket.emit('api:admin.topics.getMore', {
|
||||
limit: 10,
|
||||
after: lastTid
|
||||
|
||||
@@ -91,7 +91,7 @@ define(function() {
|
||||
timeoutId = setTimeout(function() {
|
||||
var username = $('#search-user').val();
|
||||
|
||||
jQuery('.icon-spinner').removeClass('none');
|
||||
jQuery('.fa-spinner').removeClass('none');
|
||||
socket.emit('api:admin.user.search', username);
|
||||
|
||||
}, 250);
|
||||
@@ -108,7 +108,7 @@ define(function() {
|
||||
userListEl = document.querySelector('.users');
|
||||
|
||||
userListEl.innerHTML = html;
|
||||
jQuery('.icon-spinner').addClass('none');
|
||||
jQuery('.fa-spinner').addClass('none');
|
||||
|
||||
if (data && data.length === 0) {
|
||||
$('#user-notfound-notify').html('User not found!')
|
||||
|
||||
@@ -94,7 +94,7 @@ define(function () {
|
||||
|
||||
if (numTopics > 0) {
|
||||
for (var x = 0; x < numTopics; x++) {
|
||||
if ($(topics[x]).find('.icon-pushpin').length) {
|
||||
if ($(topics[x]).find('.fa-thumb-tack').length) {
|
||||
if(x === numTopics - 1) {
|
||||
topic.insertAfter(topics[x]);
|
||||
}
|
||||
|
||||
@@ -105,11 +105,14 @@
|
||||
|
||||
notifList.appendChild(notifFrag);
|
||||
|
||||
if (data.unread.length > 0) notifIcon.className = 'icon-circle active';
|
||||
else notifIcon.className = 'icon-circle-blank';
|
||||
if (data.unread.length > 0) {
|
||||
notifIcon.className = 'fa-circle active';
|
||||
} else {
|
||||
notifIcon.className = 'fa-circle-o';
|
||||
}
|
||||
|
||||
socket.emit('api:notifications.mark_all_read', null, function() {
|
||||
notifIcon.className = 'icon-circle-blank';
|
||||
notifIcon.className = 'fa-circle-o';
|
||||
utils.refreshTitle();
|
||||
});
|
||||
});
|
||||
@@ -136,7 +139,7 @@
|
||||
});
|
||||
|
||||
socket.on('event:new_notification', function() {
|
||||
document.querySelector('.notifications a i').className = 'icon-circle active';
|
||||
document.querySelector('.notifications a i').className = 'fa-circle active';
|
||||
app.alert({
|
||||
alert_id: 'new_notif',
|
||||
title: 'New notification',
|
||||
|
||||
@@ -12,7 +12,7 @@ define(function() {
|
||||
password_notify = $('#password-notify'),
|
||||
password_confirm_notify = $('#password-confirm-notify'),
|
||||
validationError = false,
|
||||
successIcon = '<i class="icon icon-ok"></i>';
|
||||
successIcon = '<i class="fa fa-check"></i>';
|
||||
|
||||
$('#referrer').val(app.previousUrl);
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ define(function() {
|
||||
commitEl.disabled = true;
|
||||
$(cancelEl).fadeOut(250);
|
||||
$(moveThreadModal).find('.modal-header button').fadeOut(250);
|
||||
commitEl.innerHTML = 'Moving <i class="icon-spin icon-refresh"></i>';
|
||||
commitEl.innerHTML = 'Moving <i class="fa-spin fa-refresh"></i>';
|
||||
|
||||
socket.once('api:topic.move', function(data) {
|
||||
moveThreadModal.modal('hide');
|
||||
@@ -310,7 +310,7 @@ define(function() {
|
||||
var uid = $(this).parents('li').attr('data-uid');
|
||||
|
||||
var element = $(this).find('i');
|
||||
if (element.attr('class') == 'icon-star-empty') {
|
||||
if ($(element).hasClass('fa-star-o')) {
|
||||
socket.emit('api:posts.favourite', {
|
||||
pid: pid,
|
||||
room_id: app.currentRoom
|
||||
@@ -446,7 +446,7 @@ define(function() {
|
||||
activeEl.find('.anonymous-box').remove();
|
||||
if(anonymousCount || remainingUsers) {
|
||||
|
||||
var anonLink = $('<div class="anonymous-box inline-block"><i class="icon-user"></i></div>');
|
||||
var anonLink = $('<div class="anonymous-box inline-block"><i class="fa fa-user"></i></div>');
|
||||
activeEl.append(anonLink);
|
||||
|
||||
var title = '';
|
||||
@@ -541,7 +541,7 @@ define(function() {
|
||||
if (data.status === 'ok' && data.pid) {
|
||||
var favEl = document.querySelector('.post_rep_' + data.pid).nextSibling;
|
||||
if (favEl) {
|
||||
favEl.className = 'icon-star';
|
||||
favEl.className = 'fa fa-star';
|
||||
$(favEl).parent().addClass('btn-warning');
|
||||
}
|
||||
}
|
||||
@@ -551,7 +551,7 @@ define(function() {
|
||||
if (data.status === 'ok' && data.pid) {
|
||||
var favEl = document.querySelector('.post_rep_' + data.pid).nextSibling;
|
||||
if (favEl) {
|
||||
favEl.className = 'icon-star-empty';
|
||||
favEl.className = 'fa fa-star-o';
|
||||
$(favEl).parent().removeClass('btn-warning');
|
||||
}
|
||||
}
|
||||
@@ -598,11 +598,11 @@ define(function() {
|
||||
x;
|
||||
|
||||
if (locked === true) {
|
||||
lockThreadEl.html('<i class="icon-unlock"></i> Unlock Thread');
|
||||
lockThreadEl.html('<i class="fa fa-unlock"></i> Unlock Thread');
|
||||
threadReplyBtn.attr('disabled', true);
|
||||
threadReplyBtn.html('Locked <i class="icon-lock"></i>');
|
||||
threadReplyBtn.html('Locked <i class="fa fa-lock"></i>');
|
||||
for (x = 0; x < numPosts; x++) {
|
||||
postReplyBtns[x].innerHTML = 'Locked <i class="icon-lock"></i>';
|
||||
postReplyBtns[x].innerHTML = 'Locked <i class="fa fa-lock"></i>';
|
||||
quoteBtns[x].style.display = 'none';
|
||||
editBtns[x].style.display = 'none';
|
||||
deleteBtns[x].style.display = 'none';
|
||||
@@ -620,11 +620,11 @@ define(function() {
|
||||
|
||||
thread_state.locked = '1';
|
||||
} else {
|
||||
lockThreadEl.html('<i class="icon-lock"></i> Lock Thread');
|
||||
lockThreadEl.html('<i class="fa fa-lock"></i> Lock Thread');
|
||||
threadReplyBtn.attr('disabled', false);
|
||||
threadReplyBtn.html('Reply');
|
||||
for (x = 0; x < numPosts; x++) {
|
||||
postReplyBtns[x].innerHTML = 'Reply <i class="icon-reply"></i>';
|
||||
postReplyBtns[x].innerHTML = 'Reply <i class="fa fa-reply"></i>';
|
||||
quoteBtns[x].style.display = 'inline-block';
|
||||
editBtns[x].style.display = 'inline-block';
|
||||
deleteBtns[x].style.display = 'inline-block';
|
||||
@@ -652,7 +652,7 @@ define(function() {
|
||||
deleteNotice = document.getElementById('thread-deleted') || document.createElement('div');
|
||||
|
||||
if (deleted) {
|
||||
deleteTextEl.html('<i class="icon-comment"></i> Restore Thread');
|
||||
deleteTextEl.html('<i class="fa fa-comment"></i> Restore Thread');
|
||||
threadEl.addClass('deleted');
|
||||
|
||||
// Spawn a 'deleted' notice at the top of the page
|
||||
@@ -663,7 +663,7 @@ define(function() {
|
||||
|
||||
thread_state.deleted = '1';
|
||||
} else {
|
||||
deleteTextEl.html('<i class="icon-trash"></i> Delete Thread');
|
||||
deleteTextEl.html('<i class="fa fa-trash-o"></i> Delete Thread');
|
||||
threadEl.removeClass('deleted');
|
||||
deleteNotice.parentNode.removeChild(deleteNotice);
|
||||
|
||||
@@ -675,7 +675,7 @@ define(function() {
|
||||
var pinEl = $('.pin_thread');
|
||||
|
||||
if (pinned) {
|
||||
pinEl.html('<i class="icon-pushpin"></i> Unpin Thread');
|
||||
pinEl.html('<i class="fa fa-thumb-tack"></i> Unpin Thread');
|
||||
if (alert) {
|
||||
app.alert({
|
||||
'alert_id': 'thread_pin',
|
||||
@@ -688,7 +688,7 @@ define(function() {
|
||||
|
||||
thread_state.pinned = '1';
|
||||
} else {
|
||||
pinEl.html('<i class="icon-pushpin"></i> Pin Thread');
|
||||
pinEl.html('<i class="fa fa-thumb-tack"></i> Pin Thread');
|
||||
if (alert) {
|
||||
app.alert({
|
||||
'alert_id': 'thread_pin',
|
||||
@@ -896,7 +896,7 @@ define(function() {
|
||||
if(!data.posts.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var insertAfter = findInsertionPoint();
|
||||
|
||||
var html = templates.prepare(templates['topic'].blocks['posts']).parse(data);
|
||||
|
||||
@@ -36,7 +36,7 @@ define(function() {
|
||||
var username = $('#search-user').val();
|
||||
|
||||
if (username == '') {
|
||||
jQuery('#user-notfound-notify').html('<i class="icon icon-circle-blank"></i>');
|
||||
jQuery('#user-notfound-notify').html('<i class="fa fa-circle-o"></i>');
|
||||
jQuery('#user-notfound-notify').parent().removeClass('btn-warning label-warning btn-success label-success');
|
||||
return;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ define(function() {
|
||||
if (lastSearch === username) return;
|
||||
lastSearch = username;
|
||||
|
||||
jQuery('#user-notfound-notify').html('<i class="icon-spinner icon-spin"></i>');
|
||||
jQuery('#user-notfound-notify').html('<i class="fa fa-spinner fa-spin"></i>');
|
||||
|
||||
setTimeout(function() {
|
||||
socket.emit('api:admin.user.search', username);
|
||||
|
||||
Reference in New Issue
Block a user