From 78b274e31a226d30f08d7e7eee92ff9d6e88e574 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 21 Jan 2014 17:27:50 -0200 Subject: [PATCH 01/66] criando o README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a3ba7b0 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +javascript +========== + +javascript From c4ef1824c007dd346e0e22d792f1ba5a9cfd01ae Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 21 Jan 2014 17:57:12 -0200 Subject: [PATCH 02/66] create license.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Criando arquivo padrão --- LICENSE.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..9398e96 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1 @@ +1. para uso dos alunos da Targettrust From 8572d82530c5b4ddbe09ba33fa5a1ec027968cb3 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 21 Jan 2014 17:58:03 -0200 Subject: [PATCH 03/66] Create .gitignore Ok --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..079dec4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.class +*.pyc +*.pyo + + From de81e09103109c76ca34e4a5a19533963d79e1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Fri, 24 Jan 2014 09:41:01 -0200 Subject: [PATCH 04/66] Revert "Iniciando o projeto." This reverts commit cb379e0ba6513427d1b8b17b16c19df04a12978e. --- .gitignore | 215 ----------------------------------------------------- 1 file changed, 215 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b9d6bd9..0000000 --- a/.gitignore +++ /dev/null @@ -1,215 +0,0 @@ -################# -## Eclipse -################# - -*.pydevproject -.project -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# PDT-specific -.buildpath - - -################# -## Visual Studio -################# - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results - -[Dd]ebug/ -[Rr]elease/ -x64/ -build/ -[Bb]in/ -[Oo]bj/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.log -*.scc - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -.*crunch*.local.xml - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.Publish.xml -*.pubxml - -# NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ - -# Windows Azure Build Output -csx -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.[Pp]ublish.xml -*.pfx -*.publishsettings - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -App_Data/*.mdf -App_Data/*.ldf - -############# -## Windows detritus -############# - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Mac crap -.DS_Store - - -############# -## Python -############# - -*.py[co] - -# Packages -*.egg -*.egg-info -dist/ -build/ -eggs/ -parts/ -var/ -sdist/ -develop-eggs/ -.installed.cfg - -# Installer logs -pip-log.txt - -# Unit test / coverage reports -.coverage -.tox - -#Translations -*.mo - -#Mr Developer -.mr.developer.cfg From 4eaf67160f4630b136d6593aa44c6b21c3902de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Fri, 24 Jan 2014 09:41:11 -0200 Subject: [PATCH 05/66] fazendo um teste Testando --- testando.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 testando.txt diff --git a/testando.txt b/testando.txt new file mode 100644 index 0000000..e69de29 From 06ef869c08f9157f11749665c63c8dbd8fcb6c79 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 7 Feb 2014 08:43:25 -0200 Subject: [PATCH 06/66] Create incluir --- incluir | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 incluir diff --git a/incluir b/incluir new file mode 100644 index 0000000..f86c231 --- /dev/null +++ b/incluir @@ -0,0 +1,8 @@ +function incluir($arquivo){ + var script = document.createElement("script"); + script.src = $arquivo; + var head = document.getElementsByTagName("head").item(0) + head.appendChild(script); +} + +incluir("jquery-1.11.0.js"); From 1b6458338978960b825766ef42c352211004eba4 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 7 Feb 2014 12:00:36 -0200 Subject: [PATCH 07/66] Update incluir --- incluir | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/incluir b/incluir index f86c231..0d0e3cb 100644 --- a/incluir +++ b/incluir @@ -1,8 +1,35 @@ +// TargetTrust function incluir($arquivo){ - var script = document.createElement("script"); - script.src = $arquivo; - var head = document.getElementsByTagName("head").item(0) - head.appendChild(script); + + var divisao = $arquivo.split("."); + var ext = divisao[divisao.length-1]; + + switch(ext) { + case "js": + var elemento = document.createElement("script"); + elemento.src = $arquivo; + var head = document.getElementsByTagName("head").item(0) + head.appendChild(elemento); + break; + case "css": + var elemento = document.createElement("link"); + elemento.href = $arquivo; + elemento.rel = "stylesheet"; + var head = document.getElementsByTagName("head").item(0) + head.appendChild(elemento); + break; + + + default: + alert("extensao errada"); + break + + } + + + + } incluir("jquery-1.11.0.js"); +incluir("jquery-1.11.0.css"); From 0e27eb4fa9667cacb4140b2ac55764c8c6593682 Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 31 Mar 2014 18:59:05 -0300 Subject: [PATCH 08/66] Update incluir --- incluir | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/incluir b/incluir index 0d0e3cb..1747cb7 100644 --- a/incluir +++ b/incluir @@ -3,19 +3,18 @@ function incluir($arquivo){ var divisao = $arquivo.split("."); var ext = divisao[divisao.length-1]; - + var head = document.getElementsByTagName("head").item(0); + switch(ext) { case "js": var elemento = document.createElement("script"); elemento.src = $arquivo; - var head = document.getElementsByTagName("head").item(0) head.appendChild(elemento); break; case "css": var elemento = document.createElement("link"); elemento.href = $arquivo; elemento.rel = "stylesheet"; - var head = document.getElementsByTagName("head").item(0) head.appendChild(elemento); break; From fcafeffb987bb51b55ec3231c42ebc1fe32fbd7a Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 9 Jun 2014 15:26:07 -0300 Subject: [PATCH 09/66] GEB.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Criação de funções que simulam a funcionalidade dos Seletor de Jquery.. Porém o retorno nos permite usar funções nativas e construir acessar objetos de um pouco mais nativo. Selecionando um ID. geb("#teste") Selecionando o primeiro objeto através da Class geb(".teste")[0]; Selecionando o primeiro objeto através da Tag geb("div")[0]; As propriedades desse objeto pode ser acessado livremente.. [...].innerHTML += "AAAA"; [...].className += "AAAA"; [...].setAttribute("attribute","value"); --- geb.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 geb.js diff --git a/geb.js b/geb.js new file mode 100644 index 0000000..b234f93 --- /dev/null +++ b/geb.js @@ -0,0 +1,23 @@ +function getid(seletor) { + return document.getElementById(seletor); + } +function getclasse(seletor) { + return document.getElementsByClassName(seletor); + } +function gettag(seletor) { + return document.getElementsByTagName(seletor); + } + +function geb(seletor){ + var tipo = seletor.slice(0,1); + var name = seletor.slice(1,seletor.length); + console.log(name); + switch(tipo){ + case "#": + return getid(name); + case ".": + return getclasse(name); + default: + return gettag(seletor); + } +} From 580759643eafe43933c4ca8306e3b046e00f3a1b Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 28 Jul 2014 09:47:28 -0300 Subject: [PATCH 10/66] =?UTF-8?q?Coment=C3=A1rios=20e=20descri=C3=A7=C3=A3?= =?UTF-8?q?o=20da=20fun=C3=A7=C3=A3o!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- geb.js | 77 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 20 deletions(-) diff --git a/geb.js b/geb.js index b234f93..73a17fd 100644 --- a/geb.js +++ b/geb.js @@ -1,23 +1,60 @@ -function getid(seletor) { - return document.getElementById(seletor); - } +/** + * gettag + * @description retorna um objeto Array de Classes (XPTO) + * + * @seletor {string} ID de um objeto + */ + function getid(seletor) { + return document.getElementById(seletor); +} +/** + * gettag + * @description retorna um objeto Array de Classes (XPTO) + * + * @seletor {string} Classe dos objetos + */ function getclasse(seletor) { - return document.getElementsByClassName(seletor); - } + return document.getElementsByClassName(seletor); + //Desenvolver: condicional para o IE. +} +/** + * gettag + * @description retorna um objeto Arrayde tags (XPTO) + * + * @seletor {string} TagName dos objetos + */ function gettag(seletor) { - return document.getElementsByTagName(seletor); - } - -function geb(seletor){ - var tipo = seletor.slice(0,1); - var name = seletor.slice(1,seletor.length); - console.log(name); - switch(tipo){ - case "#": - return getid(name); - case ".": - return getclasse(name); - default: - return gettag(seletor); - } + return document.getElementsByTagName(seletor); } +/** + * Geb + * @description pega um objeto e retorna o mesmo + * + * @seletor {string} insira um seletor CSS + */ +function geb(seletor) { + var tipo = seletor.slice(0, 1); + var name = seletor.slice(1, seletor.length); + console.log(name); + switch (tipo) { + case "#": + return getid(name); + case ".": + return getclasse(name); + default: + return gettag(seletor); + } +} + +/* + * Evento onLoad para a pagina . ou seja assim que for carregad0 + * todo o conteudo da pagina, os eventos são executados. + * isto faz com que evite que eu chame funções ou metodos antes + * dos elementos de marcação estejam na pagina. + */ +window.onload = function() { + geb("#teste").innerHTML += "dasdsad"; + geb(".teste")[0].innerHTML += "AAAA"; + geb("div")[0].innerHTML += "BBBB"; +}; + From 7904ba3eed8b27aabc4ea8307aefa170e2a2cb5d Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 28 Jul 2014 09:52:50 -0300 Subject: [PATCH 11/66] Geb minify MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Versão compressa --- geb.min.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 geb.min.js diff --git a/geb.min.js b/geb.min.js new file mode 100644 index 0000000..78b3f98 --- /dev/null +++ b/geb.min.js @@ -0,0 +1 @@ +var gebD=document;function getid(a){return gebD.getElementById(a)}function getclasse(a){return gebD.getElementsByClassName(a)}function gettag(a){return gebD.getElementsByTagName(a)}function geb(c){var b=c.slice(0,1);var a=c.slice(1,c.length);console.log(a);switch(b){case"#":return getid(a);case".":return getclasse(a);default:return gettag(c)}}; From a87f345cc2a797a449e5a7e26ca918c59927512c Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 28 Jul 2014 10:22:57 -0300 Subject: [PATCH 12/66] Abreviando... --- geb.js | 78 ++++++++++++++++++---------------------------------------- 1 file changed, 24 insertions(+), 54 deletions(-) diff --git a/geb.js b/geb.js index 73a17fd..eb83dcb 100644 --- a/geb.js +++ b/geb.js @@ -1,60 +1,30 @@ -/** - * gettag - * @description retorna um objeto Array de Classes (XPTO) - * - * @seletor {string} ID de um objeto - */ - function getid(seletor) { - return document.getElementById(seletor); -} -/** - * gettag - * @description retorna um objeto Array de Classes (XPTO) - * - * @seletor {string} Classe dos objetos - */ -function getclasse(seletor) { - return document.getElementsByClassName(seletor); - //Desenvolver: condicional para o IE. -} -/** - * gettag - * @description retorna um objeto Arrayde tags (XPTO) - * - * @seletor {string} TagName dos objetos - */ -function gettag(seletor) { - return document.getElementsByTagName(seletor); -} /** * Geb * @description pega um objeto e retorna o mesmo * - * @seletor {string} insira um seletor CSS + * @param seletorFull {string} insira um seletor CSS + * @example + * // Evento onLoad para a pagina . ou seja assim que for carregad0 + // todo o conteudo da pagina, os eventos são executados. + // isto faz com que evite que eu chame funções ou metodos antes + // dos elementos de marcação estejam na pagina. + window.onload = function() { + geb("#teste").innerHTML += "dasdsad"; + geb(".teste")[0].innerHTML += "AAAA"; + geb("div")[0].innerHTML += "BBBB"; + }; + * */ -function geb(seletor) { - var tipo = seletor.slice(0, 1); - var name = seletor.slice(1, seletor.length); - console.log(name); - switch (tipo) { - case "#": - return getid(name); - case ".": - return getclasse(name); - default: - return gettag(seletor); - } +function geb(seletorFull) { + var tipo = seletorFull.slice(0, 1), + name = seletorFull.slice(1, seletorFull.length), + Doc = document; + switch (tipo) { + case "#": + return Doc.getElementById(name); + case ".": + return Doc.getElementsByClassName(name); + default: + return Doc.getElementsByTagName(seletorFull); + } } - -/* - * Evento onLoad para a pagina . ou seja assim que for carregad0 - * todo o conteudo da pagina, os eventos são executados. - * isto faz com que evite que eu chame funções ou metodos antes - * dos elementos de marcação estejam na pagina. - */ -window.onload = function() { - geb("#teste").innerHTML += "dasdsad"; - geb(".teste")[0].innerHTML += "AAAA"; - geb("div")[0].innerHTML += "BBBB"; -}; - From c4e5c48211d6111f8afbb1912ef632567d121bd4 Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 28 Jul 2014 10:23:40 -0300 Subject: [PATCH 13/66] Abreviando ... simplificando ainda mais! --- geb.min.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geb.min.js b/geb.min.js index 78b3f98..60aa888 100644 --- a/geb.min.js +++ b/geb.min.js @@ -1 +1,3 @@ -var gebD=document;function getid(a){return gebD.getElementById(a)}function getclasse(a){return gebD.getElementsByClassName(a)}function gettag(a){return gebD.getElementsByTagName(a)}function geb(c){var b=c.slice(0,1);var a=c.slice(1,c.length);console.log(a);switch(b){case"#":return getid(a);case".":return getclasse(a);default:return gettag(c)}}; +function geb(d){var c=d.slice(0,1),a=d.slice(1,d.length),b=document;switch(c){case"#":return b.getElementById(a);case".":return b.getElementsByClassName(a);default:return b.getElementsByTagName(d)}}; +/*Size: 946->199Bytes + Saved 78.96406%*/ From 1e14fa06d6ab454463d81a2118fdb5c1034b0718 Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 28 Jul 2014 10:56:48 -0300 Subject: [PATCH 14/66] =?UTF-8?q?N=C3=83O=20TESTEI...=20para=20IE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit COmo o iéH não suporta o getClassName... coloquei uma codicional que verifica o user agent do navegador.. e utiliza o querySelector.. que por usa vez é mais lento que o ClassName .. teste feito no jsPERF: http://jsperf.com/queryselectorall-vs-getelementsbyclassname-multiple-cla/3 --- geb.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/geb.js b/geb.js index eb83dcb..38a5838 100644 --- a/geb.js +++ b/geb.js @@ -23,7 +23,13 @@ function geb(seletorFull) { case "#": return Doc.getElementById(name); case ".": - return Doc.getElementsByClassName(name); + if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { + return Doc.querySelectorAll(seletorFull); + }else{ + return Doc.getElementsByClassName(name); + } + + default: return Doc.getElementsByTagName(seletorFull); } From efb7e34089602cac630de9d52d5f83d285258a8e Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 28 Jul 2014 11:00:55 -0300 Subject: [PATCH 15/66] =?UTF-8?q?COMPATIBILIDADE=20com=20i=C3=A9H=208+?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Devido o IÉh não identificar os Get...ClassName.. foi posto uma condicional para isto! --- geb.min.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geb.min.js b/geb.min.js index 60aa888..21044db 100644 --- a/geb.min.js +++ b/geb.min.js @@ -1,3 +1,3 @@ -function geb(d){var c=d.slice(0,1),a=d.slice(1,d.length),b=document;switch(c){case"#":return b.getElementById(a);case".":return b.getElementsByClassName(a);default:return b.getElementsByTagName(d)}}; -/*Size: 946->199Bytes - Saved 78.96406%*/ +function geb(d){var c=d.slice(0,1),a=d.slice(1,d.length),b=document;switch(c){case"#":return b.getElementById(a);case".":if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){return b.querySelectorAll(d)}else{return b.getElementsByClassName(a)}default:return b.getElementsByTagName(d)}}; +/*Size: 1116->282Bytes + Saved 74.731186%*/ From 0239e13c58aef3cc0a440363dafb55cd37fd3b42 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 20 Aug 2014 17:37:19 -0300 Subject: [PATCH 16/66] Create notification.html --- notification.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 notification.html diff --git a/notification.html b/notification.html new file mode 100644 index 0000000..38b4a2e --- /dev/null +++ b/notification.html @@ -0,0 +1,30 @@ + + + + + + + + + Web Notifications API + + + + + + +

Web Notifications

+
+ + + + + + +
+ +
+
+ + + From 6b6de6a95ab9a3009545c351c0ead4c476223812 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 20 Aug 2014 17:40:51 -0300 Subject: [PATCH 17/66] Create notification.js --- notification.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 notification.js diff --git a/notification.js b/notification.js new file mode 100644 index 0000000..7139672 --- /dev/null +++ b/notification.js @@ -0,0 +1,47 @@ + +function notificacoes(timerAuto){ + // verificando se o navegador tem suporte a API + if (!('Notification' in window)) { + document.getElementById('bt_abrir').setAttribute('disabled', 'disabled'); + document.getElementById('custom-notificacao').innerHTML = "SEM SUPORTE"; + } else { + + var tituloNotificacao, optionsNotificacao, cont = 0; + + function notificar(event) { + //titulo da notificação + cont++; + tituloNotificacao = document.getElementById('tituloNotificacao').value; + //Corpo, tag, icon... da notificação + optionsNotificacao = { + body: document.getElementById('body').value + "\n " + cont + "º vez mostrado", + tag: "custom", + // ICONE DA APLICACAO + icon: "http://www.seprorgs.org.br/upload/site_associese/138_g.jpg" + + } + //Verificando se temos permissão para mostrar a mensagem + Notification.requestPermission(function() { + //criando a mensagem + var notificacao = new Notification(tituloNotificacao, optionsNotificacao); + // mostrando a mensagem + notificacao.onshow; + }); + // evita qualquer tipo de retorno da função + return false; + } + } + // Forçar para amostrar a mensagem + document.getElementById('bt_abrir').onclick = notificar; + // timer para em tempo em tempo mostrar a mensagem mesmo com onavegador minimizado + // caso o tempo não seja especificado ele não aparece + if(!!timerAuto)setInterval(notificar, timerAuto); + + } + + + + window.onload = function(){ + // verifica suporte ao comando + notificacoes(5000); + } From 2fdf6f7645c45ae36e7b935498355e945630c50e Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 20 Aug 2014 17:41:39 -0300 Subject: [PATCH 18/66] Create notification.css --- notification.css | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 notification.css diff --git a/notification.css b/notification.css new file mode 100644 index 0000000..ae5506c --- /dev/null +++ b/notification.css @@ -0,0 +1,60 @@ + *{ + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + font-family: "Tahoma", Verdana, Arial; + line-height: 161%; + } + + .mensagem_suporte + { + display: block; + } + + + #custom-notificacao + { + max-width: 350px; + padding: 20px; + background: rgba(227, 224, 224, 1); + border-radius: 5px; + width:100%; + + } + + label + { + display: block; + font-size: 11px; + } + + input[name="tituloNotificacao"], textarea + { + width: 100%; + margin-bottom: 15px; + font-size: 11px; + color: rgba(120, 120, 120, 1); + padding: 5px; + } + + input[name="tituloNotificacao"] { + height: 2em; + } + + textarea + { + height: 5em; + } + + .buttons + { + text-align: center; + } + + .bt_padrao { + padding: 0.5em; + width: 100%; + border: 1px solid rgba(161, 161, 161, 1); + border-radius: 3px; + color: #999; + } From 5ee41d3eec32c6f5d2562145411f07ee3f517684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Tue, 16 Sep 2014 19:49:54 -0300 Subject: [PATCH 19/66] Organizando arquivos --- LICENSE.md | 1 - notification.css => notification/notification.css | 0 notification.html => notification/notification.html | 0 notification.js => notification/notification.js | 0 testando.txt | 0 5 files changed, 1 deletion(-) delete mode 100644 LICENSE.md rename notification.css => notification/notification.css (100%) rename notification.html => notification/notification.html (100%) rename notification.js => notification/notification.js (100%) delete mode 100644 testando.txt diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 9398e96..0000000 --- a/LICENSE.md +++ /dev/null @@ -1 +0,0 @@ -1. para uso dos alunos da Targettrust diff --git a/notification.css b/notification/notification.css similarity index 100% rename from notification.css rename to notification/notification.css diff --git a/notification.html b/notification/notification.html similarity index 100% rename from notification.html rename to notification/notification.html diff --git a/notification.js b/notification/notification.js similarity index 100% rename from notification.js rename to notification/notification.js diff --git a/testando.txt b/testando.txt deleted file mode 100644 index e69de29..0000000 From 887ab87410c4aed8cad56ade8d0a64aafc75e461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Tue, 16 Sep 2014 19:50:20 -0300 Subject: [PATCH 20/66] =?UTF-8?q?arrumando=20extens=C3=A3o=20do=20arquivo?= =?UTF-8?q?=20Incluir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- incluir => incluir.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename incluir => incluir.js (100%) diff --git a/incluir b/incluir.js similarity index 100% rename from incluir rename to incluir.js From edf6f53fe359f6a38248f4f8e3247552f4a29c31 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 23 Sep 2014 09:25:22 -0300 Subject: [PATCH 21/66] Update geb.js Colocando o link de test de performace do GEB comparando com Jquery e Nativo --- geb.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/geb.js b/geb.js index 38a5838..4cd7963 100644 --- a/geb.js +++ b/geb.js @@ -13,6 +13,9 @@ geb(".teste")[0].innerHTML += "AAAA"; geb("div")[0].innerHTML += "BBBB"; }; + + Teste de performace: + http://jsperf.com/jquery-vs-native-dom-selectores/2 * */ function geb(seletorFull) { From 0b84186075f75ef73ec5056164016c66f26afee0 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 23 Sep 2014 11:05:55 -0300 Subject: [PATCH 22/66] Update geb.js --- geb.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/geb.js b/geb.js index 4cd7963..d027a9e 100644 --- a/geb.js +++ b/geb.js @@ -26,13 +26,7 @@ function geb(seletorFull) { case "#": return Doc.getElementById(name); case ".": - if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { - return Doc.querySelectorAll(seletorFull); - }else{ - return Doc.getElementsByClassName(name); - } - - + return Doc.querySelectorAll(seletorFull); default: return Doc.getElementsByTagName(seletorFull); } From 1b66839df1223cce2d858dfc99ad267727a69ddf Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 6 Oct 2014 12:18:29 -0300 Subject: [PATCH 23/66] Update incluir.js --- incluir.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/incluir.js b/incluir.js index 1747cb7..2aac754 100644 --- a/incluir.js +++ b/incluir.js @@ -1,10 +1,7 @@ -// TargetTrust function incluir($arquivo){ - var divisao = $arquivo.split("."); var ext = divisao[divisao.length-1]; var head = document.getElementsByTagName("head").item(0); - switch(ext) { case "js": var elemento = document.createElement("script"); @@ -24,10 +21,6 @@ function incluir($arquivo){ break } - - - - } incluir("jquery-1.11.0.js"); From 4341b35aa1454119bcb30174d30c7952749bd643 Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 22 Dec 2014 20:21:10 -0200 Subject: [PATCH 24/66] Create myjavascript.js --- myjavascript.js | 127 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 myjavascript.js diff --git a/myjavascript.js b/myjavascript.js new file mode 100644 index 0000000..5457ceb --- /dev/null +++ b/myjavascript.js @@ -0,0 +1,127 @@ +//Meu javascript +/* +var nome = "Arno", + telefone = 99079060, + email = "arno@advg.com.br"; + +var mensagem = "Nome "+nome; + mensagem += "\nTelefone "+telefone; + mensagem += "\nE-mail "+ email; + + +var alunos = [ + ['Arno',99079060], + ['Ricardo',234], + ['Diego',343462], + ['Dias',2345345], + ['Guilherme',345134], + ['Francis',3425345] +]; + +// .... + +var alunos = [ + { + "nome" : "Zezinho", + "idade" : 18, + "matricula" : true, + "falar" : function(){ + alert(this.idade); + } + }, + { + "nome" : "Huguinho", + "idade" : 18, + "matricula" : false, + "falar" : function(){ + alert(this.idade); + } + } +]; +console.log(alunos); + + +*/ + +// funções +/** + * [somar description] + * @param {[type]} + * @param {[type]} + * @return {[type]} + */ + +var alunosObjeto = [ + { + "nome" : "Zezinho", + "idade" : 18, + "matricula" : true, + "falar" : function(){ + alert(this.idade); + } + }, + { + "nome" : "Huguinho", + "idade" : 18, + "matricula" : false, + "falar" : function(){ + alert(this.idade); + } + } +]; +function somar(parametroA, parametroB){ + var resultado = parametroB + parametroA; + console.log(typeof(resultado)); + return resultado; +} +function subtrair(parametroA, parametroB){ + var resultado = parametroB - parametroA; + return resultado; +} +function multiplicar(parametroA, parametroB){ + var resultado = parametroB * parametroA; + return resultado; +} +function dividir(parametroA, parametroB){ + var resultado = parametroB / parametroA; + return resultado; +} + + +window.onload = function(){ + // manipular DOM + 8 + + var alunos = [ + + 'Ricardo', + 'Diego', + 'Arno', + 'Dias', + 'Guilherme', + 'Francis' + ]; + + var lista = document.getElementById('listadealunos'); + + + + for(i in alunos){ + if ( alunos[i] == "Arno") { + lista.innerHTML += "
  • " + alunos[i] + " - A mAgia
  • "; + }else{ + lista.innerHTML += "
  • " + alunos[i] + "
  • "; + }; + } +*/ + + var campoTexto = document.getElementById('campoTexto'); + campoTexto.onchange = function(){ + console.log(this.value); + lista.innerHTML += "
  • " + this.value + "
  • "; + this.value = ""; + } + + + +} From 143305beb6db43760b55a735639bcef15248917b Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 22 Dec 2014 20:21:33 -0200 Subject: [PATCH 25/66] Create myhtml.html --- myhtml.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 myhtml.html diff --git a/myhtml.html b/myhtml.html new file mode 100644 index 0000000..6406615 --- /dev/null +++ b/myhtml.html @@ -0,0 +1,19 @@ + + + + + Base + + + + + + +
      + +
    + + + + + From a7bdaa7396bc3045c9256010ef564a16bfa39555 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 23 Dec 2014 19:11:08 -0200 Subject: [PATCH 26/66] atualizando o arquivo para os alunos! --- myjavascript.js | 135 ++++++++---------------------------------------- 1 file changed, 21 insertions(+), 114 deletions(-) diff --git a/myjavascript.js b/myjavascript.js index 5457ceb..cce013c 100644 --- a/myjavascript.js +++ b/myjavascript.js @@ -1,127 +1,34 @@ -//Meu javascript -/* -var nome = "Arno", - telefone = 99079060, - email = "arno@advg.com.br"; +// -var mensagem = "Nome "+nome; - mensagem += "\nTelefone "+telefone; - mensagem += "\nE-mail "+ email; +function ativarDiv(elemento){ + elemento.addEventListener("click", function(){ + var conteudo = this.innerHTML; + var h1 = document.createElement("h1"); + h1.innerHTML = conteudo; - -var alunos = [ - ['Arno',99079060], - ['Ricardo',234], - ['Diego',343462], - ['Dias',2345345], - ['Guilherme',345134], - ['Francis',3425345] -]; - -// .... - -var alunos = [ - { - "nome" : "Zezinho", - "idade" : 18, - "matricula" : true, - "falar" : function(){ - alert(this.idade); - } - }, - { - "nome" : "Huguinho", - "idade" : 18, - "matricula" : false, - "falar" : function(){ - alert(this.idade); - } - } -]; -console.log(alunos); - - -*/ - -// funções -/** - * [somar description] - * @param {[type]} - * @param {[type]} - * @return {[type]} - */ - -var alunosObjeto = [ - { - "nome" : "Zezinho", - "idade" : 18, - "matricula" : true, - "falar" : function(){ - alert(this.idade); - } - }, - { - "nome" : "Huguinho", - "idade" : 18, - "matricula" : false, - "falar" : function(){ - alert(this.idade); - } - } -]; -function somar(parametroA, parametroB){ - var resultado = parametroB + parametroA; - console.log(typeof(resultado)); - return resultado; -} -function subtrair(parametroA, parametroB){ - var resultado = parametroB - parametroA; - return resultado; -} -function multiplicar(parametroA, parametroB){ - var resultado = parametroB * parametroA; - return resultado; -} -function dividir(parametroA, parametroB){ - var resultado = parametroB / parametroA; - return resultado; + this.parentNode.insertBefore(h1,this); + this.parentNode.removeChild(this); + }); } -window.onload = function(){ - // manipular DOM - 8 - - var alunos = [ - - 'Ricardo', - 'Diego', - 'Arno', - 'Dias', - 'Guilherme', - 'Francis' - ]; - - var lista = document.getElementById('listadealunos'); - +window.onload=function(){ + var divs = document.getElementsByTagName('div'); + //divs[0].innerHTML = "TEstando"; + divs[0].id = "TEstando"; + divs[0].className = "TEstando"; - for(i in alunos){ - if ( alunos[i] == "Arno") { - lista.innerHTML += "
  • " + alunos[i] + " - A mAgia
  • "; - }else{ - lista.innerHTML += "
  • " + alunos[i] + "
  • "; - }; + for(x in divs){ + ativarDiv(divs[x]); } -*/ - var campoTexto = document.getElementById('campoTexto'); - campoTexto.onchange = function(){ - console.log(this.value); - lista.innerHTML += "
  • " + this.value + "
  • "; - this.value = ""; - } + document.getElementsByClassName('addTelefone')[0].addEventListener("click", function(){ + var input = document.createElement("input"); + input.type = 'number' + this.parentNode.insertBefore(input,this); + }); } From be035ebd4890891194008d07a7016fbe2dfbf65c Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 23 Dec 2014 21:52:28 -0200 Subject: [PATCH 27/66] =?UTF-8?q?Orienta=C3=A7=C3=B5es=20por=20evento!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- myjavascript.js | 72 ++++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/myjavascript.js b/myjavascript.js index cce013c..86f10ed 100644 --- a/myjavascript.js +++ b/myjavascript.js @@ -1,34 +1,40 @@ -// - -function ativarDiv(elemento){ - elemento.addEventListener("click", function(){ - var conteudo = this.innerHTML; - var h1 = document.createElement("h1"); - h1.innerHTML = conteudo; - - this.parentNode.insertBefore(h1,this); - this.parentNode.removeChild(this); - }); -} - - -window.onload=function(){ - - var divs = document.getElementsByTagName('div'); - //divs[0].innerHTML = "TEstando"; - divs[0].id = "TEstando"; - divs[0].className = "TEstando"; - - for(x in divs){ - ativarDiv(divs[x]); - } - - document.getElementsByClassName('addTelefone')[0].addEventListener("click", function(){ - var input = document.createElement("input"); - input.type = 'number' - this.parentNode.insertBefore(input,this); - - }); - - + +var resultado = new Number(); +/** + * [calcular description] + * @return {[type]} [description] + */ +function calcular(){ + var v1 = new Number(document.getElementsByClassName("valor")[0].value); + var v2 = new Number(document.getElementsByClassName("valor")[1].value); + resultado = somar(v1, v2); +} +/** + * [somar description] + * @param {[type]} numeroA [description] + * @param {[type]} numeroB [description] + * @return {[type]} [description] + */ +function somar(numeroA, numeroB){ + var retorno = numeroA + numeroB; + return retorno; } +/** + * [imprimir description] + * @return {[type]} [description] + */ +function imprimir(){ + document.getElementById("resultado").innerHTML = resultado; +} +/** + * [onload description] + * @return {[type]} [description] + */ +window.onload = function(){ + document.getElementById('calcular').addEventListener("click", function(){ + calcular(); + imprimir(); + }); +} + +// From 224c282ef7815397ac25716b6146300e51d7d3f1 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 23 Dec 2014 21:53:01 -0200 Subject: [PATCH 28/66] Update myhtml.html --- myhtml.html | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/myhtml.html b/myhtml.html index 6406615..0b6b542 100644 --- a/myhtml.html +++ b/myhtml.html @@ -1,19 +1,21 @@ - - - - Base - - - - - + + + Base + + + + + -
      + + -
    - - + + +
    - + From e359b1dd70fa69b3ad2c90e78c4482882e01dbce Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 24 Dec 2014 10:11:26 -0200 Subject: [PATCH 29/66] Update geb.js --- geb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geb.js b/geb.js index d027a9e..d0e0d9a 100644 --- a/geb.js +++ b/geb.js @@ -15,7 +15,7 @@ }; Teste de performace: - http://jsperf.com/jquery-vs-native-dom-selectores/2 + http://jsperf.com/jquery-vs-native-dom-selectores/4 * */ function geb(seletorFull) { From d9cb6dfbb59dc44915632d2cb2150efb5db81f65 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 30 Dec 2014 09:52:21 -0200 Subject: [PATCH 30/66] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a3ba7b0..4da5f16 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ -javascript +####javascript ========== +###passando para frente + +Esse repositório tem como finalidade compartilhar codigos que são discutidos e criados para/com os alunos. + -javascript From a13e9917a0e4a19387deb5f6a4b5ed63bfced786 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 30 Dec 2014 09:52:35 -0200 Subject: [PATCH 31/66] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4da5f16..e9061ea 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -####javascript +##javascript ========== -###passando para frente +####passando para frente Esse repositório tem como finalidade compartilhar codigos que são discutidos e criados para/com os alunos. From 439c4496c6be4e69704e00060a66fc93a96b17ac Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 30 Dec 2014 09:52:52 -0200 Subject: [PATCH 32/66] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e9061ea..3c32873 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ ##javascript -========== ####passando para frente Esse repositório tem como finalidade compartilhar codigos que são discutidos e criados para/com os alunos. From 46b0e3ec8e8a65fdf84d3efdfd6f2fd8db52f62f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Tue, 30 Dec 2014 13:24:50 -0200 Subject: [PATCH 33/66] Atualizando pasta de Javascript com novos recursos --- calc-pattern/calculador.css | 34 +++++++++++++++ calc-pattern/calculador.js | 79 ++++++++++++++++++++++++++++++++++ calc-pattern/calculador.min.js | 1 + calc-pattern/calculadora.html | 15 +++++++ myhtml.html => etc/myhtml.html | 3 +- etc/myjavascript.js | 46 ++++++++++++++++++++ etc/object.js | 10 +++++ geb.js => geb/geb.js | 0 geb.min.js => geb/geb.min.js | 0 incluir.js | 21 +++++---- myjavascript.js | 40 ----------------- 11 files changed, 200 insertions(+), 49 deletions(-) create mode 100644 calc-pattern/calculador.css create mode 100644 calc-pattern/calculador.js create mode 100644 calc-pattern/calculador.min.js create mode 100644 calc-pattern/calculadora.html rename myhtml.html => etc/myhtml.html (70%) create mode 100644 etc/myjavascript.js create mode 100644 etc/object.js rename geb.js => geb/geb.js (100%) rename geb.min.js => geb/geb.min.js (100%) delete mode 100644 myjavascript.js diff --git a/calc-pattern/calculador.css b/calc-pattern/calculador.css new file mode 100644 index 0000000..abc54b6 --- /dev/null +++ b/calc-pattern/calculador.css @@ -0,0 +1,34 @@ +@charset "utf-8"; + +/* CSS Document */ +body{ + font-family:Tahoma, Geneva, sans-serif; + font-size: 13px; +} + +#visor { + padding: 10px; + border: 1px solid #eee; + color: #cecece; + margin: 3px; +} + + +li { + padding: 1%; + list-style-type: none; + background: #cecece; + width: 28%; + height: 30px; + text-align: center; + margin: 1px; + position: relative; + float: left; +} +li:hover { + opacity:0.7; +} + +#numeros li{ + background:#DEE8EF; +} \ No newline at end of file diff --git a/calc-pattern/calculador.js b/calc-pattern/calculador.js new file mode 100644 index 0000000..5e0b5ab --- /dev/null +++ b/calc-pattern/calculador.js @@ -0,0 +1,79 @@ +// JavaScript Document +// REVISAR... +// MELHORAR... +// COMENTAR... +/* + */ +(function(){ + window.onload = function(){ + var calculadora = new ObjetoCalculadora('calculadora'); + //Criando o visor + calculadora.criandoVisor(); + //Criando os Numeros + calculadora.criarBtsNumeros(10); + //Criando os Operadores + calculadora.criarBtsOperadores("+","-","*","/","="); + //Ativando os numeros abaixo + calculadora.ativarBotoes (); + } + + /** + * Objeto Calculadora com os demais metodos predefinidos + * @param {[String]} target [Id do Elemento DOM que irá receber a calculadora] + * + * @method criandoVisor + * @method criarBtsNumeros + * @method criarBtsOperadores + * @method ativarBotoes + * + */ + var ObjetoCalculadora = function(target){ + var acumulador = ""; + var calc = document.getElementById(target); + + //criando o visor + this.criandoVisor = function(){ + var visor = document.createElement("div"); + visor.id = "visor"; + visor.innerHTML = 'Calculadora inteligente'; + calc.appendChild(visor); + } + + // Função que irá criar os Bt Numerico + this.criarBtsNumeros = function($qN) { + /* + var qTag = document.createElement('ul'); + var qName = document.createAttribute('id'); + qTag.setAttribute('id','numeros'); + document.getElementById("calculadora").appendChild(qTag); + */ + // criando a TAG + calc.innerHTML += '
      '; + //var uL = document.getElementsByTagName('ul'); + // + for (i=0 ; i < $qN; i++) { + calc.getElementsByTagName("ul").item(0).innerHTML += '
    • ' + i + '
    • '; + } + }; + + // Função que irá criar os Bt de Operação + this.criarBtsOperadores = function () { + calc.innerHTML += '
        '; + for (i=0 ; i < arguments.length ; i++) { + calc.getElementsByTagName("ul").item(1).innerHTML += '
      • ' + arguments[i] + '
      • '; + } + + } + + this.ativarBotoes = function(){ + for (i=0 ; i < 10; i++){ + document.getElementsByTagName("li").item(i).onclick= function(){ + acumulador = acumulador + this.innerHTML; + document.getElementById("visor").innerHTML = acumulador ; + } + } + } + }; + + +})() diff --git a/calc-pattern/calculador.min.js b/calc-pattern/calculador.min.js new file mode 100644 index 0000000..df6a07b --- /dev/null +++ b/calc-pattern/calculador.min.js @@ -0,0 +1 @@ +(function(){window.onload=function(){var t=new e("calculadora");t.criarBtsNumeros(10);t.criarBtsOperadores("+","-","*","/","=");t.ativarBotoes()};var e=function(e){var t="";var n=document.getElementById(e);this.criandoVisor=function(){var e=document.createElement("div");e.id="visor";e.innerHTML="Calculadora inteligente";n.appendChild(e)};this.criarBtsNumeros=function(e){n.innerHTML+='
          ';for(i=0;i'+i+""}};this.criarBtsOperadores=function(){n.innerHTML+='
            ';for(i=0;i'+arguments[i]+""}};this.ativarBotoes=function(){for(i=0;i<10;i++){document.getElementsByTagName("li").item(i).onclick=function(){t=t+this.innerHTML;document.getElementById("visor").innerHTML=t}}}}})(); \ No newline at end of file diff --git a/calc-pattern/calculadora.html b/calc-pattern/calculadora.html new file mode 100644 index 0000000..7ec5939 --- /dev/null +++ b/calc-pattern/calculadora.html @@ -0,0 +1,15 @@ + + + + + Calculadora + + + + + + + +
            + + diff --git a/myhtml.html b/etc/myhtml.html similarity index 70% rename from myhtml.html rename to etc/myhtml.html index 0b6b542..97b5d1f 100644 --- a/myhtml.html +++ b/etc/myhtml.html @@ -2,7 +2,8 @@ Base - + + diff --git a/etc/myjavascript.js b/etc/myjavascript.js new file mode 100644 index 0000000..516f002 --- /dev/null +++ b/etc/myjavascript.js @@ -0,0 +1,46 @@ +//Criando a var Carlos para instanciar um objeto +var carlos = new pessoa(); +// Benchmark: http://jsperf.com/targettrust/5 +/* + 406,475 + ±1.60% + fastest + */ +carlos.falar("legal"); +carlos.ouvir("O que?!"); +carlos.falar("legal"); +carlos.ouvir("O que?!"); + + +/** + 390,474 + ±2.67% + 5% slower + */ +(function(carlos) { + carlos.falar("legal"); + carlos.ouvir("O que?!"); + carlos.falar("legal"); + carlos.ouvir("O que?!"); +})(carlos); + + +/* + 383,892 + ±2.68% + 7% slower + */ +(function(carlos) { + carlos.falar("legal"); +})(carlos); +(function(carlos) { + carlos.ouvir("O que?!"); +})(carlos); +(function(carlos) { + carlos.falar("legal"); +})(carlos); +(function(carlos) { + carlos.ouvir("O que?!"); +})(carlos); + + diff --git a/etc/object.js b/etc/object.js new file mode 100644 index 0000000..d7775b8 --- /dev/null +++ b/etc/object.js @@ -0,0 +1,10 @@ +var pessoa = function() { + this.nome = 'Arno'; + this.idade = 30; + this.falar = function(parametro) { + window.alert(parametro); + } + this.ouvir= function(parametro) { + return window.prompt(parametro); + } +}; \ No newline at end of file diff --git a/geb.js b/geb/geb.js similarity index 100% rename from geb.js rename to geb/geb.js diff --git a/geb.min.js b/geb/geb.min.js similarity index 100% rename from geb.min.js rename to geb/geb.min.js diff --git a/incluir.js b/incluir.js index 2aac754..236f1cb 100644 --- a/incluir.js +++ b/incluir.js @@ -1,3 +1,10 @@ +/** + * Manipulando a DOM () + * + * @param {String} $arquivo [Nome do Arquivo que deseja incluir] + * @return {Bollean} false + */ + function incluir($arquivo){ var divisao = $arquivo.split("."); var ext = divisao[divisao.length-1]; @@ -13,15 +20,13 @@ function incluir($arquivo){ elemento.href = $arquivo; elemento.rel = "stylesheet"; head.appendChild(elemento); - break; - - + break; default: - alert("extensao errada"); + alert("extensão errada"); break - - } + }; + return false; } -incluir("jquery-1.11.0.js"); -incluir("jquery-1.11.0.css"); +incluir("myjavascript.js"); +incluir("mystyle.css"); diff --git a/myjavascript.js b/myjavascript.js deleted file mode 100644 index 86f10ed..0000000 --- a/myjavascript.js +++ /dev/null @@ -1,40 +0,0 @@ - -var resultado = new Number(); -/** - * [calcular description] - * @return {[type]} [description] - */ -function calcular(){ - var v1 = new Number(document.getElementsByClassName("valor")[0].value); - var v2 = new Number(document.getElementsByClassName("valor")[1].value); - resultado = somar(v1, v2); -} -/** - * [somar description] - * @param {[type]} numeroA [description] - * @param {[type]} numeroB [description] - * @return {[type]} [description] - */ -function somar(numeroA, numeroB){ - var retorno = numeroA + numeroB; - return retorno; -} -/** - * [imprimir description] - * @return {[type]} [description] - */ -function imprimir(){ - document.getElementById("resultado").innerHTML = resultado; -} -/** - * [onload description] - * @return {[type]} [description] - */ -window.onload = function(){ - document.getElementById('calcular').addEventListener("click", function(){ - calcular(); - imprimir(); - }); -} - -// From efa97526cc49564739e06758d16dae6f9522c17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Tue, 30 Dec 2014 13:29:00 -0200 Subject: [PATCH 34/66] =?UTF-8?q?Antigo=20codigo=20da=20calculadora=20....?= =?UTF-8?q?=20em=20uma=20estrutura=20de=20fun=C3=A7=C3=B5es=20e=20variavei?= =?UTF-8?q?s..=20diferente=20da=20vers=C3=A3o=20pattern=20onde=20a=20const?= =?UTF-8?q?ru=C3=A7=C3=A3o=20=C3=A9=20proxima=20do=20Pattern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calc/calculador.css | 34 +++++++++++++++++++++ calc/calculador.js | 69 +++++++++++++++++++++++++++++++++++++++++++ calc/calculadora.html | 15 ++++++++++ 3 files changed, 118 insertions(+) create mode 100644 calc/calculador.css create mode 100644 calc/calculador.js create mode 100644 calc/calculadora.html diff --git a/calc/calculador.css b/calc/calculador.css new file mode 100644 index 0000000..5839b1b --- /dev/null +++ b/calc/calculador.css @@ -0,0 +1,34 @@ +@charset "utf-8"; +/* CSS Document */ + +body{ + font-family:Tahoma, Geneva, sans-serif; + font-size: 13px; +} + +#visor { +padding: 10px; +border: 1px solid #eee; +color: #cecece; +margin: 3px; +} + + +li { +padding: 1%; +list-style-type: none; +background: #cecece; +width: 28%; +height: 30px; +text-align: center; +margin: 1px; +position: relative; +float: left; +} +li:hover { + opacity:0.7; +} + +#numeros li{ + background:#DEE8EF; +} \ No newline at end of file diff --git a/calc/calculador.js b/calc/calculador.js new file mode 100644 index 0000000..4b6c817 --- /dev/null +++ b/calc/calculador.js @@ -0,0 +1,69 @@ +// JavaScript Document +//1 PARTE + +var calc; +var acumulador = ""; +//var $d = document; +window.onload = function(){ + //1p criando a div calculadora + document.body.innerHTML = '
            '; + //2p criando uma variavel para acessar o conteudo da calculadora. + calc = document.getElementById('calculadora'); + //3p Testaremos se estamos acessando o elemento criado! + //************** calc.innerHTML = "legal"; + //criando o visor + calc.innerHTML += '
            Calculadora inteligente
            '; + //criando a LISTA que irá receber nossos numeros + //Declaração da função que chama os Numeros + criarBtsNumeros(10); + //Declaração da função que chama os Operadores + criarBtsOperadores("+","-","*","/","="); + // criando os numeros abaixo + ativarBotoes (); +} + + +// Função que irá criar os Bt Numerico +function criarBtsNumeros($qN) { + + +/* var qTag = document.createElement('ul'); + var qName = document.createAttribute('id'); + qTag.setAttribute('id','numeros'); + + document.getElementById("calculadora").appendChild(qTag); +*/ + // criando a TAG + calc.innerHTML += '
              '; + //var uL = document.getElementsByTagName('ul'); + + for (i=0 ; i < $qN; i++) { + calc.getElementsByTagName("ul").item(0).innerHTML += '
            • ' + i + '
            • '; + } + + +} + +// Função que irá criar os Bt de Operação +function criarBtsOperadores() { + //cria o segunda lista! + calc.innerHTML += '
                '; + + for (i=0 ; i < arguments.length ; i++) { + calc.getElementsByTagName("ul").item(1).innerHTML += '
              • ' + arguments[i] + '
              • '; + } + +} + +function ativarBotoes (){ + for (i=0 ; i < 10; i++){ + document.getElementsByTagName("li").item(i).onclick= function(){ + //alert(this.innerHTML); + acumulador = acumulador + this.innerHTML; + document.getElementById("visor").innerHTML = acumulador ; + } + } +} + + + diff --git a/calc/calculadora.html b/calc/calculadora.html new file mode 100644 index 0000000..5b915c4 --- /dev/null +++ b/calc/calculadora.html @@ -0,0 +1,15 @@ + + + + +Calculadora inteligente + + + + + + + + + + From 988757777fa3e29591790417a1ed2597a1d7fa74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Tue, 30 Dec 2014 13:33:16 -0200 Subject: [PATCH 35/66] Atualizando nome da pasta etc para jsperf --- {etc => jsperf}/myhtml.html | 0 {etc => jsperf}/myjavascript.js | 0 {etc => jsperf}/object.js | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {etc => jsperf}/myhtml.html (100%) rename {etc => jsperf}/myjavascript.js (100%) rename {etc => jsperf}/object.js (100%) diff --git a/etc/myhtml.html b/jsperf/myhtml.html similarity index 100% rename from etc/myhtml.html rename to jsperf/myhtml.html diff --git a/etc/myjavascript.js b/jsperf/myjavascript.js similarity index 100% rename from etc/myjavascript.js rename to jsperf/myjavascript.js diff --git a/etc/object.js b/jsperf/object.js similarity index 100% rename from etc/object.js rename to jsperf/object.js From 9c6aac32a48eebf6ba7baecbc8c17e6ae6070a03 Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 19 Jan 2015 17:00:23 -0200 Subject: [PATCH 36/66] Update code! Atualizando a forma de escrita Pattern do objeto notification! --- notification/notification.js | 75 ++++++++++++++---------------------- 1 file changed, 29 insertions(+), 46 deletions(-) diff --git a/notification/notification.js b/notification/notification.js index 7139672..5cd2c47 100644 --- a/notification/notification.js +++ b/notification/notification.js @@ -1,47 +1,30 @@ +var notificar = (function (window) { + function Notificar(titulo,opcoes) { + if (window.Notification && Notification.permission === "granted") { + var notificacao = new Notification(titulo,opcoes); + notificacao.onshow = function () { + window.setTimeout(notificacao.close.bind(notificacao), 10000); + }; + } else { + Notification.requestPermission(function (status) { + // This allows to use Notification.permission with Chrome/Safari + if (Notification.permission !== status) { + Notification.permission = status; + } + }); + } + } + return Notificar; +})(window); -function notificacoes(timerAuto){ - // verificando se o navegador tem suporte a API - if (!('Notification' in window)) { - document.getElementById('bt_abrir').setAttribute('disabled', 'disabled'); - document.getElementById('custom-notificacao').innerHTML = "SEM SUPORTE"; - } else { - - var tituloNotificacao, optionsNotificacao, cont = 0; - - function notificar(event) { - //titulo da notificação - cont++; - tituloNotificacao = document.getElementById('tituloNotificacao').value; - //Corpo, tag, icon... da notificação - optionsNotificacao = { - body: document.getElementById('body').value + "\n " + cont + "º vez mostrado", - tag: "custom", - // ICONE DA APLICACAO - icon: "http://www.seprorgs.org.br/upload/site_associese/138_g.jpg" - - } - //Verificando se temos permissão para mostrar a mensagem - Notification.requestPermission(function() { - //criando a mensagem - var notificacao = new Notification(tituloNotificacao, optionsNotificacao); - // mostrando a mensagem - notificacao.onshow; - }); - // evita qualquer tipo de retorno da função - return false; - } - } - // Forçar para amostrar a mensagem - document.getElementById('bt_abrir').onclick = notificar; - // timer para em tempo em tempo mostrar a mensagem mesmo com onavegador minimizado - // caso o tempo não seja especificado ele não aparece - if(!!timerAuto)setInterval(notificar, timerAuto); - - } - - - - window.onload = function(){ - // verifica suporte ao comando - notificacoes(5000); - } +window.addEventListener("load",function(){ + document.getElementById('bt_abrir').addEventListerner('click',function(){ + notificar("Titulo",{ + body:"Corpo da mensagem", + icon:"http://url.com.br", + dir:"ltr", + tag:"Notification, Gitarno, Arno" + }); + }); +}); + From 2353baa8e6a2eba1dd80753143618402ec99044f Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 19 Jan 2015 17:02:48 -0200 Subject: [PATCH 37/66] Buscando dinamicamente Titulo e Corpo! --- notification/notification.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/notification/notification.js b/notification/notification.js index 5cd2c47..b30a82b 100644 --- a/notification/notification.js +++ b/notification/notification.js @@ -18,9 +18,12 @@ var notificar = (function (window) { })(window); window.addEventListener("load",function(){ + var titulo = document.getElementById('tituloNotificacao').value; + var corpo = document.getElementById('body').value; + document.getElementById('bt_abrir').addEventListerner('click',function(){ - notificar("Titulo",{ - body:"Corpo da mensagem", + notificar(titulo,{ + body:corpo, icon:"http://url.com.br", dir:"ltr", tag:"Notification, Gitarno, Arno" From 554ea161031ec62787b288f6f3a9b628629b28d0 Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 19 Jan 2015 17:04:43 -0200 Subject: [PATCH 38/66] Rename notification.js to notification.min.js --- notification/{notification.js => notification.min.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename notification/{notification.js => notification.min.js} (100%) diff --git a/notification/notification.js b/notification/notification.min.js similarity index 100% rename from notification/notification.js rename to notification/notification.min.js From 2e5f471a32a26c46c74c4d4ddde5d0d63ac14afe Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 19 Jan 2015 17:05:37 -0200 Subject: [PATCH 39/66] Rename notification.min.js to notification.js --- notification/{notification.min.js => notification.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename notification/{notification.min.js => notification.js} (100%) diff --git a/notification/notification.min.js b/notification/notification.js similarity index 100% rename from notification/notification.min.js rename to notification/notification.js From 98fea8f8c085334263c523c2c2b5aa380c81a015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Thu, 5 Feb 2015 16:05:16 -0200 Subject: [PATCH 40/66] Incluindo as pastas de teste do googleCharts e do RandomUSER --- google_charts/page.html | 18 ++++ google_charts/script.js | 171 +++++++++++++++++++++++++++++++++++ google_charts/style.css | 26 ++++++ test_randomUser/README.mdown | 11 +++ test_randomUser/page.html | 12 +++ test_randomUser/script.js | 55 +++++++++++ 6 files changed, 293 insertions(+) create mode 100644 google_charts/page.html create mode 100644 google_charts/script.js create mode 100644 google_charts/style.css create mode 100644 test_randomUser/README.mdown create mode 100644 test_randomUser/page.html create mode 100644 test_randomUser/script.js diff --git a/google_charts/page.html b/google_charts/page.html new file mode 100644 index 0000000..4a67f0f --- /dev/null +++ b/google_charts/page.html @@ -0,0 +1,18 @@ + + + + + + + + + +
                +
                +
                +
                +
                + + + + \ No newline at end of file diff --git a/google_charts/script.js b/google_charts/script.js new file mode 100644 index 0000000..af19cdb --- /dev/null +++ b/google_charts/script.js @@ -0,0 +1,171 @@ + + /* +var anual = { + '2013':{ + 'Faturamento':400, + 'Volume vendas':5000, + 'Produto habilitado':5000 + }, + '2014':{ + 'Faturamento':400, + 'Volume vendas':5000, + 'Produto habilitado':5000 + }, + '2015':{ + 'Faturamento':400, + 'Volume vendas':5000, + 'Produto habilitado':5000 + } +}; + + + + +var mensal = { + 'Dezembro':{ + 'ano':2013, + 'Faturamento':400, + 'Volume vendas':5000, + 'Produto habilitado':5000 + }, + 'Janeiro':{ + 'ano':2014, + 'Faturamento':400, + 'Volume vendas':5000, + 'Produto habilitado':5000 + }, + 'Fevereiro':{ + 'ano':2014, + 'Faturamento':400, + 'Volume vendas':5000, + 'Produto habilitado':5000 + }, + + 'Março':{ + 'ano':2014, + 'Faturamento':400, + 'Volume vendas':5000, + 'Produto habilitado':5000 + }, + 'Abril':{ + 'ano':2014, + 'Faturamento':400, + 'Volume vendas':5000, + 'Produto habilitado':5000 + }, + 'Maio':{ + 'ano':2014, + 'Faturamento':400, + 'Volume vendas':5000, + 'Produto habilitado':5000 + }, +}; +*/ + +var anual = { + 'volume':{ + '2013':245, + '2014':534, + '2015':341, + }, + 'produtos':{ + '2013':65, + '2014':105, + '2015':87, + } +}; +//IDEIA DE COMO SERIA UM 'PUSH' para esses dados... +anual['faturamento'] = { + '2013':400, + '2014':500, + '2015':50, +}; + + + +// Apenas mostrando todo o objeto +for (var i in anual){ + // console.log(i); +} + + +var data_anual = [ + [ + 'Anual', + 'Faturamento', + 'Volume de Vendas', + 'Produtos' + ], + [ + '2013', + anual.faturamento['2013'], + anual.volume['2013'], + anual.produtos['2013'] + ], + [ + '2014', + anual.faturamento['2014'], + anual.volume['2014'], + anual.produtos['2014'] + ], + [ + '2015', + anual.faturamento['2015'], + anual.volume['2015'], + anual.produtos['2015'] + ] +]; + +var data_faturamento = [ + [ + 'Anual', + 'Faturamento' + ], + [ + '2013', + anual.faturamento['2013'] + ], + [ + '2014', + anual.faturamento['2014'] + ], + [ + '2015', + anual.faturamento['2015'] + ] +]; + + +console.log(window.navigator.plugins); + +// O CODE REALMENTE DE RENDER + + google.load("visualization", "1.1", { + packages:["bar"] + }); + + var onResize; + window.onresize = function(){ + clearTimeout(onResize); + onResize = setTimeout(function(){ + drawChart(data_anual,'columnchart_material'); + drawChart(data_faturamento,'columnchart_materialB'); + drawChart(data_anual,'columnchart_materialC'); + drawChart(data_anual,'columnchart_materialD'); + drawChart(data_anual,'columnchart_materialE'); + }, 100); + }; + + + function drawChart(dados,target) { + var data = google.visualization.arrayToDataTable(dados); + var options = { + chart: { + title: 'Gráficos', + subtitle: 'Faturamento, Volume de vendas, e Produtos', + } + }; + var chart = new google.charts.Bar(document.getElementById(target)); + + chart.draw(data, options); + } \ No newline at end of file diff --git a/google_charts/style.css b/google_charts/style.css new file mode 100644 index 0000000..e64e7d4 --- /dev/null +++ b/google_charts/style.css @@ -0,0 +1,26 @@ +*{ + box-sizing: border-box; + margin: 0px; + padding: 0px; +} +body{ + background: #eee; +} +.half{ + width: 48%; + position:relative; + float:left; + top:0px; + left:0px; + padding: 20px; + background: #fff; + overflow: hidden; + margin: 1% ; + +} + +@media (max-width:700px){ + .half{ + width: 98%; + } +} \ No newline at end of file diff --git a/test_randomUser/README.mdown b/test_randomUser/README.mdown new file mode 100644 index 0000000..90fcf79 --- /dev/null +++ b/test_randomUser/README.mdown @@ -0,0 +1,11 @@ +Test RANDOMUSER + +Essa pasta é apenas uma brincadeira utilizando AJAX para criar a comunicação entre a API do site RandomUSer! + +[RandomUser]('http://randomuser.me'); + +Caso queira verificar o teste funcionando acesso abaixo o JSbin: + +[jsBin]('http://jsbin.com/toyime/1'); + + diff --git a/test_randomUser/page.html b/test_randomUser/page.html new file mode 100644 index 0000000..3e0d2f3 --- /dev/null +++ b/test_randomUser/page.html @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/test_randomUser/script.js b/test_randomUser/script.js new file mode 100644 index 0000000..26bda0d --- /dev/null +++ b/test_randomUser/script.js @@ -0,0 +1,55 @@ +(function(){ + var user = []; + var containerlistaUser = document.getElementById("usuario"); + var randomUser = function(){ + $.ajax({ + url: 'http://api.randomuser.me/', + dataType: 'json', + success: function(data){ + // buscando o usuario especifico + user[0] = data.results[0].user; + //console.log( user[0] ); + + //clear list + containerlistaUser.innerHTML = "User Random: "; + //mostrando todos os abtributos do objeto + ForInObject(user[0]); + } + }); + }; +/** + * Função recursiva responsavel por buscar todos os atributos de um objeto! e colocar na lista + * @param {object} objeto + */ + var ForInObject = function(objeto){ + for(var u in objeto){ + if(typeof objeto[u] == "object"){ + addITEM(u + "{"); + //recursive + ForInObject(user[0][u]); + addITEM("}"); + }else{ + console.log(u ); + addITEM(u); + } + } + }; + /** + * Função que adiciona um eleento a lista! + * @param {[type]} CONTENT [description] + */ + var addITEM = function(CONTENT){ + var item = document.createElement("li"); + item.innerHTML = CONTENT; + containerlistaUser.appendChild(item); + }; + + function _init(){ + $("#randomButton").click(randomUser); + } + window.onload = _init; + +})(); + + + From 9152f22ed8925e99d9c6aa8dcd44c74d358e873b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Thu, 5 Feb 2015 16:20:52 -0200 Subject: [PATCH 41/66] Atualizando links! --- test_randomUser/README.mdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test_randomUser/README.mdown b/test_randomUser/README.mdown index 90fcf79..beaac83 100644 --- a/test_randomUser/README.mdown +++ b/test_randomUser/README.mdown @@ -1,11 +1,11 @@ -Test RANDOMUSER +## Test RANDOMUSER Essa pasta é apenas uma brincadeira utilizando AJAX para criar a comunicação entre a API do site RandomUSer! -[RandomUser]('http://randomuser.me'); +[RandomUser](http://randomuser.me) Caso queira verificar o teste funcionando acesso abaixo o JSbin: -[jsBin]('http://jsbin.com/toyime/1'); +[jsBin](http://jsbin.com/toyime/1) From 6fade76cc4a822e70cc20345fdbecd0651e87aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Thu, 5 Feb 2015 16:37:52 -0200 Subject: [PATCH 42/66] =?UTF-8?q?Inserindo=20bot=C3=A3o=20e=20teste!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_randomUser/page.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test_randomUser/page.html b/test_randomUser/page.html index 3e0d2f3..f0fb86b 100644 --- a/test_randomUser/page.html +++ b/test_randomUser/page.html @@ -4,9 +4,15 @@ - + + - + + +
                  + Aperte o botão acima para buscar a lista de dados de um usuário! + +
                - \ No newline at end of file + From d51a1daeb754022d456949ae1bdfa7b76630d645 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 13:40:01 -0300 Subject: [PATCH 43/66] Init Coveralls test --- .coveralls.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..d8a1949 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +repo_token: EepTioEx3iHcob7RCnyVkJOTltriAPUV3 From db3751d2955eb2a5e3031c960b7dea019a3522d9 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 13:41:03 -0300 Subject: [PATCH 44/66] Badge Coveralls --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3c32873..67bd5aa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ ##javascript +[![Coverage Status](https://coveralls.io/repos/gitarno/javascript/badge.svg?branch=master&service=github)](https://coveralls.io/github/gitarno/javascript?branch=master) + ####passando para frente Esse repositório tem como finalidade compartilhar codigos que são discutidos e criados para/com os alunos. From 5741bf6864f65911e07ad50ca1264e27f0ada5d3 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 13:48:03 -0300 Subject: [PATCH 45/66] init travis.yml --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..d7183d0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: node_js +node_js: + - "4.1" + - "4.0" + - "0.12" + - "0.11" + - "0.10" + - "0.8" + - "0.6" + - "iojs" From 7aa6cd36aaecd00612dc79c7c231011dcdb2feae Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 13:51:17 -0300 Subject: [PATCH 46/66] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d7183d0..7ef87bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,4 @@ node_js: - "0.8" - "0.6" - "iojs" +script: npm install && npm test From 6a1f24602329ab22d8b3d7b586b82ceb317ba5e4 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 13:56:02 -0300 Subject: [PATCH 47/66] Update travis Defautl settings YML --- .travis.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7ef87bc..44d5bb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,6 @@ language: node_js node_js: - - "4.1" - - "4.0" - - "0.12" - - "0.11" - - "0.10" - "0.8" - - "0.6" - - "iojs" -script: npm install && npm test +before_install: npm install -g grunt-cli +install: npm install +before_script: grunt build From 8cbb7f011b50337fb69753f9730296326725e71c Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 13:59:00 -0300 Subject: [PATCH 48/66] Create package.json --- package.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..e5d26d1 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name":"javascript", + "version":"0.0.1", + "devDependencies": { + "bower": "1.4.1", + "grunt": "0.4.5", + "grunt-contrib-uglify": "0.9.1", + }, + "scripts": { + "test": "grunt test" + } +} From bf0ea75fdcba9533682a974edf7288687b612af0 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:00:45 -0300 Subject: [PATCH 49/66] delete exception token } --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index e5d26d1..6f815d7 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,8 @@ "name":"javascript", "version":"0.0.1", "devDependencies": { - "bower": "1.4.1", "grunt": "0.4.5", - "grunt-contrib-uglify": "0.9.1", + "grunt-contrib-uglify": "0.9.1" }, "scripts": { "test": "grunt test" From f9c2699407dfc766278ebb8a06898ca43284f2b1 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:02:17 -0300 Subject: [PATCH 50/66] Update travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 44d5bb5..66baf08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,4 @@ node_js: - "0.8" before_install: npm install -g grunt-cli install: npm install -before_script: grunt build +before_script: npm test From f545bbf93c4ca2f5ffc75b94f6892f10584ccaf0 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:06:35 -0300 Subject: [PATCH 51/66] BAdge travis --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67bd5aa..deaed26 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ##javascript [![Coverage Status](https://coveralls.io/repos/gitarno/javascript/badge.svg?branch=master&service=github)](https://coveralls.io/github/gitarno/javascript?branch=master) - +[![Build Status](https://travis-ci.org/gitarno/javascript.svg?branch=master)](https://travis-ci.org/gitarno/javascript) ####passando para frente Esse repositório tem como finalidade compartilhar codigos que são discutidos e criados para/com os alunos. From 39aa6d4ac337193e867a6e2bcabf1d212407ffb9 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:08:14 -0300 Subject: [PATCH 52/66] update version node --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 66baf08..d694c88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js node_js: - - "0.8" + - "4.1.2" before_install: npm install -g grunt-cli install: npm install before_script: npm test From b46c0b8e744e627f7cae236fca49d09b356eb2cc Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:18:27 -0300 Subject: [PATCH 53/66] init basic Gruntfile --- Gruntfile.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Gruntfile.js diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..5ed1aa0 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,22 @@ +module.exports = function (grunt) { + + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + uglify: { + dist: { + options: { + banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n', + mangle: true, + compress: true + }, + files: { + 'calc-pattern/**.min.js': [calc-pattern/**/*.js,!calc-pattern/**/*.min.js]; + } + } + }); + + grunt.loadNpmTasks('grunt-contrib-uglify'); + + grunt.registerTask('default', ['uglify']); + + }; From e7cdd00933d82c4f2fbfaab16a8fb0a27f31fc0f Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:20:53 -0300 Subject: [PATCH 54/66] delete exception token . --- Gruntfile.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 5ed1aa0..5dd484c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,22 +1,21 @@ module.exports = function (grunt) { grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - uglify: { + pkg: grunt.file.readJSON('package.json'), + uglify: { dist: { - options: { - banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n', - mangle: true, - compress: true - }, - files: { - 'calc-pattern/**.min.js': [calc-pattern/**/*.js,!calc-pattern/**/*.min.js]; - } - } - }); + options: { + mangle: true, + compress: true + }, + files: { + 'calc-pattern/**.min.js': [calc-pattern/**/*.js,!calc-pattern/**/*.min.js]; + } + } + } + }); grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.registerTask('default', ['uglify']); - }; +}; From 842201e85ee607d81503c6bd377e861e0b318a21 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:23:10 -0300 Subject: [PATCH 55/66] remove grunt test --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6f815d7..52f2ed0 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,6 @@ "grunt-contrib-uglify": "0.9.1" }, "scripts": { - "test": "grunt test" + "test": "grunt" } } From ffba6e6f674dc50e66d5e2fff6a33e728a4f1d03 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:24:28 -0300 Subject: [PATCH 56/66] Update Grunt! --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 5dd484c..9b910b2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,7 +9,7 @@ module.exports = function (grunt) { compress: true }, files: { - 'calc-pattern/**.min.js': [calc-pattern/**/*.js,!calc-pattern/**/*.min.js]; + 'calc-pattern/**.min.js': [calc-pattern/**/*.js,!calc-pattern/**/*.min.js] } } } From d8449be1662a61e03a633d9784b2ee1201f85a5f Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:27:35 -0300 Subject: [PATCH 57/66] Udapte Gruntfile.js --- Gruntfile.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9b910b2..86ce0c9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,17 +1,16 @@ module.exports = function (grunt) { grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - uglify: { + pkg: grunt.file.readJSON('package.json'), + uglify: { dist: { - options: { - mangle: true, - compress: true - }, - files: { - 'calc-pattern/**.min.js': [calc-pattern/**/*.js,!calc-pattern/**/*.min.js] - } - } + options: { + compress: true + }, + files: { + 'calc-pattern/**.min.js': [ "calc-pattern/**/*.js" , "!calc-pattern/**/*.min.js"] + } + } } }); From 8ede19ccb2d117e8ffe54e86d648b5eea67ddcc4 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:32:56 -0300 Subject: [PATCH 58/66] Update Grunt! --- .coveralls.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.coveralls.yml b/.coveralls.yml index d8a1949..4e650d8 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1 +1,2 @@ repo_token: EepTioEx3iHcob7RCnyVkJOTltriAPUV3 +service_name: travis-ci From 09b5fb9033d8dcf2d766bc689721f163c53ef877 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:36:43 -0300 Subject: [PATCH 59/66] Adicionando grunt coveralls --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 52f2ed0..134bbb9 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version":"0.0.1", "devDependencies": { "grunt": "0.4.5", - "grunt-contrib-uglify": "0.9.1" + "grunt-contrib-uglify": "0.9.1", + "grunt-karma-coveralls": "latest" }, "scripts": { "test": "grunt" From f719c5973819b8a01adf0b3b5e9f543ca1fb6cbe Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:38:01 -0300 Subject: [PATCH 60/66] Adicionando task coveralls --- Gruntfile.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 86ce0c9..21fa494 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,10 +11,21 @@ module.exports = function (grunt) { 'calc-pattern/**.min.js': [ "calc-pattern/**/*.js" , "!calc-pattern/**/*.min.js"] } } + }, + coveralls: { + options: { + debug: true, + coverageDir: 'calc-pattern/', + dryRun: true, + force: true, + recursive: true + } } }); grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.registerTask('default', ['uglify']); + grunt.loadNpmTasks('grunt-karma-coveralls'); + + grunt.registerTask('default', ['uglify','coveralls']); }; From 1b9a0a5a38ae42428f621d8fba477f28b5a256b7 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:40:48 -0300 Subject: [PATCH 61/66] ... --- Gruntfile.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 21fa494..7679d93 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,7 +15,6 @@ module.exports = function (grunt) { coveralls: { options: { debug: true, - coverageDir: 'calc-pattern/', dryRun: true, force: true, recursive: true From 5e82c806a7b1b2ae8904440535b79e05126e78ea Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:43:10 -0300 Subject: [PATCH 62/66] Update Gruntfile.js --- Gruntfile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Gruntfile.js b/Gruntfile.js index 7679d93..93c63df 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,6 +15,7 @@ module.exports = function (grunt) { coveralls: { options: { debug: true, + coverageDir: '/', dryRun: true, force: true, recursive: true From 110595862ef8d950c440b5da19644d9f94568020 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:44:43 -0300 Subject: [PATCH 63/66] Update Gruntfile.js --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 93c63df..a9b984b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,7 +15,7 @@ module.exports = function (grunt) { coveralls: { options: { debug: true, - coverageDir: '/', + coverageDir: '', dryRun: true, force: true, recursive: true From 6bb0fbfe07882e24212036d0d05335eae2d8f6bb Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 8 Oct 2015 14:46:41 -0300 Subject: [PATCH 64/66] Remove coverall grunt default --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index a9b984b..e0f0557 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,6 +26,6 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-karma-coveralls'); - grunt.registerTask('default', ['uglify','coveralls']); + grunt.registerTask('default', ['uglify']); }; From fb6a316232bca73dd5e5d55cf9465496fa0362d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Mon, 10 Oct 2016 11:07:30 -0300 Subject: [PATCH 65/66] putting badget model provided by shield.io site --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index deaed26..e19d05c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ ##javascript +[![GitHub issues](https://img.shields.io/github/issues/gitarno/javascript.svg?style=flat-square)](https://github.com/gitarno/javascript/issues) +[![GitHub forks](https://img.shields.io/github/forks/gitarno/javascript.svg?style=flat-square)](https://github.com/gitarno/javascript/network) +[![GitHub stars](https://img.shields.io/github/stars/gitarno/javascript.svg?style=flat-square)](https://github.com/gitarno/javascript/stargazers) + [![Coverage Status](https://coveralls.io/repos/gitarno/javascript/badge.svg?branch=master&service=github)](https://coveralls.io/github/gitarno/javascript?branch=master) [![Build Status](https://travis-ci.org/gitarno/javascript.svg?branch=master)](https://travis-ci.org/gitarno/javascript) ####passando para frente From f16bd4d4edf00c5cd39680b1d94008e94b83768b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arno=20Rold=C3=A3o=20Junior?= Date: Mon, 10 Oct 2016 11:08:19 -0300 Subject: [PATCH 66/66] keeping the same style --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e19d05c..c94ff14 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ ##javascript -[![GitHub issues](https://img.shields.io/github/issues/gitarno/javascript.svg?style=flat-square)](https://github.com/gitarno/javascript/issues) -[![GitHub forks](https://img.shields.io/github/forks/gitarno/javascript.svg?style=flat-square)](https://github.com/gitarno/javascript/network) -[![GitHub stars](https://img.shields.io/github/stars/gitarno/javascript.svg?style=flat-square)](https://github.com/gitarno/javascript/stargazers) - +[![GitHub issues](https://img.shields.io/github/issues/gitarno/javascript.svg)](https://github.com/gitarno/javascript/issues) +[![GitHub forks](https://img.shields.io/github/forks/gitarno/javascript.svg)](https://github.com/gitarno/javascript/network) +[![GitHub stars](https://img.shields.io/github/stars/gitarno/javascript.svg)](https://github.com/gitarno/javascript/stargazers) [![Coverage Status](https://coveralls.io/repos/gitarno/javascript/badge.svg?branch=master&service=github)](https://coveralls.io/github/gitarno/javascript?branch=master) [![Build Status](https://travis-ci.org/gitarno/javascript.svg?branch=master)](https://travis-ci.org/gitarno/javascript) ####passando para frente