diff --git a/app/templates/nccu/assets/javascripts/app.js b/app/templates/nccu/assets/javascripts/app.js index 0ca8310..8a25489 100644 --- a/app/templates/nccu/assets/javascripts/app.js +++ b/app/templates/nccu/assets/javascripts/app.js @@ -3,6 +3,23 @@ // Init functions function init() { + // Add link and cursor class name on element that has data-link attribute + function addLinkOnADBanner( els ) { + $.each( els, function() { + if ( $( this ).data( "link" ) !== "" && !$( this ).hasClass( "youtube" ) ) { + $( this ).on( "click", function() { + var target = $( this ).data( "target" ), + link = $( this ).data( "link" ); + if ( target === "_blank" ) { + window.open( link, target ); + } else { + window.location.href = link; + } + }).addClass( "cursor" ); + } + }); + } + function heightCompare () { var priHeight = $('.primary').height(); var secHeight = $('.secondary').height(); @@ -29,6 +46,18 @@ } } + // Doing this is to prevent directly change in the HTML + function removeSignUpItem() { + $(".login-body").find("a[href='/users/new']") + .addClass('hide') + .prev("div") + .addClass('hide'); + $(".orbit-bar-search-sign-language") + .find(".icons-tools") + .closest('li') + .addClass('hide'); + } + function bullsEye() { $('.bullseye').bullseye({ effect: false @@ -61,6 +90,15 @@ .addClass('active'); } + // Specifically for IE8 + function addClassOnLastMenuItem() { + // IE8 and blow don't support multiple backgrouds, + // hance using this class to detect if the current user agent is IE8 + if( $( "html" ).hasClass( "no-multiplebgs" ) ) { + $( ".page_menu.level_1 > li:last-child" ).addClass( "last" ); + } + } + // Main navigation dropdown function dropdown() { var navItemLevel1$ = $('.main-nav-item.level-1'); @@ -123,6 +161,10 @@ searchDetect(); heightCompare(); } + removeSignUpItem(); + addClassOnLastMenuItem(); + addLinkOnADBanner( $(".cycle-slideshow > .slide-img") ); + } $(document).ready(function($) { @@ -225,15 +267,12 @@ var getXmlFeedForCalendar = function(){ } } - - var packagesJS = function() { $('.open-mune').on('click', function(event) { $(this).closest('.main_menu').toggleClass('in'); }); - $('.page_menu.level-2') $('.level_1').on('click', '.dot', function(event) { var $this = $(this); diff --git a/app/templates/nccu/assets/stylesheets/template/base/_default.scss b/app/templates/nccu/assets/stylesheets/template/base/_default.scss index 861e702..3a622da 100644 --- a/app/templates/nccu/assets/stylesheets/template/base/_default.scss +++ b/app/templates/nccu/assets/stylesheets/template/base/_default.scss @@ -66,6 +66,10 @@ a:active { display: none; } +.cursor { + cursor: pointer; +} + .dymanic_load { margin-bottom: 2em; position: relative; @@ -3556,6 +3560,20 @@ article.page_content .linkAndFile > div:last-child { float: left; } + +// hide edit button on announcement, news pages +body[data-module="news"] { + .show-announcement ~ .admin-edit { + display: none; + } +} + +body[data-module="announcement"] { + .show-announcement ~ .admin-edit { + display: none; + } +} + @media (max-width: 767px) { .inside_page .primary { width: 100%; @@ -3852,6 +3870,9 @@ img { font-size: 13px; font-size: 0.8125rem; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + th, td { + padding: 6px 10px; + } } @media screen and (max-width: 767px) { diff --git a/app/templates/nccu/modules/ad_banner/_widget1.html.erb b/app/templates/nccu/modules/ad_banner/_widget1.html.erb index ece14dc..fd2ccd6 100644 --- a/app/templates/nccu/modules/ad_banner/_widget1.html.erb +++ b/app/templates/nccu/modules/ad_banner/_widget1.html.erb @@ -13,6 +13,7 @@ data-cycle-title="{{title}}" data-cycle-desc="{{context}}" data-overlay-template="

{{title}}

{{desc}}" + data-target="{{target}}" > diff --git a/app/templates/nccu/modules/ad_banner/_widget2.html.erb b/app/templates/nccu/modules/ad_banner/_widget2.html.erb index f0fb025..f40e01e 100644 --- a/app/templates/nccu/modules/ad_banner/_widget2.html.erb +++ b/app/templates/nccu/modules/ad_banner/_widget2.html.erb @@ -13,6 +13,7 @@ data-cycle-title="{{title}}" data-cycle-desc="{{context}}" data-overlay-template="

{{title}}

{{desc}}" + data-target="{{target}}" >