Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- var initialized = false;
- function BuckleDown(msg) {
- var d = JSON.parse(msg);
- var uid = null;
- if ((
- d.command === "registered" ||
- d.command === "rem_dj" ||
- d.command === "add_dj"
- ) &&
- d.user[0].avatarid !== 37)
- {
- uid = d.user[0].userid;
- } else if (
- d.command === "update_user" &&
- d.userid !== turntable.user.id &&
- d.avatarid !== 37)
- {
- uid = d.userid;
- }
- if (uid !== null) GingerUp(uid);
- if (initialized) Profit();
- }
- function GingerUp(uid) {
- turntable.socket.emit('message', [JSON.stringify({
- command: "update_user",
- userid: uid,
- avatarid: 37
- })]);
- }
- function Profit() {
- $("img[src$='headback.png']").each(function() {
- this.src = this.src.replace('headback.png', 'headfront.png');
- });
- }
- $('.ttpUser').each(function() {
- var uid = (this.id + '').substring(4);
- if (uid !== turntable.user.id) GingerUp(uid);
- });
- turntable.socket.on('message',BuckleDown);
- Profit();
- initialized = true;
- })();
Add Comment
Please, Sign In to add comment