diff --git a/static/img/livros2.jpg b/static/img/livros2.jpg index 321aabf..1df7715 100644 Binary files a/static/img/livros2.jpg and b/static/img/livros2.jpg differ diff --git a/static/img/livros3.jpg b/static/img/livros3.jpg index a83cc48..6e3c1f4 100644 Binary files a/static/img/livros3.jpg and b/static/img/livros3.jpg differ diff --git a/static/materialize/LICENSE b/static/materialize/LICENSE index 9853a98..fcff17e 100644 Binary files a/static/materialize/LICENSE and b/static/materialize/LICENSE differ diff --git a/static/materialize/icons/material_icons.css b/static/materialize/icons/material_icons.css index 763193f..141d32c 100644 Binary files a/static/materialize/icons/material_icons.css and b/static/materialize/icons/material_icons.css differ diff --git a/static/scripts/libx.js b/static/scripts/libx.js index f3025d9..92c284a 100644 --- a/static/scripts/libx.js +++ b/static/scripts/libx.js @@ -1,115 +1,111 @@ -var API_XHR = new XMLHttpRequest() -var API_URL = 'index.php' -function api(cmd, ok = function (res) {}, error = function (res) {}) { - API_XHR.open('POST', API_URL, true) - API_XHR.setRequestHeader('Content-Type', 'application/json') - API_XHR.onreadystatechange = function () { - if (API_XHR.readyState === 4) { - if (API_XHR.status === 200) { - var res = JSON.parse(API_XHR.responseText) - ok(res) - } else { - error({ res: 'error', msg: 'conection error' }) - } +var API_XHR = new XMLHttpRequest(); +var API_URL = "index.php"; +function api(cmd,ok = function (res) { }, error = function (res) { }){ + API_XHR.open("POST", API_URL, true); + API_XHR.setRequestHeader("Content-Type", "application/json"); + API_XHR.onreadystatechange = function () { + if (API_XHR.readyState === 4){ + if(API_XHR.status === 200) { + var res = JSON.parse(API_XHR.responseText); + ok(res); + }else{ + error({"res":"error","msg":"conection error"}); + } + } + }; + API_XHR.send(JSON.stringify(cmd)); + } +var ultima_aba_mostrada = "" +function mostrar_aba(aba){ + if(ultima_aba_mostrada!=""){ document.getElementById(ultima_aba_mostrada).style.display = "none";} + document.getElementById(aba).style.display = "block" + ultima_aba_mostrada = aba + //document.getElementById("titulo_do_menu").innerHTML = aba + } +function DEVICE_IS_MOBILE() { + if( navigator.userAgent.match(/Android/i) + || navigator.userAgent.match(/webOS/i) + || navigator.userAgent.match(/iPhone/i) + || navigator.userAgent.match(/iPad/i) + || navigator.userAgent.match(/iPod/i) + || navigator.userAgent.match(/BlackBerry/i) + || navigator.userAgent.match(/Windows Phone/i) + ){return true;}else{return false;} } - } - API_XHR.send(JSON.stringify(cmd)) -} -var ultima_aba_mostrada = '' -function mostrar_aba(aba) { - if (ultima_aba_mostrada != '') { - document.getElementById(ultima_aba_mostrada).style.display = 'none' - } - document.getElementById(aba).style.display = 'block' - ultima_aba_mostrada = aba - //document.getElementById("titulo_do_menu").innerHTML = aba -} -function DEVICE_IS_MOBILE() { - if ( - navigator.userAgent.match(/Android/i) || - navigator.userAgent.match(/webOS/i) || - navigator.userAgent.match(/iPhone/i) || - navigator.userAgent.match(/iPad/i) || - navigator.userAgent.match(/iPod/i) || - navigator.userAgent.match(/BlackBerry/i) || - navigator.userAgent.match(/Windows Phone/i) - ) { - return true - } else { - return false - } -} function findGetParameter(parameterName) { - var result = null, - tmp = [] - var items = location.search.substr(1).split('&') - for (var index = 0; index < items.length; index++) { - tmp = items[index].split('=') - if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]) - } - return result -} -function setCookie(name, value, days = 1) { - var expires = '' - if (days) { - var date = new Date() - date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000) - expires = '; expires=' + date.toUTCString() - } - document.cookie = name + '=' + (value || '') + expires + '; path=/' -} -function getCookie(name) { - var nameEQ = name + '=' - var ca = document.cookie.split(';') - for (var i = 0; i < ca.length; i++) { - var c = ca[i] - while (c.charAt(0) == ' ') c = c.substring(1, c.length) - if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length) - } - return null -} -function eraseCookie(name) { - document.cookie = name + '=; Max-Age=-99999999;' -} -var IMPRIMIR_NO_CONSOLE = true -function p(text) { - if (IMPRIMIR_NO_CONSOLE) { - console.log(text) - } -} -function sortArrayByKeys(dict, reverter = false) { - var sorted = [] - for (var key in dict) { - sorted[sorted.length] = key - } - sorted.sort() - if (reverter) { - sorted.reverse() - } - var tempDict = {} - for (var i = 0; i < sorted.length; i++) { - tempDict[sorted[i]] = dict[sorted[i]] - } - - return tempDict -} -function arrayRemove(arr, value) { - return arr.filter(function (ele) { - return ele != value - }) -} - -const rotateBase64Image = base64data => { - const canvas = document.createElement('canvas') - const ctx = canvas.getContext('2d') - const image = new Image() - image.src = base64data - return new Promise(resolve => { - image.onload = () => { - ctx.translate(image.width, image.height) - ctx.rotate((45 * Math.PI) / 180) - ctx.drawImage(image, 0, 0) - resolve(canvas.toDataURL()) + var result = null, + tmp = []; + var items = location.search.substr(1).split("&"); + for (var index = 0; index < items.length; index++) { + tmp = items[index].split("="); + if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]); } - }) -} + return result; + } +function setCookie(name,value,days=1) { + var expires = ""; + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days*24*60*60*1000)); + expires = "; expires=" + date.toUTCString(); + } + document.cookie = name + "=" + (value || "") + expires + "; path=/"; + } +function getCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for(var i=0;i < ca.length;i++) { + var c = ca[i]; + while (c.charAt(0)==' ') c = c.substring(1,c.length); + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); + } + return null; + } +function eraseCookie(name) { + document.cookie = name+'=; Max-Age=-99999999;'; + } +var IMPRIMIR_NO_CONSOLE = true; +function p(text) { + if(IMPRIMIR_NO_CONSOLE){ + console.log(text); + } + } +function sortArrayByKeys(dict,reverter=false) { + var sorted = []; + for(var key in dict) { + sorted[sorted.length] = key; + } + sorted.sort(); + if(reverter){ + sorted.reverse(); + } + var tempDict = {}; + for(var i = 0; i < sorted.length; i++) { + tempDict[sorted[i]] = dict[sorted[i]]; + } + + return tempDict; + } +function arrayRemove(arr, value) { + + return arr.filter(function(ele){ + return ele != value; + }); + } + +const rotateBase64Image = (base64data) => { + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d"); + const image = new Image(); + image.src = base64data; + return new Promise(resolve => { + image.onload = () => { + ctx.translate(image.width, image.height); + ctx.rotate(45 * Math.PI / 180); + ctx.drawImage(image, 0, 0); + resolve(canvas.toDataURL()) + }; + }) + } + + \ No newline at end of file