Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
stylinggt.js/stylinggt.js /
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
75 lines (66 sloc)
1.92 KB
This file contains 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
| /* -------------------------------------------------------------------- | |
| * StylingGT - A Javascript plug-in | |
| * Author: Winner Crespo, http://winnercrespo.com | |
| * Copyright (c) 2014 Winner Crespo | |
| * Licensed under The MIT License (MIT) [http://opensource.org/licenses/MIT] | |
| * -------------------------------------------------------------------- | |
| */ | |
| function defaultStyle(remove, leftIcon, centerText, rightIcon, borderColor, backgroundColor, textColor, textSize){ | |
| if(remove){ | |
| removeLeftIcon(); | |
| } | |
| changeLeftIcon(leftIcon); | |
| changeCenterText(centerText); | |
| changeRightIcon(rightIcon); | |
| changeBorderColor(borderColor); | |
| changeBackgroundColor(backgroundColor); | |
| changeTextColor(textColor); | |
| changeTextSize(textSize); | |
| } | |
| function removeLeftIcon(){ | |
| $("#google_translate_element img").eq(0).remove(); | |
| } | |
| function changeLeftIcon(url){ | |
| if(url != ''){ | |
| $("#google_translate_element img").eq(0).css("background-image", ""); | |
| $("#google_translate_element img").eq(0).attr("src", url); | |
| $("#urlLeftIcon").val(''); | |
| } | |
| } | |
| function changeCenterText(text){ | |
| if(text != ''){ | |
| $("#google_translate_element span").eq(1).text(text); | |
| $("#centerText").val(''); | |
| } | |
| } | |
| function changeRightIcon(text){ | |
| if(text != ''){ | |
| $("#google_translate_element span").eq(3).text(text); | |
| $("#rightIcon").val(''); | |
| } | |
| } | |
| function changeBorderColor(color){ | |
| if(color != ''){ | |
| $("#google_translate_element span").css("border-color", color); | |
| $("#google_translate_element div").eq(1).css("border-color", color); | |
| $("#borderColor").val(''); | |
| } | |
| } | |
| function changeBackgroundColor(color){ | |
| if(color != ''){ | |
| $("#google_translate_element div").eq(1).css("background-color", color); | |
| $("#backgroundColor").val(''); | |
| } | |
| } | |
| function changeTextColor(color){ | |
| if(color != ''){ | |
| $("#google_translate_element a").css("color", color); | |
| $("#textColor").val(''); | |
| } | |
| } | |
| function changeTextSize(size){ | |
| if(size != ''){ | |
| $("#google_translate_element a").css("font-size", size); | |
| $("#textSize").val(''); | |
| } | |
| } |