diff --git a/css/ece.css b/css/ece.css
index 9533eea..4f10f54 100644
--- a/css/ece.css
+++ b/css/ece.css
@@ -9211,21 +9211,20 @@ body.home .hentry {
}
/* ----------------------------- Default Page Styles ----------------------------- */
-#page-page, #page-blank, #page-userlist, #page-user-profile .col-sm-9, #page-single, #page-archive {
+#page-page, #page-blank, #page-userlist, #page-user-profile .col-sm-9, #page-single, #page-archive, #page-advising {
background-color: #FAFAFA;
- border: 1px solid #EBEBEB;
}
-#page-page .row:nth-child(1), #page-blank .row:nth-child(1), #page-userlist .row:nth-child(1), #page-user-profile .col-sm-9 .row:nth-child(1), #page-single .row:nth-child(1), #page-archive .row:nth-child(1) {
+#page-page .row:nth-child(1), #page-blank .row:nth-child(1), #page-userlist .row:nth-child(1), #page-user-profile .col-sm-9 .row:nth-child(1), #page-single .row:nth-child(1), #page-archive .row:nth-child(1), #page-advising .row:nth-child(1) {
background-color: #FAFAFA;
border: 1px solid #EBEBEB;
}
-#page-page #main, #page-blank #main, #page-userlist #main, #page-user-profile .col-sm-9 #main, #page-single #main, #page-archive #main {
+#page-page #main, #page-blank #main, #page-userlist #main, #page-user-profile .col-sm-9 #main, #page-single #main, #page-archive #main, #page-advising #main {
background-color: transparent;
padding-left: 40px;
padding-right: 40px;
margin-top: 18px;
}
-#page-page h1, #page-blank h1, #page-userlist h1, #page-user-profile .col-sm-9 h1, #page-single h1, #page-archive h1 {
+#page-page h1, #page-blank h1, #page-userlist h1, #page-user-profile .col-sm-9 h1, #page-single h1, #page-archive h1, #page-advising h1 {
margin-bottom: 30px;
font-family: 'bebas_neue_regularregular', helvetica, arial, sans-serif;
font-size: 40px;
@@ -9233,12 +9232,16 @@ body.home .hentry {
text-shadow: 0px 1px 0px white;
color: #4B4B4B;
}
-#page-page h2, #page-blank h2, #page-userlist h2, #page-user-profile .col-sm-9 h2, #page-single h2, #page-archive h2 {
+#page-page h2, #page-blank h2, #page-userlist h2, #page-user-profile .col-sm-9 h2, #page-single h2, #page-archive h2, #page-advising h2 {
text-transform: uppercase;
color: #00a8b1;
font-size: 20px;
}
+#page-user-profile .col-sm-9 {
+ border: 1px solid #EBEBEB;
+}
+
/* ----------------------------- Page Blank ----------------------------- */
#page-blank {
background-color: #FAFAFA;
@@ -9306,6 +9309,40 @@ body.home .hentry {
margin-bottom: 20px;
}
+/* ----------------------------- Page Advising ----------------------------- */
+#page-advising .left-courses {
+ /*padding-left:0;
+ padding-right:0;
+ border-right:1px solid red;*/
+}
+#page-advising .select-course {
+ margin-top: 10px;
+}
+#page-advising #ece-course {
+ margin-top: 30px;
+}
+#page-advising #ece-course #ece-course-name {
+ font-family: 'bebas_neue_regularregular', helvetica, arial, sans-serif;
+ font-size: 30px;
+ letter-spacing: 0.5px;
+ text-shadow: 0px 1px 0px white;
+ color: #4B4B4B;
+}
+#page-advising #ece-major {
+ margin-top: 30px;
+}
+#page-advising #ece-major #ece-major-name {
+ font-family: 'bebas_neue_regularregular', helvetica, arial, sans-serif;
+ font-size: 30px;
+ letter-spacing: 0.5px;
+ text-shadow: 0px 1px 0px white;
+ color: #4B4B4B;
+ line-height: 1em;
+}
+#page-advising input, #page-advising button, #page-advising select, #page-advising textarea {
+ width: 85%;
+}
+
/* ----------------------------- Archive/Blog ----------------------------- */
#page-single .widget, #page-archive .widget {
padding: 0px !important;
diff --git a/functions.php b/functions.php
index 7a8f238..5fb4411 100644
--- a/functions.php
+++ b/functions.php
@@ -1,79 +1,79 @@
- admin_url( 'admin-ajax.php' ), 'siteurl' => site_url() ) );
-}
-add_action( 'wp_enqueue_scripts', 'ece_scripts');
-
-function ece_get_courses( $discipline ){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_course.php");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, 'discipline='.$discipline);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $courses = curl_exec($ch);
- curl_close ($ch);
-
- return json_decode($courses);
-}
-
-function ajax_ece_discipline_courses(){
- $discipline = $_POST['discipline'];
-
- $courses = ece_get_courses( urlencode($discipline) );
-
- echo wp_json_encode( $courses );
- wp_die();
-}
-add_action( 'wp_ajax_ece_discipline_courses', 'ajax_ece_discipline_courses' );
-add_action('wp_ajax_nopriv_ece_discipline_courses', 'ajax_ece_discipline_courses');
-
-function ece_get_course_info( $discipline, $course ){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_course.php");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, 'course='.$course.'&discipline='.$discipline);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $courses = curl_exec($ch);
- curl_close ($ch);
-
- return json_decode($courses);
-}
-
-function ajax_ece_course_info(){
- $discipline = $_POST['discipline'];
- $course = $_POST['course'];
-
- $courseInfo = ece_get_course_info( urlencode($discipline), urlencode($course) );
-
- echo wp_json_encode( $courseInfo );
- wp_die();
-}
-add_action( 'wp_ajax_ece_course_info', 'ajax_ece_course_info' );
-add_action('wp_ajax_nopriv_ece_course_info', 'ajax_ece_course_info');
-
-function ece_get_major_info( $major ){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_major.php");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, 'major='.$major);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $info = curl_exec($ch);
- curl_close ($ch);
-
- return json_decode($info);
-}
-
-function ajax_ece_major_info(){
- $major = $_POST['major'];
-
- $majorInfo = ece_get_major_info( urlencode($major) );
-
- echo wp_json_encode( $majorInfo );
- wp_die();
-}
-add_action( 'wp_ajax_ece_major_info', 'ajax_ece_major_info' );
-add_action('wp_ajax_nopriv_ece_major_info', 'ajax_ece_major_info');
+ admin_url( 'admin-ajax.php' ), 'siteurl' => site_url() ) );
+}
+add_action( 'wp_enqueue_scripts', 'ece_scripts');
+
+function ece_get_courses( $discipline ){
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_course.php");
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, 'discipline='.$discipline);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ $courses = curl_exec($ch);
+ curl_close ($ch);
+
+ return json_decode($courses);
+}
+
+function ajax_ece_discipline_courses(){
+ $discipline = $_POST['discipline'];
+
+ $courses = ece_get_courses( urlencode($discipline) );
+
+ echo wp_json_encode( $courses );
+ wp_die();
+}
+add_action( 'wp_ajax_ece_discipline_courses', 'ajax_ece_discipline_courses' );
+add_action('wp_ajax_nopriv_ece_discipline_courses', 'ajax_ece_discipline_courses');
+
+function ece_get_course_info( $discipline, $course ){
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_course.php");
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, 'course='.$course.'&discipline='.$discipline);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ $courses = curl_exec($ch);
+ curl_close ($ch);
+
+ return json_decode($courses);
+}
+
+function ajax_ece_course_info(){
+ $discipline = $_POST['discipline'];
+ $course = $_POST['course'];
+
+ $courseInfo = ece_get_course_info( urlencode($discipline), urlencode($course) );
+
+ echo wp_json_encode( $courseInfo );
+ wp_die();
+}
+add_action( 'wp_ajax_ece_course_info', 'ajax_ece_course_info' );
+add_action('wp_ajax_nopriv_ece_course_info', 'ajax_ece_course_info');
+
+function ece_get_major_info( $major ){
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_major.php");
+ curl_setopt($ch, CURLOPT_POST, 1);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, 'major='.$major);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ $info = curl_exec($ch);
+ curl_close ($ch);
+
+ return json_decode($info);
+}
+
+function ajax_ece_major_info(){
+ $major = $_POST['major'];
+
+ $majorInfo = ece_get_major_info( urlencode($major) );
+
+ echo wp_json_encode( $majorInfo );
+ wp_die();
+}
+add_action( 'wp_ajax_ece_major_info', 'ajax_ece_major_info' );
+add_action('wp_ajax_nopriv_ece_major_info', 'ajax_ece_major_info');
?>
\ No newline at end of file
diff --git a/js/custom.js b/js/custom.js
index 6f29951..fc470b3 100644
--- a/js/custom.js
+++ b/js/custom.js
@@ -1,137 +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('
').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( "
" );
-
- $('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(
- $(' ', {
- 'value': v,
- 'text': v,
- 'class': "course-option"
- })
- );
- });
- $('select[name="course"]').show();
- isCourseSelectActive = true;
- }, 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() + ' '+courseInfo.url+' ' );
- $.each(courseInfo.majors, function(i,v){
- $('#ece-course-required ul').append(
- $(' ', {
- 'text': v.major,
- 'class': "major-requiredcourses"
- })
- );
- });
- $('#ece-course').show();
- isCourseInfoVisible = true;
- }, 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(''+majorInfo.url+' ');
- $('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(
- $(' ', {
- 'text': v.discipline + " " + v.course,
- 'class': "major-courses"
- })
- );
- });
- $('#ece-major').show();
- isListVisible = true;
- }, dataType: "json"
- });
- });
-});
-
-
-
-
+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('').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( "
" );
+
+ $('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(
+ $(' ', {
+ '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() + ' '+courseInfo.url+' ' );
+ $.each(courseInfo.majors, function(i,v){
+ $('#ece-course-required ul').append(
+ $(' ', {
+ '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(''+majorInfo.url+' ');
+ $('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(
+ $(' ', {
+ '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();
+ })
+});
\ No newline at end of file
diff --git a/js/min/custom.min.js b/js/min/custom.min.js
index b4fedb1..2a1c955 100644
--- a/js/min/custom.min.js
+++ b/js/min/custom.min.js
@@ -1 +1 @@
-jQuery(document).ready(function(t){t(".social-vimeo > a").html("DONATE");var e="",a=!1;t(".search").on("click",function(o){"s"!=t(o.target).attr("id")&&(a=!0,e=t(o.target).parent().html(),t(".search").fadeOut(500,function(){t(this).html('').fadeIn(500),t(this).addClass("search-field")}))}),t("body").on("click",function(o){"s"!=t(o.target).attr("id")&&t(o.target).parent().html()!=e&&a&&(a=!1,t(".search").fadeOut(500,function(){t(this).html(e).fadeIn(500),t(".search").removeClass("search-field")}))}),t("#footers").before("
")});
\ No newline at end of file
+jQuery(document).ready(function(t){t(".social-vimeo > a").html("DONATE");var e="",a=!1;t(".search").on("click",function(i){"s"!=t(i.target).attr("id")&&(a=!0,e=t(i.target).parent().html(),t(".search").fadeOut(500,function(){t(this).html('').fadeIn(500),t(this).addClass("search-field")}))}),t("body").on("click",function(i){"s"!=t(i.target).attr("id")&&t(i.target).parent().html()!=e&&a&&(a=!1,t(".search").fadeOut(500,function(){t(this).html(e).fadeIn(500),t(".search").removeClass("search-field")}))}),t("#footers").before("")});
\ No newline at end of file
diff --git a/preadvising-page.php b/preadvising-page.php
index 5ba37b1..80874ca 100644
--- a/preadvising-page.php
+++ b/preadvising-page.php
@@ -50,50 +50,71 @@ function getByMajor(){
}
get_header();
-
-$majors = getByCourse();
-echo '';
-foreach( $majors as $k=>$m ){
- if( empty($m) ){
- $m = "Select a discipline";
- }
- echo ''.$m.' ';
-}
-echo ' ';
-?>
-
-
-Select a course
-
-
-
Learn more about the department at:
-
-
This course is also a required course for the following majors:
-
-
-
-
-
-
-';
-foreach( $getByMajor as $k=>$m ){
- if( empty($m) ){
- $m = "Select a major";
- }
- echo ''.$m.' ';
-}
-echo '';
?>
-
-
-
-
-
To see if your schools offers these courses, see the Guidance Director at your high school.
+
+
+
+
+
+
+
+
+
+
+
+
Select by Course
+ ';
+ foreach( $majors as $k=>$m ){
+ if( empty($m) ){
+ $m = "Select a discipline";
+ }
+ echo '
'.$m.' ';
+ }
+ echo '';
+ ?>
+
+
+
Select a course
+
+
+
Learn more about the department at:
+
+
This course is also a required course for the following majors:
+
+
+
+
+
+
+
+
+
Select by Major
+ ';
+ foreach( $getByMajor as $k=>$m ){
+ if( empty($m) ){
+ $m = "Select a major";
+ }
+ echo '
'.$m.' ';
+ }
+ echo '';
+ ?>
+
+
+
+
+
To see if your schools offers these courses, see the Guidance Director at your high school.
+
+
+
+
+