1$.fn.extend({ 2 insertAtCaret: function(myValue) { 3 this.each(function() { 4 if (document.selection) { 5 this.focus(); 6 var sel = document.selection.createRange(); 7 sel.text = myValue; 8 this.focus(); 9 } else if (this.selectionStart || this.selectionStart == '0') { 10 var startPos = this.selectionStart; 11 var endPos = this.selectionEnd; 12 var scrollTop = this.scrollTop; 13 this.value = this.value.substring(0, startPos) + 14 myValue + this.value.substring(endPos,this.value.length); 15 this.focus(); 16 this.selectionStart = startPos + myValue.length; 17 this.selectionEnd = startPos + myValue.length; 18 this.scrollTop = scrollTop; 19 } else { 20 this.value += myValue; 21 this.focus(); 22 } 23 }); 24 return this; 25 } 26}); 27function toggleFullScreen() { 28 var doc = window.document; 29 var docEl = doc.documentElement; 30 31 var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen; 32 var cancelFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen; 33 34 if(!doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement && !doc.msFullscreenElement) { 35 requestFullScreen.call(docEl); 36 } 37 else { 38 cancelFullScreen.call(doc); 39 } 40} 41 42$(function() { 43 $('body').on('click', '#btn-delete, .btn-delete', function(e){ 44 var confirm = window.confirm("Você tem certeza que deseja excluir este registro?"); 45 if(!confirm) { 46 e.preventDefault(); 47 } 48 }); 49 $('.modal').on('keydown', 'form', function(e){ 50 if((e.keyCode == 13) && e.target.nodeName!='TEXTAREA') { 51 e.preventDefault(); 52 $('.modal .btn-submit').trigger('click'); 53 } 54 }); 55 56 $('.modal').on('click', '.btn-link2', function(e){ 57 e.preventDefault(); 58 $('.modal .modal-content').load($(this).data('url')); 59 }); 60 61 $('div').on('click', '.btn-link3', function(e){ 62 e.preventDefault(); 63 $('.modal .modal-content').load($(this).data('url')); 64 }); 65 66 $('.modal').on('click', '.btn-button', function(e){ 67 e.preventDefault(); 68 $('.modal .modal-content').load($(this).attr('href')); 69 }); 70 $('body').on('click', '[data-toggle="modal"]', function(){
71 $($(this).data("target")+' .modal-content').load($(this).attr("href")); 72 }); 73 74 $('#modal, #modal_lg, #modal_lmd').on('click', '.btn-submit', function(e){ 75 var modal = $(this).parents('.modal'); 76 var name = $(this).attr('name'); 77 e.preventDefault(); 78 modal.find('.modal-content').hide(); 79 if($('input[type="file"]', modal).length>0) { 80 var data = new FormData(); 81 $.each($('input[type="file"]')[0].files, function(key, value) { 82 data.append(key, value); 83 }); 84 $.ajax({ 85 url: $('form', modal).prop('action')+'?'+$('form', modal).serialize()+'&'+$(this).prop('name')+'='+$(this).val(), 86 type: 'POST', 87 data: data, 88 cache: false, 89 processData: false, 90 contentType: false, 91 done: function(data){ 92 $('.modal-content', modal).html(data); 93 $('.modal-content', modal).show(); 94 if(data === '') { 95 if (typeof tablereload === "function") { 96 tablereload(); 97 } 98 modal.modal('toggle'); 99 $('.modal-content', modal).html(''); 100 } 101 }, 102 fail: function(data){ 103 $('.modal-content', modal).html(data.responseText); 104 } 105 }); 106 } else { 107 $.post( 108 $('form', modal).prop('action'), 109 $('form', modal).serialize() 110 ).done(function(data) { 111 $('.modal-content', modal).html(data); 112 $('.modal-content', modal).show(); 113 if(data === '') { 114 $('.modal-content', modal).html(''); 115 modal.modal('toggle'); 116 try_tablereload(); 117 } 118 }).fail(function(data){ 119 $('.modal-content', modal).html(data.responseText); 120 }); 121 } 122 }); 123 $('#modal_mail').on('click', '.btn-submit', function(e){ 124 var modal = $(this).parents('.modal'); 125 var name = $(this).attr('name'); 126 e.preventDefault(); 127 if($('input[type="file"]', modal).length>0) { 128 var data = new FormData(); 129 $.each($('input[type="file"]')[0].files, function(key, value) { 130 data.append(key, value); 131 }); 132 $.ajax({ 133 url: $('form', modal).prop('action')+'?'+$('form', modal).serialize()+'&'+$(this).prop('name')+'='+$(this).val(), 134 type: 'POST', 135 data: data, 136 cache: false, 137 processData: false, 138 contentType: false, 139 done: function(data){ 140 if(data === '') { 141 if (typeof tablereload === "function") { 142 tablereload(); 143 } 144 modal.hide(); 145 //$('.modal-content', modal).html(''); 146 } 147 }, 148 fail: function(data){ 149 //$('.modal-content', modal).html(data.responseText); 150 } 151 }); 152 } else { 153 $.post( 154 $('form', modal).prop('action'), 155 $('form', modal).serialize() 156 ).done(function(data) { 157 //$('.modal-content', modal).html(data); 158 //$('.modal-content', modal).show(); 159 if(data === '') { 160 modal.hide(); 161 //$('.modal-content', modal).html(''); 162 try_tablereload(); 163 } 164 }).fail(function(data){ 165 //$('.modal-content', modal).html(data.responseText); 166 }); 167 } 168 }); 169 170 $('body').on('hidden.bs.modal', '.modal', function () { 171 $(this).removeData('bs.modal'); 172 try_tablereload(); 173 /*if($(this).prop('id')=='modal_fscreen') { 174 toggleFullScreen(); 175 } */ 176 }); 177 178 $('body').on('shown.bs.modal', '.modal', function (e) { 179 var invoker = $(e.relatedTarget); 180 if(invoker.data('size') == 'large') { 181 $('.modal-dialog').addClass('modal-lg'); 182 } 183 /*if($(this).prop('id')=='modal_fscreen') { 184 toggleFullScreen(); 185 }*/ 186 }); 187 188 $('#modal, #modal_lg, #modal_lmd').on('hidden.bs.modal', function(){ 189 $('.modal-content').html(''); 190 $('body').removeClass('modal-open'); 191 $('.modal-backdrop').remove(); 192 }); 193 $('.notifications-menu .label-warning').html($('.status_1').length); 194 $('.btn-vertudo').on('click', function(){ 195 if($(this).data('status')==1) { 196 $('.status_2').show(); 197 $(this).data('status', '2').html('Filtrar por não lido'); 198 $('.notifications-menu .label-warning').html($('.status_1, .status_2').length); 199 $('.status_3').addClass('hide'); 200 } else { 201 $('.status_2').hide(); 202 $(this).data('status', '1').html('Ver tudo'); 203 $('.notifications-menu .label-warning').html($('.status_1').length); 204 if($('.status_1').length==0) { 205 $('.status_3').removeClass('hide'); 206 } else { 207 $('.status_3').addClass('hide'); 208 } 209 } 210 }); 211 $('[data-toggle="dropdown2"]').on('click', function(){ 212 if($(this).parent().hasClass('open')) { 213 $(this).parent().removeClass('open'); 214 } else { 215 $(this).parent().addClass('open'); 216 } 217 }); 218 $('.content-wrapper').on('click', function(){ 219 if($('.dropdown-menu').parent().hasClass('open')) { 220 $('.dropdown-menu').parent().removeClass('open'); 221 } 222 }); 223 if($().rateYo) { 224 if($('.rating').length>0) { 225 $('.rating').rateYo({ 226 starWidth: '30px', 227 fullStar: true, 228 rating: ($('input[name="nota"]').val()!=='' ? $('input[name="nota"]').val() : 0), 229 onChange: function(currentRating, $el){ 230 $('input[name="nota"]').val(currentRating); 231 } 232 }); 233 } 234 if($('.rated').length>0) { 235 $('.rated').rateYo({ 236 starWidth: '30px', 237 //fullStar: true, 238 //rating: ($(this).next('input[name="nota"]').val()!=='' ? $(this).next('input[name="nota"]').val() : 0), 239 readOnly: true 240 }); 241 } 242 } 243 if($().select2) { 244 $('.select2').select2({ 245 language: 'pt-BR' 246 }); 247 } 248 $('.abrePagina').on('click', function(){ 249 $('.pat_paginas').addClass('hide'); 250 $('#'+$(this).data('pagina')).removeClass('hide'); 251 }); 252}); 253 254function toFloat(str) 255{ 256 return parseFloat(str.replace('.','').replace(',','.')); 257} 258 259function try_tablereload() 260{ 261 try { 262 tablereload(); 263 } 264 catch(err) { 265 } 266}
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.