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
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
| "http://www.w3.org/TR/html4/strict.dtd"> | |
| <html> | |
| <head> | |
| <title>CSS Challenge 1</title> | |
| </head> | |
| <body> | |
| <h1>Shakespeare's Sonnet #18</h1> | |
| <p> | |
| This is one of the most famous of the sonnets. It is referenced |
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
| <!DOCTYPE html> | |
| <html lang="pt" dir="ltr" class="client-nojs"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <script type="text/javascript" src="jquery-1.9.0.js"></script> | |
| <script type="text/javascript" src="ajax-com-jquery.js"></script> | |
| </head> | |
| <body> | |
| <div id="wrapper"> |
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
| //Já usamos window.onload várias vezes, talvez agora possamos usar | |
| //um recurso de jQuery para cumprir uma função parecida | |
| //farei um post explicando a diferença entre window.onload | |
| //e $(document).ready | |
| $(document).ready(function () { | |
| //estamos usando um dos grandes facilitadores do framework | |
| //a capacidade de selecionar elementos com seletores css | |
| //aqui seria a mesma coisa do que fazer document.getElementById... | |
| //No entanto, o retorno da chamada $('#button-ajax') é um 'objeto jQuery' |
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
| <html> | |
| <head> | |
| <link rel="stylesheet" type="text/css" href="style.css"> | |
| <script type="text/javascript" src="gradient-change.js"></script> | |
| </head> | |
| <body> | |
| <div id="wrapper"></div> | |
| </body> | |
| </html> |
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
| //Nosso clássico callback | |
| window.onload = function () { | |
| //A div 'wrapper' | |
| var div = document.getElementById('wrapper'); | |
| //o 'onclick' recebe um callback |
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
| function Player() { | |
| } | |
| Player.prototype.play = function(song) { | |
| this.currentlyPlayingSong = song; | |
| this.isPlaying = true; | |
| }; | |
| Player.prototype.pause = function() { | |
| this.isPlaying = false; | |
| }; |
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
| //Aqui vamos descrever o teste para Player | |
| describe("Player", function() { | |
| //criamos as variáveis player e song | |
| var player; | |
| var song; | |
| //beforeEach, como a tradução indica, cria um novo Player | |
| //e um novo Song antes de cada teste | |
| beforeEach(function() { | |
| player = new Player(); |
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
| <link rel="stylesheet" type="text/css" href="css/style.css"> | |
| <script type="text/javascript" src="js/jquery-1.9.0.js"></script> | |
| <script type="text/javascript" src="js/Form.js"></script> | |
| </head> | |
| <body> | |
| <!-- Poderíamos usar a tag form aqui, no entanto, |
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
| /*vamos especificar uma largura fixa para a div | |
| assim, quando definimos a margem com '40px auto' | |
| ela terá margem superior e inferior igual a 40px e | |
| será centralizada por causa do 'auto' | |
| Note que eu especifiquei somente dois 'números', | |
| porque dessa forma é entendido que a margem superior | |
| e inferior são iguais a 40 e a da esquerda e direita | |
| são 'auto' | |
| */ | |
| #main-form { |
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
| //Criamos um objeto Form | |
| var Form = function () { | |
| return { | |
| init: function () { | |
| //O método init deve ser nosso construtor | |
| //chamamos o método setEvents | |
| this.setEvents(); | |
| }, |