mirror of https://github.com/calzoneman/sync.git
Add a special notice
This commit is contained in:
parent
1f7a53a90b
commit
e3ef9e7896
13
channel.js
13
channel.js
|
@ -508,6 +508,12 @@ Channel.prototype.tryNameBan = function(actor, name) {
|
|||
}
|
||||
|
||||
name = name.toLowerCase();
|
||||
if(name == actor.name.toLowerCase()) {
|
||||
actor.socket.emit("costanza", {
|
||||
msg: "Trying to ban yourself?"
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
self.getRank(name, function (err, rank) {
|
||||
if(err) {
|
||||
|
@ -570,6 +576,13 @@ Channel.prototype.tryIPBan = function(actor, name, range) {
|
|||
if(typeof name != "string") {
|
||||
return;
|
||||
}
|
||||
name = name.toLowerCase();
|
||||
if(name == actor.name.toLowerCase()) {
|
||||
actor.socket.emit("costanza", {
|
||||
msg: "Trying to ban yourself?"
|
||||
});
|
||||
return;
|
||||
}
|
||||
self.server.db.listIPsForName(name, function (err, ips) {
|
||||
if(err) {
|
||||
actor.socket.emit("errorMsg", {
|
||||
|
|
|
@ -74,6 +74,33 @@ Callbacks = {
|
|||
alert(data.msg);
|
||||
},
|
||||
|
||||
costanza: function (data) {
|
||||
hidePlayer();
|
||||
$("#costanza-modal").modal("hide");
|
||||
var modal = $("<div/>").addClass("modal hide fade")
|
||||
.attr("id", "costanza-modal")
|
||||
.appendTo($("body"));
|
||||
|
||||
|
||||
var body = $("<div/>").addClass("modal-body").appendTo(modal);
|
||||
$("<button/>").addClass("close")
|
||||
.attr("data-dismiss", "modal")
|
||||
.attr("data-hidden", "true")
|
||||
.html("×")
|
||||
.appendTo(body);
|
||||
$("<img/>").attr("src", "http://i0.kym-cdn.com/entries/icons/original/000/005/498/1300044776986.jpg")
|
||||
.appendTo(body);
|
||||
|
||||
$("<strong/>").text(data.msg).appendTo(body);
|
||||
|
||||
modal.on("hidden", function () {
|
||||
modal.remove();
|
||||
unhidePlayer();
|
||||
});
|
||||
|
||||
modal.modal();
|
||||
},
|
||||
|
||||
announcement: function(data) {
|
||||
$("#announcements").html("");
|
||||
makeAlert(data.title, data.text)
|
||||
|
|
Loading…
Reference in New Issue