WHY IS GIT DIFF BLANK
This commit is contained in:
parent
e6c4d5ab61
commit
0ff993b5ae
@ -90,7 +90,7 @@ Client.prototype.connect = function() {
|
||||
clearInterval(self.pingInterval);
|
||||
clearInterval(self.noteFlushInterval);
|
||||
|
||||
self.emit("disconnect");
|
||||
self.emit("disconnect", evt);
|
||||
self.emit("status", "Offline mode");
|
||||
|
||||
// reconnect!
|
||||
@ -106,8 +106,8 @@ Client.prototype.connect = function() {
|
||||
var ms = ms_lut[idx];
|
||||
setTimeout(self.connect.bind(self), ms);
|
||||
});
|
||||
this.ws.addEventListener("error", function() {
|
||||
console.trace(arguments);
|
||||
this.ws.addEventListener("error", function(err) {
|
||||
self.emit("wserror", err);
|
||||
self.ws.close(); // self.ws.emit("close");
|
||||
});
|
||||
this.ws.addEventListener("open", function(evt) {
|
||||
|
@ -146,8 +146,8 @@ table { border: 0; padding: 0; margin: 0; }
|
||||
.notification-body:after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -3px; border-top: 10px solid transparent;
|
||||
border-top-color: inherit; border-left: 6px solid transparent; border-right: 6px solid transparent; }
|
||||
.title { border-bottom: 1px solid #f84; font-size: 16px; font-weight: bold; padding-bottom: 5px; margin-bottom: 8px; }
|
||||
.notification .x { position: absolute; right: 4px; top: 0; cursor: pointer; font-size: 20px; color: #f84; text-shadow: none; }
|
||||
.notification .x:hover { font-weight: bolder; }
|
||||
.notification .x { position: absolute; right: 4px; top: 0px; cursor: pointer; font-size: 20px; color: #f84; text-shadow: none; }
|
||||
.notification .x:hover { font-weight: bold; }
|
||||
.notification.classic .notification-body { width: 400px; background: #fea; border-color: #fea;}
|
||||
.notification.short .title { display: none; }
|
||||
|
||||
|
25
script.js
25
script.js
@ -876,7 +876,7 @@ Rect.prototype.contains = function(x, y) {
|
||||
this.notification;
|
||||
this.packs = [];
|
||||
this.piano = piano;
|
||||
this.soundSelection = localStorage.soundSelection || "MPP Classic";
|
||||
this.soundSelection = localStorage?.soundSelection || "MPP Classic";
|
||||
this.addPack({name: "MPP Classic", keys: Object.keys(this.piano.keys), ext: ".mp3", url: "/sounds/mppclassic/"});
|
||||
}
|
||||
|
||||
@ -984,7 +984,7 @@ Rect.prototype.contains = function(x, y) {
|
||||
});
|
||||
})();
|
||||
}
|
||||
localStorage.soundSelection = pack.name;
|
||||
if(localStorage) localStorage.soundSelection = pack.name;
|
||||
this.soundSelection = pack.name;
|
||||
};
|
||||
|
||||
@ -1186,6 +1186,9 @@ Rect.prototype.contains = function(x, y) {
|
||||
gClient.setChannel(channel_id);
|
||||
gClient.start();
|
||||
|
||||
gClient.on("disconnect", function(evt) {
|
||||
console.log(evt);
|
||||
});
|
||||
|
||||
// Setting status
|
||||
(function() {
|
||||
@ -1391,7 +1394,9 @@ Rect.prototype.contains = function(x, y) {
|
||||
gPiano.stop(note.n, participant, ms);
|
||||
} else {
|
||||
var vel = (typeof note.v !== "undefined")? parseFloat(note.v) : DEFAULT_VELOCITY;
|
||||
if(vel < 0) vel = 0; else if (vel > 1) vel = 1;
|
||||
if(!vel) vel = 0;
|
||||
else if(vel < 0) vel = 0;
|
||||
else if (vel > 1) vel = 1;
|
||||
gPiano.play(note.n, vel, participant, ms);
|
||||
if(enableSynth) {
|
||||
gPiano.stop(note.n, participant, ms + 1000);
|
||||
@ -1576,10 +1581,8 @@ Rect.prototype.contains = function(x, y) {
|
||||
|
||||
|
||||
|
||||
|
||||
var gPianoMutes = [];
|
||||
|
||||
var gChatMutes = [];
|
||||
var gPianoMutes = (localStorage?.pianoMutes || "").split(',').filter(v => v);
|
||||
var gChatMutes = (localStorage?.chatMutes || "").split(',').filter(v => v);
|
||||
|
||||
|
||||
|
||||
@ -1878,6 +1881,7 @@ Rect.prototype.contains = function(x, y) {
|
||||
$('<div class="menu-item">Mute Notes</div>').appendTo(menu)
|
||||
.on("mousedown touchstart", function(evt) {
|
||||
gPianoMutes.push(part._id);
|
||||
if(localStorage) localStorage.pianoMutes = gPianoMutes.join(',');
|
||||
$(part.nameDiv).addClass("muted-notes");
|
||||
});
|
||||
} else {
|
||||
@ -1886,6 +1890,7 @@ Rect.prototype.contains = function(x, y) {
|
||||
var i;
|
||||
while((i = gPianoMutes.indexOf(part._id)) != -1)
|
||||
gPianoMutes.splice(i, 1);
|
||||
if(localStorage) localStorage.pianoMutes = gPianoMutes.join(',');
|
||||
$(part.nameDiv).removeClass("muted-notes");
|
||||
});
|
||||
}
|
||||
@ -1893,6 +1898,7 @@ Rect.prototype.contains = function(x, y) {
|
||||
$('<div class="menu-item">Mute Chat</div>').appendTo(menu)
|
||||
.on("mousedown touchstart", function(evt) {
|
||||
gChatMutes.push(part._id);
|
||||
if(localStorage) localStorage.chatMutes = gChatMutes.join(',');
|
||||
$(part.nameDiv).addClass("muted-chat");
|
||||
});
|
||||
} else {
|
||||
@ -1901,6 +1907,7 @@ Rect.prototype.contains = function(x, y) {
|
||||
var i;
|
||||
while((i = gChatMutes.indexOf(part._id)) != -1)
|
||||
gChatMutes.splice(i, 1);
|
||||
if(localStorage) localStorage.chatMutes = gChatMutes.join(',');
|
||||
$(part.nameDiv).removeClass("muted-chat");
|
||||
});
|
||||
}
|
||||
@ -1908,7 +1915,9 @@ Rect.prototype.contains = function(x, y) {
|
||||
$('<div class="menu-item">Mute Completely</div>').appendTo(menu)
|
||||
.on("mousedown touchstart", function(evt) {
|
||||
gPianoMutes.push(part._id);
|
||||
if(localStorage) localStorage.pianoMutes = gPianoMutes.join(',');
|
||||
gChatMutes.push(part._id);
|
||||
if(localStorage) localStorage.chatMutes = gChatMutes.join(',');
|
||||
$(part.nameDiv).addClass("muted-notes");
|
||||
$(part.nameDiv).addClass("muted-chat");
|
||||
});
|
||||
@ -1921,6 +1930,8 @@ Rect.prototype.contains = function(x, y) {
|
||||
gPianoMutes.splice(i, 1);
|
||||
while((i = gChatMutes.indexOf(part._id)) != -1)
|
||||
gChatMutes.splice(i, 1);
|
||||
if(localStorage) localStorage.pianoMutes = gPianoMutes.join(',');
|
||||
if(localStorage) localStorage.chatMutes = gChatMutes.join(',');
|
||||
$(part.nameDiv).removeClass("muted-notes");
|
||||
$(part.nameDiv).removeClass("muted-chat");
|
||||
});
|
||||
|
Reference in New Issue
Block a user