Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing merge conflict.

  • Loading branch information...
commit 590431ecf56b27d56a2fb4e7ae697f566d36e959 2 parents b469370 + 62fe4d2
@cballou authored
View
1  .gitignore
@@ -0,0 +1 @@
+chrome-ext/tt-squared.js
View
5 chrome-ext/tt-squared.css
@@ -38,7 +38,6 @@
#tt2_container ul.stats ul.current_voters ul { display: block; }
#tt2_container ul.stats ul.current_voters ul li { display: block; }
-
#tt2_container .toggleAccordion { cursor: pointer; overflow: hidden; }
#tt2_container .accordion { padding: 10px 10px 0; }
#tt2_container .accordion .accordion { padding: 0; }
@@ -94,7 +93,7 @@
#tt2_chat_box .chat-container .chatBar { width: 100%; background: transparent; }
#tt2_chat_box .chat-container .chatBar .guestListButton { display: none !important; }
#tt2_chat_box .chat-container .chatBar .input-box { width: 100%; background: transparent; border-left: none; left: 0 !important; }
-#tt2_chat_box .chat-container .chatBar .input-box input { position: relative; height: 26px !important; top: 2px !important; left: 0 !important; width: 100% !important; background: #fff; border-left: none !important; }
+#tt2_chat_box .chat-container .chatBar .input-box input { position: relative; height: 26px !important; top: 2px !important; left: 0 !important; width: 100% !important; background: #fff; border-left: none !important; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
#tt2_chat_box .guest-list-container .chatBar { width: 100%; }
#tt2_chat_box .guest-list-container .chatBar .guestListButton { display: none !important; }
@@ -285,4 +284,4 @@
.floatleft { float: left; display: inline; }
.space_right { margin-right: 10px; }
-.space_bottom { margin-bottom: 10px; }
+.space_bottom { margin-bottom: 10px; }
View
5 greasemonkey/tt-squared.css
@@ -38,7 +38,6 @@
#tt2_container ul.stats ul.current_voters ul { display: block; }
#tt2_container ul.stats ul.current_voters ul li { display: block; }
-
#tt2_container .toggleAccordion { cursor: pointer; overflow: hidden; }
#tt2_container .accordion { padding: 10px 10px 0; }
#tt2_container .accordion .accordion { padding: 0; }
@@ -94,7 +93,7 @@
#tt2_chat_box .chat-container .chatBar { width: 100%; background: transparent; }
#tt2_chat_box .chat-container .chatBar .guestListButton { display: none !important; }
#tt2_chat_box .chat-container .chatBar .input-box { width: 100%; background: transparent; border-left: none; left: 0 !important; }
-#tt2_chat_box .chat-container .chatBar .input-box input { position: relative; height: 26px !important; top: 2px !important; left: 0 !important; width: 100% !important; background: #fff; border-left: none !important; }
+#tt2_chat_box .chat-container .chatBar .input-box input { position: relative; height: 26px !important; top: 2px !important; left: 0 !important; width: 100% !important; background: #fff; border-left: none !important; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
#tt2_chat_box .guest-list-container .chatBar { width: 100%; }
#tt2_chat_box .guest-list-container .chatBar .guestListButton { display: none !important; }
@@ -285,4 +284,4 @@
.floatleft { float: left; display: inline; }
.space_right { margin-right: 10px; }
-.space_bottom { margin-bottom: 10px; }
+.space_bottom { margin-bottom: 10px; }
View
5 tt-squared.css
@@ -38,7 +38,6 @@
#tt2_container ul.stats ul.current_voters ul { display: block; }
#tt2_container ul.stats ul.current_voters ul li { display: block; }
-
#tt2_container .toggleAccordion { cursor: pointer; overflow: hidden; }
#tt2_container .accordion { padding: 10px 10px 0; }
#tt2_container .accordion .accordion { padding: 0; }
@@ -94,7 +93,7 @@
#tt2_chat_box .chat-container .chatBar { width: 100%; background: transparent; }
#tt2_chat_box .chat-container .chatBar .guestListButton { display: none !important; }
#tt2_chat_box .chat-container .chatBar .input-box { width: 100%; background: transparent; border-left: none; left: 0 !important; }
-#tt2_chat_box .chat-container .chatBar .input-box input { position: relative; height: 26px !important; top: 2px !important; left: 0 !important; width: 100% !important; background: #fff; border-left: none !important; }
+#tt2_chat_box .chat-container .chatBar .input-box input { position: relative; height: 26px !important; top: 2px !important; left: 0 !important; width: 100% !important; background: #fff; border-left: none !important; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
#tt2_chat_box .guest-list-container .chatBar { width: 100%; }
#tt2_chat_box .guest-list-container .chatBar .guestListButton { display: none !important; }
@@ -285,4 +284,4 @@
.floatleft { float: left; display: inline; }
.space_right { margin-right: 10px; }
-.space_bottom { margin-bottom: 10px; }
+.space_bottom { margin-bottom: 10px; }
View
21 tt-squared.js
@@ -755,9 +755,6 @@ window.TTFM_SQ = null;
* Record the new vote.
*/
var recordVote = function(data) {
- // the room users
- var users = _room.users;
-
// the voting user
var uid = data[0];
@@ -783,7 +780,7 @@ window.TTFM_SQ = null;
// if an upvote was cast
if (data[1] == 'up') {
// add to current upvoters
- votes.current.upvoters[uid] = users[uid].name;
+ votes.current.upvoters[uid] = _room.users[uid].name;
votes.current.upvotes += 1;
// add to the user's votes
@@ -796,9 +793,13 @@ window.TTFM_SQ = null;
if (isCurrentDj()) {
votes.mine.votes += 1;
votes.mine.upvotes += 1;
- votes.mine.songs[song_id].upvoters[uid] = users[uid].name;
+ votes.mine.songs[song_id].upvoters[uid] = _room.users[uid].name;
}
+ // check what type we have
+ _log('Checking downvoter');
+ _log(typeof votes.current.downvoters[uid]);
+
// check if they reversed their vote
if (typeof votes.current.downvoters[uid] != 'undefined') {
votes.user[uid].downvotes -= 1;
@@ -816,7 +817,7 @@ window.TTFM_SQ = null;
} else {
// add to current downvoters list
- votes.current.downvoters[uid] = users[uid].name;
+ votes.current.downvoters[uid] = _room.users[uid].name;
votes.current.downvotes += 1;
// add to the user
@@ -829,7 +830,7 @@ window.TTFM_SQ = null;
if (isCurrentDj()) {
votes.mine.votes += 1;
votes.mine.downvotes += 1;
- votes.mine.songs[song_id].downvoters[uid] = users[uid].name;
+ votes.mine.songs[song_id].downvoters[uid] = _room.users[uid].name;
}
// check if they reversed
@@ -852,7 +853,7 @@ window.TTFM_SQ = null;
/**
* Update vote counters on the stats tab.
*/
- var updateCounters = function(data) {
+ var updateCounters = function() {
// recalculate scores
votes.score = 100 * (votes.upvotes / votes.votes).toFixed(2);
votes.current.score = 100 * (votes.current.upvotes / votes.current.votes).toFixed(2);
@@ -861,6 +862,8 @@ window.TTFM_SQ = null;
votes.mine.score = 100 * (votes.mine.upvotes / votes.mine.votes).toFixed(2);
}
+ _log('Updating the counters');
+
// update current stats
$('#tt2_stats_current_upvotes').text(votes.current.upvotes);
$('#tt2_stats_current_downvotes').text(votes.current.downvotes);
@@ -904,7 +907,7 @@ window.TTFM_SQ = null;
// perform actions
recordVote(e.room.metadata.votelog[0]);
- updateCounters(e.room.metadata);
+ updateCounters();
updateVotersList();
}
Please sign in to comment.
Something went wrong with that request. Please try again.