1var WA = WA || {}; 2WA.Dialog = { 3 confirm: function(title, question, btn_title_true, btn_title_false, callback, default_text, custom_data) { 4 var btn = {}; 5 default_text = typeof(default_text) == "undefined" ? "" : default_text; 6 btn[btn_title_true] = function() { 7 callback(); 8 $(this).dialog('close'); 9 }; 10 btn[btn_title_false] = function() { 11 $(this).dialog('close'); 12 }; 13 WA.Dialog.dialog('<div><strong style="margin-top:10px">' + question + '</strong></div>', title, btn, undefined, undefined, custom_data); 14 }, 15 prompt: function(title, question, btn_title, callback, default_text) { 16 var btn = {}; 17 default_text = typeof(default_text) == "undefined" ? "" : default_text; 18 btn[btn_title] = function() { 19 callback($(this).parent().find("input").val()); 20 $(this).dialog('close'); 21 }; 22 WA.Dialog.dialog('<div><strong style="margin-top:10px">' + question + '</strong><br/><input type="text" value="' + default_text + '" style="width:95%" /></div>', title, btn); 23 }, 24 alert: function(message) { 25 var btn = {}; 26 btn[WA.Translation._ok] = function() { 27 $(this).dialog('close'); 28 }; 29 WA.Dialog.dialog('<div><strong style="margin-top:10px">' + message + '</strong></div>', "", btn); 30 31 }, 32 load_html: function(title, url, btn_cancel_title, btn_title, callback, loadcall, user_data) { 33 user_data = typeof(user_data) == "undefined" ? {} : user_data; 34 var btn = {}; 35 if (btn_cancel_title !== "") 36 { 37 btn[btn_cancel_title] = function() { 38 $(this).dialog("close"); 39 $("#load_html_data_container").remove(); 40 } 41 } 42 btn[btn_title] = function() { 43 callback($(this).parent()); 44 $(this).dialog('close'); 45 $("#load_html_data_container").remove(); 46 }; 47 var custom_data = {}; 48 custom_data["close"] = function(){ 49 $("#load_html_data_container").remove(); 50 }; 51 $.get(url, function(data) { 52 WA.Dialog.dialog('<div id="load_html_data_container">' + $(data).html() + '</div>', title, btn, 450, 300, custom_data); 53 loadcall(); 54 $("#load_html_data_container").find("span[data-lang], label[data-lang], button[data-lang]").each(function() { 55 $(this).html(WA.Translation[$(this).data("lang")]); 56 }); 57 $("#load_html_data_container").find("input[data-user]").each(function() { 58 $(this).val(user_data[$(this).data("user")]); 59 }); 60 }); 61 62 }, 63 confirm_dialog: function($title, $question, $btn, $dialog_id, $width, $height, $custom_data) { 64 $dialog_id = typeof($dialog_id) === "undefined" ? "" : ' id="'+$dialog_id+'"'; 65 $width = typeof($width) === "undefined" ? 450 : $width; 66 $height = typeof($height) === "undefined" ? 150 : $height; 67 $custom_data = typeof($custom_data) === "undefined" ? {} : $custom_data; 68 69 WA.Dialog.dialog('<div'+$dialog_id+'><strong style="margin-top:10px">' + $question + '</strong></div>', $title, $btn, $width, $height, $custom_data); 70 }, 71 dialog: function(open_on, title, buttons, width, height, custom_data) { 72 open_on = typeof(open_on) == "undefined" ? "<div/>" : open_on; 73 title = typeof(title) == "undefined" ? "" : title; 74 width = typeof(width) == "undefined" ? 450 : width; 75 height = typeof(height) == "undefined" ? 150 : height; 76 custom_data = typeof(custom_data) == "undefined" ? {} : custom_data; 77 var dialog_data = custom_data; 78 if(typeof(custom_data["height"]) === "undefined") 79 { 80 dialog_data["height"] = height; 81 } 82 if(typeof(custom_data["width"]) === "undefined") 83 { 84 dialog_data["width"] = width; 85 } 86 dialog_data["title"] = title; 87 dialog_data["buttons"] = buttons; 88 89 if (typeof(custom_data["autoOpen"]) === "undefined" || typeof(custom_data["autoOpen"]) === undefined) 90 { 91 dialog_data["autoOpen"] = true; 92 } 93 if (typeof(custom_data["modal"]) === "undefined" || typeof(custom_data["modal"]) === undefined) 94 { 95 dialog_data["modal"] = true; 96 } 97 98 $(open_on).dialog( 99 dialog_data 100 ); 101 }, 102 message: function(msg, title, btn_title, callback) { 103 if (typeof(title) === "undefined" || typeof(title) === undefined) title = "ZprÄËva"; 104 if (typeof(btn_title) === "undefined" || typeof(btn_title) === undefined) btn_title = "Ok"; 105 106 var btn = {}; 107 btn[btn_title] = function() { 108 $(this).dialog('close'); 109 if (typeof(callback) === "undefined" || typeof(callback) === undefined) callback(); 110 }; 111 112 WA.Dialog.dialog('<div><strong style="margin-top:10px">' + msg + '</strong></div>', title, btn, 450, "auto"); 113 }, 114};
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.