{"version":3,"sources":["app.aux.js","app.common.js","app.js","mainScipts.js"],"names":["$","browserTest","a","z","u","x","m","r","h","i","length","replace","c","b","name","exec","version","match","browser","versionNumber","parseFloat","versionX","substr","className","toLowerCase","extend","layout","os","navigator","platform","addClass","join","userAgent","jQuery","document","implementation","hasFeature","istouch","window","isMobile","test","inputLimiter","e","tipo","AllowableCharacters","k","all","parseInt","keyCode","which","ctrlKey","altKey","indexOf","String","fromCharCode","aux","htmlEncode","value","text","html","htmlDecode","htmlDecodeAlternativo","textArea","createElement","innerHTML","sucesso","texto","alert","erro","getTimeFromSeconds","segundos","hours","minutes","seconds","cleanString","string","split","countDown","start","update","callback","setTimeout","scrollElement","elem","tempo","animate","scrollTop","offset","top","checkSize","valor","ColorLuminance","hex","lum","rgb","Math","round","min","max","toString","isEmail","email","trim","hideMe","obj","visibility","style","display","cookies","add","cookie","this","existe","valoresCookie","get","create","remove","cookieVal","count","stringFinal","nameEQ","ca","charAt","substring","nrDias","date","Date","setTime","getTime","expires","toGMTString","erase","Array","prototype","elt","len","from","Number","arguments","ceil","floor","_API","apiUrl","requestData","escondeErros","doRequest","insert","metodo","headers","getRequestHeaders","request2","ajax","url","type","data","done","removeClass","fail","jqXHR","textStatus","erroString","responseText","erroJson","JSON","parse","Message","console","log","ExceptionType","StackTrace","maNoti","statusText","output","X-AccessToken","sessao","xzonaPermissao","getInputValues","selector","diferenciaEntreVazioEZero","dados","each","campo","getCleanVal","push","nome","getInputValuesObj","getInputValuesObjGeral","attr","val","hasClass","is","isNaN","temLocalStorageSuport","mod","localStorage","setItem","removeItem","editores","init","tinymce","plugins","theme","language","toolbar1","toolbar2","setup","ed","id","settings","readonly","menubar","toolbar_items_size","encode","tinyMCE","triggerSave","decode","escondePrimeiraColuna","css","head","getElementsByTagName","appendChild","styleSheet","cssText","createTextNode","tabela","tabelaHolderObj","opcoesOverride","options","pageSize","apiData","rowClicked","urlRemove","permitePicker","temRemove","hide","actions","filter","columnPicker","custom","idiomasAdmin","removerRegistosSelecionados","WATable","assyncPaginacao","pageSizes","hidePagerOnEmpty","preFill","urlData","types","placeHolder","number","bool","tooltip","utc","format","datePicker","tableCreated","onCreate","dataCallback","find","disableSelection","index","fadeIn","click","linhasSelecionadas","getData","rows","selected","confirm","stringify","idsite","idSiteGlobal","dataType","success","xml","error","XMLHttpRequest","errorThrown","tabs","callbackMenu","callbackSubmenu","preventDefault","_thisObj","thisPainel","siblings","first","show","stopPropagation","indexPai","parent","eq","maTimer","_this","timeout","podeEditar","isAdmin","master","initBrowserCheck","initMasterResize","resize","addEventListener","FastClick","body","after","change","location","bindInputHandler","keypress","placeholder","shim","largura","width","RegExp","$1","stop","slideDown","opacity","slideUp","dashborad","counter","opcoesTabela","pg","onTableCreated","option","resetPage","views","ctx","getElementById","getContext","myDoughnut","Chart","Doughnut","responsive","animation","timer","clearInterval","reload","dashboard","updateEmSingular","updateEmPlural","formularios","edit","emailsExistentes","idform","on","Page_ClientValidate","__doPostBack","popups","preencherCamposObrigatorios","select2","tags","tokenSeparators","initSelection","element","maximumSelectionSize","prop","closest","fadeOut","defineProp","sortable","distance","forceHelperSize","containment","forcePlaceholderSize","handle","event","ui","array","defineOrdem","erroApenasPodeEscolherUm","btnInserir","xid","opcoes","esteIdioma","encontrou","item","idioma","j","campos","itemCampo","append","nome_pt","nome_pt1","nome_pt2","nome_pt3","nome_pt4","class","linha","indexInput","preencherTodosCampos","nomePt","nomePt1","nomePt2","nomePt3","nomePt4","cssClass","formData","npt","npt1","npt2","npt3","npt4","classCss","camposArray","modal","close","notify","alteracoesGuardadasSucesso","Erro","ids","v","ordem","o","menus","listagem","idfam","artigos","persist","onClose","idpai","abreEdit","target","axis","order","active","pagesize","actual","text-indent","p","startCount","social","pesq","getItem","pesquisa","classExtra","t","categoria","promocao","toggleClass","off","detalhe","mapa","load","uploader","horarios","bindAdminClicks","media","loadSortable","bindClicks","bindClickMenus","height","bindDatePickers","datepicker","changeMonth","changeYear","yearRange","getFullYear","dateFormat","monthNamesShort","MesesMin","dayNamesMin","DiasSemana","id1","id2","accao","defineRelaco","idfam1","idfam2","idsrel","idfams","defineOrdemRelacao","defineOrdemRelacaoMultipla","defineTipoProduto","idartigo","idTipo","idOpcao","listas","consent","guardarAlteracoesErro","guardarAlteracoesSucesso","activo","definePropNews","titulo","urlSearch","htmlPop","property","hasOwnProperty","closeHTML","position","overlayId","containerId","onShow","dialog","minimumInputLength","query","term","resultados","results","preechidos","valores","input","insertNewItem","novoValorData","currentTarget","href","pretendeEliminarItem","definePropValido","itemInseridoErro","itemInseridoSucesso","slideToggle","variaveis","s","bindFiltrosClicks","pesquisaVal","tipoVal","_holderObj","textGuardadoSucesso","friendlys","redirects","redirect","idiomas","script","src","getScript","jqxhr","zoom","marcadores","mapaMA","mapOptions","dragEnd","lat","lng","updateCoordenadas","latitude","longitude","idArtigo","updatePosition","updateLista","ajustaTamanho","inputName","lastIndexOf","funcao","objAnim","altura","startCalendarios","minDate","maxDate","firstDay","onSelect","dateParts","diaSemana","getDay","beforeShowDay","result","verificaExcepcoes","feriados","dataInicio","dataFim","nrDiasSemana","countCertainDays","textoDias","dataTemp","dataS","nrDiasValidos","diasValidos","getMonth","getDate","existeFeriado","setDate","inserirData","arrayExcepcoes","anoActual","ano","fixo","dataLocal","days","d0","d1","ndays","reduce","mensagem","pedidosContacto","atencao","isFunction","apply","teste","PopupConfig","appendTo","ecommerceList","apid","listName","urlRemover","row","nomeExtra","totais","totaisHtml","Nome","Valor","estado","idProduto","dataIni","dataFin","ecommerceCarrinhosAbandonadosList","iniciaEmpresa","trigger","self","mapaExiste","loadMapa","uploadExiste","loadUpload","live","encodeFields","closeModal","decodeFields","encodeTinymceFields","getContent"],"mappings":"CAAA,SAAWA,GAAKA,EAAEC,YAAc,SAAUC,EAAGC,GAAK,IAAIC,EAAI,UAAWC,EAAI,IAAKC,EAAI,SAAUC,EAAGC,GAAK,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAEE,OAAQD,GAAQ,EAAKF,EAAIA,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IAAiBC,EAAsB,cAC/B,SAARD,IAAmBC,EAAsB,eACjC,SAARD,IAAmBC,EAAsB,eACjC,aAARD,IAAuBC,EAAsB,eACrC,WAARD,IAAqBC,EAAsB,mEAE/C,IAAIC,EAAIX,SAASY,IAAMC,SAASL,EAAEM,SAAWD,SAASL,EAAEO,OACxD,OAAS,IAALJ,GAAgB,GAALA,GAAe,GAALA,IACH,GAAbH,EAAEQ,SAAkC,GAAZR,EAAES,SACqC,GAAxDP,EAAoBQ,QAAQC,OAAOC,aAAaT","file":"all.min.js","sourcesContent":["(function ($) { $.browserTest = function (a, z) { var u = 'unknown', x = 'X', m = function (r, h) { for (var i = 0; i < h.length; i = i + 1) { r = r.replace(h[i][0], h[i][1]); } return r; }, c = function (i, a, b, c) { var r = { name: m((a.exec(i) || [u, u])[1], b) }; r[r.name] = true; r.version = (c.exec(i) || [x, x, x, x])[3]; if (r.name.match(/safari/) && r.version > 400) { r.version = '2.0'; } if (r.name === 'presto') { r.version = ($.browser.version > 9.27) ? 'futhark' : 'linear_b'; } r.versionNumber = parseFloat(r.version, 10) || 0; r.versionX = (r.version !== x) ? (r.version + '').substr(0, 1) : x; r.className = r.name + r.versionX; return r; }; a = (a.match(/Opera|Navigator|Minefield|KHTML|Chrome/) ? m(a, [[/(Firefox|MSIE|KHTML,\\slike\\sGecko|Konqueror)/, ''], ['Chrome Safari', 'Chrome'], ['KHTML', 'Konqueror'], ['Minefield', 'Firefox'], ['Navigator', 'Netscape']]) : a).toLowerCase(); $.browser = $.extend((!z) ? $.browser : {}, c(a, /(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/, [], /(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\\/|\\s)([a-z0-9\\.\\+]*?)(\\;|dev|rel|\\s|$)/)); $.layout = c(a, /(gecko|konqueror|msie|opera|webkit)/, [['konqueror', 'khtml'], ['msie', 'trident'], ['opera', 'presto']], /(applewebkit|rv|konqueror|msie)(\\:|\\/|\\s)([a-z0-9\\.]*?)(\\;|\\)|\\s)/); $.os = { name: (/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase()) || [u])[0].replace('sunos', 'solaris') }; if (!z) { $('html').addClass([$.os.name, $.browser.name, $.browser.className, $.layout.name, $.layout.className].join(' ')); } }; $.browserTest(navigator.userAgent); })(jQuery);\r\nif (document.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#Image\", \"1.1\")) { $('html').addClass('svg'); }\r\nvar istouch = !!('ontouchstart' in window);\r\n\r\nfunction isMobile() {\r\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction inputLimiter(e, tipo) {\r\n var AllowableCharacters = '';\r\n\r\n if (tipo == 'letras') { AllowableCharacters = ' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; }\r\n if (tipo == 'int') { AllowableCharacters = '1234567890'; }\r\n if (tipo == 'float') { AllowableCharacters = '1234567890.'; }\r\n if (tipo == 'codpostal') { AllowableCharacters = '1234567890-'; }\r\n\r\n var k = document.all ? parseInt(e.keyCode) : parseInt(e.which);\r\n if (k != 13 && k != 8 && k != 0) {\r\n if ((e.ctrlKey == false) && (e.altKey == false)) {\r\n return (AllowableCharacters.indexOf(String.fromCharCode(k)) != -1);\r\n } else {\r\n return true;\r\n }\r\n } else {\r\n return true;\r\n }\r\n}\r\n\r\n/* -- FUNCOES AUXILIARES -- */\r\nvar aux = {\r\n htmlEncode: function (value) {\r\n return $('
').text(value).html();\r\n },\r\n htmlDecode: function (value) {\r\n return $('
').html(value).text();\r\n },\r\n htmlDecodeAlternativo: function (value) {\r\n\r\n var textArea = document.createElement('textarea');\r\n textArea.innerHTML = value;\r\n return textArea.value;\r\n },\r\n sucesso: function (texto) {\r\n alert(texto);\r\n },\r\n erro: function (texto) {\r\n alert(texto);\r\n },\r\n getTimeFromSeconds: function (segundos) {\r\n var hours = parseInt(segundos / 3600) % 24,\r\n minutes = parseInt(segundos / 60) % 60,\r\n seconds = segundos % 60;\r\n\r\n var result = \"\";\r\n if (hours > 0) {\r\n result = (hours < 10 ? \"0\" + hours : hours) + \"h\" + (minutes < 10 ? \"0\" + minutes : minutes) + \"m\" + (seconds < 10 ? \"0\" + seconds : seconds) + \"s\";\r\n } else if (minutes > 0) {\r\n result = (minutes < 10 ? \"0\" + minutes : minutes) + \"m\" + (seconds < 10 ? \"0\" + seconds : seconds) + \"s\";\r\n } else if (seconds > 0) {\r\n result = (seconds < 10 ? \"0\" + seconds : seconds) + \"s\";\r\n } else {\r\n result = \"-\";\r\n }\r\n\r\n return result;\r\n },\r\n cleanString: function (string) {\r\n\r\n return string.split(\"'\").join(\"\\\\u0027\").split('\"').join(\"\\\\u0022\");;\r\n },\r\n\r\n countDown: function (start, update, callback) {\r\n start--;\r\n update(start);\r\n if (start > 0) {\r\n setTimeout(function () {\r\n aux.countDown(start, update, callback)\r\n }, 1000);\r\n } else {\r\n callback();\r\n }\r\n },\r\n scrollElement: function (elem, tempo) {\r\n $('html, body').animate({ scrollTop: $(elem).offset().top }, tempo);\r\n },\r\n\tcheckSize: function (valor) {\r\n if (valor < 10) {\r\n valor = \"0\" + valor;\r\n }\r\n return valor;\r\n\t},\r\n\tColorLuminance: function (hex, lum) {\r\n\r\n\t hex = String(hex).replace(/[^0-9a-f]/gi, '');\r\n\t if (hex.length < 6) {\r\n\t hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];\r\n\t }\r\n\t lum = lum || 0;\r\n\r\n\t var rgb = \"#\", c, i;\r\n\t for (i = 0; i < 3; i++) {\r\n\t c = parseInt(hex.substr(i * 2, 2), 16);\r\n\t c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16);\r\n\t rgb += (\"00\" + c).substr(c.length);\r\n\t }\r\n\t return rgb;\r\n\t},\r\n\tisEmail: function (email) {\r\n\t var re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n\t return re.test(email.trim());\r\n },\r\n hideMe: function (obj, visibility) {\r\n if (visibility)\r\n obj.style.visibility = 'hidden';\r\n else\r\n obj.style.display = 'none';\r\n }\r\n}\r\nvar cookies = {\r\n add: function (cookie, valor) {\r\n\r\n if (!this.existe(cookie, valor)) {\r\n\r\n var valoresCookie = this.get(cookie);\r\n if (valoresCookie != \"\") {\r\n valoresCookie += \",\";\r\n }\r\n valoresCookie += valor;\r\n\r\n this.create(cookie, valoresCookie);\r\n }\r\n },\r\n remove: function (cookie, valor) {\r\n var cookieVal = this.get(cookie),\r\n count = 0;\r\n if (cookieVal != null) {\r\n\r\n var valoresCookie = cookieVal.split(','),\r\n stringFinal = \"\";\r\n\r\n for (var i = 0; i < valoresCookie.length; i++) {\r\n if (valor == valoresCookie[i]) {\r\n count++;\r\n } else {\r\n if (stringFinal != \"\") {\r\n stringFinal += \",\";\r\n }\r\n stringFinal += valoresCookie[i];\r\n }\r\n }\r\n\r\n this.create(cookie, stringFinal);\r\n\r\n }\r\n return count;\r\n\r\n },\r\n existe: function (cookie, valor) {\r\n var cookieVal = this.get(cookie);\r\n if (cookieVal != null) {\r\n var valoresCookie = cookieVal.split(','),\r\n existe = false;\r\n\r\n for (var i = 0; i < valoresCookie.length; i++) {\r\n if (valor == valoresCookie[i]) {\r\n existe = true;;\r\n i = valoresCookie.length;;\r\n }\r\n }\r\n return existe;\r\n } else {\r\n return false;\r\n }\r\n },\r\n get: function (name) {\r\n\r\n var nameEQ = name + \"=\";\r\n var ca = document.cookie.split(';');\r\n\r\n for (var i = 0; i < ca.length; i++) {\r\n var c = ca[i];\r\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\r\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\r\n }\r\n return null;\r\n },\r\n create: function (name, value, nrDias) {\r\n if (nrDias == null) {\r\n nrDias = 7;\r\n }\r\n var date = new Date();\r\n date.setTime(date.getTime() + (nrDias * 24 * 60 * 60 * 1000));\r\n var expires = \"; expires=\" + date.toGMTString();\r\n\r\n document.cookie = name + \"=\" + value + expires + \"; path=/\";\r\n },\r\n erase: function (name) {\r\n this.create(name, '', -1);\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n\r\nif (!Array.prototype.indexOf) {\r\n Array.prototype.indexOf = function (elt /*, from*/) {\r\n var len = this.length >>> 0;\r\n var from = Number(arguments[1]) || 0;\r\n from = (from < 0) ? Math.ceil(from) : Math.floor(from);\r\n if (from < 0) from += len;\r\n\r\n for (; from < len; from++) {\r\n if (from in this && this[from] === elt) return from;\r\n }\r\n return -1;\r\n };\r\n}\r\n\r\n\r\n\r\nvar _API = {\r\n get: function (apiUrl, requestData, elem, callback, escondeErros) {\r\n this.doRequest(\"GET\", apiUrl, requestData, elem, callback, escondeErros);\r\n },\r\n insert: function (apiUrl, requestData, elem, callback) {\r\n this.doRequest(\"POST\", apiUrl, requestData, elem, callback);\r\n },\r\n update: function (apiUrl, requestData, elem, callback) {\r\n this.doRequest(\"POST\", apiUrl, requestData, elem, callback);\r\n },\r\n remove: function (apiUrl, requestData, elem, callback) {\r\n this.doRequest(\"POST\", apiUrl, requestData, elem, callback);\r\n },\r\n doRequest: function (metodo, apiUrl, requestData, elem, callback, escondeErros) {\r\n\r\n if (!requestData) {\r\n requestData = {};\r\n }\r\n\r\n var headers = this.getRequestHeaders(requestData);\r\n\r\n var request2 = $.ajax({\r\n url: apiUrl,\r\n type: metodo,\r\n data: requestData,\r\n headers: headers\r\n });\r\n\r\n //NProgress.start();\r\n if (elem) {\r\n elem.addClass(\"loading\");\r\n }\r\n request2.done(function (data) {\r\n\r\n if (callback) {\r\n callback(data);\r\n }\r\n\r\n //NProgress.done();\r\n if (elem) {\r\n elem.removeClass(\"loading\");\r\n }\r\n\r\n\r\n });\r\n request2.fail(function (jqXHR, textStatus, b, c) {\r\n\r\n //NProgress.done();\r\n if (elem) {\r\n elem.removeClass(\"loading\");\r\n }\r\n\r\n var erroString = jqXHR.responseText;\r\n if (erroString && erroString.indexOf(\"ExceptionMessage\") > -1) {\r\n var erroJson = JSON.parse(erroString);\r\n if (erroJson.Message) {\r\n console.log(erroJson.ExceptionType);\r\n console.log(erroJson.StackTrace);\r\n console.log(erroJson.Message);\r\n } else {\r\n console.log(erroString);\r\n }\r\n } else {\r\n console.log(erroString);\r\n }\r\n if (!escondeErros) {\r\n maNoti.erro(\"Ocorreu um erro ao ligar ao servidor
\" + jqXHR.statusText);\r\n }\r\n });\r\n\r\n },\r\n getRequestHeaders: function (data) {\r\n\r\n var output = {\r\n //'X-AccessID': accessToken.replace(/([a-z-])/gi,''),\r\n 'X-AccessToken': sessao\r\n //'X-UserId': accessToken.replace(/([0-9-])/gi,'')\r\n };\r\n\r\n if (data && data.xzonaPermissao) {\r\n output['X-zonaPermissao'] = data.xzonaPermissao;\r\n }\r\n\r\n return output;\r\n\r\n },\r\n getInputValues: function (selector, diferenciaEntreVazioEZero) {\r\n var dados = [];\r\n\r\n var obj = typeof selector == \"string\" ? $(selector) : selector;\r\n\r\n obj.each(function () {\r\n var campo = $(this).data(\"nome\");\r\n if (campo) {\r\n var valor = getCleanVal($(this));\r\n\r\n if (!diferenciaEntreVazioEZero) {\r\n if (valor == -1) {\r\n valor = 0;\r\n }\r\n }\r\n\r\n dados.push({ \"nome\": campo, \"valor\": valor });\r\n }\r\n });\r\n\r\n return dados;\r\n },\r\n getInputValuesObj: function (selector, diferenciaEntreVazioEZero) {\r\n var output = {};\r\n var dados = this.getInputValues(selector, diferenciaEntreVazioEZero);\r\n for (var i = 0; i < dados.length; i++) {\r\n output[dados[i].nome] = dados[i].valor;\r\n }\r\n\r\n return output;\r\n },\r\n getInputValuesObjGeral: function (selector, diferenciaEntreVazioEZero) {\r\n var output = {};\r\n\r\n var obj = typeof selector == \"string\" ? $(selector) : selector;\r\n\r\n obj.each(function () {\r\n var campo = $(this).attr(\"id\");\r\n if (campo && campo !== \"__VIEWSTATE\" && campo !==\"__EVENTVALIDATION\") {\r\n var valor = getCleanVal($(this));\r\n\r\n if (!diferenciaEntreVazioEZero) {\r\n if (valor == -1) {\r\n valor = 0;\r\n }\r\n }\r\n\r\n output[campo] = valor;\r\n }\r\n });\r\n\r\n return output;\r\n }\r\n\r\n};\r\n\r\n\r\nvar getCleanVal = function (obj) {\r\n var valor = \"\";\r\n if (obj.length) {\r\n valor = obj.val();\r\n }\r\n\r\n if (obj.hasClass(\"autonumber\")) {\r\n if (valor.length) {\r\n valor = valor.replace(/,|€| |%/g, \"\");\r\n if (obj.hasClass(\"input-taxa\")) {\r\n valor = parseFloat(valor);\r\n\r\n } else {\r\n valor = parseInt(valor, 10);\r\n }\r\n } else {\r\n valor = -1;\r\n }\r\n } else if (obj.is(\"select\")) {\r\n\r\n if (!valor) {\r\n valor = -1;\r\n } else if (!valor.length) {\r\n valor = -1;\r\n } else {\r\n if (!isNaN(valor)) {\r\n valor = parseInt(valor, 10);\r\n }\r\n }\r\n }\r\n\r\n return valor;\r\n\r\n};\r\n\r\n\r\nfunction temLocalStorageSuport(){\r\n var mod = 'modernizr';\r\n try {\r\n localStorage.setItem(mod, mod);\r\n localStorage.removeItem(mod);\r\n return true;\r\n } catch (e) {\r\n return false;\r\n }\r\n}","\r\n\r\nvar editores = {\r\n\tinit: function () {\r\n\r\n\t if ($('.EditorFull').length > 0) {\r\n\t \r\n\t $('.EditorFull').tinymce({\r\n\t plugins: [\r\n \" link image lists print preview hr anchor\",\r\n \" wordcount code fullscreen insertdatetime media \",\r\n \"table contextmenu template paste pastepop\"\r\n\t ],\r\n\t theme: \"modern\",\r\n\t language: 'pt_PT',\r\n toolbar1: \"undo redo | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | table | removeformat | print fullscreen\",\r\n\t toolbar2: \"cut copy pastepop | bullist numlist | outdent indent blockquote | link unlink image media code \",\r\n\t setup: function (ed) {\r\n\t if ($('#' + ed.id+':disabled').length) {\r\n\t ed.settings.readonly = true;\r\n\t }\r\n\r\n\t }\r\n\t });\r\n\t }\r\n\t\t\r\n\t if ($('.EditorSimples').length > 0) {\r\n\t $('.EditorSimples').tinymce({\r\n\t plugins: \" preview print contextmenu fullscreen template pastepop\",\r\n\t theme: \"modern\",\r\n\t menubar: false,\r\n\t language: 'pt_PT',\r\n\t toolbar_items_size: 'small',\r\n\t toolbar1: \"newdocument undo redo | pastepop | bold italic underline strikethrough | bullist | code\",\r\n\t setup: function (ed) {\r\n\t if ($('#' + ed.id + ':disabled').length) {\r\n\t ed.settings.readonly = true;\r\n\t }\r\n\r\n\t }\r\n\t });\r\n\t }\r\n\r\n\r\n\t\tif ($('.EditorMini').length > 0) {\r\n\t\t\t$('.EditorMini').tinymce({\r\n\t\t\t\tplugins: \" preview print contextmenu fullscreen template pastepop\",\r\n\t\t\t\ttheme: \"modern\",\r\n\t\t\t\tmenubar: false,\r\n\t\t\t\tlanguage: 'pt_PT',\r\n\t\t\t\ttoolbar_items_size: 'small',\r\n\t\t\t\ttoolbar1: \"newdocument undo redo | pastepop | bold italic underline | code\",\r\n\t\t\t\tsetup: function (ed) {\r\n\t\t\t\t\tif ($('#' + ed.id + ':disabled').length) {\r\n\t\t\t\t\t\ted.settings.readonly = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\r\n\t},\r\n\tencode: function () {\r\n\r\n\t if (typeof(tinyMCE) !== \"undefined\") {\r\n\t tinyMCE.triggerSave();\r\n\t }\r\n\r\n\t\t$(\"input:not(.EditorFull,.EditorSimples,.EditorMini), textarea:not(.EditorFull,.EditorSimples,.EditorMini)\").each(function () {\r\n\t\t\t$(this).val(aux.htmlEncode($(this).val()));\r\n\t\t})\r\n\r\n\t},\r\n\tdecode: function () {\r\n\r\n\t\t$(\"input:not(.EditorFull,.EditorSimples,.EditorMini), textarea:not(.EditorFull,.EditorSimples,.EditorMini)\").each(function () {\r\n\t\t\t$(this).val(aux.htmlDecode($(this).val()));\r\n\t\t})\r\n\r\n\t}\r\n}\r\n\r\nvar escondePrimeiraColuna = function () {\r\n\r\n\tvar css = '.tbcol0 input {display:none;} .watable .tbcol0{width:0; padding:0}',\r\n\t\thead = document.head || document.getElementsByTagName('head')[0],\r\n\t\tstyle = document.createElement('style');\r\n\r\n\thead.appendChild(style);\r\n\r\n\tstyle.type = 'text/css';\r\n\tif (style.styleSheet) {\r\n\t\t// This is required for IE8 and below.\r\n\t\tstyle.styleSheet.cssText = css;\r\n\t} else {\r\n\t\tstyle.appendChild(document.createTextNode(css));\r\n\t}\r\n\r\n} \r\n\r\nvar tabela = {\r\n\t\r\n\tinit: function (tabelaHolderObj, opcoesOverride) {\r\n var _this = this;\r\n\r\n var options = {\r\n pageSize: 10,\r\n apiUrl: '',\r\n apiData: {},\r\n callback: function () { },\r\n rowClicked: function (data) { }\r\n };\r\n\r\n\t\toptions = $.extend(true, options, opcoesOverride);\r\n\r\n\r\n\t\tif (!options.urlRemove && !options.permitePicker && !options.temRemove) {\r\n\t\t\tescondePrimeiraColuna();\r\n\t\t}\r\n\r\n tabelaHolderObj.hide();\r\n\r\n var actions= null;\r\n\r\n\t\tif ($(\"#hf_podeeditar\").val() == \"true\" && options.urlRemove) {\r\n\r\n\t\t\ttabelaHolderObj.data(\"urlRemove\", options.urlRemove);\r\n\r\n actions = {\r\n filter: false, //Toggle visibility\r\n columnPicker: false, //Toggle visibility\r\n custom: [\r\n\t\t\t\t\t$('' + idiomasAdmin.tabela.removerRegistosSelecionados+';')\r\n ]\r\n };\r\n }\r\n\r\n\r\n\t\ttabelaHolderObj.WATable({\r\n\t\t\tassyncPaginacao: true,\r\n\t\t\tpageSize: options.pageSize,\r\n\t\t\tpageSizes: [],\r\n\t\t\tfilter: true,\r\n\r\n\t\t\thidePagerOnEmpty: true,\r\n\t\t\tpreFill: true,\r\n\r\n\t\t\turl: options.apiUrl,\r\n\t\t\turlData: options.apiData,\r\n\r\n\t\t\ttypes: {\r\n\t\t\t\tstring: { placeHolder: \"Pesquisar... \" },\r\n\t\t\t\tnumber: { placeHolder: \"><=\" },\r\n\t\t\t\tbool: { tooltip: \" \" },\r\n\t\t\t\tdate: { utc: true, format: 'yyyy-mm-dd', datePicker: true }\r\n\t\t\t},\r\n\t\t\t// actions: { filter: false, columnPicker: false },\r\n\t\t\ttableCreated: function (data) {\r\n\r\n\t\t\t\ttabela.onCreate(tabelaHolderObj);\r\n\r\n\t\t\t\tif (options.callback) {\r\n\t\t\t\t\toptions.callback(data);\r\n }\r\n },\r\n dataCallback: options.dataCallback,\r\n rowClicked: function (data) {\r\n\r\n if (options.rowClicked) {\r\n options.rowClicked(data);\r\n }\r\n },\r\n actions: actions\r\n })\r\n\r\n\r\n\t},\r\n\tonCreate: function (tabelaHolderObj) {\r\n\t\t'use strict'\r\n\r\n\t\tvar _this = this;\r\n\r\n\t\t/* -- Impede a seleção de texto -- */\r\n\t\ttabelaHolderObj.find(\".watable tbody\").disableSelection();\r\n\r\n\r\n\t\t/* -- Esconde a paginação se não tiver páginas -- */\r\n\t\tif (tabelaHolderObj.find(\".pagination li.disabled\").length == $(\".pagination li\").length - 1) {\r\n\t\t\t$(\".pagination\").hide();\r\n\t\t}\r\n\r\n\t\t/* -- Esconde a paginação se não tiver páginas -- */\r\n\t\ttabelaHolderObj.find(\".watable tbody tr\").each(function () {\r\n\t\t\tvar id = $(this).find(\"td:nth(1)\").text();\r\n\t\t\tif (id.trim().length)\r\n\t\t\t\t$(this).attr(\"id\", \"tr_\" + id);\r\n\t\t\telse\r\n\t\t\t\t$(this).remove();\r\n\r\n\t\t\t$(this).find(\"td:nth(4)\").addClass(\"ordem\");\r\n\t\t})\r\n\r\n\t\t/* -- Adiciona classes com o index da coluna -- */\r\n\t\ttabelaHolderObj.find(\".watable th\").each(function () {\r\n\t\t\t$(this).addClass(\"tbcol tbcol\" + $(this).index());\r\n\t\t})\r\n\t\ttabelaHolderObj.find(\".watable td\").each(function () {\r\n\t\t\t$(this).addClass(\"tbcol tbcol\" + $(this).index());\r\n\t\t})\r\n\r\n tabelaHolderObj.fadeIn();\r\n\r\n tabelaHolderObj.find(\".js-remove\").click(function () {\r\n var checked = tabelaHolderObj.data(\"WATable\").getData(true);\r\n\r\n var linhasSelecionadas = checked.rows;\r\n var selected = [];\r\n if (linhasSelecionadas.length) {\r\n\r\n for (var i = 0; i < linhasSelecionadas.length; i++) {\r\n selected.push(linhasSelecionadas[i].id);\r\n }\r\n }\r\n\r\n\r\n if (selected.length) {\r\n\r\n if (confirm(\"Pretende remover os artigos selecionados?\")) {\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n\t\t\t\t\t\tdata: { a: 'remove', id: JSON.stringify(selected).replace(\"[\", \"\").replace(\"]\", \"\").replace(/,/g, '-'), idsite: idSiteGlobal },\r\n\t\t\t\t\t\turl: tabelaHolderObj.data(\"urlRemove\"),\r\n dataType: \"html\",\r\n success: function (xml) {\r\n\r\n console.log(xml)\r\n tabelaHolderObj.data(\"WATable\").update();\r\n\r\n },\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n\r\n }\r\n })\r\n }\r\n\r\n\r\n }\r\n\r\n });\r\n\t}\r\n\r\n}\r\n\r\n\r\n\r\nvar tabs = {\r\n init: function (obj, callbackMenu, callbackSubmenu) {\r\n\r\n $(obj).find(\">li\").click(function (e) {\r\n e.preventDefault();\r\n var _thisObj = $(this),\r\n index = _thisObj.index(),\r\n thisPainel = $(\"#editores .painelshow:nth(\" + index + \")\");\r\n\r\n if (!_thisObj.hasClass(\"active\")) {\r\n\r\n /* -- Se tiver filhos -- */\r\n if (_thisObj.find(\"ul\").length) {\r\n\r\n $(obj).addClass(\"open\");\r\n /* -- Seleciona o primeiro -- */\r\n _thisObj.find(\"li:first-child\").addClass(\"active\").siblings().removeClass(\"active\");\r\n thisPainel.find(\".subpainelshow\").first().show().addClass(\"open\").siblings().hide().removeClass(\"open\");\r\n } else {\r\n $(obj).removeClass(\"open\");\r\n }\r\n\r\n /* -- Activa este item -- */\r\n _thisObj.addClass(\"active\").siblings().removeClass(\"active\");\r\n\r\n /* -- Mostra o painel relacionado -- */\r\n thisPainel.siblings().addClass(\"animacao\").removeClass(\"open\");\r\n setTimeout(function () {\r\n thisPainel.siblings().hide();\r\n thisPainel.show().addClass(\"animacao\");\r\n\r\n setTimeout(function () {\r\n thisPainel.addClass(\"open\");\r\n },10);\r\n }, 201);\r\n \r\n\r\n /* -- CallBack -- */\r\n if (callbackMenu) {\r\n callbackMenu(_thisObj);\r\n }\r\n }\r\n \r\n })\r\n\r\n $(obj).find(\"ul li\").click(function (e) {\r\n\r\n e.stopPropagation();\r\n var _thisObj = $(this),\r\n index = _thisObj.index(),\r\n indexPai = _thisObj.parent().parent().index(),\r\n thisPainel = $(\"#editores .painelshow:nth(\" + indexPai + \")\")\r\n\r\n if (!_thisObj.hasClass(\"active\")) {\r\n\r\n /* -- Activa este item -- */\r\n _thisObj.addClass(\"active\").siblings().removeClass(\"active\");\r\n\r\n /* -- Mostra o painel relacionado -- */\r\n thisPainel.find(\".subpainelshow\").addClass(\"animacao\").removeClass(\"open\");\r\n setTimeout(function () {\r\n thisPainel.find(\".subpainelshow\").hide().removeClass(\"animacao\");\r\n thisPainel.find(\".subpainelshow\").eq(index).show().addClass(\"animacao\");\r\n\r\n setTimeout(function () {\r\n thisPainel.find(\".subpainelshow\").eq(index).addClass(\"open\");\r\n }, 10);\r\n }, 201);\r\n\r\n\r\n\r\n /* -- CallBack -- */\r\n if (callbackSubmenu) {\r\n callbackSubmenu(_thisObj);\r\n }\r\n }\r\n });\r\n\r\n\r\n $(obj).find(\">li\").first().click();\r\n }\r\n\r\n}\r\n\r\n\r\nvar maTimer = {\r\n\ttempo: 4,\r\n\tinit: function (elem, id, callback) {\r\n\t\t_this = this;\r\n\r\n\t\tif (elem.hasClass(\"aeliminar\")) {\r\n\t\t\tif (_this.tempo > 0) {\r\n\t\t\t\telem.addClass(\"aeliminar\").text(\"Cancelar.\" + _this.tempo + \"s! \");\r\n\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t_this.tempo--;\r\n\t\t\t\t\tmaTimer.init(elem, id, callback)\r\n\t\t\t\t}, 1000);\r\n\t\t\t} else {\r\n\r\n\t\t\t\tcallback();\r\n\t\t\t\t_this.tempo = 4;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\telem.text(\"Eliminar\");\r\n\t\t}\r\n\t}\r\n}\r\n","var timeout = null;\r\nvar podeEditar = false;\r\nvar isAdmin = false;\r\nvar idSiteGlobal = 0;\r\n\r\nvar master = {\r\n init: function () {\r\n 'use strict'\r\n\r\n master.initBrowserCheck();\r\n master.initMasterResize();\r\n\r\n $(window).resize(function () {\r\n master.initMasterResize();\r\n\r\n }).resize();\r\n\r\n if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\r\n window.addEventListener('load', function () {\r\n new FastClick(document.body);\r\n }, false);\r\n }\r\n\r\n\r\n idSiteGlobal = parseInt($(\"#hf_idsite\").val(), 10);\r\n\r\n isAdmin = $(\"#hf_isAdmin\").val() == \"true\";\r\n if ($(\"#hf_podeeditar\").val() == \"true\") {\r\n podeEditar = true;\r\n } else {\r\n $(\"input,textarea,select:not(.ddl_tipos)\").attr(\"disabled\", \"disabled\");\r\n //$(\".btn_azul,.btn_remove_media,#uploader_fotos,#uploader_docs\").hide();\r\n\r\n $(\".EditorSimples,.EditorFull,.EditorMini\").each(function () {\r\n $(this).after(\"
\" + $(this).val() + \"
\");\r\n })\r\n $(\".EditorMini\").removeClass(\"EditorMini\").hide();\r\n $(\".EditorSimples\").removeClass(\"EditorSimples\").hide();\r\n $(\".EditorFull\").removeClass(\"EditorFull\").hide();\r\n }\r\n\r\n\r\n $(\".js-change-site\").change(function () {\r\n\r\n window.location = $(this).val();\r\n })\r\n },\r\n bindInputHandler: function () {\r\n $(\".validator\").each(function () { if ($(this).find(\".erroMark\").length == 0) { $(this).html(\"*\" + ($(this).text() != \"\" ? \"\" + $(this).text() + \"\" : \"\")); } })\r\n $(\".validInt\").keypress(function (e) { return inputLimiter(e, 'int'); });\r\n $.placeholder.shim();\r\n },\r\n initMasterResize: function (largura) {\r\n if (!largura) {\r\n largura = $(window).width();\r\n }\r\n if (largura < 700) {\r\n $('html').removeClass('big').removeClass('large').removeClass('normal').removeClass('small').addClass('mini');\r\n }\r\n else if (largura >= 700 && largura < 980) {\r\n $('html').removeClass('big').removeClass('large').removeClass('normal').removeClass('mini').addClass('small');\r\n }\r\n else if (largura >= 980 && largura < 1220) {\r\n $('html').removeClass('big').removeClass('large').removeClass('small').removeClass('mini').addClass('normal');\r\n }\r\n else if (largura >= 1220 && largura < 1500) {\r\n $('html').removeClass('normal').removeClass('big').removeClass('small').removeClass('mini').addClass('large');\r\n }\r\n else {\r\n $('html').removeClass('normal').removeClass('large').removeClass('small').removeClass('mini').addClass('big');\r\n }\r\n },\r\n initBrowserCheck: function () {\r\n if (/MSIE (\\d+\\.\\d+);/.test(navigator.userAgent)) {\r\n var ieversion = new Number(RegExp.$1);\r\n if (ieversion <= 7) {\r\n $(\"#checkbrowser\").stop().slideDown(\"slow\");\r\n $(\"#masterpage\").stop().animate({ opacity: '.4' }, \"normal\");\r\n }\r\n }\r\n $('#checkbrowser .btn_close_browser ').click(function () {\r\n $(\"#checkbrowser\").stop().slideUp(\"slow\");\r\n $(\"#masterpage\").stop().animate({ opacity: '1' }, \"normal\");\r\n });\r\n }\r\n}\r\n\r\nvar dashborad = {\r\n count: 60,\r\n counter: null,\r\n init: function () {\r\n\r\n\r\n var _this = this,\r\n tabelaHolderObj = $('.dashboard-contactos'),\r\n opcoesTabela = {\r\n pageSize: 20,\r\n apiUrl: '/api/contactos/getTodosContactos.ashx',\r\n apiData: { tipo: '', pg: 1 },\r\n callback: _this.onTableCreated\r\n }\r\n\r\n tabela.init(tabelaHolderObj, opcoesTabela);\r\n\r\n /* -- FILTROS DO DASHBOARD -- */\r\n $(\".ddl_tipos\").change(function () {\r\n\r\n var tabela = $('.dashboard-contactos').data(\"WATable\");\r\n tabela.option(\"urlData\", { pg: '1', tipo: $(this).val() })\r\n tabela.resetPage();\r\n tabela.update();\r\n })\r\n\r\n if ($(\"#time\").length > 0) {\r\n // oAuto reload esta desactivado para este projecto\r\n // _this.counter = setInterval(_this.timer, 1000);\r\n }\r\n\r\n if (views) {\r\n var ctx = document.getElementById(\"chart-area\").getContext(\"2d\");\r\n window.myDoughnut = new Chart(ctx).Doughnut(views, { responsive: true, animation: false });\r\n }\r\n },\r\n onTableCreated: function () {\r\n },\r\n timer: function () {\r\n\r\n dashborad.count = dashborad.count - 1;\r\n if (dashborad.count <= 0) {\r\n clearInterval(dashborad.counter);\r\n location.reload();\r\n return;\r\n }\r\n if (dashborad.count == 1) {\r\n document.getElementById(\"time\").innerHTML = idiomasAdmin.dashboard.updateEmSingular.replace(\"{x}\", dashborad.count);\r\n } else {\r\n document.getElementById(\"time\").innerHTML = idiomasAdmin.dashboard.updateEmPlural.replace(\"{x}\", dashborad.count);\r\n }\r\n }\r\n}\r\n\r\nvar formularios = {\r\n edit: function (emailsExistentes, idform) {\r\n 'use strict'\r\n\r\n var seccao = cookies.get(\"seccao\");\r\n if (seccao == \"campos\") {\r\n $(\"#ContentPlaceHolder1_tab_menu4\").click();\r\n cookies.erase(\"seccao\");\r\n }\r\n\r\n /* -- Save -- */\r\n $(\"#div_edicao\").on(\"click\", \".btn_gravar\", function () {\r\n\r\n if (Page_ClientValidate(\"CreateUserWizard1\")) {\r\n editores.encode();\r\n setTimeout(function () {\r\n __doPostBack($(\".btn_gravar_ghost\").attr(\"name\"), '');\r\n }, 1)\r\n\r\n } else {\r\n erro(idiomasAdmin.popups.preencherCamposObrigatorios);\r\n }\r\n })\r\n\r\n $(\"#div_edicao\").on(\"click\", \".btn_adicionartag_submit\", function () {\r\n if (Page_ClientValidate(\"CreateUserWizard3\")) {\r\n editores.encode();\r\n setTimeout(function () {\r\n __doPostBack($(\".btn_adicionartag_submit_ghost\").attr(\"name\"), '');\r\n }, 1)\r\n } else { }\r\n })\r\n\r\n $(\".multitag\").select2({\r\n tags: emailsExistentes, tokenSeparators: [\";\", \",\"],\r\n initSelection: function (element, callback) {\r\n var data = [];\r\n $(element.val().split(\",\")).each(function () {\r\n if (this != \"\") {\r\n data.push({ id: this, text: this });\r\n }\r\n });\r\n callback(data);\r\n }\r\n });\r\n\r\n $(\".singletag\").select2({\r\n tags: emailsExistentes, tokenSeparators: [\";\", \",\"], maximumSelectionSize: 1,\r\n initSelection: function (element, callback) {\r\n var data = [];\r\n $(element.val().split(\",\")).each(function () {\r\n if (this != \"\") {\r\n data.push({ id: this, text: this });\r\n }\r\n });\r\n callback(data);\r\n }\r\n });\r\n\r\n /* -- Click para destaque e Activo -- */\r\n $(\"#itensholder\").on(\"click\", \".js-click\", function () {\r\n\r\n\r\n //console.log(\"click list\");\r\n\r\n var _this = $(this),\r\n prop = _this.data(\"prop\"),\r\n id = parseInt(_this.closest(\".pnl_id\").data(\"id\"), 10),\r\n valor = _this.hasClass(\"on\") ? 0 : 1;\r\n\r\n if (id && prop) {\r\n\r\n _this.addClass(\"loading\");\r\n _this.fadeOut(200, function () {\r\n formularios.defineProp(prop, id, valor, _this);\r\n });\r\n }\r\n });\r\n\r\n /* -- Click eliminar -- */\r\n $(\".js-click-remove\").on(\"click\", function () {\r\n\r\n var _this = $(this),\r\n prop = \"eliminado\",\r\n id = parseInt($(\".edit_form>input\").val(), 10),\r\n valor = 1;\r\n\r\n if (id && prop) {\r\n\r\n _this.addClass(\"loading\");\r\n _this.fadeOut(200, function () {\r\n formularios.defineProp(prop, id, valor, _this);\r\n });\r\n }\r\n });\r\n\r\n /* -- Ordenação -- */\r\n $(\"#itensholder\").sortable({\r\n distance: 15,\r\n forceHelperSize: true,\r\n containment: \"parent\",\r\n // axis: \"y\",\r\n forcePlaceholderSize: true,\r\n handle: \".move-item\",\r\n stop: function (event, ui) {\r\n\r\n var array = [];\r\n $(\"#itensholder .pnl_id\").each(function () {\r\n array.push($(this).data(\"id\"));\r\n })\r\n formularios.defineOrdem(array.join(','));\r\n }\r\n });\r\n\r\n\r\n /* -- NOVO ITEM -- */\r\n $(\".itensDisponiveis .lbl_campo\").click(function () {\r\n\r\n var tipo = $(this).data(\"tipo\");\r\n\r\n if (tipo == 7 || tipo == 8 || tipo == 9) {\r\n if ($(\".pnl_id[data-tipo='\" + tipo + \"']\").length) {\r\n erro(idiomasAdmin.popups.erroApenasPodeEscolherUm);\r\n return false;\r\n }\r\n }\r\n\r\n $(\".edit_form .opcoes\").removeClass(\"active\");\r\n if (tipo == 6 || tipo == 10 || tipo == 11) {\r\n $(\".edit_form .opcoes\").addClass(\"active\");\r\n\r\n }\r\n\r\n\r\n $(\"#itensholder\").removeClass(\"open\");\r\n $(\".edit_form\").addClass(\"open\");\r\n $(\".painelshow.open\").addClass(\"overlay\");\r\n\r\n $(\".edit_form .lbl_titulo\").text(\"Novo item\");\r\n $(\".edit_form>input\").val(\"\");\r\n $(\".edit_form .ddl_tipo\").val(tipo);\r\n\r\n $(\".edit_form .ddl_largura\").val(\"w100\");\r\n\r\n $(\".edit_form input\").val(\"\");\r\n\r\n $(\".btn_save_form\").text(idiomasAdmin.popups.btnInserir);\r\n\r\n\r\n\r\n })\r\n\r\n /* -- FECHA PAINEL DE EDITCAO -- */\r\n $(\".edit_form .edit-close\").click(function () {\r\n $(\"#itensholder\").addClass(\"open\");\r\n $(\".edit_form\").removeClass(\"open\");\r\n $(\".painelshow.open\").removeClass(\"overlay\");\r\n\r\n $(\".edit_form input\").val(\"\");\r\n })\r\n\r\n\r\n /* -- EDITA ITEM -- */\r\n $(\"#itensholder .edit-item\").click(function () {\r\n var xid = $(this).closest(\".pnl_id\").data(\"id\");\r\n\r\n $(\"#itensholder\").removeClass(\"open\");\r\n $(\".edit_form\").addClass(\"open\");\r\n\r\n $(\".painelshow.open\").addClass(\"overlay\");\r\n\r\n $(\".edit_form .lbl_titulo\").text(\"...\");\r\n $(\".edit_form>input\").val(xid);\r\n\r\n $(\".edit_form .opcoes\").removeClass(\"active\");\r\n $(\".edit_form .opcoes_holder\").html(\"\");\r\n\r\n $(\".btn_save_form\").text(\"Gravar Alterações\");\r\n //Get info from DB\r\n\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: { id: xid, idsite: idSiteGlobal },\r\n url: '/api/formularios/getCampo.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n\r\n var data = JSON.parse(xml);\r\n if (data.id) {\r\n\r\n //console.log(data);\r\n\r\n\r\n\r\n if (data.opcoes) {\r\n var opcoes = JSON.parse(data.opcoes);\r\n\r\n $(\".edit_form .opcoes\").addClass(\"active\");\r\n $(\".idiomas_paineis .pnl_idioma\").each(function () {\r\n var esteIdioma = $(this).data(\"idioma\"),\r\n _thisObj = $(this).find(\".opcoes_holder\"),\r\n encontrou = false,\r\n index = $(this).index();\r\n\r\n for (var i = 0; i < opcoes.length; i++) {\r\n\r\n var item = opcoes[i];\r\n if (item.idioma == esteIdioma) {\r\n encontrou = true;\r\n for (var j = 0; j < item.campos.length; j++) {\r\n var itemCampo = item.campos[j];\r\n _thisObj.append(\"
0 ? \" disabled='disabled' \" : \"\") + \"/>\" +\r\n \"
\");\r\n }\r\n i = opcoes.length;\r\n }\r\n }\r\n\r\n if (!encontrou) {\r\n var item = opcoes[0];\r\n for (var j = 0; j < item.campos.length; j++) {\r\n var itemCampo = item.campos[j];\r\n _thisObj.append(\"
0 ? \" disabled='disabled' \" : \"\") + \"/>\" +\r\n \"
\");\r\n }\r\n }\r\n })\r\n } else if (data.tipo == 6 || data.tipo == 10 || data.tipo == 11) {\r\n $(\".edit_form .opcoes\").addClass(\"active\");\r\n } else if (data.tipo == 12 || data.tipo == 13) {\r\n\r\n\r\n }\r\n\r\n $(\".edit_form>input\").val(data.id);\r\n $(\".edit_form .lbl_titulo\").text(data.nome_pt);\r\n $(\".edit_form .pnl_idioma[data-idioma=pt] .tbx_titulo\").val(data.nome_pt);\r\n\r\n if (!data.nome_pt1) {\r\n data.nome_pt1 = data.nome_pt;\r\n }\r\n $(\".edit_form .pnl_idioma[data-idioma=pt1] .tbx_titulo\").val(data.nome_pt1);\r\n $(\".edit_form .pnl_idioma[data-idioma=pt2] .tbx_titulo\").val(data.nome_pt2);\r\n $(\".edit_form .pnl_idioma[data-idioma=pt3] .tbx_titulo\").val(data.nome_pt3);\r\n $(\".edit_form .pnl_idioma[data-idioma=pt4] .tbx_titulo\").val(data.nome_pt4);\r\n\r\n $(\".edit_form .ddl_largura\").val(data.class);\r\n $(\".edit_form .ddl_tipo\").val(data.tipo);\r\n } else {\r\n erro('Ocorreu um erro');\r\n }\r\n }\r\n })\r\n })\r\n\r\n /* -- MUDA A OPCAO-- */\r\n $(\".idiomas_paineis .pnl_idioma:first-child .opcoes_holder\").on(\"change\", \"input\", function () {\r\n\r\n var linha = $(this).parent().index(),\r\n indexInput = $(this).index();\r\n\r\n $(\".idiomas_paineis .pnl_idioma:gt(0)\").each(function () {\r\n var obj = $(this).find(\".opcoes_holder div:nth(\" + linha + \") input:nth(\" + indexInput + \")\");\r\n if (!obj.val()) {\r\n obj.val($(this).val());\r\n }\r\n });\r\n })\r\n\r\n\r\n /* -- INSERE NOVA OPCAO -- */\r\n $(\".insert-opcao\").click(function () {\r\n\r\n var id = $(\".insert .input_id\").val(),\r\n valor = $(\".insert .input_valor\").val();\r\n\r\n if (id && valor) {\r\n $(\".idiomas_paineis .pnl_idioma\").each(function () {\r\n var esteIdioma = $(this).data(\"idioma\"),\r\n _thisObj = $(this).find(\".opcoes_holder\"),\r\n index = $(this).index();\r\n\r\n _thisObj.append(\"
0 ? \" disabled='disabled' \" : \"\") + \"/>\" +\r\n \"
\");\r\n });\r\n\r\n $(\".insert .input_id\").val(\"\");\r\n $(\".insert .input_valor\").val(\"\");\r\n } else {\r\n erro(idiomasAdmin.popups.preencherTodosCampos);\r\n }\r\n\r\n\r\n })\r\n\r\n\r\n /* -- SAVE ITEM -- */\r\n $(\".btn_save_form\").click(function () {\r\n var xid = $(\".edit_form>input\").val();\r\n //console.log(xid);\r\n\r\n var nomePt = $(\".edit_form .pnl_idioma[data-idioma=pt] .tbx_titulo\").val(),\r\n nomePt1 = $(\".edit_form .pnl_idioma[data-idioma=pt1] .tbx_titulo\").val(),\r\n nomePt2 = $(\".edit_form .pnl_idioma[data-idioma=pt2] .tbx_titulo\").val(),\r\n nomePt3 = $(\".edit_form .pnl_idioma[data-idioma=pt3] .tbx_titulo\").val(),\r\n nomePt4 = $(\".edit_form .pnl_idioma[data-idioma=pt4] .tbx_titulo\").val(),\r\n cssClass = $(\".edit_form .ddl_largura\").val(),\r\n tipo = $(\".edit_form .ddl_tipo\").val();\r\n\r\n\r\n if (((nomePt && nomePt.length) ||\r\n (nomePt1 && nomePt1.length) ||\r\n (nomePt2 && nomePt2.length) ||\r\n (nomePt3 && nomePt3.length) ||\r\n (nomePt4 && nomePt4.length)) &&\r\n cssClass.length && tipo.length) {\r\n\r\n var formData = {\r\n id: xid,\r\n npt: nomePt,\r\n npt1: nomePt1,\r\n npt2: nomePt2,\r\n npt3: nomePt3,\r\n npt4: nomePt4,\r\n classCss: cssClass,\r\n tipo: tipo,\r\n idsite: idSiteGlobal\r\n }\r\n\r\n if (!xid) {\r\n formData.id = 0;\r\n formData.idform = idform;\r\n }\r\n\r\n\r\n var array = [];\r\n $(\".idiomas_paineis .pnl_idioma\").each(function () {\r\n var camposArray = [];\r\n $(this).find(\".opcoes_holder>div\").each(function () {\r\n camposArray.push({ id: $(this).find(\".input_id\").val(), valor: $(this).find(\".input_valor\").val() });\r\n })\r\n if (camposArray.length) {\r\n array.push({\r\n idioma: $(this).data(\"idioma\"),\r\n campos: camposArray\r\n })\r\n }\r\n });\r\n\r\n if (array.length) {\r\n formData.opcoes = JSON.stringify(array);\r\n }\r\n\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n data: formData,\r\n url: '/api/formularios/SaveCampo',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n if (xml != \"false\") {\r\n $.modal.close();\r\n notify(\"alert\", idiomasAdmin.popups.alteracoesGuardadasSucesso, function () {\r\n cookies.create(\"seccao\", \"campos\");\r\n window.location.reload();\r\n\r\n })\r\n } else {\r\n erro(idiomasAdmin.popups.Erro);\r\n }\r\n }\r\n })\r\n\r\n } else {\r\n erro(idiomasAdmin.popups.preencherTodosCampos);\r\n }\r\n })\r\n\r\n /* -- Muda idioma -- */\r\n $(\".idiomas_edit li\").click(function () {\r\n $(this).addClass(\"active\").siblings().removeClass(\"active\");\r\n $(\".idiomas_paineis .pnl_idioma:nth(\" + $(this).index() + \")\").addClass(\"active\").siblings().removeClass(\"active\");\r\n })\r\n $(\".idiomas_edit li:nth(0)\").click();\r\n\r\n\r\n\r\n\r\n },\r\n\r\n defineProp: function (prop, ids, valor, obj) {\r\n 'use strict'\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: { a: prop, id: ids, v: valor, idsite: idSiteGlobal },\r\n url: '/api/formularios/setProp.ashx',\r\n dataType: \"html\",\r\n success: function (xml) {\r\n\r\n\r\n if (prop == \"eliminado\") {\r\n\r\n $(\"#itensholder\").addClass(\"open\");\r\n $(\".edit_form\").removeClass(\"open\");\r\n $(\".painelshow.open\").removeClass(\"overlay\");\r\n $(\".edit_form input\").val(\"\");\r\n\r\n cookies.create(\"seccao\", \"campos\");\r\n window.location.reload();\r\n\r\n } else {\r\n if (valor == 1) {\r\n obj.addClass(\"on\").removeClass(\"off\");\r\n } else {\r\n obj.removeClass(\"on\").addClass(\"off\");\r\n }\r\n obj.fadeIn();\r\n obj.removeClass(\"loading\");\r\n }\r\n\r\n\r\n }, error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n }\r\n })\r\n },\r\n defineOrdem: function (ordem) {\r\n $.ajax({\r\n type: \"GET\",\r\n data: { o: ordem, idsite: idSiteGlobal },\r\n url: '/api/formularios/setProp.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n }\r\n })\r\n },\r\n}\r\n\r\n\r\nvar menus = {\r\n listagem: {\r\n pageSize: 20,\r\n init: function (idfam) {\r\n 'use strict'\r\n\r\n var _this = this,\r\n tabelaHolderObj = $('#tabelaHolder'),\r\n opcoesTabela = {\r\n pageSize: artigos.listagem.pageSize,\r\n apiUrl: '/api/menus/get.ashx',\r\n apiData: { idfam: idfam, pg: 1, idsite: idSiteGlobal },\r\n callback: _this.onTableCreated\r\n }\r\n\r\n tabela.init(tabelaHolderObj, opcoesTabela);\r\n\r\n /* -- Click para adicionar artigo -- */\r\n $('.modal-basic').click(function (e) {\r\n\r\n $(\"#modal-content-new>input\").val(\"\");\r\n $(\"#modal-content-new input\").val(\"\");\r\n\r\n $(\".btn_adicionar_submit\").val(idiomasAdmin.popups.btnInserir);\r\n\r\n $('#modal-content-new').modal({\r\n persist: true,\r\n onClose: function () {\r\n $(\".validation_holder\").hide();\r\n $(\".error_popup\").css(\"visibility\", \"hidden\");\r\n $.modal.close();\r\n }\r\n });\r\n return false;\r\n });\r\n\r\n\r\n $(\".btn_adicionar_submit\").click(function () {\r\n var xid = $(\"#modal-content-new>input\").val();\r\n\r\n var nomePt = $(\"#modal-content-new .nome_pt\").val(),\r\n nomePt1 = $(\"#modal-content-new .nome_pt1\").val(),\r\n nomePt4 = $(\"#modal-content-new .nome_pt4\").val(),\r\n url = $(\"#modal-content-new .url\").val();\r\n\r\n if (((nomePt && nomePt.length) ||\r\n (nomePt1 && nomePt1.length) ||\r\n (nomePt4 && nomePt4.length)) &&\r\n url.length) {\r\n\r\n var formData = {\r\n id: xid,\r\n npt: nomePt,\r\n npt1: nomePt1,\r\n npt4: nomePt4,\r\n url: url,\r\n idsite: idSiteGlobal\r\n }\r\n\r\n if (!xid) {\r\n\r\n formData = {\r\n id: 0,\r\n npt: nomePt,\r\n npt1: nomePt1,\r\n npt4: nomePt4,\r\n url: url,\r\n idsite: idSiteGlobal,\r\n idpai: idfam\r\n }\r\n }\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: formData,\r\n url: '/api/menus/setProp.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n if (xml != \"false\") {\r\n $.modal.close();\r\n notify(\"alert\", idiomasAdmin.popups.alteracoesGuardadasSucesso, function () {\r\n window.location.reload();\r\n })\r\n } else {\r\n erro('Ocorreu um erro');\r\n }\r\n }\r\n })\r\n\r\n } else {\r\n erro('Deve preencher todos os campos');\r\n }\r\n\r\n })\r\n\r\n },\r\n onTableCreated: function () {\r\n\r\n $('#tabelaHolder .ordem').removeClass(\"ordem\");\r\n\r\n $('#tabelaHolder').find(\".watable tbody tr\").each(function () {\r\n $(this).find(\"td:nth(5)\").addClass(\"ordem\");\r\n })\r\n\r\n $(\".watable tbody tr\").click(function (e) {\r\n\r\n var abreEdit = $(this).find(\"a\").attr(\"href\") == \"#\";\r\n\r\n if ($(e.target).closest(\".tbcol7\").length) {\r\n abreEdit = true;\r\n }\r\n\r\n if ($(e.target).closest(\".tbcol6\").length) {\r\n abreEdit = false;\r\n }\r\n\r\n if (abreEdit) {\r\n var xid = parseInt($(this).find(\".tbcol1\").text(), 10);\r\n\r\n $(\".btn_adicionar_submit\").val(\"Editar\");\r\n $(\"#modal-content-new>input\").val(xid);\r\n\r\n var data = $(this).find(\".tbcol2 a\").data(\"info\").replace(\"[\", \"\").replace(\"]\", \"\").replace(/'/gi, \"\").split(',');\r\n if (data.length == 3) {\r\n $(\"#modal-content-new .nome_pt\").val(data[0]);\r\n $(\"#modal-content-new .nome_pt1\").val(data[1]);\r\n $(\"#modal-content-new .nome_pt4\").val(data[2]);\r\n $(\"#modal-content-new .url\").val($(this).find(\".tbcol4\").text())\r\n\r\n $('#modal-content-new').modal({\r\n persist: true,\r\n onClose: function () {\r\n $(\".validation_holder\").hide();\r\n $(\".error_popup\").css(\"visibility\", \"hidden\");\r\n $.modal.close();\r\n }\r\n });\r\n }\r\n return false;\r\n }\r\n })\r\n\r\n\r\n //BOTOES DE ACÇÃO\r\n if (podeEditar) {\r\n\r\n /* -- Ordenação de artigos -- */\r\n $(\".listagem-principal tbody\").sortable({\r\n distance: 15,\r\n forceHelperSize: true,\r\n containment: \"parent\",\r\n axis: \"y\",\r\n forcePlaceholderSize: true,\r\n handle: \".ordem\",\r\n stop: function (event, ui) {\r\n\r\n var order = $(\".listagem-principal tbody\").sortable('serialize').replace(/&/g, \"-\").replace(/tr\\[\\]=/g, \"\"),\r\n active = parseInt($(\".pagination .active\").text(), 10);\r\n\r\n menus.defineOrdem(order, menus.listagem.pageSize, active);\r\n }\r\n });\r\n\r\n /* -- Click para destaque e Activo -- */\r\n $(\".listagem-principal\").on(\"click\", \".js-click\", function () {\r\n\r\n var _this = $(this),\r\n prop = \"\",\r\n id = parseInt(_this.closest(\"tr\").find(\".tbcol1\").text(), 10),\r\n valor = _this.attr(\"src\").indexOf(\"off\") > 0 ? 1 : 0;\r\n\r\n\r\n //console.log(valor);\r\n\r\n if (_this.hasClass(\"js-toggleActivo\")) {\r\n prop = \"activo\";\r\n }\r\n else if (_this.hasClass(\"js-togglePublico\")) {\r\n prop = \"publico\";\r\n }\r\n\r\n _this.addClass(\"loading\");\r\n _this.fadeOut(200, function () {\r\n menus.defineProp(prop, id, valor, _this);\r\n });\r\n });\r\n\r\n\r\n }\r\n\r\n }\r\n\r\n },\r\n defineProp: function (prop, ids, valor, obj) {\r\n 'use strict'\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: { a: prop, id: ids, v: valor, idsite: idSiteGlobal },\r\n url: '/api/menus/setProp.ashx',\r\n dataType: \"html\",\r\n success: function (xml) {\r\n\r\n obj.attr(\"src\", \"/assets/release/images/\" + prop + \"_\" + (valor == 1 ? \"on\" : \"off\") + \".png\");\r\n obj.fadeIn();\r\n obj.removeClass(\"loading\");\r\n\r\n }, error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n }\r\n })\r\n },\r\n defineOrdem: function (ordem, pagesize, actual) {\r\n $(\".ordem\").animate({ \"text-indent\": -20 }, 100);\r\n $.ajax({\r\n type: \"GET\",\r\n data: { o: ordem, p: pagesize, a: actual, idsite: idSiteGlobal },\r\n url: '/api/menus/setProp.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n var startCount = pagesize * (actual - 1);\r\n $(\".ordem\").each(function () {\r\n var ordem = $(this).parent().index() + 1 + startCount\r\n if (ordem < 10)\r\n ordem = \"0\" + ordem;\r\n $(this).text(ordem);\r\n })\r\n $(\".ordem\").animate({ \"text-indent\": 0 }, 200);\r\n }\r\n })\r\n },\r\n}\r\n\r\n\r\nvar social = {\r\n listagem: {\r\n pageSize: 20,\r\n init: function (idfam) {\r\n 'use strict'\r\n\r\n var _this = this,\r\n tabelaHolderObj = $('#tabelaHolder'),\r\n opcoesTabela = {\r\n pageSize: artigos.listagem.pageSize,\r\n apiUrl: '/api/social/get.ashx',\r\n apiData: { pg: 1, idsite: idSiteGlobal },\r\n callback: _this.onTableCreated\r\n }\r\n\r\n tabela.init(tabelaHolderObj, opcoesTabela);\r\n\r\n },\r\n onTableCreated: function () {\r\n\r\n $('#tabelaHolder .ordem').removeClass(\"ordem\");\r\n\r\n $('#tabelaHolder').find(\".watable tbody tr\").each(function () {\r\n $(this).find(\"td:nth(5)\").addClass(\"ordem\");\r\n })\r\n\r\n $(\".btn_adicionar_submit\").click(function () {\r\n var xid = $(\"#modal-content-new>input\").val();\r\n //console.log(xid);\r\n\r\n var nomePt = $(\"#modal-content-new .nome_pt\").val(),\r\n url = $(\"#modal-content-new .url\").val();\r\n\r\n //console.log(nomePt, url)\r\n if (nomePt.length && url.length) {\r\n\r\n var formData = {\r\n id: xid,\r\n npt: nomePt,\r\n url: url,\r\n idsite: idSiteGlobal\r\n }\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: formData,\r\n url: '/api/social/setProp.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n if (xml != \"false\") {\r\n $.modal.close();\r\n notify(\"alert\", idiomasAdmin.popups.alteracoesGuardadasSucesso, function () {\r\n window.location.reload();\r\n })\r\n } else {\r\n erro('Ocorreu um erro');\r\n }\r\n }\r\n })\r\n\r\n } else {\r\n erro('Deve preencher todos os campos');\r\n }\r\n\r\n })\r\n\r\n $(\".watable tbody tr\").click(function (e) {\r\n\r\n var abreEdit = $(this).find(\"a\").attr(\"href\") == \"#\";\r\n\r\n if ($(e.target).closest(\".tbcol7\").length) {\r\n abreEdit = true;\r\n }\r\n\r\n if ($(e.target).closest(\".tbcol6\").length) {\r\n abreEdit = false;\r\n }\r\n\r\n if (abreEdit) {\r\n var xid = parseInt($(this).find(\".tbcol1\").text(), 10);\r\n\r\n $(\".btn_adicionar_submit\").val(\"Editar\");\r\n $(\"#modal-content-new>input\").val(xid);\r\n\r\n var data = $(this).find(\".tbcol2 a\").data(\"info\").replace(\"[\", \"\").replace(\"]\", \"\").replace(/'/gi, \"\").split(',');\r\n if (data.length == 2) {\r\n $(\"#modal-content-new .nome_pt\").val(data[0]);\r\n $(\"#modal-content-new .nome_pt1\").val(data[1]);\r\n $(\"#modal-content-new .url\").val($(this).find(\".tbcol4\").text())\r\n\r\n $('#modal-content-new').modal({\r\n persist: true,\r\n onClose: function () {\r\n $(\".validation_holder\").hide();\r\n $(\".error_popup\").css(\"visibility\", \"hidden\");\r\n $.modal.close();\r\n }\r\n });\r\n }\r\n return false;\r\n }\r\n })\r\n\r\n\r\n //BOTOES DE ACÇÃO\r\n if (podeEditar) {\r\n\r\n /* -- Ordenação de artigos -- */\r\n $(\".listagem-principal tbody\").sortable({\r\n distance: 15,\r\n forceHelperSize: true,\r\n containment: \"parent\",\r\n axis: \"y\",\r\n forcePlaceholderSize: true,\r\n handle: \".ordem\",\r\n stop: function (event, ui) {\r\n\r\n var order = $(\".listagem-principal tbody\").sortable('serialize').replace(/&/g, \"-\").replace(/tr\\[\\]=/g, \"\"),\r\n active = parseInt($(\".pagination .active\").text(), 10);\r\n\r\n social.defineOrdem(order, social.listagem.pageSize, active);\r\n }\r\n });\r\n\r\n /* -- Click para destaque e Activo -- */\r\n if (!$(\".listagem-principal\").hasClass(\"clicksBinded\")) {\r\n\r\n $(\".listagem-principal\").addClass(\"clicksBinded\")\r\n $(\".listagem-principal\").on(\"click\", \".js-click\", function () {\r\n\r\n\r\n //console.log(\"click activo\");\r\n\r\n var _this = $(this),\r\n prop = \"\",\r\n id = parseInt(_this.closest(\"tr\").find(\".tbcol1\").text(), 10),\r\n valor = _this.attr(\"src\").indexOf(\"off\") > 0 ? 1 : 0;\r\n\r\n if (_this.hasClass(\"js-toggleActivo\")) {\r\n prop = \"activo\";\r\n }\r\n else if (_this.hasClass(\"js-togglePublico\")) {\r\n prop = \"publico\";\r\n }\r\n\r\n _this.addClass(\"loading\");\r\n _this.fadeOut(200, function () {\r\n social.defineProp(prop, id, valor, _this);\r\n });\r\n });\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n\r\n },\r\n defineProp: function (prop, ids, valor, obj) {\r\n 'use strict'\r\n\r\n\r\n //console.log(\"defineProp prop, \", prop);\r\n //console.log(\"defineProp ids, \", ids);\r\n //console.log(\"defineProp valor, \", valor);\r\n //console.log(\"defineProp obj, \", obj);\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: { a: prop, id: ids, v: valor, idsite: idSiteGlobal },\r\n url: '/api/social/setProp.ashx',\r\n dataType: \"html\",\r\n success: function (xml) {\r\n\r\n obj.attr(\"src\", \"/assets/release/images/\" + prop + \"_\" + (valor == 1 ? \"on\" : \"off\") + \".png\");\r\n obj.fadeIn();\r\n obj.removeClass(\"loading\");\r\n\r\n }, error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n }\r\n })\r\n },\r\n defineOrdem: function (ordem, pagesize, actual) {\r\n $(\".ordem\").animate({ \"text-indent\": -20 }, 100);\r\n $.ajax({\r\n type: \"GET\",\r\n data: { o: ordem, p: pagesize, a: actual, idsite: idSiteGlobal },\r\n url: '/api/social/setProp.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n var startCount = pagesize * (actual - 1);\r\n $(\".ordem\").each(function () {\r\n var ordem = $(this).parent().index() + 1 + startCount\r\n if (ordem < 10)\r\n ordem = \"0\" + ordem;\r\n $(this).text(ordem);\r\n })\r\n $(\".ordem\").animate({ \"text-indent\": 0 }, 200);\r\n }\r\n })\r\n }\r\n}\r\n\r\nvar artigos = {\r\n listagem: {\r\n pageSize: 50,\r\n init: function (idfam, pesq) {\r\n\r\n var apiData = temLocalStorageSuport() ? localStorage.getItem(window.location) : null;\r\n if (!apiData) {\r\n apiData = { idfam: idfam, pg: 1, idsite: idSiteGlobal, pesquisa: pesq };\r\n } else {\r\n apiData = JSON.parse(apiData);\r\n }\r\n\r\n if (apiData[\"categoria\"]) {\r\n $(\".ddl_tipos\").val(apiData[\"categoria\"])\r\n }\r\n\r\n if (apiData[\"tipo\"]) {\r\n $(\".ddl_tipo\").val(apiData[\"tipo\"])\r\n }\r\n\r\n if (apiData[\"pesquisa\"]) {\r\n $(\".js-input-pesquisa\").val(apiData[\"pesquisa\"])\r\n }\r\n\r\n\r\n\r\n\r\n var _this = this,\r\n tabelaHolderObj = $('#tabelaHolder'),\r\n opcoesTabela = {\r\n pageSize: artigos.listagem.pageSize,\r\n apiUrl: '/api/artigos/get.ashx',\r\n apiData: apiData,\r\n callback: _this.onTableCreated,\r\n permitePicker: true,\r\n //urlRemove: '/api/artigos/setProp.ashx',\r\n dataCallback: function (data, requestData) {\r\n\r\n if (temLocalStorageSuport()) {\r\n localStorage.setItem(window.location, JSON.stringify(requestData));\r\n }\r\n\r\n if (data.classExtra) {\r\n tabelaHolderObj.addClass(data.classExtra);\r\n }\r\n }\r\n }\r\n\r\n tabela.init(tabelaHolderObj, opcoesTabela);\r\n\r\n /* -- Click para adicionar artigo -- */\r\n $('.modal-basic').click(function (e) {\r\n $('#modal-content-new').modal({\r\n persist: true,\r\n onClose: function () {\r\n $(\".validation_holder\").hide();\r\n $(\".error_popup\").css(\"visibility\", \"hidden\");\r\n $.modal.close();\r\n }\r\n });\r\n return false;\r\n });\r\n\r\n /* -- Click para cambiar preços -- */\r\n $('.modal-basic-cambio').click(function (e) {\r\n $('#modal-content-cambio').modal({\r\n persist: true,\r\n onClose: function () {\r\n $(\".validation_holder\").hide();\r\n $(\".error_popup\").css(\"visibility\", \"hidden\");\r\n $.modal.close();\r\n }\r\n });\r\n return false;\r\n });\r\n\r\n /* -- Click para duplicar artigo -- */\r\n $('.modal-basic-duplicar').click(function (e) {\r\n $('#modal-content-duplicar').modal({\r\n persist: true,\r\n onClose: function () {\r\n $(\".validation_holder\").hide();\r\n $(\".error_popup\").css(\"visibility\", \"hidden\");\r\n $.modal.close();\r\n }\r\n });\r\n return false;\r\n });\r\n\r\n /* -- Click para adicionar artigo -- */\r\n $('.btn_adicionar_submit').click(function (e) {\r\n\r\n if (!$('#modal-content-new .nome_pt').val().length) {\r\n return;\r\n }\r\n\r\n $('.txt1').val($('#modal-content-new .nome_pt').val());\r\n $('.txt2').val($('#modal-content-new select.ddl-tipo').val());\r\n\r\n var t = $(this).hasClass(\"js-edit-after\") ? \"1\" : \"0\";\r\n $('.txt3').val(t);\r\n $('.txt4').val($(\"#modal-content-new select.js-ordem\").val());\r\n\r\n setTimeout(function () {\r\n __doPostBack($(\".btn_adicionar_submit2\").attr(\"name\"), '');\r\n }, 10)\r\n });\r\n\r\n /* -- Click para cambiar preços -- */\r\n $('.btn_cambio_submit').click(function (e) {\r\n\r\n if (!$('#modal-content-cambio .nome_pt').val().length) {\r\n return;\r\n }\r\n\r\n $('.txt1').val($('#modal-content-cambio .nome_pt').val());\r\n\r\n setTimeout(function () {\r\n __doPostBack($(\".btn_cambio_submit2\").attr(\"name\"), '');\r\n }, 10)\r\n });\r\n\r\n /* -- Click para adicionar artigo -- */\r\n $('.btn_duplicar_submit').click(function (e) {\r\n\r\n if (!$('#modal-content-duplicar .nome_pt').val().length) {\r\n return;\r\n }\r\n\r\n $('.txt1').val($('#modal-content-duplicar .nome_pt').val());\r\n //$('.txt2').val($('#modal-content-duplicar .tbx_duplicar').val());\r\n\r\n var t = $(this).hasClass(\"js-edit-after\") ? \"1\" : \"0\";\r\n $('.txt3').val(t);\r\n $('.txt4').val($(\"#modal-content-duplicar select.js-ordem\").val());\r\n $('.txt5').val($(\"#modal-content-duplicar select.js-conteudo\").val());\r\n\r\n setTimeout(function () {\r\n __doPostBack($(\".btn_duplicar_submit2\").attr(\"name\"), '');\r\n }, 10)\r\n });\r\n\r\n $(\".js-input-pesquisa\").change(function () {\r\n\r\n var tabela = tabelaHolderObj.data('WATable');\r\n tabela.option(\"urlData\", { idfam: idfam, pg: 1, idsite: idSiteGlobal, pesquisa: $(this).val(), tipo: $(\"select.ddl_tipo\").val(), categoria: $(\"select.ddl_tipos\").val(), promocao: $(\".promocoes\").hasClass('active') ? \"1\" : \"0\" });\r\n tabela.resetPage();\r\n tabela.update();\r\n })\r\n $(\".ddl_tipo\").change(function () {\r\n\r\n var tabela = tabelaHolderObj.data('WATable');\r\n tabela.option(\"urlData\", { idfam: idfam, pg: 1, idsite: idSiteGlobal, pesquisa: $(\".js-input-pesquisa\").val(), tipo: $(\"select.ddl_tipo\").val(), categoria: $(\"select.ddl_tipos\").val(), promocao: $(\".promocoes\").hasClass('active') ? \"1\" : \"0\" });\r\n tabela.resetPage();\r\n tabela.update();\r\n })\r\n\r\n\r\n $(\".ddl_tipos\").change(function () {\r\n\r\n var tabela = tabelaHolderObj.data('WATable');\r\n tabela.option(\"urlData\", { idfam: idfam, pg: 1, idsite: idSiteGlobal, pesquisa: $(\".js-input-pesquisa\").val(), tipo: $(\"select.ddl_tipo\").val(), categoria: $(this).val(), promocao: $(\".promocoes\").hasClass('active') ? \"1\" : \"0\" });\r\n tabela.resetPage();\r\n tabela.update();\r\n })\r\n\r\n $(\".promocoes\").click(function () {\r\n $(this).toggleClass('active');\r\n var tabela = tabelaHolderObj.data('WATable');\r\n var opcoes = { idfam: idfam, pg: 1, idsite: idSiteGlobal, pesquisa: $(\".js-input-pesquisa\").val(), tipo: $(\"select.ddl_tipo\").val(), categoria: $(\"select.ddl_tipos\").val(), promocao: $(this).hasClass('active') ? \"1\" : \"0\" };\r\n //console.log(opcoes);\r\n tabela.option(\"urlData\", opcoes);\r\n tabela.resetPage();\r\n tabela.update();\r\n })\r\n\r\n },\r\n onTableCreated: function (data) {\r\n\r\n //BOTOES DE ACÇÃO\r\n if (podeEditar) {\r\n\r\n /* -- Ordenação de artigos -- */\r\n $(\".listagem-principal tbody\").sortable({\r\n distance: 15,\r\n forceHelperSize: true,\r\n containment: \"parent\",\r\n axis: \"y\",\r\n forcePlaceholderSize: true,\r\n handle: \".ordem\",\r\n stop: function (event, ui) {\r\n\r\n var order = $(\".listagem-principal tbody\").sortable('serialize').replace(/&/g, \"-\").replace(/tr\\[\\]=/g, \"\"),\r\n active = parseInt($(\".pagination .active\").text(), 10);\r\n\r\n artigos.defineOrdem(order, artigos.listagem.pageSize, active);\r\n }\r\n });\r\n\r\n /* -- Click para destaque e Activo -- */\r\n $(\".listagem-principal\").off().on(\"click\", \".js-click\", function () {\r\n\r\n var _this = $(this),\r\n prop = \"\",\r\n id = parseInt(_this.closest(\"tr\").find(\".tbcol1\").text(), 10),\r\n valor = _this.hasClass('active') ? 0 : 1;\r\n\r\n if (_this.hasClass(\"js-toggleActivo\")) {\r\n prop = \"activo\";\r\n }\r\n else if (_this.hasClass(\"js-togglePreview\")) {\r\n prop = \"preview\";\r\n }\r\n else if (_this.hasClass(\"js-togglePublico\")) {\r\n prop = \"publico\";\r\n }\r\n\r\n artigos.defineProp(prop, id, valor, _this);\r\n });\r\n\r\n }\r\n\r\n }\r\n },\r\n detalhe: {\r\n init: function (idfam) {\r\n\r\n if ($(\"#tabelaHolder\").length) {\r\n var _this = this,\r\n tabelaHolderObj = $('#tabelaHolder'),\r\n opcoesTabela = {\r\n pageSize: artigos.listagem.pageSize,\r\n apiUrl: '/api/artigos/get.ashx',\r\n apiData: { idfam: idfam, pg: 1, idsite: idSiteGlobal },\r\n callback: _this.onTableCreated\r\n }\r\n tabela.init(tabelaHolderObj, opcoesTabela);\r\n }\r\n\r\n editores.init();\r\n\r\n tabs.init(\".module-menu-textos\", function (obj) {\r\n\r\n if (obj.find(\">span\").hasClass(\"tab_localizacao\") && !mapa.existe) {\r\n setTimeout(function () {\r\n mapa.load();\r\n }, 300);\r\n } else if (obj.find(\">span\").hasClass(\"tab_multimedia\") && !uploader.existe) {\r\n setTimeout(function () {\r\n uploader.load();\r\n }, 300);\r\n } else if (obj.find(\">span\").hasClass(\"tab_horarios\") && !horarios.existe) {\r\n setTimeout(function () {\r\n horarios.init();\r\n }, 300);\r\n }\r\n });\r\n\r\n //this.bindClickMenus();\r\n\r\n if (podeEditar) {\r\n this.bindAdminClicks();\r\n\r\n media.loadSortable();\r\n media.bindClicks();\r\n }\r\n },\r\n onTableCreated: function () {\r\n\r\n //BOTOES DE ACÇÃO\r\n if (podeEditar) {\r\n\r\n /* -- Ordenação de artigos -- */\r\n $(\".listagem-principal tbody\").sortable({\r\n distance: 15,\r\n forceHelperSize: true,\r\n containment: \"parent\",\r\n axis: \"y\",\r\n forcePlaceholderSize: true,\r\n handle: \".ordem\",\r\n stop: function (event, ui) {\r\n\r\n var order = $(\".listagem-principal tbody\").sortable('serialize').replace(/&/g, \"-\").replace(/tr\\[\\]=/g, \"\"),\r\n active = parseInt($(\".pagination .active\").text(), 10);\r\n\r\n artigos.defineOrdem(order, artigos.listagem.pageSize, active);\r\n }\r\n });\r\n\r\n /* -- Click para destaque e Activo -- */\r\n $(\".listagem-principal\").on(\"click\", \".js-click\", function () {\r\n\r\n var _this = $(this),\r\n prop = \"\",\r\n id = parseInt(_this.closest(\"tr\").find(\".tbcol1\").text(), 10),\r\n valor = _this.attr(\"src\").indexOf(\"off\") > 0 ? 1 : 0;\r\n\r\n if (_this.hasClass(\"js-toggleActivo\")) {\r\n prop = \"activo\";\r\n }\r\n else if (_this.hasClass(\"js-togglePublico\")) {\r\n prop = \"publico\";\r\n }\r\n\r\n _this.addClass(\"loading\");\r\n _this.fadeOut(200, function () {\r\n artigos.defineProp(prop, id, valor, _this);\r\n });\r\n });\r\n\r\n\r\n }\r\n\r\n },\r\n bindClickMenus: function () {\r\n\r\n\r\n $(\"#editores .divs:first-child\").fadeIn();\r\n $(\"#submenuTextos .submenuitem:first-child\").addClass(\"active\");\r\n\r\n $(\"#tabs>.tab\").click(function () {\r\n var _this = $(this);\r\n\r\n\r\n\r\n _this.parent().find(\".tab\").removeClass(\"active\").addClass(\"inactive\");\r\n _this.removeClass(\"inactive\").addClass(\"active\");\r\n\r\n $(\"#editores .divs\").fadeOut(200);\r\n setTimeout(function () { $(\".show_\" + _this.attr(\"id\")).fadeIn(); }, 200);\r\n\r\n if (_this.hasClass(\"tab_localizacao\") && !mapa.existe) {\r\n setTimeout(function () {\r\n mapa.load();\r\n }, 300);\r\n }\r\n\r\n\r\n\r\n\r\n\r\n if (_this.hasClass(\"tab_multimedia\") && !uploader.existe) {\r\n setTimeout(function () {\r\n uploader.load();\r\n }, 300);\r\n $(\"#submenu .submenuitem:first-child\").addClass(\"active\");\r\n }\r\n\r\n if (_this.hasClass(\"tab_multimedia\")) {\r\n $(\"#submenu\").animate({ height: 25 }, 200);\r\n }\r\n else {\r\n $(\"#submenu\").animate({ height: 0 }, 200);\r\n }\r\n\r\n\r\n if (_this.hasClass(\"tab_textos\"))\r\n $(\"#submenuTextos\").animate({ height: 25 }, 200);\r\n else\r\n $(\"#submenuTextos\").animate({ height: 0 }, 200);\r\n })\r\n\r\n\r\n /* -- Submenu Multimedia -- */\r\n $(\"#submenu .submenuitem\").click(function () {\r\n var _this = $(this);\r\n $(\"#submenu .submenuitem\").removeClass(\"active\");\r\n _this.addClass(\"active\");\r\n $(\"#uploader_imagens,#uploader_documentos,#uploader_videos_holder\").hide();\r\n var id = _this.attr(\"id\").replace(\"open_\", \"\");\r\n $(\"#\" + id).fadeIn();\r\n //console.log(id);\r\n })\r\n\r\n /* -- Submenu idiomas -- */\r\n $(\"#submenuTextos .submenuitem\").click(function () {\r\n var _this = $(this);\r\n $(\"#submenuTextos .submenuitem\").removeClass(\"active\");\r\n _this.addClass(\"active\");\r\n\r\n $(\"#pt,#en\").hide()\r\n var id = _this.attr(\"id\").replace(\"open_lingua_\", \"\");\r\n $(\"#\" + id).fadeIn();\r\n })\r\n\r\n },\r\n bindDatePickers: function () {\r\n /* -- DATA INPUTS -- */\r\n //console.log(idiomasAdmin.MesesMin);\r\n //console.log(idiomasAdmin.DiasSemana);\r\n\r\n if ($(\".data_input\").length > 0) {\r\n $(\".data_input:not(.hasDatepicker)\").datepicker({\r\n changeMonth: true,\r\n changeYear: true,\r\n yearRange: \"1900:\" + (new Date().getFullYear() + 5),\r\n dateFormat: \"dd-mm-yy\",\r\n monthNamesShort: idiomasAdmin.MesesMin,\r\n dayNamesMin: idiomasAdmin.DiasSemana,\r\n });\r\n }\r\n },\r\n bindAdminClicks: function () {\r\n var _this = this;\r\n\r\n /* -- Save -- */\r\n $(\"#div_edicao\").on(\"click\", \".btn_gravar\", function () {\r\n\r\n if (Page_ClientValidate(\"CreateUserWizard1\")) {\r\n editores.encode();\r\n setTimeout(function () {\r\n __doPostBack($(\".btn_gravar_ghost\").attr(\"name\"), '');\r\n }, 1);\r\n\r\n } else {\r\n erro(\"Preencha os campos obrigatórios\");\r\n }\r\n })\r\n\r\n /* -- Save -- */\r\n $(\"#div_edicao\").on(\"click\", \".btn_preview\", function () {\r\n\r\n if (Page_ClientValidate(\"CreateUserWizard1\")) {\r\n editores.encode();\r\n setTimeout(function () {\r\n __doPostBack($(\".btn_preview_ghost\").attr(\"name\"), '');\r\n }, 1);\r\n\r\n } else {\r\n erro(\"Preencha os campos obrigatórios\");\r\n }\r\n })\r\n\r\n /* -- Eliminar -- */\r\n $(\"#div_edicao\").on(\"click\", \".btn_eliminar_artigo\", function () {\r\n\r\n notify(\"confirm\", \"Pretende eliminar este artigo?\", function () {\r\n editores.encode();\r\n setTimeout(function () {\r\n __doPostBack($(\".btn_eliminar_artigo_ghost\").attr(\"name\"), '');\r\n }, 1)\r\n })\r\n\r\n })\r\n\r\n\r\n _this.bindDatePickers();\r\n\r\n\r\n /* -- Datas de Validade -- */\r\n if ($(\".validade_checks_trigger input\").is(\":checked\")) {\r\n $(\".validade_checks\").show();\r\n }\r\n\r\n $(\".validade_checks_trigger input\").change(function () {\r\n if ($(this).is(\":checked\"))\r\n $(\".validade_checks\").slideDown();\r\n else\r\n $(\".validade_checks\").slideUp();\r\n })\r\n\r\n\r\n /* -- Seo Tags -- */\r\n $(\".show_tab_meta\").on(\"click\", \".btn_adicionartag_submit\", function () {\r\n\r\n if (Page_ClientValidate(\"CreateUserWizard3\")) {\r\n editores.encode();\r\n __doPostBack($(\".btn_adicionartag_submit_ghost\").attr(\"name\"), '');\r\n }\r\n })\r\n\r\n $(\".show_tab_meta\").on(\"click\", \".btn_remover_tag\", function () {\r\n\r\n var id = $(this).parent().find(\"input:first\").val();\r\n $(\"#hfIdTag\").val(id);\r\n editores.encode();\r\n __doPostBack($(\".eliminar_ghost\").attr(\"name\"), '');\r\n })\r\n\r\n\r\n /* -- Artihos relacionados -- */\r\n $(\".show_tab_relacoes\").on(\"change\", \".rel_check input\", function () {\r\n\r\n var id1 = $(\"#idholder input\").val(),\r\n id2 = $(this).closest(\".rel_item\").find(\".hf_holder input\").val(),\r\n accao = $(this).is(\":checked\") ? \"guarda\" : \"elimina\";\r\n\r\n if (accao == \"elimina\") {\r\n\r\n if (confirm(\"Pretende Remover esta relação?\")) {\r\n\r\n artigos.defineRelaco(accao, id1, id2, 0, 0);\r\n\r\n $(this).closest(\".rel_item\").fadeOut(function () {\r\n $(this).remove();\r\n });\r\n } else {\r\n $(this).prop(\"checked\", true);\r\n }\r\n } else {\r\n //Este nunca vai ser chamado\r\n artigos.defineRelaco(accao, id1, id2, 0, 0);\r\n\r\n }\r\n })\r\n }\r\n },\r\n\r\n defineProp: function (prop, ids, valor, obj) {\r\n 'use strict'\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: { a: prop, id: ids, v: valor, idsite: idSiteGlobal },\r\n url: '/api/artigos/setProp.ashx',\r\n dataType: \"html\",\r\n success: function (xml) {\r\n\r\n if (prop == \"preview\") {\r\n prop = \"activo\";\r\n }\r\n\r\n obj.toggleClass(\"active\");\r\n\r\n }, error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n }\r\n })\r\n },\r\n defineOrdem: function (ordem, pagesize, actual) {\r\n $(\".ordem\").animate({ \"text-indent\": -20 }, 100);\r\n $.ajax({\r\n type: \"GET\",\r\n data: { o: ordem, p: pagesize, a: actual, idsite: idSiteGlobal },\r\n url: '/api/artigos/setProp.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n var startCount = pagesize * (actual - 1);\r\n $(\".ordem\").each(function () {\r\n var ordem = $(this).parent().index() + 1 + startCount\r\n if (ordem < 10)\r\n ordem = \"0\" + ordem;\r\n $(this).text(ordem);\r\n })\r\n $(\".ordem\").animate({ \"text-indent\": 0 }, 200);\r\n }\r\n })\r\n },\r\n defineRelaco: function (accao, id1, id2, idfam1, idfam2) {\r\n $.ajax({\r\n type: \"GET\",\r\n data: { a: accao, idsrel: id1 + \"-\" + id2, idfams: idfam1 + \"-\" + idfam2 },\r\n url: '/api/artigos/setProp.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) { },\r\n success: function (xml) { }\r\n })\r\n },\r\n defineOrdemRelacao: function (data) {\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n data: data,\r\n url: '/api/ArtigosRelacionados/setOrdem',\r\n //dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n\r\n //console.log(xml);\r\n /*\r\n var startCount = pagesize * (actual - 1);\r\n $(\".ordem\").each(function () {\r\n var ordem = $(this).parent().index() + 1 + startCount\r\n if (ordem < 10)\r\n ordem = \"0\" + ordem;\r\n $(this).text(ordem);\r\n })\r\n $(\".ordem\").animate({ \"text-indent\": 0 }, 200);*/\r\n }\r\n })\r\n\r\n },\r\n defineOrdemRelacaoMultipla: function (data, callback) {\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n data: data,\r\n url: '/api/ArtigosRelacionados/SetOrdemRelacaoInversa',\r\n //dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n\r\n //console.log(xml);\r\n if (callback) {\r\n callback();\r\n }\r\n /*\r\n var startCount = pagesize * (actual - 1);\r\n $(\".ordem\").each(function () {\r\n var ordem = $(this).parent().index() + 1 + startCount\r\n if (ordem < 10)\r\n ordem = \"0\" + ordem;\r\n $(this).text(ordem);\r\n })\r\n $(\".ordem\").animate({ \"text-indent\": 0 }, 200);*/\r\n }\r\n })\r\n\r\n },\r\n\r\n defineTipoProduto: function (accao, idartigo, idTipo, idOpcao, valor, callback) {\r\n $.ajax({\r\n type: \"GET\",\r\n data: { accao: accao, idartigo: idartigo, idTipo: idTipo, idOpcao: idOpcao, valor: valor },\r\n url: '/api/artigos/setPropTipoProduto.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) { },\r\n success: function (xml) {\r\n callback(xml)\r\n }\r\n })\r\n },\r\n}\r\n\r\n\r\nvar listas = {\r\n init: function (url, pagesize, apiData, urlRemove, temRemove) {\r\n 'use strict'\r\n\r\n if (!url) {\r\n url = '/api/contactos/getContactos.ashx';\r\n }\r\n\r\n\r\n\r\n //// PERDE ALGURES O VALOR?\r\n idSiteGlobal = $(\"#hf_idsite\").val();\r\n\r\n var _this = this,\r\n tabelaHolderObj = $('#tabelaHolder'),\r\n opcoesTabela = {\r\n pageSize: pagesize ? pagesize : artigos.listagem.pageSize,\r\n apiUrl: url,\r\n apiData: apiData ? apiData : { pg: '1', tipo: $(\".ddl_tipos\").val(), idsite: idSiteGlobal },\r\n callback: _this.onTableCreated,\r\n urlRemove: urlRemove,\r\n temRemove: temRemove\r\n\r\n }\r\n\r\n\r\n tabela.init(tabelaHolderObj, opcoesTabela);\r\n\r\n //////////////////////////NEWSLETTER77777777777777777777777777777777777777\r\n //// USER CONSENTE OU NAO\r\n $(\".listagem.newsletter\").on(\"click\", \".js_consente_cliente\", function () {\r\n\r\n var _this = this;\r\n var consent = $(_this).data(\"consent\");\r\n var id = $(_this).data(\"id\");\r\n\r\n var data = {\r\n consent: consent,\r\n id: id,\r\n };\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: data,\r\n url: '/api/newsletter/consentimentoInscritos.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n erro(idiomasAdmin.popups.guardarAlteracoesErro + \"
\" + textStatus);\r\n },\r\n success: function (xml) {\r\n\r\n //console.log(\"xml \", xml);\r\n\r\n /// mudar ícone\r\n if (xml == \"1\") {\r\n $(_this).attr('src', '/assets/release/images/consent_on.png');\r\n $(_this).data('consent', 1);\r\n } else {\r\n $(_this).attr('src', '/assets/release/images/consent_off.png');\r\n $(_this).data('consent', 0);\r\n }\r\n\r\n sucesso(idiomasAdmin.popups.guardarAlteracoesSucesso);\r\n\r\n }\r\n })\r\n })\r\n\r\n $(\".listagem.newsletter\").on(\"click\", \".js_del_news\", function () {\r\n\r\n var _this = this;\r\n var id = $(_this).data(\"id\");\r\n\r\n var data = {\r\n id: id,\r\n };\r\n\r\n var mensagem = \"Tem a certeza que pretende eliminar este registo? Esta operação é irreversível\";\r\n var titulo = \"Alerta\";\r\n\r\n //notify(\"confirm\", mensagem, listas.confirmaDelte(data), titulo);\r\n\r\n\r\n notify(\"confirm\", mensagem, function () {\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: data,\r\n url: '/api/newsletter/eliminarInscritos.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n erro(\"Não foi possível gravar as alterações
\" + textStatus);\r\n },\r\n success: function (xml) {\r\n\r\n $(\"#tabelaHolder\").data(\"WATable\").update();\r\n\r\n //var href = $(\".button_refresh\").attr('href');\r\n //window.location.href = href;\r\n //$(\".button_refresh\").trigger('click');\r\n }\r\n })\r\n\r\n }, titulo)\r\n });\r\n\r\n //////// novos cliques newsletter\r\n /// desactivar\r\n $(\".listagem.newsletter\").on(\"click\", \".js-click\", function () {\r\n\r\n var _this = $(this),\r\n prop = \"\"\r\n //id = parseInt(_this.closest(\"tr\").find(\".tbcol1\").text(), 10),\r\n //valor = _this.attr(\"src\").indexOf(\"off\") > 0 ? 1 : 0;\r\n\r\n if (_this.hasClass(\"js-toggleActivo\")) {\r\n prop = 0;\r\n }\r\n else if (_this.hasClass(\"js-togglePublico\")) {\r\n prop = 1;\r\n }\r\n\r\n\r\n var activo = _this.data(\"activo\");\r\n var id = _this.data(\"id\");\r\n\r\n\r\n //console.log(\"activo, \", activo);\r\n\r\n _this.addClass(\"loading\");\r\n _this.fadeOut(200, function () {\r\n listas.definePropNews(activo, id, _this);\r\n });\r\n });\r\n\r\n /////////////////////////////////////////////////////////////////////\r\n\r\n //////////////////CONTACTOS7777777777777777777777777777777777\r\n //// USER CONSENTE OU NAO\r\n $(\".listagem.contactos\").on(\"click\", \".js_consente_cliente\", function () {\r\n event.stopPropagation();\r\n var _this = this;\r\n var consent = $(_this).data(\"consent\");\r\n var id = $(_this).data(\"id\");\r\n\r\n var data = {\r\n consent: consent,\r\n id: id,\r\n };\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: data,\r\n url: '/api/contactos/consentimentoInscritos.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n erro(\"Não foi possível gravar as alterações
\" + textStatus);\r\n },\r\n success: function (xml) {\r\n\r\n //console.log(\"xml \", xml);\r\n\r\n /// mudar ícone\r\n if (xml == \"1\") {\r\n $(_this).attr('src', '/assets/release/images/consent_on.png');\r\n $(_this).data('consent', 1);\r\n } else {\r\n $(_this).attr('src', '/assets/release/images/consent_off.png');\r\n $(_this).data('consent', 0);\r\n }\r\n\r\n sucesso(\"Registo alterado com sucesso\");\r\n }\r\n })\r\n })\r\n\r\n /////////////////////////////////////////////////////////////////////////////////\r\n\r\n $(\".ddl_tipos\").change(function () {\r\n var tabela = $('#tabelaHolder').data(\"WATable\");\r\n tabela.option(\"urlData\", { pg: '1', tipo: $(this).val(), idsite: idSiteGlobal });\r\n tabela.resetPage();\r\n tabela.update();\r\n })\r\n\r\n $(\".input_nome\").change(function () {\r\n var tabela = $('#tabelaHolder').data(\"WATable\");\r\n tabela.option(\"urlData\", { pg: '1', tipo: $(\".ddl_tipos\").val(), idsite: idSiteGlobal, texto: $(this).val() });\r\n tabela.resetPage();\r\n tabela.update();\r\n })\r\n\r\n $(\".lbl_insert\").click(function () {\r\n\r\n var titulo = $(this).data(\"titulo\"),\r\n placeholder = $(this).data(\"placeholder\"),\r\n url = $(this).data(\"url\"),\r\n urlSearch = $(this).data(\"urlsearch\");\r\n\r\n var campos = $(this).data(\"campos\");\r\n\r\n if (!campos) {\r\n campos = { nome: placeholder };\r\n }\r\n\r\n\r\n var htmlPop = \"
\" + titulo + \"
\" +\r\n \"
\"\r\n\r\n for (var property in campos) {\r\n if (campos.hasOwnProperty(property)) {\r\n\r\n htmlPop += \"
\" + campos[property] + \"
\";\r\n }\r\n }\r\n\r\n\r\n htmlPop += \"
\" +\r\n \"
\" + idiomasAdmin.popups.btnInserir + \"
\";\r\n\r\n $.modal(htmlPop, {\r\n closeHTML: \"x\",\r\n position: [\"20%\",],\r\n overlayId: 'confirm-overlay',\r\n containerId: 'confirm-container',\r\n onShow: function (dialog) {\r\n var modal = this;\r\n\r\n\r\n if (urlSearch) {\r\n\r\n $(\".input-new-item\").first().select2({\r\n minimumInputLength: 3,\r\n query: function (query) {\r\n\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: { texto: query.term, idsite: idSiteGlobal },\r\n url: urlSearch,\r\n dataType: \"json\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n erro(\"Erro a obter dados
\" + textStatus);\r\n },\r\n success: function (resultados) {\r\n var data = { results: [] };\r\n\r\n if (resultados.rows) {\r\n resultados = resultados.rows;\r\n }\r\n if (resultados) {\r\n\r\n for (var i = 0; i < resultados.length; i++) {\r\n data.results.push({ id: resultados[i].id, text: $(resultados[i].nome).text() + \" (\" + resultados[i].email + \")\" });\r\n }\r\n\r\n }\r\n query.callback(data);\r\n }\r\n })\r\n }\r\n });\r\n }\r\n\r\n\r\n // if the user clicks \"yes\"\r\n $('.yes', dialog.data[0]).click(function () {\r\n\r\n var preechidos = true;\r\n $(\".input-new-item\").each(function () {\r\n\r\n if (!$(this).val().length) {\r\n preechidos = false;\r\n }\r\n });\r\n\r\n if (preechidos) {\r\n\r\n var valores = $(\".lbl_insert\").data(\"valores\");\r\n\r\n if (!valores) {\r\n valores = {};\r\n }\r\n valores.input = $(\"#input_new_item\").val();\r\n\r\n if (urlSearch) {\r\n\r\n valores.input = $(\"#input_new_item\").select2('data').id;\r\n }\r\n\r\n $(\".input-new-item\").each(function () {\r\n\r\n valores[$(this).data(\"request\")] = $(this).val();\r\n })\r\n\r\n\r\n listas.insertNewItem(url, valores);\r\n }\r\n\r\n // close the dialog\r\n modal.close(); // or $.modal.close();\r\n });\r\n }\r\n });\r\n\r\n })\r\n\r\n },\r\n definePropNews: function (activo, id, obj) {\r\n\r\n 'use strict'\r\n\r\n var prop;\r\n\r\n if (activo == 1) {\r\n prop = 0;\r\n } else {\r\n prop = 1;\r\n }\r\n\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: { a: prop, id: id },\r\n url: '/api/newsletter/activaInscritos.ashx',\r\n dataType: \"html\",\r\n success: function (xml) {\r\n\r\n //console.log(\"xml, \", xml);\r\n\r\n obj.attr(\"src\", \"/assets/release/images/activo_\" + (xml == \"1\" ? \"on\" : \"off\") + \".png\");\r\n obj.fadeIn();\r\n obj.removeClass(\"loading\");\r\n var novoValorData;\r\n if (xml == \"1\") {\r\n novoValorData = 1;\r\n } else {\r\n novoValorData = 0;\r\n }\r\n obj.data('activo', novoValorData);\r\n\r\n }, error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n\r\n }\r\n })\r\n\r\n },\r\n onTableCreated: function () {\r\n 'use strict'\r\n\r\n $(\"#tabelaHolder\").on(\"click\", \".watable tr\", function (e) {\r\n\r\n if (!$(e.target).hasClass(\"js-click\") && $(e.target).closest(\".no-click\").length == 0 && $(e.currentTarget).hasClass(\"tbcol0\")) {\r\n e.preventDefault();\r\n\r\n var href = $(this).find(\"a\").attr(\"href\");\r\n if (href) {\r\n window.location = href;\r\n }\r\n }\r\n\r\n });\r\n\r\n ///// ELIMINAR USER\r\n $(document).off().on(\"click\", \".js_del_contacto\", function () {\r\n\r\n var _this = this;\r\n var id = $(_this).data(\"id\");\r\n\r\n var data = {\r\n id: id,\r\n };\r\n\r\n if (confirm(idiomasAdmin.popups.pretendeEliminarItem)) {\r\n\r\n // notify(\"confirm\", mensagem, function () {\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: data,\r\n url: '/api/contactos/eliminarInscritos.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n erro(\"Não foi possível gravar as alterações
\" + textStatus);\r\n },\r\n success: function (xml) {\r\n\r\n var href = $(\".button_refresh\").attr('href');\r\n window.location.href = href;\r\n //$(\".button_refresh\").trigger('click');\r\n }\r\n })\r\n\r\n //}, titulo)\r\n };\r\n });\r\n\r\n /* -- Click para destaque e Activo -- */\r\n $(\".listagem\").off().on(\"click\", \".js-click\", function () {\r\n //console.log(\"click listagem listas, \", $(this));\r\n\r\n var _this = $(this),\r\n prop = \"\",\r\n id = parseInt(_this.closest(\"tr\").find(\".tbcol1\").text(), 10);\r\n //valor = _this.attr(\"src\").indexOf(\"off\") > 0 ? 1 : 0;\r\n //valor = _this.hasClass('active') ? 0 : 1;\r\n\r\n\r\n if (_this.hasClass(\"js-toggleActivo\")) {\r\n prop = \"activo\";\r\n }\r\n else if (_this.hasClass(\"js-togglePublico\")) {\r\n prop = \"publico\";\r\n }\r\n\r\n if (_this.hasClass(\"js-toggleValido\")) {\r\n var valor = _this.hasClass('active') ? 0 : 1;\r\n prop = \"valido\";\r\n\r\n _this.fadeOut(200, function () {\r\n listas.definePropValido(prop, id, valor, _this);\r\n });\r\n } else {\r\n var valor = _this.attr(\"src\").indexOf(\"off\") > 0 ? 1 : 0;\r\n\r\n _this.addClass(\"loading\");\r\n _this.fadeOut(200, function () {\r\n listas.defineProp(prop, id, valor, _this);\r\n });\r\n }\r\n });\r\n\r\n },\r\n defineProp: function (prop, ids, valor, obj) {\r\n 'use strict'\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: { a: prop, id: ids, v: valor, idsite: idSiteGlobal },\r\n url: '/api/clientes/setProp.ashx',\r\n dataType: \"html\",\r\n success: function (xml) {\r\n\r\n obj.attr(\"src\", \"/assets/release/images/\" + prop + \"_\" + (valor == 1 ? \"on\" : \"off\") + \".png\");\r\n obj.fadeIn();\r\n obj.removeClass(\"loading\");\r\n\r\n }, error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n }\r\n })\r\n },\r\n definePropValido: function (prop, ids, valor, obj) {\r\n 'use strict'\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: { a: prop, id: ids, v: valor, idsite: idSiteGlobal },\r\n url: '/api/comentarios/setProp.ashx',\r\n dataType: \"html\",\r\n success: function (xml) {\r\n\r\n if (prop == \"preview\") {\r\n prop = \"activo\";\r\n }\r\n\r\n obj.toggleClass(\"active\");\r\n\r\n }, error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n }\r\n })\r\n },\r\n insertNewItem: function (url, valores) {\r\n\r\n valores.idsite = idSiteGlobal;\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: valores,\r\n url: url,\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n erro(idiomasAdmin.popups.itemInseridoErro + \"
\" + textStatus);\r\n },\r\n success: function (xml) {\r\n if (xml == \"true\") {\r\n sucesso(idiomasAdmin.popups.itemInseridoSucesso);\r\n //window.location.reload();\r\n\r\n $('#tabelaHolder').data(\"WATable\").update();\r\n\r\n } else {\r\n erro(idiomasAdmin.popups.itemInseridoErro + \"
\" + xml);\r\n }\r\n }\r\n })\r\n },\r\n detalhe: {\r\n init: function () {\r\n\r\n $(\"#editores .divs:first-child\").fadeIn();\r\n $(\".alteracoes_recentes_titulo\").click(function () {\r\n $(\".alteracoes_recentes ul\").slideToggle();\r\n })\r\n\r\n if (podeEditar) {\r\n if (typeof tinyMCE != 'undefined') {\r\n editores.init();\r\n }\r\n\r\n $(\"#div_edicao\").on(\"click\", \".btn_gravar\", function () {\r\n editores.encode();\r\n setTimeout(function () {\r\n\r\n __doPostBack($(\".btn_gravar_ghost\").attr(\"name\"), '');\r\n }, 1)\r\n })\r\n\r\n /* -- Eliminar -- */\r\n $(\"#div_edicao\").on(\"click\", \".btn_eliminar_artigo\", function () {\r\n\r\n notify(\"confirm\", idiomasAdmin.popups.pretendeEliminarItem, function () {\r\n editores.encode();\r\n setTimeout(function () {\r\n __doPostBack($(\".btn_eliminar_artigo_ghost\").attr(\"name\"), '');\r\n }, 1)\r\n })\r\n })\r\n }\r\n },\r\n bindDatePickers: function () {\r\n /* -- DATA INPUTS -- */\r\n\r\n //console.log('cheguei');\r\n\r\n\r\n if ($(\".data_input\").length > 0) {\r\n $(\".data_input:not(.hasDatepicker)\").datepicker({\r\n changeMonth: true,\r\n changeYear: true,\r\n yearRange: \"1900:\" + (new Date().getFullYear() + 5),\r\n dateFormat: \"dd-mm-yy\",\r\n monthNamesShort: idiomasAdmin.MesesMin,\r\n dayNamesMin: idiomasAdmin.DiasSemana,\r\n });\r\n }\r\n }\r\n\r\n }\r\n}\r\n\r\n\r\nvar variaveis = {\r\n init: function (url) {\r\n\r\n var _this = this,\r\n tabelaHolderObj = $('#tabelaHolder'),\r\n opcoesTabela = {\r\n pageSize: 30,\r\n apiUrl: url,\r\n apiData: { pg: '1', tipo: '', s: '' },\r\n callback: _this.onTableCreated\r\n }\r\n tabela.init(tabelaHolderObj, opcoesTabela);\r\n\r\n _this.bindFiltrosClicks();\r\n\r\n if (podeEditar) {\r\n _this.bindAdminClicks();\r\n }\r\n\r\n },\r\n bindFiltrosClicks: function () {\r\n $(\".ddl_tipos\").change(function () {\r\n var pesquisaVal = $(\".tbx_pesquisa\").val().trim(),\r\n tipoVal = $(this).val(),\r\n tabela = $('#tabelaHolder').data(\"WATable\");\r\n\r\n tabela.option(\"urlData\", { pg: 1, tipo: tipoVal, s: pesquisaVal });\r\n tabela.resetPage();\r\n tabela.update();\r\n\r\n $(\".tbx_pesquisa\").data(\"oldSearch\", pesquisaVal);\r\n })\r\n\r\n $(\".lbl_pesquisar\").click(function () {\r\n var pesquisaVal = $(\".tbx_pesquisa\").val().trim(),\r\n tipoVal = $(\".ddl_tipos\").val(),\r\n tabela = $('#tabelaHolder').data(\"WATable\");\r\n\r\n if ($(\".tbx_pesquisa\").data(\"oldSearch\") !== pesquisaVal) {\r\n tabela.option(\"urlData\", { pg: 1, tipo: tipoVal, s: pesquisaVal });\r\n tabela.resetPage();\r\n tabela.update();\r\n\r\n $(\".tbx_pesquisa\").data(\"oldSearch\", pesquisaVal);\r\n }\r\n })\r\n },\r\n bindAdminClicks: function () {\r\n\r\n $(\".listagem.textosvariaveis\").on(\"click\", \".btn_gravar_list\", function (e) {\r\n e.preventDefault();\r\n var _holderObj = $(this).closest(\"tr\"),\r\n xid = _holderObj.find(\".id_linha input\").val(),\r\n variaveis = { id: xid };\r\n\r\n _holderObj.find(\"textarea\").each(function () {\r\n variaveis[$(this).attr(\"data-var\")] = $(this).val();\r\n })\r\n\r\n //console.log(\"variaveis \", variaveis);\r\n $.ajax({\r\n type: \"POST\",\r\n data: variaveis,\r\n url: '/api/texto/SetTextoVariavel',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n erro(idiomasAdmin.popups.guardarAlteracoesErro + \"
\" + textStatus);\r\n },\r\n success: function (xml) {\r\n\r\n if (xml.replace(/\"/g, \"\") == \"true\") {\r\n sucesso(idiomasAdmin.popups.textGuardadoSucesso);\r\n } else {\r\n erro(idiomasAdmin.popups.guardarAlteracoesErro + \"
\" + xml);\r\n }\r\n }\r\n })\r\n })\r\n }\r\n\r\n\r\n}\r\n\r\nvar friendlys = {\r\n init: function (url) {\r\n\r\n var _this = this,\r\n tabelaHolderObj = $('#tabelaHolder'),\r\n opcoesTabela = {\r\n pageSize: 30,\r\n apiUrl: url,\r\n apiData: { pg: '1', tipo: '', s: '' },\r\n callback: _this.onTableCreated\r\n }\r\n tabela.init(tabelaHolderObj, opcoesTabela);\r\n\r\n _this.bindFiltrosClicks();\r\n\r\n if (podeEditar) {\r\n _this.bindAdminClicks();\r\n }\r\n\r\n },\r\n bindFiltrosClicks: function () {\r\n $(\".ddl_tipos\").change(function () {\r\n var pesquisaVal = $(\".tbx_pesquisa\").val().trim(),\r\n tipoVal = $(this).val(),\r\n tabela = $('#tabelaHolder').data(\"WATable\");\r\n\r\n tabela.option(\"urlData\", { pg: 1, tipo: tipoVal, s: pesquisaVal });\r\n tabela.resetPage();\r\n tabela.update();\r\n\r\n $(\".tbx_pesquisa\").data(\"oldSearch\", pesquisaVal);\r\n })\r\n\r\n $(\".lbl_pesquisar\").click(function () {\r\n var pesquisaVal = $(\".tbx_pesquisa\").val().trim(),\r\n tipoVal = $(\".ddl_tipos\").val(),\r\n tabela = $('#tabelaHolder').data(\"WATable\");\r\n\r\n if ($(\".tbx_pesquisa\").data(\"oldSearch\") !== pesquisaVal) {\r\n tabela.option(\"urlData\", { pg: 1, tipo: tipoVal, s: pesquisaVal })\r\n tabela.resetPage();\r\n tabela.update();\r\n\r\n $(\".tbx_pesquisa\").data(\"oldSearch\", pesquisaVal);\r\n }\r\n })\r\n },\r\n bindAdminClicks: function () {\r\n\r\n $(\".listagem.configuracoes\").on(\"click\", \".btn_gravar_list\", function (e) {\r\n e.preventDefault();\r\n var _holderObj = $(this).closest(\"tr\"),\r\n xid = _holderObj.find(\".id_linha input\").val(),\r\n variaveis = { id: xid };\r\n\r\n _holderObj.find(\"input[data-var]\").each(function () {\r\n variaveis[$(this).attr(\"data-var\")] = $(this).val();\r\n })\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: variaveis,\r\n url: '/api/config/setFriendlysCheck.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n erro(idiomasAdmin.popups.guardarAlteracoesErro + \"
\" + textStatus);\r\n },\r\n success: function (xml) {\r\n if (xml == \"true\") {\r\n sucesso(idiomasAdmin.popups.textGuardadoSucesso);\r\n } else {\r\n erro(idiomasAdmin.popups.guardarAlteracoesErro + \"
\" + xml);\r\n }\r\n }\r\n })\r\n })\r\n }\r\n\r\n\r\n}\r\n\r\nvar redirects = {\r\n init: function (url) {\r\n //console.log(\"init redirects\");\r\n var _this = this,\r\n tabelaHolderObj = $('#tabelaHolder'),\r\n opcoesTabela = {\r\n pageSize: 30,\r\n apiUrl: url,\r\n apiData: { pg: '1', tipo: '', s: '' },\r\n callback: _this.onTableCreated\r\n }\r\n tabela.init(tabelaHolderObj, opcoesTabela);\r\n\r\n _this.bindFiltrosClicks();\r\n\r\n if (podeEditar) {\r\n _this.bindAdminClicks();\r\n }\r\n\r\n /* -- Click para adicionar artigo -- */\r\n $('.modal-basic').click(function (e) {\r\n $('#modal-content-new').modal({\r\n persist: true,\r\n onClose: function () {\r\n $(\".validation_holder\").hide();\r\n $(\".error_popup\").css(\"visibility\", \"hidden\");\r\n $.modal.close();\r\n }\r\n });\r\n return false;\r\n });\r\n\r\n /* -- Click para adicionar artigo -- */\r\n $('.btn_adicionar_submit').click(function (e) {\r\n\r\n if (!$('#modal-content-new .descr').val().length) {\r\n return;\r\n }\r\n\r\n $('.txt1').val($('#modal-content-new .descr').val());\r\n $('.txt2').val($('#modal-content-new .oldurl').val());\r\n $('.txt3').val($('#modal-content-new .newurl').val());\r\n\r\n setTimeout(function () {\r\n __doPostBack($(\".btn_adicionar_submit2\").attr(\"name\"), '');\r\n }, 10)\r\n });\r\n },\r\n bindFiltrosClicks: function () {\r\n $(\".lbl_pesquisar\").click(function () {\r\n var pesquisaVal = $(\".tbx_pesquisa\").val().trim(),\r\n tabela = $('#tabelaHolder').data(\"WATable\");\r\n\r\n if ($(\".tbx_pesquisa\").data(\"oldSearch\") !== pesquisaVal) {\r\n tabela.option(\"urlData\", { pg: 1, s: pesquisaVal })\r\n tabela.resetPage();\r\n tabela.update();\r\n\r\n $(\".tbx_pesquisa\").data(\"oldSearch\", pesquisaVal);\r\n }\r\n })\r\n },\r\n bindAdminClicks: function () {\r\n\r\n $(\".listagem.redirects\").on(\"click\", \".btn_gravar_list\", function (e) {\r\n e.preventDefault();\r\n var _holderObj = $(this).closest(\"tr\"),\r\n xid = _holderObj.find(\".id_linha input\").val(),\r\n redirect = { id: xid };\r\n\r\n _holderObj.find(\"input[data-var]\").each(function () {\r\n redirect[$(this).attr(\"data-var\")] = $(this).val();\r\n })\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: redirect,\r\n url: '/api/config/setRedirects.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n erro(idiomasAdmin.popups.guardarAlteracoesErro + \"
\" + textStatus);\r\n },\r\n success: function (xml) {\r\n if (xml == \"true\") {\r\n sucesso(idiomasAdmin.popups.textGuardadoSucesso);\r\n } else {\r\n erro(idiomasAdmin.popups.guardarAlteracoesErro + \"
\" + xml);\r\n }\r\n }\r\n })\r\n })\r\n }\r\n\r\n\r\n}\r\n\r\nvar idiomasAdmin = \"\";\r\n\r\nvar idiomas = {\r\n init: function (url) {\r\n\r\n alert(\"a\");\r\n\r\n var _this = this,\r\n tabelaHolderObj = $('#tabelaHolder'),\r\n opcoesTabela = {\r\n pageSize: 30,\r\n apiUrl: url,\r\n apiData: { pg: '1', tipo: '', s: '' },\r\n callback: _this.onTableCreated\r\n }\r\n tabela.init(tabelaHolderObj, opcoesTabela);\r\n\r\n _this.bindFiltrosClicks();\r\n\r\n if (podeEditar) {\r\n _this.bindAdminClicks();\r\n }\r\n\r\n },\r\n bindFiltrosClicks: function () {\r\n $(\".ddl_tipos\").change(function () {\r\n var pesquisaVal = $(\".tbx_pesquisa\").val().trim(),\r\n tipoVal = $(this).val(),\r\n tabela = $('#tabelaHolder').data(\"WATable\");\r\n\r\n tabela.option(\"urlData\", { pg: 1, tipo: tipoVal, s: pesquisaVal });\r\n tabela.resetPage();\r\n tabela.update();\r\n\r\n $(\".tbx_pesquisa\").data(\"oldSearch\", pesquisaVal);\r\n })\r\n\r\n $(\".lbl_pesquisar\").click(function () {\r\n var pesquisaVal = $(\".tbx_pesquisa\").val().trim(),\r\n tipoVal = $(\".ddl_tipos\").val(),\r\n tabela = $('#tabelaHolder').data(\"WATable\");\r\n\r\n if ($(\".tbx_pesquisa\").data(\"oldSearch\") !== pesquisaVal) {\r\n tabela.option(\"urlData\", { pg: 1, tipo: tipoVal, s: pesquisaVal });\r\n tabela.resetPage();\r\n tabela.update();\r\n\r\n $(\".tbx_pesquisa\").data(\"oldSearch\", pesquisaVal);\r\n }\r\n })\r\n },\r\n bindAdminClicks: function () {\r\n\r\n $(\".listagem.idiomas\").on(\"click\", \".btn_gravar_list\", function (e) {\r\n e.preventDefault();\r\n var _holderObj = $(this).closest(\"tr\"),\r\n xid = _holderObj.find(\".id_linha input\").val(),\r\n variaveis = { id: xid };\r\n\r\n _holderObj.find(\"input[data-var], select[data-var]\").each(function () {\r\n variaveis[$(this).attr(\"data-var\")] = $(this).val();\r\n })\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: variaveis,\r\n url: '/api/config/setIdiomas.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n erro(\"Não foi possível gravar as alterações
\" + textStatus);\r\n },\r\n success: function (xml) {\r\n if (xml == \"true\") {\r\n sucesso(\"Idioma atualizado com suscesso\");\r\n } else {\r\n erro(\"Não foi possível gravar as alterações
\" + xml);\r\n }\r\n }\r\n })\r\n })\r\n }\r\n\r\n\r\n}\r\n\r\nvar mapa = {\r\n existe: false,\r\n load: function () {\r\n\r\n if (!mapa.existe) {\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&callback=mapa.init&key=AIzaSyCqkGWT-3TeNmfHNoc50HghR0udkzqeBCk';\r\n document.body.appendChild(script);\r\n }\r\n\r\n\r\n },\r\n init: function () {\r\n\r\n $.getScript(\"/assets/release/js/standalone/jquery.ma.mapa.js\", function (data, textStatus, jqxhr) {\r\n\r\n if (!parseInt(zoom)) {\r\n zoom = \"8\";\r\n }\r\n\r\n if (marcadores.length > 0) {\r\n $(\"#mapa\").mapaMA({\r\n mapOptions: { zoom: zoom },\r\n dragEnd: function (lat, lng, zoom, id) {\r\n mapa.updateCoordenadas(lat, lng, zoom, id);\r\n $(\".coordenas_holder\").val(lat + \",\" + lng)\r\n },\r\n marcadores: marcadores\r\n });\r\n }\r\n mapa.existe = true;\r\n });\r\n\r\n },\r\n updateCoordenadas: function (latitude, longitude, zoom, idArtigo) {\r\n /*$.ajax({\r\n type: \"GET\",\r\n data: { lat: latitude, lng: longitude, z: zoom, id: idArtigo },\r\n url: '/api/artigos/setProp.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) { },\r\n success: function (xml) { }\r\n })*/\r\n },\r\n updatePosition: function (latitude, longitude) {\r\n $(\"#mapa\").mapaMA(\"refresh\", [latitude, longitude]);\r\n\r\n }\r\n}\r\n\r\n\r\nvar media = {\r\n updateLista: function (tipo) {\r\n\r\n editores.encode();\r\n\r\n if (tipo == \"img\") {\r\n setTimeout(function () {\r\n __doPostBack($(\".button_update_ghost\").attr(\"name\"), '');\r\n }, 1);\r\n }\r\n else if (tipo == \"video\") {\r\n setTimeout(function () {\r\n __doPostBack($(\".button_update_ghostvideos\").attr(\"name\"), '');\r\n }, 1);\r\n\r\n }\r\n else {\r\n setTimeout(function () {\r\n __doPostBack($(\".button_update_ghostdocs\").attr(\"name\"), '');\r\n }, 1);\r\n\r\n }\r\n\r\n uploader.ajustaTamanho(100, tipo);\r\n },\r\n\r\n loadSortable: function () {\r\n\r\n\r\n $(\".painel_fotos .media_item,.painel_docs .doc_item,.painel_videos .doc_item\").each(function () { $(this).attr(\"id\", \"m_\" + $(this).find(\".hf_holder input\").val()); })\r\n\r\n $(\".painel_fotos\").sortable({\r\n forceHelperSize: true, containment: \"parent\", forcePlaceholderSize: true, handle: \".pic\",\r\n stop: function (event, ui) {\r\n var order = $(\".painel_fotos\").sortable('serialize').replace(/&/g, \"-\");\r\n media.defineOrdem(order, \"img\");\r\n }\r\n });\r\n\r\n $(\".painel_docs\").sortable({\r\n forceHelperSize: true, containment: \"parent\", forcePlaceholderSize: true, handle: \".pic\",\r\n stop: function (event, ui) {\r\n var order = $(\".painel_docs\").sortable('serialize').replace(/&/g, \"-\");\r\n media.defineOrdem(order, \"doc\");\r\n }\r\n });\r\n\r\n\r\n $(\".painel_videos\").sortable({\r\n forceHelperSize: true, containment: \"parent\", forcePlaceholderSize: true, handle: \".pic\",\r\n stop: function (event, ui) {\r\n var order = $(\".painel_videos\").sortable('serialize').replace(/&/g, \"-\");\r\n media.defineOrdem(order, \"video\");\r\n }\r\n });\r\n\r\n\r\n },\r\n bindClicks: function () {\r\n\r\n\r\n /* EDITAR DESCRICAO IMAGEM */\r\n $(\"#editores\").on(\"change\", \".media_input\", function () {\r\n\r\n var _this = $(this),\r\n idioma = _this.data(\"idioma\"),\r\n xid = \"\",\r\n valor = _this.val(),\r\n funcao = function () {\r\n sucesso(\"Descrição guardada com sucesso\");\r\n };\r\n\r\n if (!valor.length) {\r\n erro(\"A imagem deve ter uma descrição\");\r\n return false;\r\n }\r\n\r\n if (_this.closest(\".painel_fotos\").length) {\r\n tipo = \"img\";\r\n } else if (_this.closest(\".painel_videos\").length) {\r\n tipo = \"video\";\r\n } else {\r\n tipo = \"doc\";\r\n }\r\n\r\n\r\n if (_this.closest(\".doc_item\").length) {\r\n xid = _this.closest(\".doc_item\").attr(\"id\").replace(\"m_\", \"\")\r\n } else {\r\n xid = _this.parent().attr(\"id\").replace(\"m_\", \"\")\r\n }\r\n\r\n media.defineProp(\"descr\", xid, valor, funcao, tipo, idioma)\r\n });\r\n\r\n /* EDITAR TIPO DOCUMENTO */\r\n $(\"#editores\").on(\"blur\", \".media_tipodocs\", function () {\r\n\r\n var _this = $(this),\r\n xid = _this.parent().attr(\"id\").replace(\"m_\", \"\"),\r\n valor = _this.val(),\r\n tipo = 'img',\r\n funcao = function () { };\r\n\r\n if (_this.closest(\".modo-ftp\").length) {\r\n return false;\r\n }\r\n\r\n if (_this.closest(\".painel_fotos\").length) {\r\n tipo = \"img\";\r\n } else if (_this.closest(\".painel_videos\").length) {\r\n tipo = \"video\";\r\n } else {\r\n tipo = \"doc\";\r\n }\r\n\r\n\r\n media.defineProp(\"tipodocs\", xid, valor, funcao, tipo);\r\n\r\n });\r\n\r\n /* -- Checks das imagens -- */\r\n $(\"#editores\").on(\"click\", \".media_check input\", function () {\r\n\r\n var _this = $(this),\r\n valor = _this.is(\":checked\") ? \"1\" : \"0\",\r\n inputName = _this.attr(\"name\"),\r\n campo = inputName.substring(inputName.lastIndexOf('$') + 1, inputName.length).replace(\"chk_\", \"\"),\r\n tipo = \"img\";\r\n\r\n if (_this.closest(\".modo-ftp\").length) {\r\n return false;\r\n }\r\n\r\n if (_this.closest(\".painel_fotos\").length) {\r\n tipo = \"img\";\r\n } else if (_this.closest(\".painel_videos\").length && !_this.closest(\".modo-ftp\").length) {\r\n tipo = \"video\";\r\n } else {\r\n tipo = \"doc\";\r\n }\r\n\r\n if (tipo == \"img\") {\r\n var xid = _this.closest(\".media_item\").attr(\"id\").replace(\"m_\", \"\"),\r\n funcao = function () { };\r\n\r\n media.defineProp(campo, xid, valor, funcao, tipo);\r\n\r\n } else {\r\n var xid = _this.closest(\".doc_item\").find(\".hf_holder input\").val(),\r\n funcao = function () { };\r\n\r\n media.defineProp(campo, xid, valor, funcao, tipo);\r\n }\r\n })\r\n\r\n /* -- Apagar item media -- */\r\n $(\"#editores\").on(\"click\", \".btn_remove_media\", function () {\r\n var _this = $(this),\r\n id = _this.parent().find(\".hf_holder input\").val();\r\n\r\n\r\n if (!_this.hasClass(\"aeliminar\")) {\r\n _this.addClass(\"aeliminar\")\r\n\r\n maTimer.init(_this, id, function () {\r\n\r\n var tipo = \"doc\";\r\n if (_this.closest(\".painel_fotos\").length) {\r\n tipo = \"img\";\r\n } else if (_this.closest(\".painel_videos\").length) {\r\n tipo = \"video\";\r\n }\r\n\r\n var funcao = function () {\r\n _this.parent().remove();\r\n //sucesso(\"Imagem removida com sucesso\");\r\n }\r\n\r\n media.defineProp(\"eliminar\", id, \"1\", funcao, tipo);\r\n });\r\n\r\n } else {\r\n $(this).removeClass(\"aeliminar\").text(\"Eliminar\");\r\n }\r\n\r\n })\r\n\r\n\r\n },\r\n defineProp: function (accao, xid, valor, funcao, tipo, idioma) {\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n data: { t: tipo, id: xid, a: accao, v: valor, idioma: idioma },\r\n url: '/api/media/setProp.ashx',\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) { },\r\n success: function (xml) {\r\n\r\n if (xml == \"false\") {\r\n sucesso(\"Oops. Não foi possível concluir a acção\");\r\n } else {\r\n funcao();\r\n }\r\n }\r\n })\r\n\r\n },\r\n defineOrdem: function (ordem, tipo) {\r\n\r\n if (!tipo) {\r\n tipo = \"img\";\r\n }\r\n\r\n var objAnim = $(\".painel_fotos\");\r\n\r\n if (tipo == \"doc\") {\r\n objAnim = $(\".painel_docs\");\r\n\r\n } else if (tipo == \"video\") {\r\n objAnim = $(\".painel_videos\");\r\n }\r\n\r\n\r\n objAnim.css(\"opacity\", \".5\");\r\n $.ajax({\r\n type: \"GET\",\r\n url: '/api/media/setProp.ashx?o=' + ordem + \"&t=\" + tipo,\r\n dataType: \"html\",\r\n error: function (XMLHttpRequest, textStatus, errorThrown) {\r\n },\r\n success: function (xml) {\r\n objAnim.animate({ \"opacity\": 1 }, 200);\r\n }\r\n })\r\n }\r\n}\r\n\r\nvar uploader = {\r\n existe: false,\r\n load: function () {\r\n\r\n var id = $(\"#uploaderId input\").val();\r\n $(\".uploader_fotos\").append(\"