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
var n = 10 | |
var C = function () { | |
this.s = function (a, b) { | |
return a + b | |
} | |
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
//Os eventos 'pageinit' e 'pagecreate' são chamados | |
//quando exibimos uma página pela primeira vez... | |
//vamos criar um objeto chamado app | |
var app = {}; | |
$(document).bind('pageinit', function (ev) { | |
//toda vez que chamarmos esse novo evento | |
//checaremos se a propriedade 'loaded' | |
//existe e é verdadeira. Caso contrário instanciamos |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Page Title</title> | |
<link rel="stylesheet" href="lib/jquery.mobile-1.3.0/jquery.mobile-1.3.0.css" /> | |
<script type="text/javascript" src="lib/jquery-1.8.3.js"></script> | |
<script type="text/javascript" src="lib/jquery.mobile-1.3.0/jquery.mobile-1.3.0.min.js"></script> | |
<script type="text/javascript" src="js/transition-test.js"></script> | |
</head> |
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
//aqui temos o json com dados que devemos exibir para o usuário | |
var employeesListByCompany = [ | |
{ | |
name: 'Death Star', | |
employees: [ | |
{ | |
name: 'Darth Vader', | |
email: 'lukesfather@deathstar.com' | |
}, |
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
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Teste COM Templates</title> | |
<style type="text/css"> | |
.employee-name { | |
list-style: none; | |
} | |
.employee-data { | |
list-style: none; |
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
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Teste SEM template</title> | |
<style type="text/css"> | |
.employees { | |
list-style: none; | |
} | |
.employee-data { | |
list-style: none; |
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
//Aqui temos o json que poderíamos receber do back-end | |
//uma lista de empresas que tem uma lista de funcionários | |
//que tem nome e email | |
var employeesListByCompany = [ | |
{ | |
name: 'Death Star', | |
employees: [ | |
{ | |
name: 'Darth Vader', | |
email: 'lukesfather@deathstar.com' |
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
describe('MatrizEspiral', function () { | |
it ('Deve retornar uma matriz espiral que incrementa no sentido horário', function () { | |
var response = [] | |
response[0] = [ 1, 2, 3]; | |
response[1] = [10, 11, 4]; | |
response[2] = [ 9, 12, 5]; | |
response[3] = [ 8, 7, 6]; | |
expect(MatrizEspiral(3, 4)).toEqual(response); |
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
describe('PrimeFactor', function () { | |
it ('Deve retornar um array com a decomposicao em fatores primos', function () { | |
expect(primeFactor(100)).toEqual([2, 2, 5, 5]); | |
expect(primeFactor(2)).toEqual([2]); | |
expect(primeFactor(12)).toEqual([2, 2, 3]); |
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
//Quando a página tiver sido carregada... | |
window.onload = function () { | |
//atribuímos um evento de click ao botão. | |
//Ao clicar, chamamos a função 'change' | |
$('#changeClass').on('click', function () { | |
change(); | |
}); |