tweaks to composer pushing, fixed random extra letter in footer js

v1.18.x
Julian Lam 12 years ago
parent 9ca749d62f
commit 49ea40f6ee

@ -109,8 +109,6 @@ var socket,
// timeout default = permanent
// location : alert_window (default) or content
app.alert = function(params) {
var alert_id = 'alert_button_' + ((params.alert_id) ? params.alert_id : new Date().getTime());
var alert = $('#'+alert_id);
@ -121,7 +119,6 @@ var socket,
alert.attr('class', "alert toaster-alert " + ((params.type=='warning') ? '' : "alert-" + params.type));
}
else {
var div = document.createElement('div'),
button = document.createElement('button'),
strong = document.createElement('strong'),

@ -13,7 +13,7 @@
socket.emit('user.latest', {});
socket.on('user.latest', function(data) {
if (data.username == '') {
latest_user.innerHTML = '';y
latest_user.innerHTML = '';
} else {
latest_user.innerHTML = "The most recent user to register is <b><a href='/users/"+data.username+"'>" + data.username + "</a></b>.";
}

@ -41,6 +41,7 @@ define(function() {
document.body.insertBefore(composer.postContainer, composer.btnContainer);
socket.on('api:composer.push', function(threadData) {
if (!threadData.error) {
var uuid = utils.generateUUID(),
btnEl = document.createElement('li');
btnEl.innerHTML = '<a href="#"><img src="/graph/users/' + threadData.username + '/picture" /><span>' + (!threadData.cid ? (threadData.title || '') : 'New Topic') + '</span></a>';
@ -56,6 +57,18 @@ define(function() {
composer.active++;
composer.update();
composer.load(uuid);
} else {
app.alert({
type: 'error',
timeout: 5000,
alert_id: 'post_error',
title: 'Please Log In to Post',
message: 'Posting is currently restricted to registered members only, click here to log in',
clickfn: function() {
ajaxify.go('login');
}
});
}
});
socket.on('api:composer.editCheck', function(editCheck) {

@ -308,6 +308,7 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
});
socket.on('api:composer.push', function(data) {
if (uid > 0) {
if (parseInt(data.tid) > 0) {
topics.get_topic(data.tid, uid, function(topicData) {
topicData.tid = data.tid;
@ -342,6 +343,11 @@ var SocketIO = require('socket.io').listen(global.server, { log:false }),
});
});
}
} else {
socket.emit('api:composer.push', {
error: 'no-uid'
});
}
});
socket.on('api:composer.editCheck', function(pid) {

Loading…
Cancel
Save