1var c_alerts = {}; 2 3Console = function(){}; 4 5 6Console.show_busy = function(val){ 7 var def = ''; 8 9 switch (val) { 10 case 1: // save 11 def = 'ÐожалÑйÑÑа подождиÑе<br /><b>Ð¸Ð´ÐµÑ ÑÐ¾Ñ Ñанение...</b>'; 12 break; 13 case 2: // load 14 def = 'ÐожалÑйÑÑа подождиÑе<br /><b>Ð¸Ð´ÐµÑ Ð·Ð°Ð³ÑÑзка...</b>'; 15 break; 16 case 3: // indexing 17 def = 'ÐожалÑйÑÑа подождиÑе<br /><b>Ð¸Ð´ÐµÑ Ð¸Ð½Ð´ÐµÐºÑаÑиÑ...</b>'; 18 break; 19 default: 20 def = val; 21 } 22 23 $('#dbusy div.editor_busytxt').html(def); 24 $('#dbusy').show(); 25 26}; 27 28Console.hide_busy = function(){ 29 $('#dbusy').hide(); 30} 31 32 33Console.notice = function (msg, id, opts){ 34 Console.message('message', id, msg, opts); 35} 36 37Console.warning = function (msg, id, opts){ 38 Console.message('warning', id, msg, opts); 39} 40 41Console.error = function (msg, id, opts){ 42// alert(msg); 43 if ('undefined' == typeof(opts)) 44 var opts = {permanent:1}; 45 Console.message('error', id, msg, opts); 46} 47 48 49//opts - {permanent} 50Console.message = function (mode, id, msg, opts){ 51 if ('undefined' == typeof(id)) 52 var id = 0; 53 if ('undefined' == typeof(opts)) 54 var opts = {}; 55 opts = Console._process_opts(id, opts); 56 var msg_div = this; 57 var msg_id = id; 58 if (!id) 59 msg_id = Math.random(); 60 if ('undefined' == typeof(c_alerts[msg_id])) { 61 c_alerts[msg_id] = {}; 62 } 63 64 if (id) { 65 if ('undefined' != typeof(c_alerts[msg_id]['tid'])) { 66 if (c_alerts[msg_id]['tid']) 67 clearTimeout(c_alerts[msg_id]['tid']); 68 $('#msg_'+id).fadeOut(400).fadeIn(400).fadeOut(800).fadeIn(800, function(){c_alerts[msg_id]['tid'] = 0; Console._start_alert(msg_id, this, opts)}); 69 return; 70 } 71 } 72 73// c_alerts[msg_id]['container'] = $('<div class="'+mode+'" id="msg_'+msg_id+'"><span class="close" onclick="Console.hide_alert(\''+msg_id+'\')"> </span><div class="txt">'+msg+'</div></div><div class="sadow"></div>') 74 c_alerts[msg_id]['container'] = $('<div class="item" id="msg_'+msg_id+'"><div class="'+mode+'"><span class="close" onclick="Console.hide_alert(\''+msg_id+'\')"> </span><div class="txt">'+msg+'</div></div><div class="sadow"></div></div>') 75 .appendTo('#alert_container') 76 .slideDown('fast', function(){Console._start_alert(msg_id, this, opts)} ); 77 78} 79 80Console.hide_alert = function (msg_id) { 81 if ('undefined' == typeof(c_alerts[msg_id])) return; 82 if ('undefined' == typeof(c_alerts[msg_id]['container'])) return; 83 var msg_div = c_alerts[msg_id]['container']; 84 $(msg_div).slideUp('slow', function(){Console._remove_alert(msg_id)}); 85} 86 87// Internal functions 88Console._start_alert = function(msg_id, msg_div, opts){ 89 if (opts['permanent']) { 90 tid = 0; 91 } else { 92 var tid = setTimeout(function(){ 93 $(msg_div).slideUp('slow', function(){Console._remove_alert(msg_id)}); 94 if (msg_id) { 95 c_alerts[msg_id]['tid'] = 0; 96 } 97 }, 4000); 98 } 99 100 if (msg_id) { 101 c_alerts[msg_id]['container'] = msg_div; 102 c_alerts[msg_id]['tid'] = tid; 103 c_alerts[msg_id]['opts'] = opts; 104 } 105} 106 107 108Console._process_opts = function (id, opts) { 109 if ('undefined' == typeof(opts['permanent']) || !id) { 110 opts['permanent'] = 0; 111 } 112 return opts; 113} 114 115Console._remove_alert = function (msg_id){ 116 if ('undefined' == typeof(c_alerts[msg_id])) return; 117 if ('undefined' == typeof(c_alerts[msg_id]['container'])) return; 118 var msg_div = c_alerts[msg_id]['container']; 119 $(msg_div).remove(); 120 c_alerts[msg_id] = {}; 121} 122 123//init 124/* 125//Replase standard alert() function 126window.alert = function(txt) { 127 Console.alert('message', 0, txt); 128} 129*/
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.