%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/projetos/suporte.iigd.com.br.old/js/
Upload File :
Create Path :
Current File : /var/www/projetos/suporte.iigd.com.br.old/js/glpi_dialog.min.js

/**
 * ---------------------------------------------------------------------
 *
 * GLPI - Gestionnaire Libre de Parc Informatique
 *
 * http://glpi-project.org
 *
 * @copyright 2015-2022 Teclib' and contributors.
 * @copyright 2003-2014 by the INDEPNET Development Team.
 * @licence   https://www.gnu.org/licenses/gpl-3.0.html
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * ---------------------------------------------------------------------
 */
var glpi_html_dialog=function({title:t="",body:a="",footer:o="",modalclass:n="",dialogclass:i="",id:s="modal_"+Math.random().toString(36).substring(7),appendTo:l="body",autoShow:e=true,show:d=(()=>{}),close:r=(()=>{}),buttons:c=[]}={}){if(c.length>0){var _="";c.forEach((t=>{var a="id"in t?t.id:"button_"+Math.random().toString(36).substring(7);var o="label"in t?t.label:__("OK");var n="class"in t?t.class:"btn-secondary";_+=`\n            <button type="button" id="${a}"\n                    class="btn ${n}" data-bs-dismiss="modal">\n               ${o}\n            </button>`;if("click"in t){$(document).on("click","#"+a,(function(a){t.click(a)}))}}));o+=_}if(o.length>0){o=`<div class="modal-footer">\n         ${o}\n      </div>`}var m=`<div class="modal fade ${n}" id="${s}" role="dialog">';\n         <div class="modal-dialog ${i}">\n            <div class="modal-content">\n               <div class="modal-header">\n                  <h4 class="modal-title">${t}</h4>\n                  <button type="button" class="btn-close" data-bs-dismiss="modal"\n                           aria-label="${__("Close")}"></button>\n               </div>\n               <div class="modal-body">${a}</div>\n               ${o}\n            </div>\n         </div>\n      </div>`;glpi_close_all_dialogs();$(l).append(m);var b=document.getElementById(s);var g=new bootstrap.Modal(b,{});if(e){g.show()}b.addEventListener("shown.bs.modal",(function(t){$("#"+s).find("input, textearea, select").first().trigger("focus");d(t)}));b.addEventListener("hidden.bs.modal",(function(t){r(t);$("#"+s).remove()}));return s};var glpi_ajax_dialog=function({url:t="",params:a={},method:o="post",title:n="",footer:i="",modalclass:s="",dialogclass:l="",id:e="modal_"+Math.random().toString(36).substring(7),appendTo:d="body",autoShow:r=true,done:c=(()=>{}),fail:_=(()=>{}),show:m=(()=>{}),close:b=(()=>{}),buttons:g=[]}={}){if(t.length==0){return}glpi_close_all_dialogs();$.ajax({url:t,type:o,data:a,success:function(t){glpi_html_dialog({title:n,body:t,footer:i,id:e,appendTo:d,modalclass:s,dialogclass:l,autoShow:r,buttons:g,show:m,close:b})}}).done((function(t){c(t)})).fail((function(t,a){_(t,a)}));return e};var glpi_alert=function({title:t=_n("Information","Information",1),message:a="",id:o="modal_"+Math.random().toString(36).substring(7),ok_callback:n=(()=>{})}={}){glpi_html_dialog({title:t,body:a,id:o,buttons:[{label:__("OK"),click:function(t){n(t)}}]});return o};var glpi_confirm=function({title:t=_n("Information","Information",1),message:a="",id:o="modal_"+Math.random().toString(36).substring(7),confirm_callback:n=(()=>{}),confirm_label:i=_x("button","Confirm"),cancel_callback:s=(()=>{}),cancel_label:l=_x("button","Cancel")}={}){glpi_html_dialog({title:t,body:a,id:o,buttons:[{label:i,click:function(t){n(t)}},{label:l,click:function(t){s(t)}}]});return o};var glpi_close_all_dialogs=function(){$(".modal.show").modal("hide").remove()};var toast_id=0;const glpi_toast=(t,a,o,n={})=>{toast_id++;n=Object.assign({delay:1e4,animated:true,animation:"animate__tada",animation_extra_classes:"animate__delay-2s animate__slow"},n);const i=n.animated?`animate_animated ${n.animation} ${n.animation_extra_classes}`:"";const s=`<div class='toast-container bottom-0 end-0 p-3 messages_after_redirect'>\n      <div id='toast_js_${toast_id}' class='toast ${o} ${i}' role='alert' aria-live='assertive' aria-atomic='true'>\n         <div class='toast-header'>\n            <strong class='me-auto'>${t}</strong>\n            <button type='button' class='btn-close' data-bs-dismiss='toast' aria-label='${__("Close")}'></button>\n         </div>\n         <div class='toast-body'>\n            ${a}\n         </div>\n      </div>\n   </div>`;$("body").append(s);const l=new bootstrap.Toast(document.querySelector("#toast_js_"+toast_id),{delay:n.delay});l.show()};const glpi_toast_success=(t,a,o={})=>{glpi_toast(a||__("Success"),t,"bg-success text-white border-0",o)};const glpi_toast_info=function(t,a,o={}){glpi_toast(a||_n("Information","Informations",1),t,"bg-info text-white border-0",o)};const glpi_toast_warning=(t,a,o={})=>{glpi_toast(a||__("Warning"),t,"bg-warning text-white border-0",o)};const glpi_toast_error=(t,a,o={})=>{glpi_toast(a||__("Error"),t,"bg-danger text-white border-0",o)};

Zerion Mini Shell 1.0