diff --git a/css/default.css b/css/default.css index 788a6a3..6b2f053 100755 --- a/css/default.css +++ b/css/default.css @@ -1,3 +1,49 @@ +/* snack */ +#snackbar-container { + position: fixed; + left: 20px; + bottom: 0; + z-index: 99999; +} +.snackbar { + overflow: hidden; + clear: both; + min-width: 288px; + max-width: 568px; + cursor: pointer; + opacity: 0; +} +.snackbar:after { + font-family: "Glyphicons Halflings"; + content: "\e014"; + float: right; + color: white; + font-size: 14px; + top: 0px; + position: absolute; + right: 5px; +} +.snackbar.snackbar-opened { + height: auto; + opacity: 1; +} +@media (max-width: 767px) { + #snackbar-container { + left: 0px !important; + right: 0px; + width: 100%; + } + #snackbar-container .snackbar { + min-width: 100%; + } + #snackbar-container [class="snackbar snackbar-opened"] ~ .snackbar.toast { + margin-top: 20px; + } + #snackbar-container [class="snackbar snackbar-opened"] { + border-radius: 0; + margin-bottom: 0; + } +} /*slide*/ .noUi-horizontal { height: 5px; diff --git a/ferramentas/animacao/index.js b/ferramentas/animacao/index.js index e6042ec..ba8cb31 100755 --- a/ferramentas/animacao/index.js +++ b/ferramentas/animacao/index.js @@ -1,239 +1,176 @@ if(typeof(i3GEOF) === 'undefined'){ - var i3GEOF = {}; + var i3GEOF = {}; } i3GEOF.animacao = { - /* - Variavel: aguarde - - Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. - */ - aguarde: "", - tempo: 1000, - /** - * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php - */ - MUSTACHE : "", - /** - * Susbtitutos para o template - */ - mustacheHash : function() { - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.animacao.dicionario); - dicionario["locaplic"] = i3GEO.configura.locaplic; - return dicionario; + renderFunction: i3GEO.janela.formModal, + _parameters : { + "mustache": "", + "idContainer": "i3GEOanimacaoguiasContainer", + "namespace": "animacao", + "idlista": "i3GEOanimacaoguiasContainerLista", + "codigos": [], }, - /* - Function: inicia - - Inicia a ferramenta. É chamado por criaJanelaFlutuante - - Parametro: - - iddiv {String} - id do div que receberá o conteudo HTML da ferramenta - */ - inicia: function(iddiv){ - if(i3GEOF.animacao.MUSTACHE == ""){ - $.get(i3GEO.configura.locaplic + "/ferramentas/animacao/template_mst.html", function(template) { - i3GEOF.animacao.MUSTACHE = template; - i3GEOF.animacao.inicia(iddiv); - }); - return; - } - i3GEOF.animacao.aguarde.visibility = "visible"; - $i(iddiv).innerHTML = i3GEOF.animacao.html(); - - i3GEOF.animacao.listaDeCamadas(); - i3GEOF.animacao.aguarde.visibility = "hidden"; + tempo: 1000, + start: function(){ + var i3f = i3GEOF.animacao, + p = i3f._parameters, + t1 = i3GEO.configura.locaplic + "/ferramentas/animacao/template_mst.html"; + if(p.mustache === ""){ + $.get(t1, function(template) { + p.mustache = template; + i3f.html(); + }).fail(function() { + i3GEO.janela.tempoMsg($trad("erroTpl")); + }); + } else { + i3f.html(); + } }, - /* - Function: html - - Gera o código html para apresentação das opções da ferramenta - - Retorno: - - String com o código html - */ html:function() { - var ins = Mustache.render(i3GEOF.animacao.MUSTACHE, i3GEOF.animacao.mustacheHash()); - return ins; - }, - listaDeCamadas: function(camadas){ - if(!camadas){ - camadas = i3GEO.arvoreDeCamadas.CAMADAS; - } - var n = camadas.length, - ins = ""; - while(n > 0){ - n -= 1; - if(camadas[n].tema !== ""){ - ins += '
'; - } - } - $i("i3GEOFanimacaoLista").innerHTML = ins; + var p = this._parameters, + i3f = this, + hash = i3GEO.idioma.objetoIdioma(i3GEOF[p.namespace].dicionario); + hash["locaplic"] = i3GEO.configura.locaplic; + hash["namespace"] = p.namespace; + hash["idContainer"] = p.idContainer; + hash["idlista"] = p.idlista; + i3f.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)}); + i3GEO.janela.applyScrollBar(p.idContainer); + i3GEOF.animacao.listaDeCamadas(); }, - /* - Function: iniciaJanelaFlutuante + listaDeCamadas: function(){ + var p = this._parameters, + camadas = i3GEO.arvoreDeCamadas.CAMADAS, + n = camadas.length, + ins = "", + hash = []; + while(n > 0){ + n -= 1; + if(camadas[n].tema !== ""){ + hash.push({ + "title": "", + "checked": "checked", + "value": camadas[n].name, + "id": "i3GEOanima" + camadas[n].name, + "label": camadas[n].tema + }); - Cria a janela flutuante para controle da ferramenta. - */ - iniciaJanelaFlutuante: function(){ - var janela,divid,temp,titulo,cabecalho,minimiza; - if($i("i3GEOF.animacao")){ - return; + ins += '
'; } - cabecalho = function(){}; - minimiza = function(){ - i3GEO.janela.iconiza("i3GEOF.animacao",200); - }; - //cria a janela flutuante - titulo = "" + $trad("p21") + ""; - janela = i3GEO.janela.cria( - "410px", - "250px", - "", - "", - "", - titulo, - "i3GEOF.animacao", - false, - "hd", - cabecalho, - minimiza, - "", - true, - "", - "", - "", - "", - 107 - ); - divid = janela[2].id; - $i("i3GEOF.animacao_corpo").style.backgroundColor = "white"; - $i("i3GEOF.animacao_corpo").style.textAlign = "left"; - i3GEOF.animacao.aguarde = $i("i3GEOF.animacao_imagemCabecalho").style; - i3GEOF.animacao.inicia(divid); - temp = function(){ - i3GEOF.animacao.termina(); - }; - YAHOO.util.Event.addListener(janela[0].close, "click", temp); + } + ins = Mustache.render("{{#data}}" + i3GEO.template.checkbox + "{{/data}}", {data: hash}); + $i(p.idlista).innerHTML = ins; + i3GEO.janela.snackBar({content: $trad("ajuda",i3GEOF[p.namespace].dicionario)}); }, - codigos: [], - /* - Function: anima - - Inicia a animação - - */ dispara: function(){ - if(i3GEOF.animacao.aguarde.visibility === "visible") - {return;} - var codigos = i3GEOF.animacao.obtemTemasAnima(); - i3GEOF.animacao.codigos = codigos; - i3GEOF.animacao.contador = 0; - i3GEOF.animacao.aguarde.visibility = "visible"; - i3GEOF.animacao.desligaTodos(codigos); - i3GEOF.animacao.retornaCoresInicial(); - i3GEOF.animacao.anima(i3GEOF.animacao.codigos.length - 1); + var codigos = i3GEOF.animacao.obtemTemasAnima(); + this._parameters.codigos = codigos; + i3GEOF.animacao.contador = 0; + i3GEOF.animacao.desligaTodos(codigos); + i3GEOF.animacao.anima(codigos.length); }, maisrapido: function(){ - i3GEOF.animacao.tempo -= 100; + i3GEOF.animacao.tempo -= 100; }, maislento: function(){ - i3GEOF.animacao.tempo += 100; + i3GEOF.animacao.tempo += 100; }, anima: function(c){ - if(i3GEOF.animacao.codigos.length === 0) - {return;} - //console.warn(c); - if(c < 0){ - i3GEOF.animacao.termina(); - i3GEOF.animacao.dispara(); - } - else{ - $i("i3GEOanima"+i3GEOF.animacao.codigos[c]).style.backgroundColor = "yellow"; - i3GEOF.animacao.ligaDesliga(i3GEOF.animacao.codigos[c],'troca'); - setTimeout("i3GEOF.animacao.anima("+(c - 1)+");",i3GEOF.animacao.tempo); - } + if(this._parameters.codigos.length === 0) + {return;} + $( "#" + this._parameters.idlista ).toggle(false); + if(c < 0){ + i3GEOF.animacao.termina(); + i3GEOF.animacao.dispara(); + } + else{ + i3GEOF.animacao.ligaDesliga(this._parameters.codigos[c],'troca'); + setTimeout("i3GEOF.animacao.anima("+(c - 1)+");",i3GEOF.animacao.tempo); + } }, desligaTodos: function(codigos){ - var n = codigos.length; - while(n > 0){ - n -= 1; - i3GEOF.animacao.ligaDesliga(codigos[n],"desliga"); + var n = codigos.length; + while(n >= 0){ + n -= 1; + if(codigos[n]){ + i3GEOF.animacao.ligaDesliga(codigos[n],"desliga"); } + } }, ligaDesliga: function(codigoTema,tipo){ - var layer,estilo; - switch(i3GEO.Interface.ATUAL){ - case "openlayers": - layer = i3geoOL.getLayersByName(codigoTema)[0]; - if(tipo === "troca"){ - layer.setVisibility(!layer.getVisibility()); - } - if(tipo === "liga") - {layer.setVisibility(true);} - if(tipo === "desliga") - {layer.setVisibility(false);} - break; - case "googlemaps": - layer = i3GEO.Interface.googlemaps.retornaDivLayer(codigoTema); - if(!layer){return;} - estilo = layer.style.visibility; - if(tipo === "troca"){ - if(estilo === "visible" || estilo === "") - {layer.style.visibility = "hidden";} - else - {layer.style.visibility = "visible";} - } - if(tipo === "liga") - {layer.style.visibility = "visible";} - if(tipo === "desliga") - {layer.style.visibility = "hidden";} - break; - }; + if(codigoTema == undefined){ + return; + } + var layer,estilo; + switch(i3GEO.Interface.ATUAL){ + case "openlayers": + layer = i3geoOL.getLayersByName(codigoTema)[0]; + if(tipo === "troca"){ + layer.setVisibility(!layer.getVisibility()); + } + if(tipo === "liga") + {layer.setVisibility(true);} + if(tipo === "desliga") + {layer.setVisibility(false);} + break; + case "googlemaps": + layer = i3GEO.Interface.googlemaps.retornaDivLayer(codigoTema); + if(!layer){return;} + estilo = layer.style.visibility; + if(tipo === "troca"){ + if(estilo === "visible" || estilo === "") + {layer.style.visibility = "hidden";} + else + {layer.style.visibility = "visible";} + } + if(tipo === "liga") + {layer.style.visibility = "visible";} + if(tipo === "desliga") + {layer.style.visibility = "hidden";} + break; + }; }, termina: function(){ - i3GEOF.animacao.codigos = []; - i3GEOF.animacao.aguarde.visibility = "hidden"; - i3GEOF.animacao.retornaStatusInicial(); + this._parameters.codigos = []; + i3GEOF.animacao.retornaStatusInicial(); + $( "#" + this._parameters.idlista ).toggle(true); }, obtemTemasAnima: function(){ - var temp = [], - cs = $i("i3GEOFanimacaoLista").getElementsByTagName("input"), - n = cs.length; - while(n > 0){ - n -= 1; - if(cs[n].checked === true) - {temp.push(cs[n].value);} + var l = $i(this._parameters.idlista); + if(!l){ + this.termina(); + return; + } + var temp = [], + cs = l.getElementsByTagName("input"), + n = cs.length; + while(n >= 0){ + n -= 1; + if(cs[n] && cs[n].checked === true){ + temp.push(cs[n].value); } - return temp; + } + return temp; }, retornaStatusInicial: function(){ - if($i("i3GEOFanimacaoLista")){ - i3GEOF.animacao.retornaCoresInicial(); - var temas = i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS), - n = temas.length; - while(n > 0){ - n -= 1; - i3GEOF.animacao.ligaDesliga(temas[n].name,"liga"); - } - temas = i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"diferente",i3GEO.arvoreDeCamadas.CAMADAS); - n = temas.length; - while(n > 0){ - n -= 1; - i3GEOF.animacao.ligaDesliga(temas[n].name,"desliga"); - } - } - }, - retornaCoresInicial: function(){ - var cs = $i("i3GEOFanimacaoLista").getElementsByTagName("input"), - n = cs.length; + if($i(this._parameters.idlista)){ + var temas = i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"igual",i3GEO.arvoreDeCamadas.CAMADAS), + n = temas.length; while(n > 0){ - n -= 1; - $i("i3GEOanima"+cs[n].value).style.backgroundColor = ""; + n -= 1; + i3GEOF.animacao.ligaDesliga(temas[n].name,"liga"); + } + temas = i3GEO.arvoreDeCamadas.filtraCamadas("status",2,"diferente",i3GEO.arvoreDeCamadas.CAMADAS); + n = temas.length; + while(n >= 0){ + n -= 1; + if(temas[n]){ + i3GEOF.animacao.ligaDesliga(temas[n].name,"desliga"); + } } + } } }; diff --git a/ferramentas/animacao/template_mst.html b/ferramentas/animacao/template_mst.html index 9135ec3..c5c5a05 100755 --- a/ferramentas/animacao/template_mst.html +++ b/ferramentas/animacao/template_mst.html @@ -1,5 +1,4 @@ -
-
{{{ajuda}}}
+
-
- +
\ No newline at end of file diff --git a/ferramentas/filtroarvore/index.js b/ferramentas/filtroarvore/index.js index 603eb7a..972a346 100755 --- a/ferramentas/filtroarvore/index.js +++ b/ferramentas/filtroarvore/index.js @@ -5,29 +5,32 @@ i3GEOF.filtroarvore = { renderFunction: i3GEO.janela.formModal, _parameters : { "mustache": "", - "idContainer": "i3GEOfiltroarvoreguiasContainer" + "idContainer": "i3GEOfiltroarvoreguiasContainer", + "namespace": "filtroarvore" }, start : function(){ - var p = i3GEOF.filtroarvore._parameters; + var p = this._parameters, + i3f = this, + t1 = i3GEO.configura.locaplic + "/ferramentas/"+p.namespace+"/template_mst.html"; if(p.mustache === ""){ - var t1 = i3GEO.configura.locaplic + "/ferramentas/filtroarvore/template_mst.html"; $.get(t1, function(template) { p.mustache = template; - i3GEOF.filtroarvore.html(); + i3f.html(); }).fail(function() { i3GEO.janela.tempoMsg($trad("erroTpl")); }); } else { - i3GEOF.filtroarvore.html(); + i3f.html(); } }, html:function() { - var p = i3GEOF.filtroarvore._parameters; - var hash = i3GEO.idioma.objetoIdioma(i3GEOF.filtroarvore.dicionario); + var p = this._parameters, + i3f = this, + hash = i3GEO.idioma.objetoIdioma(i3GEOF[p.namespace].dicionario); hash["locaplic"] = i3GEO.configura.locaplic; - hash["namespace"] = "filtroarvore"; + hash["namespace"] = p.namespace; hash["idContainer"] = p.idContainer; - i3GEOF.filtroarvore.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)}); + i3f.renderFunction.call(this,{texto: Mustache.render(p.mustache, hash)}); i3GEO.janela.applyScrollBar(p.idContainer); $('#' + p.idContainer + ' button[name="' + i3GEO.arvoreDeCamadas.FILTRO + '"]').button('toggle'); }, diff --git a/interface/openlayersdebug.php b/interface/openlayersdebug.php index f2197d0..9db3366 100644 --- a/interface/openlayersdebug.php +++ b/interface/openlayersdebug.php @@ -101,8 +101,7 @@ include ($configInc["url"]."/css.php"); + + +To use it in HTML: + + Click me + +or with javascript: + + $.snackbar({content: "This is my awesome snackbar!"}); + +## Options + +Following options are supported to customize look and behaviour: + + var options = { + content: "Some text", // text of the snackbar + style: "toast", // add a custom class to your snackbar + timeout: 100, // time in milliseconds after the snackbar autohides, 0 is disabled + htmlAllowed: true, // allows HTML as content value + onClose: function(){ } // callback called when the snackbar gets closed. + } + + $.snackbar(options); + +Or in HTML: + + + Click me + + + +**Tip**: SnackbarJS returns always a jQuery element which corresponds to the snackbar DOM element, you can use it to get the ID of the element, and then do other operations with it. + +**Heads up!**: The onClose callback is not available using the HTML syntax. + +## Interact with snackbars + +Once you have created a snackbar you can show, hide or toggle it with: + + $("#snackbarid").snackbar("show"); + $("#snackbarid").snackbar("hide"); + $("#snackbarid").snackbar("toggle"); + +`#snackbarid` can be both the button with the data-toggle=snackbar attribute or the snackbar element. +Calling it on a non-existing snackbar will create it before executing the specificed action. + +## Demo + +To see SnackbarJS in action visit [the demo page](http://fezvrasta.github.io/snackbarjs/). + +Browserify +---------- +This library is [UMD](https://github.com/umdjs/umd) compatible, so you can use it in this way: + +```javascript +var jquery = require('jquery'); +require('snackbarjs'); + +var options = { + ... +} + +jquery.snackbar(options); +``` diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/bower.json b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/bower.json new file mode 100644 index 0000000..8e0dc8b --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/bower.json @@ -0,0 +1,15 @@ +{ + "name": "snackbarjs", + "version": "1.1.0", + "main": [ + "dist/snackbar.min.js", + "dist/snackbar.min.css" + ], + "ignore": [ + ".jshintrc", + "**/*.txt" + ], + "dependencies": { + "jquery": "~2.1.1" + } +} diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.css b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.css new file mode 100644 index 0000000..536a9ac --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.css @@ -0,0 +1,36 @@ +#snackbar-container { + position: fixed; + left: 20px; + bottom: 0; + z-index: 99999; +} +.snackbar { + overflow: hidden; + clear: both; + min-width: 288px; + max-width: 568px; + cursor: pointer; + opacity: 0; +} +.snackbar.snackbar-opened { + height: auto; + opacity: 1; +} +@media (max-width: 767px) { + #snackbar-container { + left: 0px !important; + right: 0px; + width: 100%; + } + #snackbar-container .snackbar { + min-width: 100%; + } + #snackbar-container [class="snackbar snackbar-opened"] ~ .snackbar.toast { + margin-top: 20px; + } + #snackbar-container [class="snackbar snackbar-opened"] { + border-radius: 0; + margin-bottom: 0; + } +} +/*# sourceMappingURL=snackbar.css.map */ \ No newline at end of file diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.css.map b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.css.map new file mode 100644 index 0000000..760c549 --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["/src/snackbar.less"],"names":[],"mappings":"AACA;EACI,eAAA;EACA,UAAA;EACA,SAAA;EACA,cAAA;;AAEJ;EACI,gBAAA;EACA,WAAA;EACA,gBAAA;EACA,gBAAA;EACA,eAAA;EACA,UAAA;;AAGJ,SAAS;EACL,YAAA;EACA,UAAA;;AAoBJ,QAjB0B;EACtB;IACI,oBAAA;IACA,UAAA;IACA,WAAA;;EAHJ,mBAII;IACI,eAAA;;EALR,mBAOI,mCAAmC,YAAW;IAC1C,gBAAA;;EARR,mBAUI;IACI,gBAAA;IACA,gBAAA"} \ No newline at end of file diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.min.css b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.min.css new file mode 100644 index 0000000..9bcc471 --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.min.css @@ -0,0 +1 @@ +#snackbar-container{position:fixed;left:20px;bottom:0;z-index:99999}.snackbar{overflow:hidden;clear:both;min-width:288px;max-width:568px;cursor:pointer;opacity:0}.snackbar.snackbar-opened{height:auto;opacity:1}@media (max-width:767px){#snackbar-container{left:0!important;right:0;width:100%}#snackbar-container .snackbar{min-width:100%}#snackbar-container [class="snackbar snackbar-opened"]~.snackbar.toast{margin-top:20px}#snackbar-container [class="snackbar snackbar-opened"]{border-radius:0;margin-bottom:0}} \ No newline at end of file diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.min.js b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.min.js new file mode 100644 index 0000000..2047f11 --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.min.js @@ -0,0 +1,2 @@ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){function b(a){return"undefined"!=typeof a&&null!==a?!0:!1}a(document).ready(function(){a("body").append("
")});var c={events:{},on:function(a,b){this.events[a]=this.events[a]||[],this.events[a].push(b)},off:function(a,b){if(this.events[a])for(var c=0;c").attr("id",""+d.id).attr("class","snackbar"),f=!0):(d.id="snackbar"+Date.now(),e=a("
").attr("id",d.id).attr("class","snackbar"),f=!0);var g=e.hasClass("snackbar-opened");b(d.style)?(g?e.attr("class","snackbar snackbar-opened "+d.style):e.attr("class","snackbar "+d.style),e.attr("data-style",d.style)):g?e.attr("class","snackbar snackbar-opened"):e.attr("class","snackbar"),d.htmlAllowed=b(d.htmlAllowed)?d.htmlAllowed:!1,d.timeout=b(d.timeout)?d.timeout:3e3,e.attr("data-timeout",d.timeout),d.content=d.htmlAllowed?d.content:a("

"+d.content+"

").text(),b(d.onClose)&&c.on(d.id,d.onClose),b(d.htmlAllowed)&&e.attr("data-html-allowed",d.htmlAllowed),b(d.content)&&(e.find(".snackbar-content").length?e.find(".snackbar-content").html(d.content):e.prepend(""+d.content+""),e.attr("data-content",d.content)),f?e.appendTo("#snackbar-container"):e.insertAfter("#snackbar-container .snackbar:last-child"),b(d.action)&&"toggle"==d.action&&(g?d.action="hide":d.action="show");var h=Date.now();e.data("animationId1",h),setTimeout(function(){e.data("animationId1")===h&&(b(d.action)&&"show"!=d.action?b(d.action)&&"hide"==d.action&&(e.removeClass("snackbar-opened"),c.emit(d.id),c.off(d.id)):e.addClass("snackbar-opened"))},50);var i=Date.now();return e.data("animationId2",i),0!==d.timeout&&setTimeout(function(){e.data("animationId2")===i&&(e.removeClass("snackbar-opened"),c.emit(d.id),c.off(d.id))},d.timeout),e}return!1},a.fn.snackbar=function(c){if("undefined"!=typeof c){var d={};if(this.hasClass("snackbar"))return d={id:this.attr("id"),content:a(this).attr("data-content"),style:a(this).attr("data-style"),timeout:parseInt(a(this).attr("data-timeout")),htmlAllowed:a(this).attr("data-html-allowed")},("show"===c||"hide"===c||"toggle"==c)&&(d.action=c),a.snackbar(d);b(c)&&"show"!==c&&"hide"!==c&&"toggle"!=c||(d={content:a(this).attr("data-content"),style:a(this).attr("data-style"),timeout:a(this).attr("data-timeout"),htmlAllowed:a(this).attr("data-html-allowed")}),b(c)&&(d.id=this.attr("data-snackbar-id"),("show"===c||"hide"===c||"toggle"==c)&&(d.action=c));var e=a.snackbar(d);return this.attr("data-snackbar-id",e.attr("id")),e}}}); +//# sourceMappingURL=snackbar.min.js.map \ No newline at end of file diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.min.js.map b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.min.js.map new file mode 100644 index 0000000..5bc0fdc --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/dist/snackbar.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/snackbar.js"],"names":["factory","define","amd","exports","module","require","jQuery","$","isset","variable","document","ready","append","events","on","eventName","fn","this","push","off","i","length","splice","emit","data","forEach","snackbar","options","Object","$snackbar","snackbarNew","id","attr","Date","now","snackbarStatus","hasClass","style","htmlAllowed","timeout","content","text","onClose","find","html","prepend","appendTo","insertAfter","action","animationId1","setTimeout","removeClass","addClass","animationId2","parseInt"],"mappings":"CAEC,SAAUA,GACe,kBAAXC,SAAyBA,OAAOC,IAEvCD,QAAQ,UAAWD,GACO,gBAAZG,SAEdC,OAAOD,QAAUH,EAAQK,QAAQ,WAGjCL,EAAQM,SAEd,SAAUC,GAMR,QAASC,GAAMC,GACX,MAAwB,mBAAbA,IAAyC,OAAbA,GAC5B,GAEA,EARfF,EAAEG,UAAUC,MAAM,WACdJ,EAAE,QAAQK,OAAO,iCAYrB,IAAIC,IACFA,UACAC,GAAI,SAAUC,EAAWC,GACvBC,KAAKJ,OAAOE,GAAaE,KAAKJ,OAAOE,OACrCE,KAAKJ,OAAOE,GAAWG,KAAKF,IAE9BG,IAAK,SAASJ,EAAWC,GACvB,GAAIC,KAAKJ,OAAOE,GACd,IAAK,GAAIK,GAAI,EAAGA,EAAIH,KAAKJ,O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CQ,QAASjC,EAAEU,MAAMe,KAAK,gBACtBK,MAAO9B,EAAEU,MAAMe,KAAK,cACpBO,QAASe,SAAS/C,EAAEU,MAAMe,KAAK,iBAC/BM,YAAa/B,EAAEU,MAAMe,KAAK,uBAEpB,SAAXgB,GAAgC,SAAXA,GAA+B,UAAVA,KACzCrB,EAAQqB,OAASA,GAEdzC,EAAEmB,SAASC,EAlCbnB,GAAMwC,IAAsB,SAAXA,GAAgC,SAAXA,GAA+B,UAAVA,IAC5DrB,GACIa,QAASjC,EAAEU,MAAMe,KAAK,gBACtBK,MAAO9B,EAAEU,MAAMe,KAAK,cACpBO,QAAShC,EAAEU,MAAMe,KAAK,gBACtBM,YAAa/B,EAAEU,MAAMe,KAAK,uBAI9BxB,EAAMwC,KACNrB,EAAQI,GAAKd,KAAKe,KAAK,qBAET,SAAXgB,GAAgC,SAAXA,GAA+B,UAAVA,KACzCrB,EAAQqB,OAASA,GAIzB,IAAInB,GAAYtB,EAAEmB,SAASC,EAG3B,OAFAV,MAAKe,KAAK,mBAAoBH,EAAUG,KAAK,OAEtCH","file":"snackbar.min.js"} \ No newline at end of file diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/package.json b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/package.json new file mode 100644 index 0000000..55773d3 --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/package.json @@ -0,0 +1,24 @@ +{ + "name": "snackbarjs", + "version": "1.1.0", + "description": "SnackbarJS is a lightweight and jQuery powered plugin made to work in Bootstrap style, just like the Bootstrap tooltips work.", + "main": "src/snackbar", + "repository": { + "type": "git", + "url": "https://github.com/FezVrasta/snackbarjs.git" + }, + "author": "FezVrasta", + "license": "ISC", + "bugs": { + "url": "https://github.com/FezVrasta/snackbarjs/issues" + }, + "homepage": "https://github.com/FezVrasta/snackbarjs", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-contrib-copy": "^0.7.0", + "grunt-contrib-cssmin": "^0.10.0", + "grunt-contrib-jshint": "^0.10.0", + "grunt-contrib-less": "^0.12.0", + "grunt-contrib-uglify": "^0.6.0" + } +} diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/src/snackbar.js b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/src/snackbar.js new file mode 100644 index 0000000..bbe79ec --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/src/snackbar.js @@ -0,0 +1,212 @@ +/* SnackbarJS - MIT LICENSE (https://github.com/FezVrasta/snackbarjs/blob/master/LICENSE.md) */ + +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS + module.exports = factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } +}(function( $ ){ + + $(document).ready(function() { + $("body").append("
"); + }); + + function isset(variable) { + if (typeof variable !== "undefined" && variable !== null) { + return true; + } else { + return false; + } + } + + //events (publish subscribe) pattern [aka Event Emitter] + var events = { + events: {}, + on: function (eventName, fn) { + this.events[eventName] = this.events[eventName] || []; + this.events[eventName].push(fn); + }, + off: function(eventName) { + if (this.events[eventName]) { + delete this.events[eventName]; + } + }, + emit: function (eventName, data) { + if (this.events[eventName]) { + this.events[eventName].forEach(function(fn) { + fn(data); + }); + } + } + }; + + $(document) + .on("click", "[data-toggle=snackbar]", function() { + $(this).snackbar("toggle"); + }) + .on("click", "#snackbar-container .snackbar", function() { + $(this).snackbar("hide"); + }); + + $.snackbar = function(options) { + + if (isset(options) && options === Object(options)) { + var $snackbar; + + var snackbarNew = false; + + if (!isset(options.id)) { + options.id = "snackbar" + Date.now(); + $snackbar = $("
").attr("id", options.id).attr("class", "snackbar"); + snackbarNew = true; + } else { + if ($("#" + options.id).length) { + $snackbar = $("#" + options.id); + } else { + $snackbar = $("
").attr("id", "" + options.id).attr("class", "snackbar"); + snackbarNew = true; + } + } + + var snackbarStatus = $snackbar.hasClass("snackbar-opened"); + + if (isset(options.style)) { + if (snackbarStatus) { + $snackbar.attr("class", "snackbar snackbar-opened " + options.style); + } else { + $snackbar.attr("class", "snackbar " + options.style); + } + $snackbar.attr("data-style", options.style); + } else { + if (snackbarStatus) { + $snackbar.attr("class", "snackbar snackbar-opened"); + } else { + $snackbar.attr("class", "snackbar"); + } + } + + options.htmlAllowed = isset(options.htmlAllowed) ? options.htmlAllowed : false; + + options.timeout = (isset(options.timeout)) ? options.timeout : 3000; + $snackbar.attr("data-timeout", options.timeout); + + options.content = (options.htmlAllowed) ? options.content : $("

" + options.content + "

").text(); + + if (isset(options.onClose)) events.on(options.id, options.onClose); + + if (isset(options.htmlAllowed)) { + $snackbar.attr("data-html-allowed", options.htmlAllowed); + } + + if (isset(options.content)) { + if ($snackbar.find(".snackbar-content").length) { + $snackbar.find(".snackbar-content").html(options.content); + } else { + $snackbar.prepend("" + options.content + ""); + } + $snackbar.attr("data-content", options.content); + } + + if (snackbarNew) { + $snackbar.appendTo("#snackbar-container"); + } else { + $snackbar.insertAfter("#snackbar-container .snackbar:last-child"); + } + + // Show or hide item + if (isset(options.action) && options.action == "toggle") { + if (snackbarStatus) { + options.action = "hide"; + } else { + options.action = "show"; + } + } + + var animationId1 = Date.now(); + $snackbar.data("animationId1", animationId1); + setTimeout(function() { + if ($snackbar.data("animationId1") === animationId1) { + if (!isset(options.action) || options.action == "show") { + $snackbar.addClass("snackbar-opened"); + } else if (isset(options.action) && options.action == "hide") { + $snackbar.removeClass("snackbar-opened"); + events.emit(options.id); + events.off(options.id); + } + } + }, 50); + + // Set timer for item autohide + var animationId2 = Date.now(); + $snackbar.data("animationId2", animationId2); + + if (options.timeout !== 0) { + setTimeout(function() { + if ($snackbar.data("animationId2") === animationId2) { + $snackbar.removeClass("snackbar-opened"); + events.emit(options.id); + events.off(options.id); + } + }, options.timeout); + } + + return $snackbar; + + } else { + return false; + } + }; + + $.fn.snackbar = function(action) { + if (typeof action==='undefined'){ + return; + } + var options = {}; + + if (!this.hasClass("snackbar")) { + + if (!isset(action) || action === "show" || action === "hide" || action == "toggle") { + options = { + content: $(this).attr("data-content"), + style: $(this).attr("data-style"), + timeout: $(this).attr("data-timeout"), + htmlAllowed: $(this).attr("data-html-allowed") + }; + } + + if (isset(action)) { + options.id = this.attr("data-snackbar-id"); + + if(action === "show" || action === "hide" || action == "toggle") { + options.action = action; + } + } + + var $snackbar = $.snackbar(options); + this.attr("data-snackbar-id", $snackbar.attr("id")); + + return $snackbar; + + } else { + + options = { + id: this.attr("id"), + content: $(this).attr("data-content"), + style: $(this).attr("data-style"), + timeout: parseInt($(this).attr("data-timeout")), + htmlAllowed: $(this).attr("data-html-allowed") + }; + if(action === "show" || action === "hide" || action == "toggle") { + options.action = action; + } + return $.snackbar(options); + } + + }; +})); diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/src/snackbar.less b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/src/snackbar.less new file mode 100644 index 0000000..23e6896 --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/src/snackbar.less @@ -0,0 +1,38 @@ +// out: snackbar.css +#snackbar-container { + position: fixed; + left: 20px; + bottom: 0; + z-index: 99999; +} +.snackbar { + overflow: hidden; + clear: both; + min-width: 288px; + max-width: 568px; + cursor: pointer; + opacity: 0; +} + +.snackbar.snackbar-opened { + height: auto; + opacity: 1; +} + +@media (max-width: 767px) { + #snackbar-container { + left: 0px !important; + right: 0px; + width: 100%; + .snackbar { + min-width: 100%; + } + [class="snackbar snackbar-opened"] ~ .snackbar.toast { + margin-top: 20px; + } + [class="snackbar snackbar-opened"] { + border-radius: 0; + margin-bottom: 0; + } + } +} diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/themes-css/material.css b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/themes-css/material.css new file mode 100644 index 0000000..b9cda67 --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/themes-css/material.css @@ -0,0 +1,28 @@ +.snackbar { + background-color: #323232; + color: #FFFFFF; + font-size: 14px; + border-radius: 2px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + height: 0; + -moz-transition: -moz-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, padding 0s linear 0.2s, height 0s linear 0.2s; + -webkit-transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, padding 0s linear 0.2s, height 0s linear 0.2s; + transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, padding 0s linear 0.2s, height 0s linear 0.2s; + -moz-transform: translateY(200%); + -webkit-transform: translateY(200%); + transform: translateY(200%); +} +.snackbar.snackbar-opened { + padding: 14px 15px; + margin-bottom: 20px; + height: auto; + -moz-transition: -moz-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s; + -webkit-transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s; + transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, height 0s linear 0.2s; + -moz-transform: none; + -webkit-transform: none; + transform: none; +} +.snackbar.toast { + border-radius: 200px; +} diff --git a/pacotes/bootstrap-material-design/snackbarjs-1.1.0/themes-less/material.less b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/themes-less/material.less new file mode 100644 index 0000000..3d52dc8 --- /dev/null +++ b/pacotes/bootstrap-material-design/snackbarjs-1.1.0/themes-less/material.less @@ -0,0 +1,39 @@ +// out: ../themes-css/material.css + +.snackbar { + // Style + background-color: #323232; + color: #FFFFFF; + font-size: 14px; + border-radius: 2px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); + + // Animation + height: 0; + -moz-transition: -moz-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, padding 0s linear 0.2s, height 0s linear 0.2s; + -webkit-transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, padding 0s linear 0.2s, height 0s linear 0.2s; + transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, padding 0s linear 0.2s, height 0s linear 0.2s; + -moz-transform: translateY(200%); + -webkit-transform: translateY(200%); + transform: translateY(200%); +} + +.snackbar.snackbar-opened { + // Style + padding: 14px 15px; + margin-bottom: 20px; + + // Animation + height: auto; + -moz-transition: -moz-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s; + -webkit-transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s; + transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, height 0s linear 0.2s; + -moz-transform: none; + -webkit-transform: none; + transform: none; +} + +// Variations +.snackbar.toast { + border-radius: 200px; +} -- libgit2 0.21.2