1/** toMoney 2 * @param c Precisión 3 * @param d Separador decimal 4 * @param t Separador Miles 5 * @param locale idioma 6 * @param currency simbolo moneda 7 * @return Precio formateado 8 */ 9 10var Money = function (c, locale, currency, country){ 11 12 var n = this, 13 c = isNaN(c = Math.abs(c)) ? 2 : c, 14 d = d == undefined ? "." : d, 15 t = t == undefined ? "," : t, 16 s = n < 0 ? "-" : "", 17 i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", 18 j = (j = i.length) > 3 ? j % 3 : 0; 19 20 if(country=='198' && currency === 'â¬') { 21 d=","; 22 t="."; 23 mascara= "%s " + currency; 24 } else { 25 d = "."; 26 t = ","; 27 mascara = currency + "%s"; 28 } 29 number=s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); 30 numberFinal=mascara.replace("%s",number); 31 return numberFinal; 32}; 33 34Number.prototype.toMoney = Money; 35String.prototype.toMoney = Money; 36 37function getPricing(unitPrice,months,vat,locale,currency,numeric) { 38 39 if (isNaN(unitPrice)) { 40 unitPrice = 0; 41 }; 42 43 total = unitPrice * months; 44 totalVat = total * vat/100; 45 totalWithTotalVat = parseFloat(total) + parseFloat(totalVat); 46 47 if (numeric) { 48 return {"total":parseFloat(total),"totalVat":parseFloat(totalVat),"totalWithTotalVat":parseFloat(totalWithTotalVat)}; 49 } // 50 51 return {"total":parseFloat(total).toMoney(2,locale,currency),"totalVat":parseFloat(totalVat).toMoney(2,locale,currency),"totalWithTotalVat":parseFloat(totalWithTotalVat).toMoney(2,locale,currency)}; 52 53} 54 55 56jQuery(document).ready(function($) { 57 58 $('.btn-confirm').click(function(e) { 59 60 var message = $(this).attr('data-message'); 61 62 if ('undefined' != typeof message ) { 63 64 if(!confirm(message)) { 65 e.preventDefault(); 66 } 67 68 } 69 70 }); 71 72 //$(botonMin).appendTo('.breadcrumb,.resize-btn'); 73 $(botonMin).appendTo($(".page-header")[0]); 74 $(botonMin).appendTo($(".section-header")[0]); 75 76 $('.glyphicon-resize-full,.glyphicon-resize-small').click( function (e) { 77 78 if ( $(e.target).hasClass('glyphicon-resize-full') ) { 79 $(e.target).removeClass('glyphicon-resize-full') 80 $(e.target).addClass('glyphicon-resize-small') 81 //loadingIcon($(e.target),true); 82 grabarMinMax($(e.target), 1); 83 } else { 84 $(e.target).removeClass('glyphicon-resize-small') 85 $(e.target).addClass('glyphicon-resize-full') 86 //loadingIcon($(e.target),true); 87 grabarMinMax($(e.target), 0); 88 89 } // 90 91 } ); 92 93 // Control de Tabs activas por URL 94 // 95 if ( document.location.href.split('#').length > 0 && $(".nav-tabs") ) { 96 97 $(".nav-tabs a[href='#"+(document.location.href.split('#')[1])+"']").tab('show'); 98 99 $(".nav-tabs a[href^='#']").parent().not('.active').find('a').click(function (e) { 100 if ( $(e.target).is(':link') ) { 101 obj = $(e.target); 102 }else{ 103 obj = $(e.target).parents('a'); 104 } 105 console.log(obj); 106 107 document.location.href = document.location.href.split('#')[0]+obj.attr('href'); 108 }); 109 110 } // if ( document.location.href.split('#').length > 0 && $(".nav-tabs") != null ) 111 112}); 113 114function loadingIcon (obj, action) { 115 if (action) { 116 //$('body').addClass('loading'); 117 $(obj).addClass('disabled'); 118 }else{ 119 //$('body').removeClass('loading'); 120 $(obj).removeClass('disabled'); 121 } 122} // function loadingIcon 123 124 125$(".mask-telephone-es").mask("+99 (999) 99-99-99",{placeholder:"+34 (___) __-__-__"}); 126$(".mask-ip").ipAddress(); 127$(".mask-date-es").mask("99/99/9999",{placeholder:"dd/mm/yyyy"}); 128$(".mask-date-en").mask("9999-99-99",{placeholder:"yyyy-mm-dd"}); 129$.mask.definitions['A']='[A-Z]'; 130$(".mask-dni").mask("99999999A",{placeholder:"99999999A"}); 131$(".mask-nif").mask("A99999999A",{placeholder:"X99999999A"}); 132 133function grabarMinMax (obj, action) { 134 actionString=action.toString(); 135 ageCookie="31536000"; 136 setCookie('maxPanel',actionString,{'path':'/', 'max-age': ageCookie, 'samesite': 'strict'}); 137 if (actionString=="1"){ 138 iconMinMax = 'glyphicon-resize-small'; 139 maximizeScreen(); 140 }else{ 141 minimizeScreen(); 142 iconMinMax = 'glyphicon-resize-full'; 143 } 144} // 145 146function maximizeScreen () { 147 $('.well2').removeClass('well2').addClass('well2-lg');
148 $('.well2-padding').removeClass('well2-padding').addClass('well2-padding-lg'); 149 $('.well-white').removeClass('well-white').addClass('well-white-lg'); 150 $('.well-form').removeClass('well-form').addClass('well-form-lg'); 151 $('.breadcrumb').css('max-width','none'); 152 $('.section-header').css('max-width','none'); 153 $('.well-form-sm').removeClass('well-form-sm').addClass('well-form-lg-sm'); 154} 155 156function minimizeScreen () { 157 $('.well2-lg').removeClass('well2-lg').addClass('well2'); 158 $('.well2-padding-lg').removeClass('well2-padding-lg').addClass('well2-padding'); 159 $('.well-white-lg').removeClass('well-white-lg').addClass('well-white'); 160 $('.well-form-lg').removeClass('well-form-lg').addClass('well-form'); 161 $('.breadcrumb').css('max-width','1080px'); 162 $('.section-header').css('max-width','1080px'); 163 $('.well-form-lg-sm').removeClass('well-form-lg-sm').addClass('well-form-sm'); 164} 165 166function setCookie(name, value, options = {}) { 167 if (options.expires instanceof Date) { 168 options.expires = options.expires.toUTCString(); 169 } 170 171 let updatedCookie = encodeURIComponent(name) + "=" + encodeURIComponent(value); 172 for (let optionKey in options) { 173 updatedCookie += "; " + optionKey; 174 let optionValue = options[optionKey]; 175 if (optionValue !== true) { 176 updatedCookie += "=" + optionValue; 177 } 178 } 179 document.cookie = updatedCookie; 180} 181function valueCookie(namecookie){ 182 misCookies = document.cookie; 183 listaCookies = misCookies.split(";"); 184 for (i in listaCookies) { 185 busca = listaCookies[i].search(namecookie); 186 if (busca > -1) { 187 micookie=listaCookies[i]; 188 igual = micookie.indexOf("="); 189 valor = micookie.substring(igual+1); 190 return valor.toString(); 191 } 192 } 193} 194 195/* Funciones agregadas por Grego */ 196/* 197$(function(){ 198 $('table').each(function() { 199 if($(this).find('thead').length > 0 && $(this).find('th').length > 0) { 200 // Clone <thead> 201 var $w = $(window), 202 $t = $(this), 203 $thead = $t.find('thead').clone(), 204 $col = $t.find('thead, tbody').clone(); 205 206 // Add class, remove margins, reset width and wrap table 207 $t 208 .addClass('sticky-enabled') 209 .css({ 210 margin: 0, 211 width: '100%' 212 }).wrap('<div class="sticky-wrap" />'); 213 214 if($t.hasClass('overflow-y')) $t.removeClass('overflow-y').parent().addClass('overflow-y'); 215 216 // Create new sticky table head (basic) 217 $t.after('<table class="sticky-thead" />'); 218 219 // If <tbody> contains <th>, then we create sticky column and intersect (advanced) 220 if($t.find('tbody th').length > 0) { 221 $t.after('<table class="sticky-col" /><table class="sticky-intersect" />'); 222 } 223 224 // Create shorthand for things 225 var $stickyHead = $(this).siblings('.sticky-thead'), 226 $stickyCol = $(this).siblings('.sticky-col'), 227 $stickyInsct = $(this).siblings('.sticky-intersect'), 228 $stickyWrap = $(this).parent('.sticky-wrap'); 229 230 $stickyHead.append($thead); 231 232 $stickyCol 233 .append($col) 234 .find('thead th:gt(0)').remove() 235 .end() 236 .find('tbody td').remove(); 237 if($t.find('thead th:first-child').text() == "#") 238 { 239 var lastScrollLeft = 0; 240 $('.sticky-wrap').scroll(function() { 241 var documentScrollLeft = $('.sticky-wrap').scrollLeft(); 242 if (lastScrollLeft != documentScrollLeft) { 243 lastScrollLeft = documentScrollLeft; 244 if(lastScrollLeft > 0) 245 { 246 valor = $('.sticky-thead thead th:nth-child(2)').text(); 247 $stickyInsct.html('<thead><tr><th>'+valor+'</th></tr></thead>'); 248 $('.sticky-col thead th:first-child').text(valor); 249 } 250 } 251 }); 252 }else{ 253 $stickyInsct.html('<thead><tr><th>'+$t.find('thead th:first-child').html()+'</th></tr></thead>'); 254 } 255 256 257 258 259 // Set widths 260 var setWidths = function () { 261 $t 262 .find('thead th').each(function (i) { 263 $stickyHead.find('th').eq(i).width($(this).width()); 264 }) 265 .end() 266 .find('tr').each(function (i) { 267 $stickyCol.find('tr').eq(i).height($(this).height()); 268 }); 269 270 // Set width of sticky table head 271 $stickyHead.width($t.width()); 272 273 // Set width of sticky table col 274 $stickyCol.find('th').add($stickyInsct.find('th')).width($t.find('thead th').width()) 275 }, 276 repositionStickyHead = function () { 277 // Return value of calculated allowance 278 var allowance = calcAllowance(); 279 280 // Check if wrapper parent is overflowing along the y-axis 281 if($t.height() > $stickyWrap.height()) { 282 // If it is overflowing (advanced layout) 283 // Position sticky header based on wrapper scrollTop() 284 if($stickyWrap.scrollTop() > 0) { 285 // When top of wrapping parent is out of view 286 $stickyHead.add($stickyInsct).css({ 287 opacity: 1, 288 top: $stickyWrap.scrollTop() 289 }); 290 } else { 291 // When top of wrapping parent is in view 292 $stickyHead.add($stickyInsct).css({ 293 opacity: 0, 294 top: 0 295 }); 296 } 297 } else { 298 // If it is not overflowing (basic layout) 299 // Position sticky header based on viewport scrollTop 300 if($w.scrollTop() > $t.offset().top && $w.scrollTop() < $t.offset().top + $t.outerHeight() - allowance) { 301 // When top of viewport is in the table itself 302 $stickyHead.add($stickyInsct).css({ 303 opacity: 1, 304 top: $w.scrollTop() - $t.offset().top + 54 305 }); 306 } else { 307 // When top of viewport is above or below table 308 $stickyHead.add($stickyInsct).css({ 309 opacity: 0, 310 top: 0 311 }); 312 } 313 } 314 }, 315 repositionStickyCol = function () { 316 if($stickyWrap.scrollLeft() > 0) { 317 // When left of wrapping parent is out of view 318 $stickyCol.add($stickyInsct).css({ 319 opacity: 1, 320 left: $stickyWrap.scrollLeft() 321 }); 322 } else { 323 // When left of wrapping parent is in view 324 $stickyCol 325 .css({ opacity: 0 }) 326 .add($stickyInsct).css({ left: 0 }); 327 } 328 }, 329 calcAllowance = function () { 330 var a = 0; 331 // Calculate allowance 332 $t.find('tbody tr:lt(3)').each(function () { 333 a += $(this).height(); 334 }); 335 336 // Set fail safe limit (last three row might be too tall) 337 // Set arbitrary limit at 0.25 of viewport height, or you can use an arbitrary pixel value 338 if(a > $w.height()*0.25) { 339 a = $w.height()*0.25; 340 } 341 342 // Add the height of sticky header 343 a += $stickyHead.height(); 344 return a; 345 }; 346 347 setWidths(); 348 349 $t.parent('.sticky-wrap').scroll($.throttle(250, function() { 350 repositionStickyHead(); 351 repositionStickyCol(); 352 })); 353 354 $w 355 .load(setWidths) 356 .resize($.debounce(250, function () { 357 setWidths(); 358 repositionStickyHead(); 359 repositionStickyCol(); 360 })) 361 .scroll($.throttle(250, repositionStickyHead)); 362 } 363 }); 364}); 365 366 367( function( window ) { 368 369'use strict'; 370// class helper functions from bonzo https://github.com/ded/bonzo 371 372function classReg( className ) { 373 return new RegExp("(^|\\s+)" + className + "(\\s+|$)"); 374} 375 376// classList support for class management 377// altho to be fair, the api sucks because it won't accept multiple classes at once 378var hasClass, addClass, removeClass; 379 380if ( 'classList' in document.documentElement ) { 381 hasClass = function( elem, c ) { 382 return elem.classList.contains( c ); 383 }; 384 addClass = function( elem, c ) { 385 elem.classList.add( c ); 386 }; 387 removeClass = function( elem, c ) { 388 elem.classList.remove( c ); 389 }; 390} 391else { 392 hasClass = function( elem, c ) { 393 return classReg( c ).test( elem.className ); 394 }; 395 addClass = function( elem, c ) { 396 if ( !hasClass( elem, c ) ) { 397 elem.className = elem.className + ' ' + c; 398 } 399 }; 400 removeClass = function( elem, c ) { 401 elem.className = elem.className.replace( classReg( c ), ' ' ); 402 }; 403} 404 405function toggleClass( elem, c ) { 406 var fn = hasClass( elem, c ) ? removeClass : addClass; 407 fn( elem, c ); 408} 409 410var classie = { 411 // full names 412 hasClass: hasClass, 413 addClass: addClass, 414 removeClass: removeClass, 415 toggleClass: toggleClass, 416 // short names 417 has: hasClass, 418 add: addClass, 419 remove: removeClass, 420 toggle: toggleClass 421}; 422 423// transport 424if ( typeof define === 'function' && define.amd ) { 425 // AMD 426 define( classie ); 427} else { 428 // browser global 429 window.classie = classie; 430} 431 432})( window ); 433 434$(document).ready(function() { 435 436 function toggleMenu() { 437 if( isOpen ) { 438 classie.remove( bodyEl, 'show-menu' ); 439 } 440 else { 441 classie.add( bodyEl, 'show-menu' ); 442 } 443 isOpen = !isOpen; 444 } 445 446 init(); 447 448}
448)(); 449 450}); 451*/ 452 453 454 455 456 457/* Fin de las funciones agregadas por Grego */ 458
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.