Skip to content

Instantly share code, notes, and snippets.

function collapse(){
$.myView.collapse();
// $.myView.expand();
}
var Validations = (function(){
var Validation = function() {
var name = $("[name='nome']");
var email = $("[name='email']");
var empresa = $("[name='empresa']");
var telefone = $("[name='telefone']");
var mensagem = $("[name='mensagem']");
var regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
function formatDuration (seconds) {
return [60, 3600, 86400, 31536000]
.reduceRight(function (results, current) {
var seconds = results.pop();
results.push(Math.floor(seconds / current));
results.push(seconds - results[results.length - 1] * current);
return results;
}, [seconds])
.map(function (value, index) {
var words = ['year', 'day', 'hour', 'minute', 'second'];
/*
* Metadata - jQuery plugin for parsing metadata from elements
*
* Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $
function getURLParameter(name) {
return decodeURIComponent(
(RegExp('[?|&]'+name + '=' + '(.+?)(&|$)').exec(location.search)||[null,null])[1]
);
}
function setURLParameter(name,value){
var search,
getParam = getURLParameter(name),
isParamInUrl = (getParam !== null && getParam !== "" && getParam !== "null" && (typeof getParam === "string" && getParam.length > 0));
/**
* Lucida Grande doesn't have italics, but is preferable for its small size awesomeness.
* Lucida Sans has lovely italics.
* Let's use @font-face to combine them
*/
body {
font-family:'Lucida Improved','Lucida Grande','Lucida Sans','Lucida Sans Unicode',Verdana,sans-serif;
}
@font-face {
font-family:'Lucida Improved';
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
/**
* Provides requestAnimationFrame in a cross browser way.
* @author paulirish / http://paulirish.com/
*/
if ( !window.requestAnimationFrame ) {
var pollFocus;
window.requestAnimationFrame = ( function() {
return window.webkitRequestAnimationFrame ||