1 2 3function create_simple_modal(type, id, title, contents, footer_contents, callback, callback_param){ 4 5 $(".modal").remove(); 6 $(".modal-backdrop").remove(); 7 8 var fade_div = $("<div/>"); 9 fade_div.addClass("modal").addClass("venngage-modal").addClass("fade").attr("id", id); 10 11 var dialog_div = $("<div/>"); 12 dialog_div.addClass("modal-dialog").addClass(type); 13 14 var content_div = $("<div/>"); 15 content_div.addClass("modal-content"); 16 17 var header_div = $("<div/>"); 18 header_div.addClass("modal-header"); 19 20 var close_button = $("<button/>"); 21 close_button.addClass("close").addClass("close-modal").attr({"type":"button"}).html("×"); 22 23 var title_div = $("<h4/>") 24 title_div.addClass("modal-title").html(title); 25 26 var modal_body = $("<div/>"); 27 modal_body.addClass("modal-body"); 28 29 var modal_footer = $("<div/>"); 30 modal_footer.addClass("modal-footer"); 31 32 var close_button2 = $("<button/>"); 33 close_button2 .addClass("btn").addClass("btn-gray").addClass("btn-sm").addClass("close-modal").attr({"type":"button"}).html("Close"); 34 35 if (window.__vg_translator) { 36 close_button2.html(window.__vg_translator.t('editor.misc.close')); 37 } 38 39 header_div.html(close_button).append(title_div); 40 41 //adding the actual content. 42 modal_body.html(contents); 43 44 modal_footer.html(close_button2) 45 46 modal_footer.append(footer_contents) 47 48 content_div.html(header_div).append(modal_body).append(modal_footer); 49 dialog_div.html(content_div); 50 fade_div.html(dialog_div); 51 $("body").append(fade_div); 52 53 $("#" + id + " .close-modal").on("click", function(){ 54 $("#" + id).modal("hide"); 55 $('body').removeClass('modal-open').css('overflow', ''); 56 $("#" + id).remove(); 57 $(".modal-backdrop").remove(); 58 }); 59 60 61 if(typeof callback == 'function'){ 62 63 //console.log("running callback"); 64 65 callback(callback_param); 66 67 } 68 69 70 $("body").css("overflow", "hidden"); 71 $("#" + id).modal({backdrop: 'static', keyboard: false}); 72 73}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.