Help
RSS
API
Feed
Maltego
Contact
Domain > www.logextrans.com
×
Welcome!
Right click nodes and scroll the mouse to navigate the graph.
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2021-05-14
86.109.178.108
(
ClassC
)
2025-01-10
78.46.3.226
(
ClassC
)
Port 80
HTTP/1.1 301 Moved PermanentlyDate: Fri, 10 Jan 2025 18:01:58 GMTServer: ApacheLocation: https://www.logextrans.com/Content-Length: 303Content-Type: text/html; charsetiso-8859-1 !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN>html>head>title>301 Moved Permanently/title>/head>body>h1>Moved Permanently/h1>p>The document has moved a hrefhttps://www.logextrans.com/>here/a>./p>hr>address>Apache Server at www.logextrans.com Port 80/address>/body>/html>
Port 443
HTTP/1.1 200 OKDate: Fri, 10 Jan 2025 18:01:58 GMTServer: ApacheX-URI: Expires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidatePragma: no-cacheServer-Timing: php;dur19.31Set-Cookie: langes; expiresSat, 10 Jan 2026 18:01:58 GMT; Max-Age31536000; path/; domainwww.logextrans.com; secure; HttpOnly; SameSiteStrictSet-Cookie: PHPSESSIDd0cdc064c9c86ca4d5c2447b85a43671; path/Upgrade: h2Connection: UpgradeTransfer-Encoding: chunkedContent-Type: text/html; charsetutf-8 !DOCTYPE html>html langes> head> meta http-equivContent-Type contenttext/html; charsetUTF-8 /> meta nameviewport contentwidthdevice-width, initial-scale1> BASE href/> !-- FONT --> link hrefhttps://fonts.googleapis.com/css2?familyHeebo:wght@400;500;600&familyInter:wght@600&familyLobster+Two:wght@700&displayswap relstylesheet> !-- Bootstrap CSS --> link relstylesheet hrefcss/base/bootstrap3/bootstrap.min.css> !-- Bootstrap Optional theme CSS --> link relstylesheet hrefcss/base/bootstrap3/bootstrap-theme.min.css> !-- Bootstrap dialog CSS --> link hrefcss/base/bootstrap-dialog/bootstrap-dialog.min.css relstylesheet> link hrefcss/base/bootstrap-dialog/bootstrap.fd.css relstylesheet> !-- SweetAlert2 CSS --> link hrefcss/base/bootstrap-dialog/sweetalert2.min.css relstylesheet> !-- Footable CSS --> link hrefcss/base/bootstrap-extra/footable.bootstrap.min.css relstylesheet> !-- Summernote CSS --> link hrefcss/base/bootstrap-extra/summernote/summernote.css relstylesheet> link hrefcss/base/bootstrap-extra/summernote/summernote-image-attributes.css relstylesheet> !-- Datepicker CSS --> link hrefjs/bootstrap-datepicker/bootstrap-datepicker.min.css relstylesheet typetext/css mediascreen> !-- Owl carousel CSS --> link hrefcss/owl.carousel.min.css relstylesheet typetext/css mediascreen> link relstylesheet hrefphp/inc/libs/IconCaptcha/css/icon-captcha.min.css/> !-- FAVICON --> link relicon typeimage/png sizes32x32 hrefimg/favicon.png> !-- Custom stlylesheet --> link relstylesheet hrefcss/font-awesome.min.css> link typetext/css relstylesheet hrefcss/style.css/> link typetext/css relstylesheet hrefcss/jennytainer.v1.css/> !-- Envas icons --> link relstylesheet typetext/css hrefcss/envas-icons.css> !-- Favicon --> link relicon hrefimg/favicon.png> !-- Accesibilidad --> link relstylesheet typetext/css hrefjs/accessibility/css/style.css/> !-- CUSTOM CSS --> link relstylesheet hrefcss/custom.css/> !-- archivos CSS extra (inline) --> style> @font-face { font-family: Roboto; font-weight: 400; font-style: normal; src: url(fonts/google/Roboto-regular/Roboto-regular.eot); src: url(fonts/google/Roboto-regular/Roboto-regular.eot?#iefix) format(embedded-opentype), local(Roboto), local(Roboto-regular), url(fonts/google/Roboto-regular/Roboto-regular.woff2) format(woff2), url(fonts/google/Roboto-regular/Roboto-regular.woff) format(woff), url(fonts/google/Roboto-regular/Roboto-regular.ttf) format(truetype), url(fonts/google/Roboto-regular/Roboto-regular.svg#Roboto) format(svg); } @font-face { font-family: RobotoBold; font-weight: 700; font-style: normal; src: url(fonts/google/Roboto-700/Roboto-700.eot); src: url(fonts/google/Roboto-700/Roboto-700.eot?#iefix) format(embedded-opentype), local(RobotoBold), url(fonts/google/Roboto-700/Roboto-700.woff2) format(woff2), url(fonts/google/Roboto-700/Roboto-700.woff) format(woff), url(fonts/google/Roboto-700/Roboto-700.ttf) format(truetype), url(fonts/google/Roboto-700/Roboto-700.svg#Roboto) format(svg); } @font-face { font-family: RobotoCondensed; font-weight: 300; font-style: normal; src: url(fonts/google/roboto-condensed-v24-latin-300.woff); src: url(fonts/google/roboto-condensed-v24-latin-300.woff2) format(woff2), url(fonts/google/roboto-condensed-v24-latin-300.woff) format(woff); } @font-face { font-family: RobotoThin; font-weight: 100; font-style: normal; src: url(fontsw/Roboto-Thin.ttf); } @font-face { font-family: RobotoLight; font-weight: 100; font-style: normal; src: url(fontsw/Roboto-Light.ttf); } /* file: bootstrap-dialog-hacks.css *//* Fix sweetalert spacer when its in combination with Smarty theme */.swal2-spacer { background-image:none;}/* Bootstrap 3 modal vertical position center http://stackoverflow.com/questions/18422223/bootstrap-3-modal-vertical-position-center*/.modal { text-align: center;}.modal-dialog { display: inline-block; text-align: left; vertical-align: middle; margin-top: 6px; /* Este pequeño margen para cuando es resolución movil (y no se centra el dialog) */}@media screen and (min-width: 768px) { .modal:before { display: inline-block; vertical-align: middle; content: ; height: 100%; } .modal-dialog { margin-top:0; /* Sin margen superior cuando hay espacio de sobra */ }}@media screen and (min-width: 768px) and (min-device-pixel-ratio: 2) { .modal:before { vertical-align: inherit !important; content: inherit !important; height: inherit !important; }}/* Mis Dialog HACKS para tener full-responsive stuff - Juanga 2016-10-05 */@media screen and (min-width: 768px) { div.modal-dialog.modal-extra { width: calc(100vw - 30px) !important; } div.modal-dialog { /* left: 50%; */ right: auto; width: 620px !important; /* 600px; */ padding-top:0; padding-bottom:0; } div.modal-dialog div.modal-body { height:auto !important; max-height: 490px !important; overflow-y: auto !important; } div.modal-dialog.modal-lg { margin-top:0 !important; } div.modal-content { -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); }}@media screen and (min-width: 1200px) { div.modal-dialog.modal-extra { width: 1080px !important; } div.modal-dialog.modal-extra div.modal-content div.modal-body { max-height: calc(99vh - 120px) !important; }}/* Por defecto todos los dialogs ocuparán casi todo el ancho, salvo que el media query superior nos lo corrija */div.modal-dialog { width: calc(100vw - 30px);}/* hack: modal-lg is the bootstrap dialog SIZE_WIDE / size-wide */div.modal-dialog.modal-lg { /* En dialogs grandes modal-lg ocupamos casi todo el ancho por defecto */ width: 98% !important; /* width: 1100px; /* 960px; */ /* Margen si queremos */ margin-top: 5px;}/* Por defecto todos los dialogs tienen que ocupar casi todo el alto, salvo que el media query superior nos lo corrija */div.modal-dialog div.modal-body { height: calc( 99vh - 120px); /* Dejamos que se corrija, NO USAR !important */ overflow-y: auto;}div.modal-dialog.modal-lg div.modal-body { height: auto !important; /* sobreescribimos max-height del @media screen */ max-height: calc( 99vh - 120px) !important; /* Este SI tiene que mandar porque es para .modal-lg */ overflow-y: auto;}/* End of file: bootstrap-dialog-hacks.css */ /* Dialog Theme CSS */.modal-dialog { border-radius: 16px !important; margin-top: 10px;}.modal-content { border: 0 none; border-radius: 16px;}.modal-header { background-color: #01209F !important; border-top: 1px solid #ddd; border-bottom: 1px solid #aaa; padding: 8px 15px; color: white; font-weight: bold; font-size: 16px; line-height: 22px; border-top-left-radius: 16px !important; border-top-right-radius: 16px !important;}.modal-header .close { margin-top: -1px; font-weight: normal; color: #E0007A; opacity: 1; text-shadow: none; font-size: 30px; padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none;}.close:hover { cursor: pointer; background: none;}.modal-footer { padding: 4px 0 4px 0; text-align: center; background: white; border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }.modal-body { background:white; padding: 15px 15px 0px 15px;}.modal-header.bootstrap-dialog-draggable { cursor: -webkit-grab; cursor: -moz-grab; cursor: -o-grab; cursor: -ms-grab; cursor: grab;}.modal-header.bootstrap-dialog-draggable:active { cursor: -webkit-grabbing !important; cursor: -moz-grabbing !important; cursor: -o-grabbing !important; cursor: -ms-grabbing !important; cursor: grabbing !important;}/* ----------------- */ /style> !-- GRPD -->link hrefcss/base/gdpr/pdcc150.min.css relstylesheet>script typetext/javascript srcjs/base/gdpr/pdcc150.min.js>/script>script typetext/javascript>PDCookieConsent.blockList( { domain : google.com/maps, name : Google Maps, report : true });PDCookieConsent.config({ defaultLang : es, brand : { dev : true, name : SOFT LINE, url : https://logextrans.com, websiteOwner : Logextrans }, cookiePolicyLink: https://www.logextrans.com/politica-cookies, hideModalIn: https://www.logextrans.com/politica-cookies, https://www.logextrans.com/aviso-legal, https://www.logextrans.com/politica-privacidad , showBadges: true, styles: { primaryButton: { bgColor : #005C9E, txtColor: #FFF }, secondaryButton: { bgColor : #bfbfbf, txtColor: #000000 }, cookieButton: { activedColor : #1772bf, disabledColor: #91c7f2 } }});/script> title>Logextrans/title> meta nameDescription contentLogextrans> /head> body idhome classmodo-accesibilidad > a idpojo-a11y-skip-content classpojo-skip-link pojo-skip-content tabindex1 accesskeys href/#content>Saltar contenido/a> div idda11y-plugin>/div> !-- Header -->header idheader classtransparent-nav> div classcontainer flexi align-items-center justify-content-space-between> div classnavbar-header> !-- Logo --> div classnavbar-brand> div classlogo-rounded> a classlogo flexi align-items-center href> img src/img/logo.png classlogo_texto img-responsive altLogextrans > /a> /div> /div> !-- /Logo --> !-- Mobile toggle --> div classnav-movil> button classnavbar-toggle> span>/span> /button> /div> !-- /Mobile toggle --> /div> !-- Navigation --> nav idnav> ul classmain-menu nav navbar-nav navbar-right> li>a href/quienes-somos>Quiénes somos/a>/li> li>a href/que-ofrecemos>Qué ofrecemos/a>/li> li>a href/experiencia>Nuestra experiencia/a>/li> li>a href/contacto>Contacto/a>/li> /ul> /nav> !-- /Navigation --> /div>/header>!-- /Header --> !-- Slider -->div idhome_content classhero-area> div classowl-carousel owl-theme owl-slider> img src/upload/slider/slider.jpg> /div>/div> div classsection logosection> div classcontainer> div classrow> div classcol-md-3> img src/upload/cms/correos-express.jpg altCorreos Express> /div> div classcol-md-3> img src/upload/cms/fedex.jpg altFedEx> /div> div classcol-md-3> img src/upload/cms/ups.jpg altUPS> /div> div classcol-md-3> img src/upload/cms/gls.jpg altGLS> /div> /div> /div> /div> !-- About -->div idabout classsection> !-- container --> div classcontainer> !-- row --> div classrow flex flexi-wrap justify-content-center> div classcol-md-4 col-sm-4 col-xs-12 text-center> img src/upload/cms/outsourcing.png altOutsourcing width180> /div> div classcol-md-12 col-sm-12 col-xs-12> div classsection-header text-center> h2 classlobster fw300>Distribución de b>última milla/b> y b>almacenaje/b> desde 2003/h2> /div> /div> /div> /div>/div> div idservicios classsection bg-primary> div classcontainer> div classrow> div classsection-header text-center> h2 classlobster no-subtit text-white>Qué ofrecemos/h2> /div> /div> div idcontent-wrapper classflexi flexi-wrap> div classcol-lg-12 col-md-12 col-sm-12 flexi-column> div classclasses-item flexi align-items-center g20> div classcol-lg-3 col-md-3 col-sm-12 flexi-column> img classimg-responsive src/upload/cms/balearic.png altTodo Baleares> /div> div classcol-lg-9 col-md-8 col-sm-12 flexi-column> h2 classd-block h3>b>Todo Baleares/b>/h2> p classlead>En la actualidad desarrollamos nuestra actividad en b>Mallorca, Menorca, Ibiza y Formentera/b> bajo la cobertura de diferentes empresas del Grupo./p> /div> /div> /div> div classcol-lg-12 col-md-12 col-sm-12 flexi-column> div classclasses-item flexi align-items-center g20> div classcol-lg-3 col-md-3 col-sm-12 flexi-column> img classimg-responsive src/upload/cms/paradas.png altProducción 85 paradas por vehíc./día> /div> div classcol-lg-9 col-md-8 col-sm-12 flexi-column> h2 classd-block h3>b>Producción 85 paradas por vehíc./día/b>/h2> p classlead>La productividad media de nuestro actual equipo es de 85 paradas/direcciones por vehículo y día./p> /div> /div> /div> div classcol-lg-12 col-md-12 col-sm-12 flexi-column> div classclasses-item flexi align-items-center g20> div classcol-lg-3 col-md-3 col-sm-12 flexi-column> img classimg-responsive src/upload/cms/confidencialidad.png altNo concurrencia y confidencialidad> /div> div classcol-lg-9 col-md-8 col-sm-12 flexi-column> h2 classd-block h3>b>No concurrencia y confidencialidad/b>/h2> p classlead>Respetamos mutuamente una política comercial y de RRHH de b>NO CONCURRENCIA/b>, así como la b>CONFIDENCIALIDAD/b> que forma parte de nuestra Reputación como Empresa con posibilidad de exclusividad contractual./p> /div> /div> /div> /div> div classmt80 flexi align-items-center justify-content-center> a classmain-button main-button2 href/que-ofrecemos idbutton typebutton>Ver más/a> /div> /div> /div> div idcta3 classcontact section> div classbg-image bg-parallax overlay stylebackground-image:url(./img/banner.jpg)>/div> div classcontainer> div classrow> div classcol-md-12> div classcontact-form stylemargin-bottom:50px> h2 classlobster no-subtit text-center>Contacta con nosotros/h2> form action/contacto/form namecontacto methodpost roleform enctypemultipart/form-data classcontactForm> input classinput typetext namecontactnombrerequired placeholderNombre y Apellidos *> input classinput typeemail namecontactemailrequired placeholderEmail *> input classinput typetel namecontacttelrequired placeholderTeléfono *> textarea classinput namecontactmensajerequired placeholderMensaje *>/textarea> div classform-group row no-padding> div classcol-md-9> div classform-group> label> input typecheckbox namecontactpolitica classpolitica /> He leído y acepto la b>a href/politica-privacidad target_blank>Política de protección de datos/a>/b> span classcheckmark>/span> /label> /div> div classcontrols> label>Completa el captcha:/label> input typehidden name_iconcaptcha-token idtoken_captcha value1adc90d83e764d9cfe825c9afeea7a81d9e01f08 /> div classiconcaptcha-holder data-themelight>/div> /div> /div> div classcol-md-3> div classtext-center> input typehidden namecontactjsval idin-jsval valuevalue /> a classmain-button pull-right stylecursor:pointer idbutton typebutton valuesubmit onclickjavascript:validateHoneyPot(); phastard_ajax_submit_form(this);>Enviar/a> /div> /div> /div> /form> form idjsval> input typehidden namejsval idiphd values0ftl1n3 /> /form> /div> /div> /div> /div>/div> !-- Footer -->footer idfooter classsection> img src/img/footer.png altLogextrans classimg-footer> !-- container --> div classcontainer> div classrow flexi flexi-wrap> div classcol-md-3 col-xs-12> h3>span>Información/span>/h3> ul classfooter-nav> li>i classfa fa-map-pin>/i>b> Palma de Mallorca./b>br> C/ de Francisco Sancho, 4, 07004, Illes Balears /li> /ul> /div> div classcol-md-3 col-xs-12> h3>span>Enlaces/span>/h3> ul classfooter-nav> li>a href/contacto>Contacta con nosotros/a>/li> li>a href/accesibilidad>Accesibilidad/a>/li> li>a href/aviso-legal>Aviso legal/a>/li> li>a href/politica-privacidad>Política de privacidad/a>/li> li>a href/politica-cookies>Política de cookies/a>/li> li>a href# classpdcc-open-modal>Configurar cookies/a>/li> /ul> /div> div classcol-md-3 col-xs-12> div classrow flexi flexi-wrap mt10 logos-kit> img src./img/ES-Financiado-por-la-Union-Europea-blanco.png classlogo_texto img-responsive altFinanciado por la Unión Europea width200> img src./img/Logo-PRTR-vertical_blanco.png classlogo_texto img-responsive altPRTR width200> /div> /div> /div> div idbottom-footer classrow> div classcol-md-4 col-md-push-8> ul classfooter-social> li>a href# classfacebook>i classfa fa-facebook>/i>/a>/li> li>a href# classinstagram>i classfa fa-instagram>/i>/a>/li> /ul> /div> div classcol-md-12> div classtext-center> span>© 2025 b>Logextrans/b> - Todos los derechos reservados - a hrefhttp://www.softline.es/ target_blank>img src/img/softline-blanco-blanco.png titleSoft Line altSoft Line />/a>/span> /div> /div> /div> /div>/footer>!-- preloader -->div idpreloader>div classpreloader>/div>/div>!-- /preloader --> !-- Latest jQuery 2.x --> script srcjs/base/jquery2/jquery-2.2.4.min.js>/script> !-- Bootstrap JS --> script srcjs/base/bootstrap3/bootstrap.min.js>/script> !-- Bootstrap-dialog JS --> script srcjs/base/bootstrap-dialog/bootstrap-dialog.min.js>/script> !-- Bootstrap-dialog JS --> script src/js/base/bootstrap-dialog/bootstrap-dialog.min.js>/script> script srcjs/base/bootstrap-dialog/bootstrap.fd.min.js>/script> !-- SweetAlert2 JS --> script srcjs/base/bootstrap-dialog/sweetalert2.min.js>/script> script srcjs/base/bootstrap-dialog/promise.min.js>/script> !-- Footable JS --> script typetext/javascript srcjs/base/bootstrap-extra/footable.min.js>/script> !-- Summernote JS --> script srcjs/base/bootstrap-extra/summernote/summernote.js>/script> script srcjs/base/bootstrap-extra/summernote/lang/summernote-es-ES.min.js>/script> script srcjs/base/bootstrap-extra/summernote/summernote-image-attributes.js>/script> script srcjs/base/bootstrap-extra/summernote/summernote-bootstrap-grid.js>/script> !-- Datepicker JS --> script typetext/javascript srcjs/bootstrap-datepicker/bootstrap-datepicker.js>/script> !-- Owl carousel JS --> script typetext/javascript srcjs/owl.carousel.min.js>/script> script srcphp/inc/libs/IconCaptcha/js/icon-captcha.min.js>/script> !-- Custom JS --> script typetext/javascript srcjs/main.js>/script> !-- Accesibilidad --> script srcjs/accessibility/js/app.dev.js>/script> script typetext/javascript> function ph_dialog(title, size, name, param1, param2, param3) { if (! param1) { console.log(WARNING: Empty param1 at ph_dialog. This could lead to empty param at dialog controller); } phastard_dialog_confirm(title, size, dialog, get, send, name, param1, param2, param3);}function ph_dialog_close(title, size, name, param1, param2, param3, button_text) { phastard_dialog_close(title, size, dialog, get, name, param1, param2, param3, button_text);}function common_change_page(options) { var defaults { reload: false, reload_wo_querystring: false, ajax_reload: false, load_uri: false, backdrop: true } options $.extend({}, defaults, options || {}); if (options.reload || options.ajax_reload || options.reload_wo_querystring || options.load_uri) { swal.close(); /* Force hiding of sweetAlert2, just in case */ $(div.swal2-modal).hide(); } else { clean_backdrop(); return; } clean_backdrop(); if (options.backdrop) { /* Force a mask over the whole page while the page reloads */ put_backdrop(); } if (options.reload_wo_querystring) { window.location window.location.pathname; return; } if (options.reload) { window.location.reload(); return; } if (options.ajax_reload) { virtual_refresh(); return; } if (options.load_uri) { window.location.href +options.load_uri; return; }}function bytes2str(bytes, si) { var thresh si ? 1000 : 1024; if(Math.abs(bytes) thresh) { return bytes + B; } var units si ? kB,MB,GB,TB,PB,EB,ZB,YB : KiB,MiB,GiB,TiB,PiB,EiB,ZiB,YiB; var u -1; do { bytes / thresh; ++u; } while(Math.abs(bytes) > thresh && u units.length - 1); return bytes.toFixed(1)+ +unitsu;}/* gets a complete QUERYSTRING from URL (href) or the value of a key in the provided QUERYSTRING. If both params are empty, the full, window location QUERYSTRING from the URL is got */function get_qs(key, href) { if (! key) { var qs_pos (!href) ? window.location.href.indexOf(?) : href.indexOf(?); if (qs_pos ! -1) { return (!href) ? window.location.href.slice(qs_pos + 1) : href.slice(qs_pos + 1); } return ; } key key.replace(/*+?^$.\\{}()|\\\//g, \\$&); // escape RegEx meta chars var match (!href) ? location.search.match(new RegExp(?&+key+(^&+)(&|$))) : href.match(new RegExp(?&+key+(^&+)(&|$))); return match && decodeURIComponent(match1.replace(/\+/g, ));}/* changes or adds a GET param to the given URL *//* a URL string, k Key, v Value */function updateQueryStringParameter(a, k, v) { var re new RegExp((?|&) + k + .*?(&|$), i), separator a.indexOf(?) ! -1 ? & : ?; if (a.match(re)) return a.replace(re, $1 + k + + v + $2); else return a + separator + k + + v;}/* Generates a random cachebuster string */function cachebuster() { var hex ((1 + Math.random()) * 0x10000).toString(16).substring(1).replace(., ); /* usleep(2); */ /* cachebuster timestamp: https://support.google.com/dfa/partner/answer/134572?hlen */ var axel Math.random() + ; return hex + (axel * 1000000000000000000);}var hasOwnProperty Object.prototype.hasOwnProperty;function empty(obj) { // null and undefined are empty if (obj null) return true; // Assume if it has a length property with a non-zero value // that that property is correct. if (obj.length > 0) return false; if (obj.length 0) return true; // If it isnt an object at this point // it is empty, but it cant be anything *but* empty // Is it empty? Depends on your application. if (typeof obj ! object) return true; // Otherwise, does it have any properties of its own? // Note that this doesnt handle // toString and valueOf enumeration bugs in IE 9 for (var key in obj) { if (hasOwnProperty.call(obj, key)) return false; } return true;}function flash_element(selector, highlightColor, duration, jqo) { var rgb ; if (highlightColor) { /* formato string hex ej. #ffff00 */ var r parseInt(highlightColor.substring(1,3), 16); var g parseInt(highlightColor.substring(3,5), 16); var b parseInt(highlightColor.substring(5,7), 16); rgb r + , + g + , + b; /* console.log(rgb: +rgb); */ } var flash function(elements, rgb, duration, jqo) { var opacity 100; var color rgb || 76, 217, 100; // green default var duration duration || 50; var interval setInterval(function() { opacity - 3; if (opacity 0) clearInterval(interval); var _the_thing; if (!jqo) _the_thing $(elements); else _the_thing jqo; _the_thing.css({background: rgba(+color+, +opacity/100+)}); }, duration) }; flash(selector, rgb, duration, jqo);}function flash_elements(selector, highlightColor, duration) { var s null; if (selector.length) selector.join(, ); else s selector; $(s).each(function() { flash_element(this, highlightColor, duration); });}/** virtual_refresh / virtual_reload / DOM diff function As seen on: https://news.ycombinator.com/item?id26694878 by kouteiheika. Search comment with: https://pastebin.com/V7UiWj1e*/function virtual_refresh(callback_function) { var xhr new XMLHttpRequest(); xhr.onreadystatechange function() { if (xhr.readyState 4) { var parser new DOMParser(); var doc parser.parseFromString(xhr.responseText, text/html); update_in_place(document.querySelector(body), doc.body); if (callback_function) { if (typeof callback_function string) { console.log(callback_functionstring+callback_function+); callback_function windowcallback_function; } if (callback_function && typeof callback_function function) { console.log(calling callback_function); callback_function(); } else { alert(Could not execute virtual_refresh callback_function); } } } else { alert(AJAX Error (+readyState+) trying to virtual_refresh()); } } swal.close(); /* Force hiding of sweetAlert2, just in case */ $(div.swal2-modal).hide(); clean_backdrop(); put_backdrop(); xhr.open(GET, window.location.href); xhr.send(); }function update_in_place(old_root, new_root) { function are_compatible(lhs, rhs) { return lhs.nodeType rhs.nodeType && lhs.tagName rhs.tagName && lhs.id rhs.id } if (old_root.nodeType 3 && new_root.nodeType 3) { old_root.textContent new_root.textContent; return old_root } if (!are_compatible(old_root, new_root) || old_root.nodeType ! 1) { old_root.parentElement.replaceChild(new_root, old_root); return new_root } for (var i 0; i new_root.attributes.length; i++) { var a new_root.attributesi; if (a.specified && old_root.getAttribute(a.name) ! a.value) { old_root.setAttribute(a.name, a.value) } } for (var i 0; i old_root.attributes.length; i++) { var a old_root.attributesi; if (a.specified && !new_root.hasAttribute(a.name)) { old_root.removeAttribute(a.name) } } var old_children Array.prototype.slice.call(old_root.childNodes); var new_children Array.prototype.slice.call(new_root.childNodes); var old_start 0; var new_start 0; var old_end old_children.length; var new_end new_children.length; while (old_start old_end || new_start new_end) { if (old_start old_end) { var target old_childrenold_end; while (new_start new_end) { old_root.insertBefore(new_childrennew_start++, target) } break } if (new_start new_end) { while (old_start old_end) { old_root.removeChild(old_childrenold_start++) } break } if (old_childrenold_start.isEqualNode(new_childrennew_start)) { old_start++; new_start++; continue } if (old_childrenold_end - 1.isEqualNode(new_childrennew_end - 1)) { old_end--; new_end--; continue } if (old_childrenold_start.isEqualNode(new_childrennew_start + 1)) { old_root.insertBefore(new_childrennew_start, old_childrenold_start); new_start + 2; old_start++; continue } if (old_childrenold_end - 1.isEqualNode(new_childrennew_end - 2)) { old_root.insertBefore(new_childrennew_end - 1, old_childrenold_end); new_end - 2; old_end--; continue } old_childrenold_start update_in_place(old_childrenold_start, new_childrennew_start); old_start++; new_start++ } return old_root} var gDbgPHDLevel 0;/* List of dialog instances */var dialogList new Object(); var BSDialogStack ;var curBSDialog null;function resolve_modal_size(modal_size) { switch(modal_size) { case SIZE_WIDE: /* Maximized width */ default: modal_size BootstrapDialog.SIZE_WIDE; break; case SIZE_NORMAL: modal_size BootstrapDialog.SIZE_NORMAL; break; case SIZE_EXTRA: modal_size BootstrapDialog.SIZE_EXTRA; break; } return modal_size;}function dbgc(lvl, txt) { if (! curBSDialog) { return; } var curlvl curBSDialog.getData(dbg_lvl); if (! curlvl) { return; } gpddbgc(lvl, curlvl, txt, global);}function gpddbgc(lvl, curlvl, txt, g) { var lvlstr; if (lvl > curlvl) { return; } var openstr (g) ? G : ; switch(lvl) { case 0: lvlstropenstr+ OOPS ; break; case 1: lvlstropenstr+message ; break; case 2: lvlstropenstr+verbose ; break; case 3: lvlstropenstr+pedantic; break; } console.log(phastard_dialog +lvlstr+ +txt);}/*** A generic wrapper for Bootstrap Dialog, which is a wrapper for Bootstrap modals so they are more monkey-friendly.* Creates a modal and gets inserted into the DOM. When closed, it is removed from the DOM, which is super cool* * Juanga Covas 2017 - 2024* * Reference: https://nakupanda.github.io/bootstrap3-dialog/* * Supports several calls using one or two arguments* */function phastardDialog(arg1, arg2) { if (! arg1) { alert(ERROR: Missing argument(s) calling phastardDialog()); return; } /* support 2 arguments as (file.tpl, this) */ if (arguments.length 2 && typeof arg1 string) { arg2 $(arg2); return _phastardDialog(arg2, { load_tpl: arg1 }); } /* support 1 argument as ({ option1: value1 ... }) */ if (arguments.length 1) { if (typeof arg1 ! object) { alert(ERROR: Invalid argument for phastardDialog(options) call!!!); return; } return _phastardDialog(null, arg1); } /* support 2 arguments as (this, { option1: value1 ... }) */ if (arguments.length 2) { if ( (typeof arg1 object) && !(arg1 instanceof jQuery) ) { arg1 $(arg1); } else { alert(ERROR: Invalid this for phastardDialog(this, options) call!!!); return; } } return _phastardDialog(arg1, arg2);}/*** @param _this Mandatory: this* @param options Optional object with your options*/function _phastardDialog(_this, options) { /* the first _this is optional, should be this and should ALWAYS come from a onClick event (even at links: if this is used from HREF, the DOM element is window, not the A tag) */ /*****************************************************************************/ /* Debug stuff. Nested dbgc function so async calls can use dbg_lvl flag too */ var dbg_lvl (options && options.dbg) ? options.dbg : gDbgPHDLevel; function dbgc(lvl, txt) { if (lvl > 0 && dbg_lvl && lvl dbg_lvl) { gpddbgc(lvl, dbg_lvl, txt); } } dbgc(1, ---- _phastardDialog() function Begins); /*********************************************************************************/ /* Convert _this into jQuery object, instead of the expected native DOM element. */ /* After the conversion, if you ever need the native DOM element, use: _this0 */ if (!_this && !options) { alert(ERROR: _phastardDialog expects two parameters); return false; } if (_this && (typeof _this object) && _this.length && !(_this instanceof jQuery) ) { alert(ERROR: Invalid this for _phastardDialog(_this, options) call); return false; } var img_bsd options.bsd ? /+options.bsd : /img/cargandosl.gif; /*************************/ /* Set default options */ var defaults { ID: default, /* Should uniquely identify the dialog, and will be appended to controller/method/... so its part of the backend methods name */ dbg: gDbgPHDLevel, /* console.log verbosity level 0|1|2|3 ... defaults to 0. 0no output, 1standard, 2verbose messages, 3ultra verbosity (rare) */ title: null, /* String or function that returns string. If not set, when _this tag is A (link), the title will automagically get the inner HTML of the link tag */ size: SIZE_EXTRA, /* SIZE_WIDE, SIZE_NORMAL, SIZE_EXTRA */ type: close, /* Determines which default footer buttons to create: */ /* close: one close button confirm: two buttons, ACCEPT (Save) and Cancel (Close) */ load_tpl: null, /* Load a simple tpl which by default assumes that ID will be default and .../dialog/get_default?tplxxx will be called to get the content */ controller: dialog, /* Default controller to call */ params: , /* Optional params array value1, valueN that will be appended to the URL, after ID and before the QUERYSTRING, so controller/method/ID/param1/paramN/...?QUERYSTRING */ keep_cur_get_vars: false, /* If true, the URLs to call will include the QUERYSTRING of the current URL, so controller/method/ID/param1/paramN?QUERYSTRING */ new_get_vars: {}, /* Optional pairs object {key1: value1, keyN: valueN} that will be appended as keyvalue at the QUERYSTRING (can be combined safely with the previous keep_cur_get_vars option) */ tpl_post_data: {}, /* (or String) Optionally POST this pairs object {key1: value1, keyN: valueN} or String kv&k2v2 for the tpl/html that will be loaded. This will be checked if is an empty object and converted to null so the load function dont think IS a POST */ method_get: get, /* Default method to call to get the dialog contents (AJAX loaded) */ method_send: rcv, /* Default mehotd to call when ACCEPT button is clicked (AJAX loaded) */ data: {}, /* data that is stored into the dialog to retrieve later using .getData(key). Uses its own default_data object to merge with any that you could initialize here */ closable: true, /* When set to false, you can ONLY close (cancel) the dialog by clicking the close icon in dialog header */ /* When set to true, you can close (cancel) the dialog by: Clicking the close icon in dialog header, Clicking outside the dialog or pressing the ESC key */ button_close_text: Cerrar, button_save_text: Aceptar, button_cancel_text: Cancelar, animate: true, /* Wether to use animation to open / close the dialog, optionally use anim_in/out with a class name of animate.css */ anim_in: (typeof globalBSDialogAnimationIn ! undefined && globalBSDialogAnimationIn) ? globalBSDialogAnimationIn : null, anim_out: (typeof globalBSDialogAnimationOut ! undefined && globalBSDialogAnimationOut) ? globalBSDialogAnimationOut : null, draggable: false, /* Wether to allow to drag and drop the dialog (dragging by the header) */ origin_jqo: null, /* (optional) origin DOM element (i.e. the OnClick button) */ body_callback: function(d) { /* Using this function procedure instead of a string we can AJAX load anything (method GET or POST) as the Modal Body */ var $message $(div>/div>); /* Set a loading animated image as the message while async call will go on */ $message.html(div styletext-align:center;>img src+img_bsd+ border0 stylevertical-align:middle;>/div>); /* Get pageToLoadURL which is the pageToLoad data saved from the body_callback_uri var built from options */ /* This includes the QUERYSTRING if desired */ var pageToLoadURL d.getData(pageToLoad); /* Get postDataToSend to force a POST instead of GET (they QUERYSTRING is sent too) */ var postDataToSend d.getData(postDataToLoad); postDataToSend (empty(postDataToSend)) ? null : postDataToSend; if (typeof postDataToSend string) { postDataToSend JSON.parse({ + postDataToSend.replace(/&/g, ,).replace(//g,:) + }, function(key, value) { return key?value:decodeURIComponent(value) }); } /* Async AJAX load the remote page to be put as the Modal Body */ dbgc(1, body_callback: async load for content. URL: +pageToLoadURL+ POST: +postDataToSend); /* function load will assume GET if data (postDataToSend) is NULL or a string. function load will do a POST if finds an object. We use the URL to include the QUERYSTRING instead of passing the QUERYSTRING as string in data */ $message.load(pageToLoadURL, postDataToSend, function(response, status, xhr) { dbgc(1, body_callback: event: async load finished. Status+status+ Code: +xhr.status+ +xhr.statusText+ Bytes: +(response.length)); /* Make sure were pointing to the current dialog */ if (!curBSDialog || d ! curBSDialog) { dbgc(1, ERROR: curBSDialog vanished or mismatched); return; } if (! response) { response ERROR: Empty response; dbgc(1, body_callback: +response); } if (status error) { $message.html(response); } d.setData(isDialogReady, true); var _form d.getModalBody().find(form); _form && _form.length && _form.on(submit, function(e) { e.preventDefault(); }) if (typeof d.getData(onDialogReady) function && d.getData(isDialogShown) && !d.getData(execOnDialogReady)) { d.setData(execOnDialogReady, true); d.getData(exec_callback)(onDialogReady, {}, d); } /* Enable buttons once the load is completed (successfully or not) */ dbgc(2, body_callback: enabling modal buttons); d.enableButtons(true); if (d.getData(dialog_type) confirm && d.getData(reorder_mode)) { d.getButton(save).hide(); } curBSDialog.setData(targetDialogRef, null); }); /* Return the loading content html while content loads via AJAX */ return $message; }, onShow: function(d) { dbgc(2, onShow event: disabling modal buttons); /* Disable footer buttons while loading the dialog content */ d.enableButtons(false); dbgc(2, onShow event: set footer buttons and close button type as button); /* Ensure none of the buttons are the submit type */ d.getModalFooter().find(button).attr(type, button); d.getModalHeader().find(button.close).attr(type, button); d.getData(exec_callback)(onDialogShow, {}, d); }, onShown: function(d) { dbgc(2, onShown event); d.setData(isDialogShown, true); var _form d.getModalBody().find(form); _form && _form.length && _form.on(submit, function(e) { e.preventDefault(); }) d.getModal().find(div.modal.bootstrap-dialog).addClass(no-padding-17); var isDialogReady d.getData(isDialogReady); dbgc(3, onShown event: isDialogReady+isDialogReady+); if (isDialogReady && typeof d.getData(onDialogReady) function && !d.getData(execOnDialogReady)) { dbgc(2, body_callback: event: exec_callback: onDialogReady); d.setData(execOnDialogReady, true); d.getData(exec_callback)(onDialogReady, {}, d); } if (typeof d.getData(onDialogReady) ! function) { dbgc(3, body_callback: event: exec_callback: onDialogReady has not been defined (which can be OK)); } }, onHide: function(d) { dbgc(2, onHide event); /* Disable footer buttons while closing the modal window */ d.enableButtons(false); d.getData(exec_callback)(onDialogClose, {}, d); }, onHidden: function(d) { dbgc(2, onHidden event); d.getData(exec_callback)(onDialogClosed, {}, d); var dialogID d.getData(ID); if (d && dialogID) { dialogListdialogID null; dbgc(2, onHide event: removed global ref. from dialogList+dialogID+); /* remove ref from top of stack */ curBSDialog BSDialogStack.pop(); if (curBSDialog) { dbgc(2, onHidden event: stack: curBSDialog is now: +curBSDialog.getData(ID)); } else { dbgc(2, onHidden event: stack: there is NO curBSDialog dialog now.); } } } } options $.extend({}, defaults, options || {}); dbgc(1, dialog ID+options.ID+ Processing options for a new Bootstrap Dialog modal window); /******************/ /* Set origin_jqo */ if (! options.origin_jqo) { options.origin_jqo _this; } if (options.origin_jqo && (typeof options.origin_jqo object) && options.origin_jqo.length && !(options.origin_jqo instanceof jQuery) ) { alert(ERROR: Invalid options.origin_jqo at _phastardDialog()); return false; } /*******************/ /* Set modal title */ if (options.title && typeof options.title function) { options.title options.title(options.origin_jqo); } if (! options.title) { options.title ; if (options.origin_jqo) { if (options.origin_jqo.prop(tagName) A) { options.title options.origin_jqo.html(); } } } /********************************************************/ /* Build the body_callback_uri and confirm_callback_uri */ dbgc(3, Building body|confirm_callback_uri); var body_callback_uri /+options.controller+/+options.method_get+/+options.ID; var confirm_callback_uri; var params_len options.params.length; var __str; for (i0; i params_len; i++) { __str options.paramsi.toString(); if (!__str || !__str.length) { __str 0; } body_callback_uri + /+__str; } /* Include the current GET vars (QUERYSTRING) into the URL */ if (options.keep_cur_get_vars) { dbgc(3, keep_cur_get_vars: adding QUERYSTRING to body|confirm_callback_uri); var QS get_qs(); if (QS) { body_callback_uri + ?+QS; } } /* Add / Update custom GET vars into the URL */ if (!empty(options.new_get_vars)) { var keys Object.keys(options.new_get_vars); var get_vars_len keys.length; dbgc(3, new_get_vars: new keys: +JSON.stringify(keys)); for (i0; i get_vars_len; i++) { var gkey keysi; var gvalue options.new_get_varsgkey; body_callback_uri updateQueryStringParameter(body_callback_uri, gkey, encodeURIComponent(gvalue)); /* dbgc(3, new_get_vars: body_callback_uri is now: +body_callback_uri); */ } } /* Appends the tpl GET var */ if (options.load_tpl) { dbgc(3, load_tpl: appending as QUERYSTRING: tpl+options.load_tpl); body_callback_uri updateQueryStringParameter(body_callback_uri, tpl, options.load_tpl); } /* confirm_callback_uri will be the same but using the rcv/send method */ confirm_callback_uri body_callback_uri.replace(/+options.controller+/+options.method_get+/, /+options.controller+/+options.method_send+/); dbgc(3, Final body_callback_uri: +body_callback_uri); dbgc(3, Final confirm_callback_uri: +confirm_callback_uri); /**************************************************************************************************************/ /* Defines a default button */ var default_button { id: dummy, label: unlabeled button, icon: fa fa-check fa-fw, cssClass: btn-primary, action: function(d) { } } /* Defines the default CLOSE BUTTON */ var default_close_button { id: close, label: options.button_close_text, icon: fa fa-check fa-fw, cssClass: btn-primary, action: function(d) { var res_onCloseButton d.getData(exec_callback)(onCloseButton, {}, d); if (res_onCloseButton ! false) { d.close(); } } } /* Defines the default SAVE BUTTON */ var default_save_button { id: save, label: options.button_save_text, icon: fa fa-check fa-fw, cssClass: btn-primary, action: function(d) { d.getData(exec_callback)(onPreSaveButton, {}, d); phastardDialogSetSaveFooterBar(d); var _sn_list phastardDialogFind(d, textarea.summernote); if (_sn_list.length > 0) { /* Support multiple textareas with summernote */ _sn_list.each(function() { var $textarea jQuery(this); var sn_content $textarea.summernote(code); var ta_parts $textarea.attr(name).split(_); /* sn_content_es to sn, content, es*/ if (! ta_parts1) { alert(ERROR handling summernote content: unable to get textarea name?); return; } var name_search ta_parts.slice(1).join(_); var $hidden_input $textarea.parent(div).find(inputtypehiddenname^+name_search+); /* search content_es hidden input */ if (!$hidden_input || !$hidden_input.length || $hidden_input.length > 1) { alert(ERROR handling summernote content: unable to set content to hidden input, maybe a missing surrounding div or length > 1?); return; } /* The hidden input will be POSTED, the textarea WONT */ $hidden_input.val(sn_content); $textarea.attr(disabled, true); }); } var ms_sel $(select.multiple-select-selector); if (ms_sel.length > 0) { /* alert(Found +ms_sel.length+ multiple-selects); */ ms_sel.each(function(){ var _this $(this); var ms_items_arr _this.multipleSelect(getSelects); if (ms_items_arr.length) { /* alert(ms for +_this.attr(name)+ got: +ms_items_arr.join(,)); */ $(form#dialog-form input#ms_values_+_this.attr(id)).val( ms_items_arr.join(,) ); } else { $(form#dialog-form input#ms_values_+_this.attr(id)).val(); /* alert(None selected for +_this.attr(name)); */ } }); } $.ajax({ type: POST, dataType: json, /* The type of data that youre expecting back from the server */ url: +confirm_callback_uri, data: d.getModalBody().find(form#dialog-form).serialize(), /* Data to send to the server */ success: function(msg){ if (msg.result) { /* JSON RESPONSE SAYS OK (msg.result ! 0) */ /* Process other JSON RESPONSE keys that could say to do some JS tasks (that change the current page only) */ _phastard_json_success_result_domChanges(msg); d.getData(exec_callback)(onSaveButton, msg, d); /* Close the dialog now */ d.close(); /* Process other JSON RESPONSE keys that could say to do some JS tasks */ _phastard_json_success_result_pageChanges(msg); } else { phastard_json_failure_result(msg, d, options); } }, error: function(jqXHR, strError, strHTTP) { /* RESPONSE IS NOT VALID (for whatever reason, including not a json, 404, 500/503, etc.) */ _phastard_swal_status(jqXHR, strError, strHTTP, save-button: +confirm_callback_uri); phastardDialogRestoreFooterBar(d); d.setClosable(options.closable); } }); } } /*****************************************************************/ /* Handle dialog type which determines the default modal buttons */ var default_button_list; switch(options.type) { case confirm: default_button_list { save: {}, /* En una ventana confirm con dos botones, forzamos el botón close a label Cancelar en vez de Cerrar e icono X en vez de visto */ close: { label: options.button_cancel_text, icon: fa fa-times fa-fw, cssClass: btn-default } } break; /* Por defecto cuando es botón único, el label es Cerrar con un visto */ default: default_button_list { close: {} } break; } /* Extend default_button_list using options.buttons */ options.buttons $.extend({}, default_button_list, options.buttons || {}); /**********************************************************************/ dbgc(3, Handle buttons); /* deep copy the input Object that is options.buttons */ var buttonsDefList $.extend(true, {}, options.buttons); /* options.buttons has to be an array of objects to pass to Bootstrap Dialog */ options.buttons ; for (var buttonID in buttonsDefList) { dbgc(2, Processing button +buttonID+); var buttonDef; if (buttonID save) { buttonDef default_save_button; } else if (buttonID close) { buttonDef default_close_button; } else { buttonDef default_button; } /* extend the default properties for the button */ buttonDef $.extend({}, buttonDef, buttonsDefListbuttonID || {}); /* ensure the custom buttons get the proper id property */ if (buttonDef.id dummy) { buttonDef.id buttonID; } options.buttons.push(buttonDef); dbgc(3, Button data: +JSON.stringify(buttonDef)); } /**********************************************************************/ var data_defaults { ID: options.ID, controller: options.controller, title: options.title, pageToLoad: +body_callback_uri, postDataToLoad: options.tpl_post_data, formURL: +confirm_callback_uri, isDialogReady: false, isClosable: options.closable, get_vars: options.new_get_vars, dialog_type: options.type, dbg_lvl: options.dbg, } options.data $.extend({}, data_defaults, options.data || {}); /**********************************************************************/ if (typeof options.size string) { dbgc(3, Converting options.size from String: +options.size); options.size resolve_modal_size(options.size); } if (dialogListoptions.ID) { dbgc(1, WARNING: A dialog also called +options.ID+ seems to be already open); } /**********************************************************/ dbgc(2, Going to instantiate the new BootStrap Dialog); dialogListoptions.ID new BootstrapDialog({ title: options.title, size: options.size, closable: options.closable, animate: options.animate, animIn: options.anim_in, animOut: options.anim_out, nl2br: false, draggable: options.draggable, message: options.body_callback, data: options.data, buttons: options.buttons, onshow: options.onShow, onshown: options.onShown, onhide: options.onHide, onhidden: options.onHidden }); if (! dialogListoptions.ID) { var str ERROR: Could not create the BSD modal window; dbgc(0, str); alert(str); return; } /*************************************************************************************/ /* Prepare a function that allows to set callbacks after the dialog has been created */ (!dialogListoptions.ID.getData(set_callbacks)) && dialogListoptions.ID.setData(set_callbacks, function(d, callbackList) { dbgc(2, set_callbacks: called); if (empty(callbackList)) { dbgc(0, ERROR: empty callbackList); return; } if (! d) { dbgc(0, set_callbacks: ERROR: dialog not found); return; } if (options.dbg) { dbgc(1, set_callbacks: callbackList for dialog+d.getData(ID)+: +JSON.stringify(Object.keys(callbackList))); } for (var callbackName in callbackList) { if (d.getData(callbackName) && typeof d.getData(callbackName) function && !d.getData(isDialogReloaded)) { dbgc(0, WARNING: set_callbacks: overwritting callback +callbackName+ already set at initialization); } d.setData(callbackName, callbackListcallbackName); dbgc(3, Callback set: +callbackName); } }); /*************************************************************/ /* Prepare a generic internal function that calls a callback */ (!dialogListoptions.ID.getData(exec_callback)) && dialogListoptions.ID.setData(exec_callback, function(callbackName, options, d) { if (! d) { d curBSDialog; } if (! d) { alert(ERROR phastard_dialog: exec_callback: unexpected empty dialog ref); return; } var for_dialog_str for dialog+d.getData(ID)+; var callback d.getData(callbackName); if (callback && typeof callback function) { var str ; if (! empty(options)) { str options: +JSON.stringify(Object.keys(options)); } dbgc(2, exec_callback: +callbackName+ +str+ +for_dialog_str); return callback(d, options); } else { dbgc(3, exec_callback: +callbackName+ has not been defined +for_dialog_str); return no_callback; } }); /**************************************************************/ /* Prepare a generic internal function that performs a RELOAD */ (!dialogListoptions.ID.getData(doDialogReload)) && dialogListoptions.ID.setData(doDialogReload, function(d, c_options) { var c_defaults { newURL: null } c_options $.extend({}, c_defaults, c_options || {}); dbgc(1, doDialogReload: called for dialogID+d.getData(ID)+); /* alert(callback c_options.d+c_options.d+ ID+options.ID+); */ d.setData(isDialogReloaded, true); if (c_options.newURL) { d.setData(pageToLoad, c_options.newURL); } d.setClosable(true); d.enableButtons(false); /* Hide footer buttons and set the gear spin into the footer bar */ phastardDialogSetSaveFooterBar(d); /* Set the loading icon at the modal body */ var dBody d.getModalBody(); dBody.css(background, white url(/img/cargandosl.gif) no-repeat fixed center); dBody.find(.bootstrap-dialog-body).css(visibility, hidden); dBody.find(button, a.btn).css(display, none); d.setData(isDialogReady, false); d.setData(execOnDialogReady, false); var pageToLoadURL d.getData(pageToLoad); dbgc(1, doDialogReload: async load for content. URL: +pageToLoadURL); var content_elem dBody.find(div.bootstrap-dialog-message > div); content_elem.load(pageToLoadURL, function(response, status, xhr) { dbgc(1, doDialogReload: event: async load finished. Status+status+ Code: +xhr.status+ +xhr.statusText+ Bytes: +(response.length)); if (! response) { response ERROR: Empty response; dbgc(1, body_callback: +response); } if (status error) { $message.html(response); } phastardDialogRestoreFooterBar(d); d.getModalBody().css(background, ); d.getModalBody().find(.bootstrap-dialog-body).css(visibility, visible); d.enableButtons(true); if (d.getData(dialog_type) confirm && d.getData(reorder_mode)) { d.getButton(save).hide(); } d.setClosable(d.getData(isClosable)); d.setData(isDialogReady, true); d.setData(execOnDialogReady, true); /* dbgc(0, this_dialog+this_dialog.getData(ID)+); */ d.getData(exec_callback)(onDialogReady, {}, d); d.getData(exec_callback)(onDialogReload, {}, d); if (curBSDialog) { curBSDialog.setData(targetDialogRef, null); } }); }); /**********************************************************************/ /* Handle dialog stack before realize() so curBSDialog is valid there */ var prevDialog curBSDialog; if (prevDialog) { /* put dialog ref on top of stack */ BSDialogStack.push(prevDialog); dbgc(2, pre_realize: Previous, underlying dialog is now: +prevDialog.getData(ID)); } curBSDialog dialogListoptions.ID; curBSDialog.setData(prevDialog, prevDialog); dbgc(2, pre_realize: Current dialog is now: +curBSDialog.getData(ID)); dbgc(2, Calling realize() for the BSD instance); dialogListoptions.ID.realize(); /* ToDo: we could manipulate the dialog now (i.e. .getButton, .css, etc) so a good callback point */ /*********************************************************/ dbgc(2, Calling open() for the BSD instance); var result dialogListoptions.ID.open(); dbgc(1, ---- _phastardDialog function Ends); return false; /* prevent browser from following the link if thats the case */}function phastardDialogSetCallbacks(callbackList, dialogID) { var d phastardDialogGet(dialogID); if (! d) { return; /* phastardDialogGet already throws an error in this case */ } d.getData(set_callbacks)(d, callbackList);}/* Performs a jquery Find in the current or specified dialog *//* ToDo: Cleanup this crap... */function phastardDialogFind(d, selector) { if (typeof d string) { return _phastardDialogFind(selector, d); } if (! d) { d phastardDialogGet(); if (! d) { return; /* phastardDialogGet already throws an error in this case */ } } return d.getModalBody().find(selector);}function _phastardDialogFind(selector, dialogID) { var d phastardDialogGet(dialogID); if (! d) { return null; /* phastardDialogGet already throws an error in this case */ } return d.getModalBody().find(selector);}function phastardDialogExecCallback(callbackName, options, dialogID) { var d phastardDialogGet(dialogID); if (! d) { return; } if (dialogID && d ! curBSDialog) { dbgc(0, NOTICE: phastardDialogExecCallback +callbackName+: calls a different dialog+d.getData(ID)+ than curBSDialog+curBSDialog.getData(ID)+); d.setData(originDialogRef, curBSDialog); if (curBSDialog) { curBSDialog.setData(targetDialogRef, d); } } if (! dialogID && d curBSDialog && d ! curBSDialog.getData(targetDialogRef)) { dbgc(0, NOTICE: phastardDialogExecCallback +callbackName+: calls the same dialog+d.getData(ID)+ but targetDialogRef is bad, nulling...); curBSDialog.setData(targetDialogRef, null); } d.getData(exec_callback)(callbackName, options, d); /* if (curBSDialog && callbackName ! doDialogReload) { curBSDialog.setData(targetDialogRef, null); } */}function phastardDialogGet(dialogID) { var d (! dialogID) ? curBSDialog : dialogListdialogID; if (typeof gen_bs_dialog ! undefined && gen_bs_dialog && !curBSDialog) { return gen_bs_dialog; } if (! d) { var caller arguments.callee.toString(); dbgc(0, ERROR +caller+: unexpected empty dialog ref +(!dialogID) ? for curBSDialog : +dialogID+); return null; } if (! dialogID && d.getData(targetDialogRef)) { d d.getData(targetDialogRef); } return d; }/* Obtiene el ID único del div del diálogo actual (ej. 2e878e1a-e8e7-4461-aea8-a58d167fa1fc de un div idxxx classmodal bootstrap-dialog */function phastardDialogGetID() { if (gen_bs_dialog) { return gen_bs_dialog.getId(); } var d phastardDialogGet(); if (! d) return unable_to_find_dialog_id; return d.getId();}function phastardDialogSetSaveFooterBar(d) { var dFooterButtons d.getModalFooter().find(div.bootstrap-dialog-footer-buttons); /* Hide all the modal footer buttons */ dFooterButtons.find(button).hide(); /* Set an animated icon while saving or loading */ dFooterButtons.append(i classloading-dummy fa fa-cog fa-spin fa-3x fa-fw>/i>);}function phastardDialogRestoreFooterBar(d) { var dFooterButtons d.getModalFooter().find(div.bootstrap-dialog-footer-buttons); /* Remove the animated icon */ dFooterButtons.find(i.loading-dummy).remove(); /* Show the buttons again */ dFooterButtons.find(button).show();}function phastardDialog_footable_new_button(table_selector, label, onClickFunction, remove_i) { var html button typebutton classbtn btn-primary btn-xs stylemargin-right:10px; onClickjavascript:+onClickFunction+()>+ i classfa fa-plus>/i> +label++ /button>; if (remove_i) { html html.replace(i classfa fa-plus>/i>, ); } $(table_selector).find(thead tr.footable-filtering th form).prepend(html);}function phastardDialog_list_onReady(d, empty_string) { var footable_head; phastardDialogFind(d, table).footable({ filtering: { placeholder: Filtrar, dropdownTitle: Filtrar por:, position: left, }, empty: (empty_string) ? empty_string : No se han encontrado resultados, on: { postinit.ft.table: function(e, ft) { footable_head phastardDialogFind(d, table thead tr.footable-filtering th form); footable_head.append(button idnuevo-list-button typebutton classbtn btn-primary>i classfa fa-plus fa-lg>/i> Nuevo/button> ); footable_head.append(button idreorder-list-button typebutton classbtn btn-primary>i classfa fa-sort fa-lg>/i> Reordenar/button>); footable_head.find(button#reorder-list-button).on(click, function(){ phastardDialogExecCallback(doDialogReload, { newURL: updateQueryStringParameter(d.getData(pageToLoad), reorder_mode, 1) }); d.setData(reorder_mode, 1); }) return footable_head; } } }); return footable_head;}function phastardDialog_reorder_onReady(d, id_dialog) { d.setTitle(Reordenar); id_dialog typeof id_dialog ! undefined ? id_dialog : d.getData(ID); controller d.getData(controller); /* Helper function to keep table row from collapsing when being sorted */ var fixHelperModified function(e, tr) { var $originals tr.children(); var $helper tr.clone(); $helper.children().each(function(index) { $(this).width($originals.eq(index).width()) }); return $helper; }; // Make the table TRs sortable phastardDialogFind(d, table tbody).sortable({ helper: fixHelperModified, start: function(e, ui){ ui.placeholder.height(ui.helper.height()); /* outerHeight() */ }, stop: function(event,ui) { phastardDialogFind(d, table tbody tr).each(function() { count $(this).parent().children().index($(this)) + 1; var td $(this).find(.priority); if (td.length) { td.html(count); } }); var priority_data phastardDialogFind(d, table tbody).sortable(serialize); put_backdrop(); $.ajax({ data: priority_data, type: POST, url: /+controller+/save_order/+id_dialog, complete: function() { clean_backdrop(); /* phastardDialogFind(table).footable(); */ /* FooTable.get(table#slider-list).use(FooTable.Sorting).reset(); */ /* var th phastardDialogFind(table thead th:first); th.removeClass(footable-asc footable-desc); th.addClass(footable-desc); th.trigger(click); */ } }); } }).disableSelection(); }function phastardDialog_list_onCloseAction(d) { var res d.getData(exec_callback)(onCloseButton, {}, d); /* BC */ if (typeof res string && res no_callback) { if (! d.getData(reorder_mode)) { d.close(); } else { d.setData(reorder_mode, 0); d.setTitle(d.getData(title)); phastardDialogExecCallback(doDialogReload, { newURL: updateQueryStringParameter(d.getData(pageToLoad), reorder_mode, 0) }); if (d.getData(dialog_type) confirm) { d.getButton(save).show(); } } return; } if (res ! false) { d.close(); } }function phastardInitSummernote(d) { var controller d.getData(controller); var _sm_list; if (d) { _sm_list phastardDialogFind(d, textarea.summernote); } else { _sm_list $(textarea.summernote); } if (! _sm_list.length > 0) { return; } _sm_list.each(function() { var data_get jQuery(this).attr(data-get) || fromdefault; jQuery(this).summernote({ height: jQuery(this).attr(data-height) || 200, lang: jQuery(this).attr(data-lang) || es-ES, /* default: en-US */ dialogsInBody: true, dialogsFade: false, toolbar: /* groupname, button list */ style, style, fontsize, fontsize, fontname, fontname, style, bold, italic, underline,strikethrough, clear, color, color, para, ul, ol, paragraph, table, table, bootstrap-grid, insert, link, hr, media, link, picture, video, misc, codeview, fullscreen, help , popover: { image: custom, imageAttributes, /* imageAttributes */ imagesize, imageSize100, imageSize50, imageSize25, /* Default summenote params ↓↓↓ */ float, floatLeft, floatRight, floatNone, remove, removeMedia , }, /* var check_plugin_imageAttributes ($.summernote.pluginsimageAttributes)? 1 : 0; */ imageAttributes: { icon: i classnote-icon-pencil/>, removeEmpty: true, /* true remove attributes | false leave empty if present */ disableUpload: false /* true dont display Upload Options | Display Upload Options */ }, callbacks: { onInit: function(){ $(.toggle-content).css(display, block); }, onImageUpload: function(files) { var num_files files.length; var data new FormData(); for (var i 0; i num_files; i++) { data.append(file+i, filesi); var propValue; var t_size0; for(var propName in filesi) { t_sizet_size+filesisize; } } var show_process (t_size > 1024*30); if (show_process) { if (num_files > 1) { phastard_js_show_process({title: Subiendo +num_files+ archivos (+bytes2str(t_size)+)...}); } else { phastard_js_show_process({title: Subiendo el archivo (+bytes2str(t_size)+)...}); } } $.ajax({ data: data, dataType: json, type: POST, url: / + controller + /files_upload?+data_get, cache: false, contentType: false, processData: false, success: function(response) { swal.close(); if (response.result) { var arrayLength response.urls.length; var elem $(.summernotedata-get+ data_get +); if (elem.summernote(isEmpty)) { elem.summernote(insertText, ); } var elem_upload_image $(div.note-input-group .note-imageAttributes-src); if (elem_upload_image.length) { elem_upload_image.val(response.urls0); } elem.summernote(focus); for (var i 0; i arrayLength; i++) { /* editor.insertImage(welEditable, response.urlsi); */ elem.summernote(insertImage, response.urlsi, function($image) { $image.addClass(img-responsive); }); } } else { alert(Upload error: +response.msg); } }, error: function() { swal.close(); alert(FATAL ERROR, could not upload files to backend); } }); /* upload image to server and create imgNode... */ /* $summernote.summernote(insertNode, imgNode); */ } } }); });} function phastard_dialog_confirm(title, modal_size, controller, method_get, method_send, action, param1, param2, param3) { var content_uri; var action_uri; if (param1 && typeof param1 ! undefined) { if (! param2 || typeof param2 undefined) { param2 0; } if (! param3 || typeof param3 undefined) { param3 0; } content_uri /+controller+/+method_get+/+action+/+param1+/+param2+/+param3; action_uri /+controller+/+method_send+/+action+/+param1+/+param2+/+param3; } else { content_uri /+controller+/+method_get+/+action; action_uri /+controller+/+method_send+/+action; } modal_size resolve_modal_size(modal_size); dialogListaction new BootstrapDialog({ title: title, size: modal_size, closable: true, animate: true, nl2br: false, message: function(d) { var $message $(div>/div>); $message.html(div styletext-align:center;>img src/img/cargandosl.gif border0 stylevertical-align:middle;>/div>); var pageToLoad d.getData(pageToLoad); d.setData(execOnDialogReady, 0); $message.load(pageToLoad, function(response, status, xhr) { if (status error) { $message.html(response); } var _form d.getModalBody().find(form); _form && _form.length && _form.on(submit, function(e) { e.preventDefault(); }) if (d.getData(isDialogShown) && typeof on_shown_BootstrapDialog function) { on_shown_BootstrapDialog(d); } else { console.log(on_shown_BootstrapDialog message.load skipped.); } d.enableButtons(true); }); return $message; }, data: { pageToLoad: +content_uri, dialogName: action }, buttons: { /* BOTÓN ACEPTAR */ label: Aceptar, cssClass: btn-primary, icon: fa fa-check fa-fw, action: function(d) { d.getModalFooter().find(button).hide(); d.getModal().find(div.modal-dialog div.bootstrap-dialog-footer-buttons).append(i classloading-dummy fa fa-cog fa-spin fa-3x fa-fw>/i>); var sn_sel $(form#dialog-form textarea.summernote); if (sn_sel.length > 0) { var sn_content sn_sel.summernote(code); $(form#dialog-form input#sn_content).val( sn_content ); $(form#dialog-form textarea.summernote).attr(disabled, true); } var ms_sel $(select.multiple-select-selector); if (ms_sel.length > 0) { /* alert(Found +ms_sel.length+ multiple-selects); */ ms_sel.each(function(){ var _this $(this); var ms_items_arr _this.multipleSelect(getSelects); if (ms_items_arr.length) { /* alert(ms for +_this.attr(name)+ got: +ms_items_arr.join(,)); */ $(form#dialog-form input#ms_values_+_this.attr(id)).val( ms_items_arr.join(,) ); } else { $(form#dialog-form input#ms_values_+_this.attr(id)).val(); /* alert(None selected for +_this.attr(name)); */ } }); } $.ajax({ type: POST, dataType: json, url: +action_uri, data: d.getModal().find(form#dialog-form).serialize(), success: function(msg){ if (msg.result) { /* JSON RESPONSE OK */ d.close(); phastard_json_success_result(msg); } else { phastard_json_failure_result(msg, d, {closable:true}); } }, error: function() { /* RESPONSE IS NOT VALID (for whatever reason, including not a json, 404, etc.) */ swal(ERROR, Ha ocurrido un ERROR FATAL al intentar procesar la operación, error); phastardDialogRestoreFooterBar(d); } }); } }, { /* BOTÓN CANCELAR */ label: Cancelar, icon: fa fa-times fa-fw, action: function(d){ d.close(); } }, onshow: function(d) { d.enableButtons(false); }, onshown: function(d) { d.setData(isDialogShown, 1); d.getModalFooter().find(button).attr(type, button); d.getModalHeader().find(button.close).attr(type, button); if (typeof on_shown_BootstrapDialog function) { d.setData(execOnDialogReady, 1); on_shown_BootstrapDialog(d); } else { console.log(Skipped onshown on_shown_BootstrapDialog.); } /*Jennifer was here 24-08-17*/ /* Algunos modales son muy anchos, en responsive no caben y se acaban desplazando hacia abajo. */ /* Todos los dialogos se les añade padding-right 17px y esto hace que el dialogo que desplazado hacia abajo y no centrado */ $(div.modal.bootstrap-dialog).addClass(no-padding-17); }, onhide: function(d) { }, onhidden: function(d) { if (d && d.getData(action)) { dialogListd.getData(action) null; } } }); dialogListaction.open();}function phastard_dialog_close(title, modal_size, controller, method_get, action, param1, param2, param3, button_text) { var content_uri; if (param1 && typeof param1 ! undefined) { if (! param2 || typeof param2 undefined) { param2 0; } if (! param3 || typeof param3 undefined) { param3 0; } content_uri /+controller+/+method_get+/+action+/+param1+/+param2+/+param3; } else { content_uri /+controller+/+method_get+/+action; } if (! button_text) { button_text Cerrar; } modal_size resolve_modal_size(modal_size); dialogListaction new BootstrapDialog({ title: title, size: modal_size, closable: true, animate: true, nl2br: false, message: function(d) { var $message $(div>/div>); $message.html(div styletext-align:center;>img src/img/cargandosl.gif border0 stylevertical-align:middle;>/div>); var pageToLoad d.getData(pageToLoad); $message.load(pageToLoad, function(response, status, xhr){ if (status error) { $message.html(response); } d.enableButtons(true); }); return $message; }, data: { pageToLoad: +content_uri, dialogName: action, }, buttons: { label: button_text, icon: fa fa-check fa-fw, cssClass: btn-primary, action: function(d){ d.close(); if (d.getData(reloaded)) { common_change_page({reload: true}); } } }, onshow: function(d) { d.enableButtons(false); }, onshown: function(d) { if (typeof on_shown_BootstrapDialog function) { d.setData(execOnDialogReady, true); on_shown_BootstrapDialog(d); } d.getModalFooter().find(button).attr(type, button); d.getModalHeader().find(button.close).attr(type, button); /*Jennifer was here 24-08-17*/ /* Algunos modales son muy anchos, en responsive no caben y se acaban desplazando hacia abajo. */ /* Todos los dialogos se les añade padding-right 17px y esto hace que el dialogo que desplazado hacia abajo y no centrado */ $(div.modal.bootstrap-dialog).addClass(no-padding-17); }, onhidden: function(d) { dialogListd.getData(action) null; } }); dialogListaction.open();}function phastard_dialog_reload(d) { d.setClosable(true); d.enableButtons(false); d.getModalFooter().find(div.bootstrap-dialog-footer-buttons button).hide(); d.getModalFooter().find(div.bootstrap-dialog-footer-buttons).append(i classloading-dummy fa fa-cog fa-spin fa-3x fa-fw>/i>); d.getModalBody().css(background, white url(/img/cargandosl.gif) no-repeat fixed center); d.getModalBody().find(.bootstrap-dialog-body).css(visibility, hidden); var content_elem d.getModalBody().find(div.bootstrap-dialog-message > div); content_elem.load(d.getData(pageToLoad), function(response, status, xhr) { if (status error) { content_elem.html(response); } d.getModalFooter().find(div.bootstrap-dialog-footer-buttons i.loading-dummy).remove(); d.getModalFooter().find(div.bootstrap-dialog-footer-buttons button).show(); d.getModalBody().css(background, ); d.getModalBody().find(.bootstrap-dialog-body).css(visibility, visible); d.enableButtons(true); d.setClosable(true); d.setData(reloaded, true); if (typeof on_shown_BootstrapDialog function) { on_shown_BootstrapDialog(d, refresh); } }); }function phastardFileDialog(options) { var defaults { mime_type: *, mas_de_uno: false, from_str: , from_id: , source_str: , extra_checkbox: , ext_allowed: , success_callback: false, height: 100, readAs: BinaryString, title: Subir archivo, title_folder: , drag_message: Soltar archivo aquí, ok_button: Subir archivo, cancel_button: Cancelar, error_message: Error al subir el archivo, remove_message: Eliminar, controller: dialog_admin, info_message: Tamaño máximo de los archivos: 50MB, file_type: archivo } options $.extend({}, defaults, options || {}); if (options.file_type ! foto) { options.title i classfa fa-circle-arrow-up>/i> i classfa fa-file-text>/i> +options.title; } else { options.title i classfa fa-circle-arrow-up>/i> i classfa fa-camera>/i> +options.title; } if (options.source_str) { options.title_folder En carpeta i classfa fa-folder stylecolor:#F2D06C;font-size: 21px;>/i> + decodeURIComponent(options.source_str); } if (options.es_plantilla) { options.title_folder Usar como plantilla el documento Word...; } if (options.file_type || defaults.file_type ! options.file_type) { if (options.es_plantilla) { options.file_type plantilla; } options.title options.title.replace(defaults.file_type, options.file_type); options.drag_message options.drag_message.replace(defaults.file_type, options.file_type); options.error_message options.error_message.replace(defaults.file_type, options.file_type); options.ok_button options.ok_button.replace(defaults.file_type, options.file_type); options.info_message options.info_message.replace(archivos, options.file_type); if (options.file_type foto) options.info_message options.info_message.replace(los, las); /* options.title_folder options.title_folder.replace(archivo, options.file_type); */ } if (options.mas_de_uno) { options.info_message options.info_message.replace(options.file_type, options.file_type + s); options.info_message Límite de subida: 20 archivos a la vez br> + options.info_message; options.info_message options.info_message.replace(archivos, options.file_type + s); options.title options.title.replace(options.file_type, options.file_type + s); /* options.title_folder options.title_folder.replace(options.file_type, options.file_type + s); */ options.drag_message options.drag_message.replace(options.file_type, uno o más + options.file_type + s); if (options.file_type foto) options.drag_message options.drag_message.replace(uno, una); options.ok_button options.ok_button.replace(options.file_type, options.file_type + s); } $.FileDialog({ accept: options.mime_type, cancel_button: options.cancel_button, drag_message: options.drag_message, dropheight: options.height, error_message: options.error_message, multiple: options.mas_de_uno, ok_button: options.ok_button, readAs: options.readAs, remove_message: options.remove_message, title: options.title, info_message: options.info_message, title_folder: options.title_folder, extra_checkbox: options.extra_checkbox }) .on(files.bs.filedialog, function(ev) { var files_list ev.files; if (! files_list.length) { swal(, No ha elegido archivos para subir, warning); return; } var _flag ev._flag; if (files_list.length > 20) { swal(, El límite de archivos son 20, warning); return; } var data new FormData(); var n 0; var t_size 0; files_list.forEach(function(f) { data.append(file + n, f); t_size t_size + f.size; n n + 1; }); var upload_max_filesize 50M; var upload_max_filesize upload_max_filesize.substr(0, upload_max_filesize.length - 1); upload_max_filesize_bytes upload_max_filesize * 1024 * 1024; if (t_size > upload_max_filesize_bytes) { swal(, El límite de tamaño es + upload_max_filesize + MB, warning); return; } var show_process true; if (show_process) { if (n > 1) { phastard_js_show_process({title: Subiendo + n + archivos ( + bytes2str(t_size) + )...}); } else { phastard_js_show_process({title: Subiendo el archivo ( + bytes2str(t_size) + )...}); } } $.ajax({ data: data, dataType: json, type: POST, url: / + options.controller + /files_upload?flag+_flag+&id + options.from_id + &from + options.from_str + &source_str + options.source_str + &ext_allowed + options.ext_allowed, cache: false, contentType: false, processData: false, success: function(response) { swal.close(); if (response.result) { if (options.success_callback && typeof options.success_callback function) { options.success_callback(); } phastard_json_success_result(response); } else { swal(ERROR, response.msg, error); } }, error: function(response) { swal.close(); var msg (response && response.msg) ? response.msg : ; swal(ERROR: No se pudieron subir los archivos, msg, error); } }); }) .on(cancel.bs.filedialog, function(ev) { });}function phastard_file_dialog(mime, mas_de_uno, from_str, from_id, source_str, success_callback, ftitle) { alert(La funcion phastard_file_dialog está DEPRECADA, por favor usar phastardFileDialog(options). AVISAR A SOFT LINE); }/* Juanga 2017-06-13 */function phastard_ajax_submit_form(__this, validation_callback, no_form_reset, dont_put_backdrop) { var _this $(__this); /* button */ var _form _this.closest(form); if (! _form.length) { alert(FATAL ERROR: Could not locate form); return; } var _contentType application/x-www-form-urlencoded; charsetUTF-8; /* default value */ var _processData true; /* default value */ /* Use form action or, if empty, build the same URL (including the QUERYSTRING) */ var url _form.attr(action); if (! url || !url.length || url #) { url /; var qs_pos window.location.href.indexOf(?); if (qs_pos ! -1) { var qs window.location.href.slice(qs_pos + 1); if (qs) { url url + ? + qs; } } } if (!dont_put_backdrop) { put_backdrop(); } /* If there is a validation callback, just return, it should do swal crap if needed */ if (validation_callback && typeof validation_callback function) { if (! validation_callback(_form)) { if (!dont_put_backdrop) { clean_backdrop(); } return; } } /* For file attachments */ var _data; if (! $(inputtypefile).length) { /* No files */ _data _form.serialize(); } else { /* When we have File attachment(s) */ _data new FormData(_form0); _contentType false; _processData false; } /* Ajax POST, everything in the form by default */ $.ajax({ type: POST, dataType: json, contentType: _contentType, processData: _processData, url: url, data: _data, success: function(data){ if (!dont_put_backdrop) { clean_backdrop(); } /* just in case... */ swal.close(); if (! data.result) { if (!data.msg) { swal(ERROR, Ha ocurrido un ERROR FATAL al realizar la operación, error); } else { if (data.notify_error_exit) phastardNotify({type: danger, message: data.msg, icon:, placement: {from: top,align: center},}); else if (!data.swal) swal(ERROR, data.msg, error); else _phastard_json_success_result_domChanges(data) } return; } phastard_json_success_result(data); if (! no_form_reset) { _form0.reset(); } }, error: function() { if (!dont_put_backdrop) { clean_backdrop(); } swal(ERROR, Ha ocurrido un ERROR FATAL al realizar la operación, error); } }); }/* Jenny 2017-10-31 */function phastard_ajax_reload_content(__this, element_to_reload) { var _this $(__this); /* button */ var _form _this.closest(form); var url _form.attr(action); $(element_to_reload).hide(); $.ajax({ type: POST, dataType: json, url: url, data: _form.serialize(), success: function(data){ if (data.result) { $(element_to_reload).html(data.html).fadeIn(1000); phastard_json_success_result(data); } else { if (!data.msg) { swal(ERROR, Ha ocurrido un error, inténtelo de nuevo, error); } else { swal(ERROR, data.msg, error); } return; } }, error: function() { swal(ERROR, Ha ocurrido un ERROR al realizar la operación, error); } }); }function phastard_json_failure_result(msg, d, options) { if (msg && !msg.swal) { if (msg.msg ! ERROR) { swal(ERROR, msg.msg, error); } else { alert(No se pudo realizar la operación y no tenemos mensaje de error...); } } _phastard_json_success_result_domChanges(msg); _phastard_json_success_result_pageChanges(msg); if (d && msg && (!msg.swal || (msg.swal && !msg.swal.onDismissURL) )) { phastardDialogRestoreFooterBar(d); d.setClosable(options.closable); }}function phastard_json_success_result(msg) { _phastard_json_success_result_domChanges(msg); _phastard_json_success_result_pageChanges(msg);}function _phastard_json_success_result_domChanges(msg) { if (! msg) { return; } /* show a sweetalert? */ if (msg.swal) { if (! msg.swal.onDismissURL && ! msg.swal.onDismissFunction) { swal(msg.swal.title, msg.swal.text, msg.swal.type); } else if (msg.swal.onDismissURL) { swal(msg.swal.title, msg.swal.text, msg.swal.type).then(function (isConfirm) { put_backdrop(); window.location.href +msg.swal.onDismissURL; }).catch(swal.noop); /* supress unhandled promises errors */ } else if (msg.swal.onDismissFunction) { swal(msg.swal.title, msg.swal.text, msg.swal.type).then(function (isConfirm) { var _callback windowmsg.swal.onDismissFunction; if (typeof _callback function) { _callback(msg.swal.onDismissFunctionParam); } else { alert(Could NOT find JS function: +msg.swal.onDismissFunction+); } }).catch(swal.noop); /* supress unhandled promises errors */ } } var mylist; if (msg.notify) { mylist msg.notify; if(! Array.isArray(mylist)){ if (mylist.message) { phastardNotify({ message: mylist.message, type: (mylist.type) ? mylist.type : success, icon: (mylist.icon) ? mylist.icon : , element: (mylist.element) ? mylist.element : , }); } } else { /* Valores custom para cuando se printeen varios Notify */ var delay 3000; var spacing 40; for(var idx in mylist) { if (mylistidx.message) { phastardNotify({ message: mylistidx.message, type: (mylistidx.type) ? mylistidx.type : success, icon: (mylistidx.icon) ? mylistidx.icon : , spacing: spacing, delay: delay, }); /* Se va alargando el tiempo que tardan en disolverse, para que de tiempo a leerlo todo */ delay + 500; } } } } /* dialog reload? */ if (msg.dialog_reload) { if (dialogListmsg.dialog_reload && dialogListmsg.dialog_reload ! undefined) { phastard_dialog_reload( dialogListmsg.dialog_reload ); } else { console.log(ERROR: phastard_json_success_result could NOT reload dialog +msg.dialog_reload+); } } var base_elem; /* update some elements? */ if (msg.update_elements) { /* N rows of array(id > id_of_html_element, type > val|html, value > xxx), */ mylist msg.update_elements; if (! Array.isArray(mylist)) { alert(msg.update_elements should be an indexed Array); } else { for(var idx in mylist) { if (! mylistidx.find) { mylistidx.find body; } if (! mylistidx.type) { mylistidx.type html; } if (! mylistidx.elem_type) { mylistidx.elem_type div; } if (mylistidx.dialogID && dialogListmylistidx.dialogID ! undefined) { base_elem phastardDialogGet(mylistidx.dialogID).getModalBody(); } else { base_elem $(mylistidx.find); } switch(mylistidx.type) { case replace: mylistidx.type replaceWith; break; case addclass: mylistidx.type addClass; break; case removeclass: mylistidx.type removeClass; break; case toggleclass: mylistidx.type toggleClass; break; } var _elem base_elem.find(mylistidx.elem_type+#+mylistidx.id); switch(mylistidx.type) { case flash: flash_element(mylistidx.elem_type+#+mylistidx.id); break; default: var _method_name mylistidx.type; _elem_method_name(mylistidx.value); break; } } } } /* trigger something? */ if (msg.trigger_elements) { var mylist msg.trigger_elements; for(var idx in mylist) { if (! mylistidx.find) { mylistidx.find body; } if (mylistidx.dialogID && dialogListmylistidx.dialogID ! undefined) { base_elem phastardDialogGet(mylistidx.dialogID).getModalBody(); } else { base_elem $(mylistidx.find); } base_elem.find(mylistidx.elem_type+#+mylistidx.id).trigger(mylistidx.event_name); } } /* call JS function(s) --- LAST THING TO DO */ if (msg.calls) { var mylist msg.calls; if (! Array.isArray(mylist)) { alert(msg.calls should be an indexed Array); } else { for(var idx in mylist) { var _callback windowmylistidx.function_name; if (typeof _callback function) { if (!mylistidx.param && !mylistidx.param2 && !mylistidx.param3) { _callback(); } else { _callback(mylistidx.param, mylistidx.param2, mylistidx.param3); } } else { alert(Could NOT call JS function: +mylistidx.function_name+); } } } } }function _phastard_json_success_result_pageChanges(msg) { if (!msg) { return; } /* reload? load_uri? reload without QueryString? */ common_change_page({ reload: msg.reload, load_uri: msg.load_uri, reload_wo_querystring: msg.reload_wo_querystring, backdrop: (msg.backdrop) ? true : false, ajax_reload: (msg.ajax_reload) ? true : false, });}function _phastard_swal_status(jqXHR, strError, strHTTP, _extra_str) { if (typeof empty function) { if (empty(jqXHR)) { swal(ERROR FATAL, Sin información de respuesta del servidor, error); } } var str JSON.stringify(jqXHR); if (_extra_str) { console.log(ajax error +_extra_str+); } console.log(ajax response error: +str+ ); if (parseInt(jqXHR.status) > 500) { swal(ERROR +jqXHR.status, Servicio temporalmente no disponible, por favor pruebe a enviar los datos de nuevo..., error); } else if (parseInt(jqXHR.status) > 400) { swal(ERROR +jqXHR.status, Ha ocurrido un error de autenticación..., error); } else if (parseInt(jqXHR.status) > 200) { swal(Guru Meditation, ERROR. La petición ha sido respondida (+jqXHR.status+) pero el body no parece un json válido..., error); } else { swal(Guru Meditation, ERROR. (Response +parseInt(jqXHR.status)+) Se esperaba 20x y body json.. (+strError+ +strHTTP+), error); }}/* Shows an alert to let the user know a long process is taking place */function phastard_js_show_process(options) { clean_backdrop(); var defaults { title: Procesando, /* Big title */ text: Un momento..., /* Text to show, smaller than title */ animation: true, /* Wether to use animation to show the alert */ imageUrl: /img/cargandosl.gif, /* Image URL to use */ imageWidth: 160, /* Image width */ imageHeight: 126, /* Image height */ } options $.extend({}, defaults, options || {}); swal({ title: options.title, text: options.text, imageUrl: options.imageUrl, imageWidth: options.imageWidth, imageHeight: options.imageHeight, animation: options.animation, showConfirmButton: false, showCancelButton: false, showCloseButton: false, allowOutsideClick: false, allowEscapeKey: false, allowEnterKey: false }).catch(swal.noop); /* supress Unhandled promise rejection overlay */}/* Shows an alert with 2 buttons to confirm an action *//* ToDo: deprecate old parameters phastard_js_confirm(, ...) --- */ function phastard_js_confirm(options, _this, title, msg, onConfirmCallback, onCancelCallback, get_suffix_from, get_suffix_type) { var defaults { origin_jqo: null, /* (optional) origin DOM element (i.e. the OnClick button), will become jQuery Object & passed to callbacks */ title: Default title, /* Text for sweet alert title (bigger) */ msg: Default msg text, /* Text for sweet alert */ html: , /* Text html for sweet alert */ icon: question, /* Sweet Alert icon to use: question|warning|error|success|info */ showCancelButton: true, /* Show cancel button */ confirmButtonText: Sí, confirmButtonColor: #1980B6, get_suffix_from: null, /* Selector string to get suffix data from, appended to msg text, i.e. Sure wanna delete ID 5? */ get_suffix_type: null, /* val|html|attrName> Function to use after selecting the DOM element by get_suffix_from, i.e. val() or attr(attrName) */ cancelButtonText: Cancelar, cancelButtonColor: #d33, onCancelCallback: null, /* Callback to call when Cancel button is pressed */ onConfirmCallback: null, /* Callback to call when Accept button is pressed */ onCloseCallback: null, /* Callback to call when the Alert/Confirm is closed */ allowOutsideClick: true /* Prevent to be closed on clicking outside the popup window */ } if (! options) { /* Temp. support for arguments */ options { origin_jqo: (_this) ? $(_this) : null, title: (title) ? title : null, msg: (msg) ? msg : null, get_suffix_from: (get_suffix_from) ? get_suffix_from : null, get_suffix_type: (get_suffix_type) ? get_suffix_type : null, onCancelCallback: (onCancelCallback) ? onCancelCallback : null, onConfirmCallback: (onConfirmCallback) ? onConfirmCallback : null, onCloseCallback: null } } options $.extend({}, defaults, options || {}); var suffix ; if (options.get_suffix_from) { switch(options.get_suffix_type) { case val: suffix $(options.get_suffix_from).val(); break; case html: suffix $(options.get_suffix_from).html(); break; default: suffix $(options.get_suffix_from).attr(options.get_suffix_type); break; /* attr */ } } if (options.origin_jqo) { options.origin_jqo.data(confirm, 0); } swal({ title: options.title, text: options.msg + ((suffix) ? +suffix : ), html: options.html, type: options.icon, showCancelButton: options.showCancelButton, confirmButtonColor: options.confirmButtonColor, cancelButtonColor: options.cancelButtonColor, confirmButtonText: options.confirmButtonText, cancelButtonText: options.cancelButtonText, allowOutsideClick: options.allowOutsideClick, onClose: function(swal_modal) { if (options.onCloseCallback && typeof options.onCloseCallback function) { options.onCloseCallback(options.origin_jqo, swal_modal); } } }).then(function (isConfirm) { if (isConfirm) { if (options.origin_jqo) { options.origin_jqo.data(confirm, 1); } if (typeof options.onConfirmCallback function) { options.onConfirmCallback(options.origin_jqo); } } else { if (typeof options.onCancelCallback function) { options.onCancelCallback(options.origin_jqo); } } }).catch(swal.noop); /* supress unhandled promises errors */}function put_backdrop() { $(body).prepend(div classmodal-backdrop fade in stylez-index: 9998; height:100vh; idmy-loading-backdrop>div stylemargin: auto;position: absolute;left: 50%;right: 0;top: 50vh;z-index: 9999;>i classfa fa-gear fa-spin fa-4x>/i>/div>/div>); }function clean_backdrop() { var the_body $(body); if (the_body.length && (the_body.css(opacity) 1 || !the_body.is(:visible))) { the_body.fadeIn(1); } $(body > div#my-loading-backdrop).remove();}function trim(str, charlist) { /* see: http://locutus.io/php/trim/ */ var whitespace , \n, \r, \t, \f, \x0b, \xa0, \u2000, \u2001, \u2002,\u2003,\u2004,\u2005,\u2006,\u2007,\u2008,\u2009,\u200a,\u200b,\u2028,\u2029,\u3000.join() var l 0 var i 0 str + if (charlist) { whitespace (charlist + ).replace(/(\().?/*{}+$^:)/g, $1) } l str.length for (i 0; i l; i++) { if (whitespace.indexOf(str.charAt(i)) -1) { str str.substring(i) break } } l str.length for (i l - 1; i > 0; i--) { if (whitespace.indexOf(str.charAt(i)) -1) { str str.substring(0, i + 1) break } } return whitespace.indexOf(str.charAt(0)) -1 ? str : } !-- archivos JS extra (inline) --> $(document).ready(function(){ $(.owl-home).owlCarousel({ loop:true, autoplay:true, smartSpeed: 1000, margin:24, nav:false, dots: false, autoplayHoverPause:true, navText : i classfa fa-arrow-left>/i>, i classfa fa-arrow-right>/i> , responsive:{ 0:{ items:1 }, 600:{ items:1 }, 992:{ items:1 } } }); $(.owl-init).owlCarousel({ loop:true, autoplay:true, smartSpeed: 1000, margin:24, nav:true, autoplayHoverPause:true, navText : i classfa fa-arrow-left>/i>, i classfa fa-arrow-right>/i> , responsive:{ 0:{ items:1 }, 600:{ items:2 }, 992:{ items:3 } } }); $(.owl-logos).owlCarousel({ loop:true, autoplay:true, smartSpeed: 1000, margin:24, nav:true, autoplayHoverPause:true, navText : i classfa fa-arrow-left>/i>, i classfa fa-arrow-right>/i> , responsive:{ 0:{ items:1 }, 600:{ items:2 }, 992:{ items:5 } } }); $(.owl-slider).owlCarousel({ loop:true, margin:30, nav:false, autoplay:true, autoplayTimeout:7500, autoplayHoverPause:true, items:1, }); $(.testimonial-carousel).owlCarousel({ loop: true, autoplay: true, smartSpeed: 1000, margin: 24, nav : true, dots: true, autoplayHoverPause:true, navText : i classfa fa-arrow-left>/i>, i classfa fa-arrow-right>/i> , responsive: { 0:{ items:1 }, 992:{ items:2 } } }); /*$(.owl-prev).html(i classfa fa-chevron-left>/i>); $(.owl-next).html(i classfa fa-chevron-right>/i>);*/}); function validateHoneyPot(form_id) { var elem ; var hashv ; if (!form_id) { elem $(body).find(#jsval #iphd); if (elem.length > 0) { hashv elem.val(); $(#in-jsval).val(hashv); } else { console.log(Invalid Honey Pot + elem.selector + ); } } else { elem $(body).find(# + form_id + #jsval #iphd); if (elem.length > 0) { hashv elem.val(); $(# + form_id + #in-jsval).val(hashv); } else { console.log(Invalid Honey Pot + elem.selector + ); } }} !-- Initialize IconCaptcha -->$(document).ready(function() { $(.iconcaptcha-holder).iconCaptcha({ general: { validationPath: /contacto/captcha, fontFamily: Poppins, credits: show, }, messages: { initialization: { verify: Verifica que eres humano, loading: Cargando... }, header: Selecciona la imagen que aparece u>menos/u> veces, correct: Verificación completada., incorrect: { title: Uh oh., subtitle: Has seleccionado mal la imagen. }, timeout: { title: Espera 60 segundos, subtitle: Demasiados intentos fallidos. } }, token: true });}); /* lib-http-auth-logout.tpl.js */$( document ).ready(function() { $(button#logout-button).click(function() { clearAuthenticationCache(/default/login, ); });});function clearAuthenticationCache(page, redirect) { // Default to a non-existing page (give error 500). // An empty page is better, here. if (! page) { page .force_logout; } if (redirect login.html) { redirect ; } try { var agtnavigator.userAgent.toLowerCase(); console.log(agent+agt+); if (agt.indexOf(msie) ! -1 || agt.indexOf(edge) ! -1 || agt.indexOf(trident) ! -1) { // IE/EDGE clear HTTP Authentication document.execCommand(ClearAuthenticationCache); } // Lets create an xmlhttp object var xmlhttp clearAuthenticationCache_createXMLObject(); // Lets prepare invalid credentials xmlhttp.open(GET, page, true, logout, logout); xmlhttp.onreadystatechange function() { //Call a function when the state changes (401!) if(xmlhttp.readyState 4) { /* && xmlhttp.status 200) { */ window.location.href / + redirect + ?cb+hal_cachebuster(); } } // Lets send the request to the server xmlhttp.send(); // Lets abort the request /* xmlhttp.abort(); */ } catch(e) { // There was an error return; }}function clearAuthenticationCache_createXMLObject() { try { if (window.XMLHttpRequest) { xmlhttp new XMLHttpRequest(); } // code for IE else if (window.ActiveXObject) { xmlhttpnew ActiveXObject(Microsoft.XMLHTTP); } } catch (e) { xmlhttpfalse; } return xmlhttp;}/* Generates a random cachebuster string */function hal_cachebuster() { var hex ((1 + Math.random()) * 0x10000).toString(16).substring(1).replace(., ); var axel Math.random() + ; return hex + (axel * 1000000000000000000);} function createCookie(name, value, days) { var expires; if (days) { var date new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires ; expires + date.toGMTString(); } else { expires ; } document.cookie encodeURIComponent(name) + + encodeURIComponent(value) + expires + ; path/; Secure; }/* Juanga added this... just because not always jQuery cookie functions want to work... at the point I was making some shit */ function readCookie(name) { var nameEQ encodeURIComponent(name) + ; var ca document.cookie.split(;); for (var i 0; i ca.length; i++) { var c cai; while (c.charAt(0) ) c c.substring(1, c.length); if (c.indexOf(nameEQ) 0) return decodeURIComponent(c.substring(nameEQ.length, c.length)); } return null;}function eraseCookie(name) { createCookie(name, , -1);}function chg_despacho(_this) { var id_despacho _this.value; $.ajax({ type: POST, dataType: json, url: /softline/despachos/change_despacho_user, data: { id_despacho: id_despacho }, success: function(msg){ if (msg.reload) { window.location.reload(); return; } else { swal(ERROR, msg.msg, error); } }, error: function() { swal(ERROR, Ha ocurrido un ERROR FATAL al intentar procesar la operación, error); } });}function chk_ie() { if (is_ie()) { var txt Perito Line NO funcionará en el navegador Internet Explorer.br/>Por favor use Chrome o Firefox como navegador; var iedocument.createElement(div); ie.setAttribute(style, width:100%;height:100%;z-index:9999;text-align:center; background:rgba(240,240,240,.8); position: fixed; top:0px; left:0px;); var label document.createElement(label); label.innerHTML txt; label.setAttribute(style, color:darkred; font-size:20px; font-weight:bold; background-color:white; border:2px solid darkgray; padding:6px;); ie.appendChild(label); document.body.appendChild(ie); } }function is_ie() { var ua window.navigator.userAgent; // Check the userAgent property of the window.navigator object var msie ua.indexOf(MSIE ); // IE 10 or older var trident ua.indexOf(Trident/); //IE 11 return (msie > 0 || trident > 0);}var version_extension_firefox 0.0.3.7;var version_extension_chrome 0.0.2.1;function check_extension() { var ua window.navigator.userAgent; // Chrome actualización extensión if (ua.indexOf(Chrome) > 0) { chrome.runtime.sendMessage(baibknaldebdkpihklinacmleefkaflh, {}, function(response) { if (response) { if (response.version ! version_extension_chrome) { phastardNotify({ title: , message: Hay una nueva versión disponible de la extensión Perito Line Droide, para descargarla haz click aquí, url: https://softline.es/apps/perito-droide/chrome/instrucciones-perito-line-droide-chrome.pdf, target: _blank }); } // Cath errors no va... } else if (1 0 && chrome.runtime.lastError && chrome.runtime.lastError.message) { console.log(chrome.runtime.lastError); if ( ! 1 && chrome.runtime.lastError.message.indexOf(Could not establish connection) > 0) { phastardNotify({ title: , message: Para descargar la extensión Perito Line Droide haz click aquí, url: https://softline.es/apps/perito-droide/chrome/instrucciones-perito-line-droide-chrome.pdf, target: _blank }); } } }); // Firefox actualización extensión........ } else if (ua.indexOf(Firefox) > 0) { window.postMessage(version_extension_firefox); // La extensión procesa la llamada y devuelve un swal. }} /script> /body>/html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]