Last active
August 29, 2015 14:06
-
-
Save misterpah/23d899736dac5f792dd3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/* | |
alter_branding.js | |
webteam UTM | |
last updated 21 september 2014 , 11:41 pm | |
*/ | |
(function(jQuery){ | |
// edit here | |
var branding_myutm = {'show':true,"text":"UTM","link":"http://www.utm.my"}; | |
var branding_feedback = {'show':true,"text":"Feedback","link":"http://www.utm.my/feedback"} | |
var branding_language = {'show':false} | |
var branding_map = {'show':false} | |
var branding_campus_johor = {'show':true} | |
var branding_campus_kl = {'show':true} | |
var branding_contact = {'show':true,"text":"Contact","link":"http://www.utm.my/about/contact-us"}; | |
var facebook = {"show":true,"url":"http://www.facebook.com"}; | |
var twitter = {"show":true,"url":"http://www.twitter.com"}; | |
var youtube = {"show":false,"url":"http://www.youtube.com"}; | |
var instagram = {"show":false,"url":"http://www.instagram.com"}; | |
var pinterest = {"show":false,"url":"http://www.pinterest.com"}; | |
// Don't edit after this line. | |
function build_simple_link(object) | |
{ | |
var ret = ""; | |
if(object.show == false) | |
{ | |
return ret; | |
} | |
if (object.link) | |
{ | |
ret += "<a href='"+object.link+"'>"; | |
} | |
if (object.text) | |
{ | |
ret += object.text; | |
} | |
if (object.link) | |
{ | |
ret += "</a>"; | |
} | |
return ret; | |
} | |
jQuery(document).on("branding_complete",function(){ | |
jQuery(".branding_myutm").html(build_simple_link(branding_myutm)); | |
jQuery(".branding_feedback").html(build_simple_link(branding_feedback)); | |
jQuery(".branding_language").html(build_simple_link(branding_language)); | |
jQuery(".branding_map").html(build_simple_link(branding_map)); | |
jQuery(".branding_campus_johor").html(build_simple_link(branding_campus_johor)); | |
jQuery(".branding_campus_kl").html(build_simple_link(branding_campus_kl)); | |
jQuery(".branding_contact").html(build_simple_link(branding_contact)); | |
if (facebook.show == false) { jQuery(".utm-sitemap-box-branding img[alt='Facebook']").css('display','none'); } | |
jQuery(".utm-sitemap-box-branding img[alt='Facebook']").parent().attr("href",facebook.url); | |
if (twitter.show == false) { jQuery(".utm-sitemap-box-branding img[alt='Twitter']").css('display','none'); } | |
jQuery(".utm-sitemap-box-branding img[alt='Twitter']").parent().attr("href",twitter.url); | |
if (youtube.show == false) { jQuery(".utm-sitemap-box-branding img[alt='YouTube']").css('display','none'); } | |
jQuery(".utm-sitemap-box-branding img[alt='YouTube']").parent().attr("href",youtube.url); | |
if (instagram.show == false) { jQuery(".utm-sitemap-box-branding img[alt='Instagram']").css('display','none'); } | |
jQuery(".utm-sitemap-box-branding img[alt='Instagram']").parent().attr("href",instagram.url); | |
if (pinterest.show == false) { jQuery(".utm-sitemap-box-branding img[alt='Pinterest']").css('display','none'); } | |
jQuery(".utm-sitemap-box-branding img[alt='Pinterest']").parent().attr("href",pinterest.url); | |
}); | |
})(jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment