formatting - template js admin side

v1.18.x
psychobunny 12 years ago
parent 221b9bc149
commit c44461e33f

@ -1,4 +1,3 @@
var modified_categories = {};
function modified(el) {
@ -73,7 +72,9 @@ jQuery('.blockclass').each(function() {
timeout: 2000
});
var html = templates.prepare(templates['admin/categories'].blocks['categories']).parse({categories:[data]});
var html = templates.prepare(templates['admin/categories'].blocks['categories']).parse({
categories: [data]
});
$('#entry-container').append(html);
$('#new-category-modal').modal('hide');

@ -1,6 +1,3 @@
var nodebb_admin = (function(nodebb_admin) {
nodebb_admin.config = undefined;
@ -63,7 +60,10 @@ var nodebb_admin = (function(nodebb_admin) {
value = fields[x].value;
}
socket.emit('api:config.set', { key: key, value: value });
socket.emit('api:config.set', {
key: key,
value: value
});
}
});
}
@ -119,4 +119,3 @@ var nodebb_admin = (function(nodebb_admin) {
return nodebb_admin;
}(nodebb_admin || {}));

@ -1,5 +1,3 @@
var nodebb_admin = (function(nodebb_admin) {
var themes = {};
@ -58,10 +56,12 @@ var nodebb_admin = (function(nodebb_admin) {
cssSrc = parentEl.attr('data-css'),
cssName = parentEl.attr('data-theme');
socket.emit('api:config.set', {
key: 'theme:id', value: 'bootswatch:' + cssName
key: 'theme:id',
value: 'bootswatch:' + cssName
});
socket.emit('api:config.set', {
key: 'theme:src', value: cssSrc
key: 'theme:src',
value: cssSrc
});
break;
}

@ -9,16 +9,28 @@ $(document).ready(function() {
switch (action) {
case 'pin':
if (!$this.hasClass('active')) socket.emit('api:topic.pin', { tid: tid });
else socket.emit('api:topic.unpin', { tid: tid });
if (!$this.hasClass('active')) socket.emit('api:topic.pin', {
tid: tid
});
else socket.emit('api:topic.unpin', {
tid: tid
});
break;
case 'lock':
if (!$this.hasClass('active')) socket.emit('api:topic.lock', { tid: tid });
else socket.emit('api:topic.unlock', { tid: tid });
if (!$this.hasClass('active')) socket.emit('api:topic.lock', {
tid: tid
});
else socket.emit('api:topic.unlock', {
tid: tid
});
break;
case 'delete':
if (!$this.hasClass('active')) socket.emit('api:topic.delete', { tid: tid });
else socket.emit('api:topic.restore', { tid: tid });
if (!$this.hasClass('active')) socket.emit('api:topic.delete', {
tid: tid
});
else socket.emit('api:topic.restore', {
tid: tid
});
break;
}
});

@ -1,4 +1,3 @@
(function() {
var yourid = templates.get('yourid');
@ -179,8 +178,7 @@
.show()
.addClass('label-danger')
.removeClass('label-success');
}
else {
} else {
$('#user-notfound-notify').html(data.length + ' user' + (data.length > 1 ? 's' : '') + ' found!')
.show()
.addClass('label-success')
@ -191,7 +189,9 @@
});
function onUsersLoaded(users) {
var html = templates.prepare(templates['admin/users'].blocks['users']).parse({ users: users });
var html = templates.prepare(templates['admin/users'].blocks['users']).parse({
users: users
});
$('#users-container').append(html);
updateUserButtons();
}

Loading…
Cancel
Save