Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Updating for SSL (again)
Js files this time
  • Loading branch information
bcd04001 committed Oct 18, 2017
1 parent abe522c commit 99c0ddd
Show file tree
Hide file tree
Showing 2 changed files with 178 additions and 178 deletions.
354 changes: 177 additions & 177 deletions js/custom.js
@@ -1,178 +1,178 @@
jQuery(document).ready(function($) {

$( ".social-vimeo > a" ).html( "DONATE" );

var search = '';
var active = false;
$('.search').on('click',function(e){
if($(e.target).attr('id')=='s') return;
active = true;
search = $(e.target).parent().html();
$('.search').fadeOut(500,function(){
$(this).html('<form class="form-inline" role="form" method="get" action="http://ece.uconn.edu/"><input id="s" type="text" onfocus="this.value = \'\'" name="s" value="Search ECE"></form>').fadeIn(500);
$(this).addClass('search-field');
});
});

$('body').on('click',function(e){
if($(e.target).attr('id')=='s') return;
if($(e.target).parent().html()== search) return;
if(!active) return;
active = false;
$('.search').fadeOut(500,function(){
$(this).html(search).fadeIn(500);
$('.search').removeClass('search-field');
});
});

$( "#footers" ).before( "<div class='container'><div class='col-sm-12 footer-img'></div></div>" );

$('select[name="discipline"] option:eq(0)').prop("selected", true);
$('select[name="major"] option:eq(0)').prop("selected", true);

var isCourseSelectActive = false;
var selectedDiscipline;
$('select[name="discipline"]').change(function(e){
var discipline = $(this).find(":selected").text();
selectedDiscipline = discipline;
$.ajax({
type: "POST",
url: ece_object.ajaxurl,
data: {
action: "ece_discipline_courses",
discipline : discipline
},
success: function(response){
if( isCourseSelectActive == true ){
$('.course-option').remove();
}
$.each(response, function(i,v){
$('select[name="course"]').append(
$('<option />', {
'value': v,
'text': v,
'class': "course-option"
})
);
});
$('select[name="course"]').show();
isCourseSelectActive = true;
eceStickyFoot();
}, dataType: "json"
});
});

var isCourseInfoVisible = false;
$('select[name="course"]').change(function(e){
if( isCourseSelectActive == false || selectedDiscipline == undefined ){
return false;
}
var course = $(this).find(":selected").text();
$.ajax({
type: "POST",
url: ece_object.ajaxurl,
data: {
action: "ece_course_info",
discipline: selectedDiscipline,
course: course
},
success: function(response){
if( isCourseInfoVisible == true ){
$('#ece-course-learnmore').empty();
$('.major-requiredcourses').remove();
}

var courseInfo = response[0];
$('#ece-course-name').text(courseInfo.discipline + " " + courseInfo.course);
$('#ece-course-learnmore').html( $('#ece-course-learnmore').text() + ' <a href="'+courseInfo.url+'">'+courseInfo.url+'</a>' );
$.each(courseInfo.majors, function(i,v){
$('#ece-course-required ul').append(
$('<li />', {
'text': v.major,
'class': "major-requiredcourses"
})
);
});
$('#ece-course').show();
isCourseInfoVisible = true;
eceStickyFoot();
}, dataType: "json"
});
});

var isListVisible = false;
$('select[name="major"]').change(function(e){
var major = $(this).find(":selected").text();
$.ajax({
type: "POST",
url: ece_object.ajaxurl,
data: {
action: "ece_major_info",
major: major,
},
success: function(response){
if( isListVisible == true ){
$('.major-courses').remove();
}

var majorInfo = response[0];
$('#ece-major-name').text(majorInfo.major);
$('#ece-major-url').html('<a href="'+majorInfo.url+'">'+majorInfo.url+'</a>');
$('ece-major-text').text("UConn ECE offers the following courses which lead to a major in "+majorInfo.major);
$.each(majorInfo.courses, function(i,v){
$('#ece-major-courses ul').append(
$('<li />', {
'text': v.discipline + " " + v.course,
'class': "major-courses"
})
);
});
$('#ece-major').show();
isListVisible = true;
eceStickyFoot();
}, dataType: "json"
});
});

// STICKY FOOTER
// measures height of the page, and applies a class to absolute position the footer, or not.
// on short pages, it sticks; on tall pages, it doesn't.

function eceStickyFoot(){
if (document.getElementById('page')!=null && document.getElementById('footers') !=null){
var wrapperH = $('#page').outerHeight();
var footerImgH = $('.footer-img').parent().outerHeight();
var wpadminbarH = $('#wpadminbar').outerHeight();
var ucheaderH = $('#uc-header').outerHeight();
var footerH = $('#footers').outerHeight();
var windowH = window.innerHeight;
var gformH = 0;
$('.gform_wrapper').each(function(){
gformH = gformH + $(this).outerHeight();
});
windowH = windowH - wpadminbarH - ucheaderH;
wrapperH = wrapperH + footerH + footerImgH;
if(windowH>=wrapperH){
$('body').addClass('sticky');
} else {
$('body').removeClass('sticky');
}
}
}
$(document).ready(function(){
eceStickyFoot();
});
$(window).resize(function() {
eceStickyFoot();
});
$(window).load(function() {
eceStickyFoot();
});

$('.panel, .collapse').on('shown.bs.collapse', function (e) {
eceStickyFoot();
})
$('.panel, .collapse').on('hidden.bs.collapse', function (e) {
eceStickyFoot();
})
jQuery(document).ready(function($) {

$( ".social-vimeo > a" ).html( "DONATE" );

var search = '';
var active = false;
$('.search').on('click',function(e){
if($(e.target).attr('id')=='s') return;
active = true;
search = $(e.target).parent().html();
$('.search').fadeOut(500,function(){
$(this).html('<form class="form-inline" role="form" method="get" action="https://ece.uconn.edu/"><input id="s" type="text" onfocus="this.value = \'\'" name="s" value="Search ECE"></form>').fadeIn(500);
$(this).addClass('search-field');
});
});

$('body').on('click',function(e){
if($(e.target).attr('id')=='s') return;
if($(e.target).parent().html()== search) return;
if(!active) return;
active = false;
$('.search').fadeOut(500,function(){
$(this).html(search).fadeIn(500);
$('.search').removeClass('search-field');
});
});

$( "#footers" ).before( "<div class='container'><div class='col-sm-12 footer-img'></div></div>" );

$('select[name="discipline"] option:eq(0)').prop("selected", true);
$('select[name="major"] option:eq(0)').prop("selected", true);

var isCourseSelectActive = false;
var selectedDiscipline;
$('select[name="discipline"]').change(function(e){
var discipline = $(this).find(":selected").text();
selectedDiscipline = discipline;
$.ajax({
type: "POST",
url: ece_object.ajaxurl,
data: {
action: "ece_discipline_courses",
discipline : discipline
},
success: function(response){
if( isCourseSelectActive == true ){
$('.course-option').remove();
}
$.each(response, function(i,v){
$('select[name="course"]').append(
$('<option />', {
'value': v,
'text': v,
'class': "course-option"
})
);
});
$('select[name="course"]').show();
isCourseSelectActive = true;
eceStickyFoot();
}, dataType: "json"
});
});

var isCourseInfoVisible = false;
$('select[name="course"]').change(function(e){
if( isCourseSelectActive == false || selectedDiscipline == undefined ){
return false;
}
var course = $(this).find(":selected").text();
$.ajax({
type: "POST",
url: ece_object.ajaxurl,
data: {
action: "ece_course_info",
discipline: selectedDiscipline,
course: course
},
success: function(response){
if( isCourseInfoVisible == true ){
$('#ece-course-learnmore').empty();
$('.major-requiredcourses').remove();
}

var courseInfo = response[0];
$('#ece-course-name').text(courseInfo.discipline + " " + courseInfo.course);
$('#ece-course-learnmore').html( $('#ece-course-learnmore').text() + ' <a href="'+courseInfo.url+'">'+courseInfo.url+'</a>' );
$.each(courseInfo.majors, function(i,v){
$('#ece-course-required ul').append(
$('<li />', {
'text': v.major,
'class': "major-requiredcourses"
})
);
});
$('#ece-course').show();
isCourseInfoVisible = true;
eceStickyFoot();
}, dataType: "json"
});
});

var isListVisible = false;
$('select[name="major"]').change(function(e){
var major = $(this).find(":selected").text();
$.ajax({
type: "POST",
url: ece_object.ajaxurl,
data: {
action: "ece_major_info",
major: major,
},
success: function(response){
if( isListVisible == true ){
$('.major-courses').remove();
}

var majorInfo = response[0];
$('#ece-major-name').text(majorInfo.major);
$('#ece-major-url').html('<a href="'+majorInfo.url+'">'+majorInfo.url+'</a>');
$('ece-major-text').text("UConn ECE offers the following courses which lead to a major in "+majorInfo.major);
$.each(majorInfo.courses, function(i,v){
$('#ece-major-courses ul').append(
$('<li />', {
'text': v.discipline + " " + v.course,
'class': "major-courses"
})
);
});
$('#ece-major').show();
isListVisible = true;
eceStickyFoot();
}, dataType: "json"
});
});

// STICKY FOOTER
// measures height of the page, and applies a class to absolute position the footer, or not.
// on short pages, it sticks; on tall pages, it doesn't.

function eceStickyFoot(){
if (document.getElementById('page')!=null && document.getElementById('footers') !=null){
var wrapperH = $('#page').outerHeight();
var footerImgH = $('.footer-img').parent().outerHeight();
var wpadminbarH = $('#wpadminbar').outerHeight();
var ucheaderH = $('#uc-header').outerHeight();
var footerH = $('#footers').outerHeight();
var windowH = window.innerHeight;
var gformH = 0;
$('.gform_wrapper').each(function(){
gformH = gformH + $(this).outerHeight();
});
windowH = windowH - wpadminbarH - ucheaderH;
wrapperH = wrapperH + footerH + footerImgH;
if(windowH>=wrapperH){
$('body').addClass('sticky');
} else {
$('body').removeClass('sticky');
}
}
}
$(document).ready(function(){
eceStickyFoot();
});
$(window).resize(function() {
eceStickyFoot();
});
$(window).load(function() {
eceStickyFoot();
});

$('.panel, .collapse').on('shown.bs.collapse', function (e) {
eceStickyFoot();
})
$('.panel, .collapse').on('hidden.bs.collapse', function (e) {
eceStickyFoot();
})
});
2 changes: 1 addition & 1 deletion js/min/custom.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 99c0ddd

Please sign in to comment.