Merge pull request #122 from tweakign/lamefix

Fix NS1 gather issues.
This commit is contained in:
Jiriki 2018-11-25 22:12:45 +00:00 committed by GitHub
commit 9a2ce76628
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View file

@ -181,11 +181,11 @@ class Gather < ActiveRecord::Base
end end
def can_create? cuser def can_create? cuser
cuser and cuser.admin? return true if cuser.admin? or cuser.gather_moderator?
end end
def can_update? cuser def can_update? cuser
cuser and cuser.admin? return true if cuser.admin? or cuser.gather_moderator?
end end
def self.last(name = "NS2") def self.last(name = "NS2")

View file

@ -34,22 +34,23 @@
success: function(response, text, request) { success: function(response, text, request) {
if (request.getResponseHeader('Gather') == 'voting') { if (request.getResponseHeader('Gather') == 'voting') {
if (!played) { if (!played) {
var startTime = 110;
$("#jplayer").jPlayer({ $("#jplayer").jPlayer({
ready: function() { ready: function() {
$(this).jPlayer("setMedia", { $(this).jPlayer("setMedia", {
mp3: "https://www.ensl.org/sounds/gather-1.mp3" mp3: "https://www.ensl.org/sounds/gather-1.mp3"
}).jPlayer("play"); }).jPlayer("play", startTime);
var click = document.ontouchstart === undefined ? 'click' : 'touchstart'; var click = document.ontouchstart === undefined ? 'click' : 'touchstart';
var kickoff = function () { var kickoff = function () {
$("#jplayer").jPlayer("play"); $("#jplayer").jPlayer("play", startTime);
document.documentElement.removeEventListener(click, kickoff, true); document.documentElement.removeEventListener(click, kickoff, true);
}; };
document.documentElement.addEventListener(click, kickoff, true); document.documentElement.addEventListener(click, kickoff, true);
}, },
loop: true, loop: false,
volume: 0.5, volume: 0.45,
swfPath: "/flash" swfPath: "/flash"
}); });
@ -180,8 +181,8 @@
<h6>Voice Communication</h6> <h6>Voice Communication</h6>
<ul> <ul>
<li><%= link_to "Teamspeak 3", "http://www.teamspeak.com/?page=downloads" %></li> <li><%= link_to "Teamspeak 3", "http://www.teamspeak.com/?page=downloads" %></li>
<li><strong>Join server:</strong> <a href="ts3server://ensl.org?channel=NS1%20Gathers">ensl.org</a></li> <li><strong>Click to join:</strong> <a href="ts3server://ensl.org?channel=NS1%20Gathers">ensl.org</a></li>
<li><strong>All passwords:</strong> europe </li> <li><strong>TS password:</strong> europe </li>
</ul> </ul>
</div> </div>