Merge 514a88e0be into a4ef10cf1b
This commit is contained in:
commit
f1e37df5a0
21 changed files with 264 additions and 3 deletions
|
|
@ -45,6 +45,7 @@
|
|||
//= require osem-commercials
|
||||
//= require unobtrusive_flash
|
||||
//= require unobtrusive_flash_bootstrap
|
||||
//= require refresh_current_events
|
||||
|
||||
$(document).ready(function() {
|
||||
$('a[disabled=disabled]').click(function(event){
|
||||
|
|
|
|||
32
app/assets/javascripts/refresh_current_events.js
Normal file
32
app/assets/javascripts/refresh_current_events.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
$(document).ready(function() {
|
||||
// will call refreshCurrentEvents every 15 minutes
|
||||
setInterval(refreshCurrentEvents,900000);
|
||||
|
||||
// Only show the first child of tweet and sponsor containers on page load
|
||||
$('#tweet-container').children().hide();
|
||||
$('#tweet-container').children().eq(0).show();
|
||||
$('#sponsor-container').children().hide();
|
||||
$('#sponsor-container').children().eq(0).show();
|
||||
|
||||
setInterval(function(){ cycleVisibleElement($('#tweet-container'))}, 5000)
|
||||
setInterval(function(){ cycleVisibleElement($('#sponsor-container'))}, 10000)
|
||||
});
|
||||
|
||||
// Makes an ajax call for fresh data
|
||||
function refreshCurrentEvents(){
|
||||
$.ajax({
|
||||
url: "conference_info.js"
|
||||
});
|
||||
};
|
||||
|
||||
// Cycle through children in a container and toggles visibility
|
||||
function cycleVisibleElement(container){
|
||||
var childrens = $(container).children();
|
||||
for(var i = 0; i < childrens.length; i++ ){
|
||||
if(childrens.eq(i).is(":visible")){
|
||||
childrens.eq(i).hide();
|
||||
childrens.eq(++i % childrens.length).show();
|
||||
return
|
||||
}
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue