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
function html_decode(text){ | |
var div = document.createElement("div"); | |
div.innerHTML = text; | |
return ("textContent" in div) ? div.textContent : div.innerText ; | |
} | |
function html_encode(str){ | |
var div = document.createElement("div"); | |
div[("textContent" in div) ? "textContent" : "innerText"] = str; | |
return div.innerHTML; |
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
// the semi-colon before function invocation is a safety net against concatenated | |
// scripts and/or other plugins which may not be closed properly. | |
;(function ( $, window, undefined ) { | |
// undefined is used here as the undefined global variable in ECMAScript 3 is | |
// mutable (ie. it can be changed by someone else). undefined isn't really being | |
// passed in so we can ensure the value of it is truly undefined. In ES5, undefined | |
// can no longer be modified. | |
// window and document are passed through as local variables rather than globals |
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
/** | |
* === Scroller === | |
* Basta adicionar a classe "scroller" para algum elemento e atribuir o seletor ao atributo href ou data-target; | |
* Exemplos: | |
* <a href="#wrapper" class="scroller">Topo</a> | |
* <span class="scroller" data-target="#wrapper">Topo</span> | |
*/ | |
jQuery(document).ready(function(){ | |
var screen = $('html, window, body'), | |
regex = /.*(?=#[^\s]+$)/; //strip for ie7 |
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
//standalo ie9+ code | |
/** | |
* @param v Number Number to be formatted | |
* @param m String Milliar delimitter. Default: '.' (pt-br). | |
* @param d String Decimal delimitter. Default: ',' (pt-br). | |
* @return String Formatted number | |
*/ | |
function formatCurrency(v,m,d){ | |
var r = v.toFixed(2).split(/\.|-/), | |
m = m || '.', |
NewerOlder