1/* ########################################################### 2## PROGETTO : Donaform 3## SVILUPPO : Salvatore Fazzalari 4## COPY : AeB Solutions Srl 5## FILE : sys/jscript/funzioni.donaform.js 6## INFO : File delle funzioni Main Javascript di Donaform 7## ######################################################## */ 8 9 10/* ######################## 11## VARIABILI GLOBALI 12## ##################### */ 13//var messaggio_errore = "<strong>Oooops</strong><br/>Non riesco a comunicare con il server centrale.<br/>Per favore, prova a ripetere l'operazione fra qualche istante."; 14var messaggio_errore = "<strong>Oooops</strong><br/>Sono mortificato, ma al momento non posso prendere in carico la tua richiesta.<br/>Per favore, ti chiedo di ripetere l'operazione più tardi."; 15var messaggio_attesa = "<strong>Oooops</strong><br/>La richiesta purtroppo non ha restituito il risultato che stavo aspettando per completare l'operazione.<br/>Per favore, potresti riprovare?<br/><span class=\"inciso\">Contatta l'assistenza se il problema persiste.</span>"; 16var messaggio_avviso = "<strong>Oooops</strong><br/>Si é verificato un errore che non riesco ad identificare...<br/>Per favore, contatta l'assistenza spiegando l'operazione che intendevi effettuare." 17var messaggio_fatale = "<strong>Oooops</strong><br/>Si é verificato un errore che richiede il ricaricamento dell'applicativo...<br/>Per favore, contatta l'assistenza questo errore persiste." 18 19var timeout = 10000; 20 21 22/* ######################## 23## FUNCTION fDonaformAction 24## @param act : azione 25## @param rec : invio parametri specifici 26## @param req : tipo della richiesta 27## ##################### */ 28function fDonaformAction (act, rec, req) 29{ 30 var blocco = 1; 31 var timer = 0; 32 33 req = (!req || (req == "")) ? "page" : req; 34 rec = (!rec) ? "" : rec; 35 36 var frm = ''; 37 switch (act) 38 { 39 case "": 40 return false; 41 break; 42 43 case "init": 44 bloccaInterfaccia(); 45 setTimeout( 46 function () 47 { 48 bloccaInterfaccia(false); 49 fDonaformInterfaccia(1); 50 }, 51 1500 52 ); 53 return false; 54 break; 55 } 56 57 switch (req) 58 { 59 case 'action': 60 switch (act) 61 { 62 case 'check-campi': 63 case 'ecomm-campi': 64 bloccaPagina(true, false); 65 66 var ver = false; 67 $(".sezione_obbligatori").each 68 ( 69 function() 70 { 71 var str = $(this).val(); 72 73 if (str && (str != '')) 74 { 75 var split = new Array(); 76 split = str.split('[]'); 77 78 if (split && (split.length > 0)) 79 { 80 for (var i = 0; i < split.length; i++) 81 { 82 var spl = new Array(); 83 spl = split[i].split('|'); 84 85 /* 86 spl[0] => ID radio (se checked) 87 spl[1] => ID campo 88 spl[2] => TIPO campo 89 spl[3] => [OPT] Valore di controllo 90 */ 91 92 ver = true; 93 var msg = ''; 94 95 var shk = new Array(); 96 switch (spl.length) 97 { 98 case 2: 99 shk = spl; 100 break; 101 102 case 3: 103 shk = [spl[1], spl[2]]; 104 break; 105 } 106 107 switch (shk[1]) 108 { 109 case 'bool': 110 if ($('#' + shk[0]).is(':checked') == false) 111 { 112 if ($('#' + shk[0]).is(':visible') == true) 113 { 114 msg = 'Occorre acconsentire alla sezione ' + $.trim($('#' + shk[0] + '_msg').val()) + ' per poter continuare.'; 115 ver = false; 116 } 117 } 118 break; 119 120 case 'cap': 121 if ($.trim($('#' + shk[0]).val()) == '') 122 { 123 if ($('#' + shk[0]).is(':visible') == true) 124 { 125 msg = 'Occorre inserire il CAP.<br/>Per favore, controllare.'; 126 ver = false; 127 } 128 } 129 break; 130 131 case 'civico': 132 if ($.trim($('#' + shk[0]).val()) == '') 133 { 134 if ($('#' + shk[0]).is(':visible') == true) 135 { 136 msg = 'Occorre inserire il numero civico.<br/>Per favore, controllare.'; 137 ver = false;
138 } 139 } 140 break; 141 142 case 'nazione': 143 if ($.trim($('#' + shk[0] + ' option:selected').val()) == '') 144 { 145 if ($('#' + shk[0]).is(':visible') == true) 146 { 147 msg = 'Occorre selezionare la nazione.<br/>Per favore, controllare.'; 148 ver = false; 149 } 150 } 151 break; 152 153 case 'select': 154 var sppl = new Array(); 155 sppl = shk[0].split("_"); 156 157 if (sppl[(sppl.length - 1)] != "sesso") 158 { 159 if ($.trim($('#' + shk[0] + ' option:selected').val()) == '0') 160 { 161 if ($('#' + shk[0]).is(':visible') == true) 162 { 163 msg = 'Occorre selezionare una voce dalla lista.<br/>Per favore, controllare.'; 164 ver = false; 165 } 166 } 167 } 168 break; 169 170 case 'text': 171 if (($.trim($('#' + shk[0]).val()) == '') || ($.trim($('#' + shk[0]).val()).length < 2)) 172 { 173 if ($('#' + shk[0]).is(':visible') == true) 174 { 175 msg = 'Il valore inserito risulta troppo breve.<br/>Per favore, controllare.'; 176 ver = false; 177 } 178 } 179 break; 180 } 181 182 if (ver == false) 183 { 184 avviso 185 ( 186 "attenzione", 187 msg, 188 "warning", 189 "Campo non compilato correttamente", 190 shk[0] 191 ); 192 bloccaPagina(false); 193 return false; 194 } 195 } 196 } 197 } 198 } 199 ); 200 201 if (ver == true) 202 return fDonaformAction(((act == 'ecomm-campi') ? 'ecomm' : '') + 'ver-campi', rec, req); 203 204 return false; 205 break; 206 207 case 'check-invalid': 208 $(".sezione_obbligatori").each 209 ( 210 function() 211 { 212 var str = $(this).val(); 213 214 if (str && (str != '')) 215 { 216 var split = new Array(); 217 split = str.split('[]'); 218 219 if (split && (split.length > 0)) 220 { 221 for (var i = 0; i < split.length; i++) 222 { 223 var spl = new Array(); 224 spl = split[i].split('|'); 225; 226 /* 227 spl[0] => ID radio (se checked) 228 spl[1] => ID campo 229 spl[2] => TIPO campo 230 spl[3] => [OPT] Valore di controllo 231 */ 232 var msg = ''; 233 234 var shk = new Array(); 235 switch (spl.length) 236 { 237 case 2: 238 shk = spl; 239 break; 240 241 case 3: 242 shk = [spl[1], spl[2]]; 243 break; 244 } 245 246 switch (shk[1]) 247 { 248 case 'bool': 249 if ($('#' + shk[0]).is(':checked') == false) 250 { 251 if ($('#' + shk[0]).is(':visible') == true) 252 { 253 $('#' + shk[0]).focus(); 254 return false; 255 } 256 } 257 break; 258 259 case 'cap': 260 if ($.trim($('#' + shk[0]).val()) == '') 261 { 262 if ($('#' + shk[0]).is(':visible') == true) 263 { 264 $('#' + shk[0]).focus(); 265 return false; 266 } 267 } 268 break; 269 270 case 'civico': 271 if ($.trim($('#' + shk[0]).val()) == '') 272 { 273 if ($('#' + shk[0]).is(':visible') == true) 274 { 275 $('#' + shk[0]).focus(); 276 return false; 277 } 278 } 279 break; 280 281 case 'nazione': 282 if ($.trim($('#' + shk[0] + ' option:selected').val()) == '') 283 { 284 if ($('#' + shk[0]).is(':visible') == true) 285 { 286 $('#' + shk[0]).focus(); 287 return false; 288 } 289 } 290 break; 291 292 case 'select': 293 if ($.trim($('#' + shk[0] + ' option:selected').val()) == '0') 294 { 295 if ($('#' + shk[0]).is(':visible') == true) 296 { 297 msg = 'Occorre selezionare una voce dalla lista.<br/>Per favore, controllare.'; 298 ver = false;
299 } 300 } 301 break; 302 303 case 'text': 304 if (($.trim($('#' + shk[0]).val()) == '') || ($.trim($('#' + shk[0]).val()).length < 3)) 305 { 306 if ($('#' + shk[0]).is(':visible') == true) 307 { 308 $('#' + shk[0]).focus(); 309 return false; 310 } 311 } 312 break; 313 } 314 } 315 } 316 } 317 } 318 ); 319 return false; 320 break; 321 322 case 'filtra-lista': 323 var tmp = new Array(); 324 tmp = rec.split('[]'); 325 326 var cur = $.trim($('#sezione_' + tmp[0] + '_paginazione_filtro_selected').val()); 327 if (cur != tmp[1]) 328 { 329 $('.sezione_' + tmp[0] + '_paginazione_filtri_active').removeClass('sezione_' + tmp[0] + '_paginazione_filtri_active'); 330 331 $('.sezione_' + tmp[0] + '_paginazione_filtro_' + tmp[1]).addClass('sezione_' + tmp[0] + '_paginazione_filtri_active'); 332 $('#sezione_' + tmp[0] + '_paginazione_filtro_selected').val(tmp[1]); 333 334 $('#sezione_' + tmp[0] + '_paginazione_' + cur + '_div').hide(); 335 $('#sezione_' + tmp[0] + '_paginazione_' + tmp[1] + '_div').show(); 336 } 337 return false; 338 break; 339 340 case 'load-async': 341 var tmp = new Array(); 342 tmp = rec.split('[]'); 343 344 rec = rec.replace(/</gi, "[<]"); 345 rec = rec.replaceAll(/>/gi, "[>]"); 346 rec = rec.replace(/%3C/gi, "[<]"); 347 rec = rec.replace(/%3E/gi, "[>]"); 348 break; 349 350 case 'sel-pagamento': 351 var id = $(rec).attr('id'); 352 353 var elem = $('.donaform-pagamento-selected')[0]; 354 if (elem) 355 { 356 var prec = $(elem).attr('id'); 357 358 if (prec == id) 359 return false; 360 361 $('#' + prec).removeClass('donaform-pagamento-selected'); 362 $('#' + prec + '-div-hidden').fadeOut(); 363 setTimeout 364 ( 365 function () 366 { 367 $('.' + prec + '_form_fields').val(''); 368 $('.' + prec + '_form_fields').attr('disabled', true); 369 }, 370 500 371 ); 372 } 373 374 var t_titolo = $.trim($('#' + id + '_tips_titolo').val()); 375 var t_testo = $.trim($('#' + id + '_tips_testo').val()); 376 377 if ((t_titolo && (t_titolo != '')) || (t_testo && (t_testo != ''))) 378 { 379 $('#tooltip_pagamento-titolo').html(t_titolo); 380 $('#tooltip_pagamento-testo').html(t_testo); 381 382 $('#tooltip_pagamento').fadeIn(); 383 } 384 else 385 $('#tooltip_pagamento').fadeOut(); 386 387 $('.donaform-pagamento-label-selected').removeClass('donaform-pagamento-label-selected'); 388 389 390 $('#' + id + '-div').addClass('donaform-pagamento-label-selected'); 391 $('#' + id).addClass('donaform-pagamento-selected'); 392 393 if ($('#' + id).is(':checked') == true) 394 { 395 $('#' + id + '-div-hidden').fadeIn(); 396 $('.' + id + '_form_fields').removeAttr('disabled'); 397 } 398 399 return false; 400 break; 401 402 case 'undo-donazione': 403 bloccaPagina(true, false); 404 405 if ($('#donaform-copyright-footer')) 406 $('#donaform-copyright-footer').fadeOut(); 407 408 $('#div-riepilogo').fadeOut(); 409 setTimeout 410 ( 411 function () 412 { 413 $('#div-riepilogo').html(''); 414 $('#div-donazione').fadeIn(); 415 416 if ($('#donaform-copyright-footer')) 417 $('#donaform-copyright-footer').fadeIn(); 418 419 bloccaPagina(false, false); 420 }, 421 1000 422 ); 423 return false; 424 break; 425 426 case 'ver-riepi': 427 frm = 'form-riepilogo'; 428 case 'ecommver-campi': 429 case 'ver-campi': 430 if (frm == '') 431 frm = 'form-donazione'; 432 433 rec = $.trim($('#' + frm).serialize()); 434 rec = rec.replace(/&/g, "[]").replace(/%3A/g, "[-]").replace(/=/g, ":"); 435 436 rec = rec.replace(/</gi, "[<]"); 437 rec = rec.replaceAll(/>/gi, "[>]"); 438 rec = rec.replace(/%3C/gi, "[<]"); 439 rec = rec.replace(/%3E/gi, "[>]"); 440 break; 441 442 default: 443 } 444 445 if (blocco == 1) 446 { 447 timer = 500; 448 bloccaPagina(true, false); 449 } 450 break; 451 452 case 'page': 453 if (blocco == 1) 454 { 455 timer = 1000; 456 bloccaPagina(); 457 } 458 break; 459 } 460 461 setTimeout 462 ( 463 function () 464 { 465 var request = $.ajax( 466 { 467 url : "?", 468 type : "POST", 469 data : 470 { 471 req, 472 act, 473 rec 474 }, 475 dataType: "html" 476 } 477 ); 478 479 request.done( 480 function(msg) 481 { 482 var risposta = new Array(); 483 risposta = msg.split('|||'); 484 485 switch (req) 486 { 487 case 'action': 488 if (blocco == 1) 489 bloccaPagina(false, false); 490 break; 491 492 case 'page': 493 if (blocco == 1) 494 bloccaPagina(false); 495 break; 496 } 497 498 switch (risposta[0]) 499 { 500 case "OK": 501 switch (req) 502 { 503 case 'action': 504 switch (act) 505 { 506 case 'ecommver-campi': 507 fDonazioniStoreAction('cart', '4'); 508 return false;
509 break; 510 511 case 'load-async': 512 var sel = tmp[0].replace('act:', ''); 513 var n = tmp[1].replace('n:', ''); 514 var c = tmp[2].replace('c:', ''); 515 516 switch (sel) 517 { 518 case 'donaform-fundraising-page': 519 $('#donazioni_fundraising_pagina').hide(); 520 521 setTimeout(() => { 522 $('#donazioni_fundraising_pagina').html(risposta[1]); 523 setTimeout(() => { 524 $('#donazioni_fundraising_pagina').fadeIn(); 525 document.getElementById('donazioni_fundraising_div_container').parentNode.parentNode.scrollIntoView({ behavior: 'smooth' }); 526 }, 125); 527 }, 25); 528 break; 529 530 case 'donaform-fundraising-select': 531 $('#donazioni_fundraising_elenco_campagne').hide(); 532 533 setTimeout(() => { 534 $('#donazioni_fundraising_dettagli').html(risposta[1]); 535 setTimeout(() => { 536 $('#donazioni_fundraising_dettagli').fadeIn(); 537 document.getElementById('donazioni_fundraising_div_container').parentNode.parentNode.scrollIntoView({ behavior: 'smooth' }); 538 $('#id_campagna').val($.trim($('#donazioni_fundraising_progetto_riferimento').val())); 539 }, 125); 540 }, 25); 541 break; 542 543 case 'donaform-fundraising-select-filtro': 544 $('#donazioni_fundraising_elenco_campagne_div').hide(); 545 546 setTimeout(() => { 547 $('#donazioni_fundraising_elenco_campagne_div').html(risposta[1]); 548 setTimeout(() => { 549 $('#donazioni_fundraising_elenco_campagne_div').fadeIn(); 550 document.getElementById('donazioni_fundraising_div_container').parentNode.parentNode.scrollIntoView({ behavior: 'smooth' }); 551 }, 125); 552 }, 25); 553 break; 554 555 case 'donaform-showcase': 556 $('#donazioni_vetrina_' + n).html(risposta[1]); 557 showcaseCartDonazione(c, n); 558 break; 559 560 case 'donaform-showprod': 561 showprodCartDonazione(c, n, risposta[1]); 562 break; 563 564 case 'donaform-variante': 565 var spl = new Array(); 566 spl = risposta[1].split('[]'); 567 568 switch (spl[0]) 569 { 570 case 'NODISP': 571 $('#donazioni_vetrina_prodotto_checkbox_' + n).prop('checked', false); 572 selectCartDonazioneProdotto(n, '0'); 573 574 $('#donazioni_vetrina_prodotto_vrnt_' + n).val('0'); 575 $('#donazioni_vetrina_prodotto_disp_' + n).val('0'); 576 $('#donazioni_vetrina_prodotto_' + n + '_esiste').hide(); 577 $('#donazioni_vetrina_prodotto_' + n + '_nonesiste_testo').html('- non disponibile -'); 578 $('#donazioni_vetrina_prodotto_' + n + '_nonesiste').fadeIn(); 579 break; 580 581 case 'SEL': 582 $('#donazioni_vetrina_prodotto_vrnt_' + n).val(spl[1]); 583 $('#donazioni_vetrina_prodotto_disp_' + n).val(spl[2]); 584 585 if (spl[2] == '0') 586 { 587 if (spl[3] != '1') 588 { 589 $('#donazioni_vetrina_prodotto_checkbox_' + n).prop('checked', false); 590 selectCartDonazioneProdotto(n, '0'); 591 592 $('#donazioni_vetrina_prodotto_' + n + '_esiste').hide(); 593 $('#donazioni_vetrina_prodotto_' + n + '_nonesiste_testo').html('- terminato -'); 594 $('#donazioni_vetrina_prodotto_' + n + '_nonesiste').fadeIn(); 595 } 596 else 597 { 598 $('#donazioni_vetrina_prodotto_' + n + '_nonesiste').hide(); 599 $('#donazioni_vetrina_prodotto_' + n + '_esiste').fadeIn(); 600 } 601 } 602 else 603 { 604 $('#donazioni_vetrina_prodotto_' + n + '_nonesiste').hide(); 605 $('#donazioni_vetrina_prodotto_' + n + '_esiste').fadeIn(); 606 } 607 break; 608 609 case 'NOSEL': 610 default: 611 $('#donazioni_vetrina_prodotto_checkbox_' + n).prop('checked', false); 612 selectCartDonazioneProdotto(n, '0'); 613
614 $('#donazioni_vetrina_prodotto_vrnt_' + n).val('0'); 615 $('#donazioni_vetrina_prodotto_disp_' + n).val('0'); 616 $('#donazioni_vetrina_prodotto_' + n + '_esiste').hide(); 617 $('#donazioni_vetrina_prodotto_' + n + '_nonesiste').hide(); 618 } 619 break; 620 } 621 break; 622 623 case 'ver-campi': 624 if ($('#donaform-copyright-footer')) 625 $('#donaform-copyright-footer').fadeOut(); 626 627 $('#div-donazione').fadeOut(); 628 $('#div-riepilogo').html(risposta[1]); 629 setTimeout 630 ( 631 function () 632 { 633 $('#div-riepilogo').fadeIn(); 634 635 if ($('#donaform-copyright-footer')) 636 $('#donaform-copyright-footer').fadeIn(); 637 638 document.getElementById('div-riepilogo').scrollIntoView({ behavior: 'smooth' }); 639 }, 640 1000 641 ); 642 break; 643 644 case 'ver-riepi': 645 if ($('#donaform-copyright-footer')) 646 $('#donaform-copyright-footer').fadeOut(); 647 648 $('#div-riepilogo').fadeOut(); 649 $('#div-donazione').html(risposta[1]); 650 setTimeout 651 ( 652 function () 653 { 654 $('#div-donazione').fadeIn(); 655 $('#div-riepilogo').html(''); 656 657 if ($('#donaform-copyright-footer')) 658 $('#donaform-copyright-footer').fadeIn(); 659 660 document.getElementById('div-donazione').scrollIntoView({ behavior: 'smooth' }); 661 }, 662 1000 663 ); 664 break; 665 } 666 break; 667 668 case 'modal': 669 modale( 670 (risposta[1] ? risposta[1] : ""), 671 (risposta[2] ? risposta[2] : ""), 672 (risposta[3] ? risposta[3] : ""), 673 (risposta[4] ? risposta[4] : ""), 674 (risposta[5] ? risposta[5] : ""), 675 (risposta[6] ? risposta[6] : "") 676 ); 677 break; 678 679 case 'page': 680 $('#fstruct_contenitore').html(risposta[1]); 681 break; 682 } 683 break; 684 685 case "WRN": 686 avviso 687 ( 688 "attenzione", 689 (risposta[1] ? risposta[1] : messaggio_avviso), 690 "warning", 691 (risposta[2] ? risposta[2] : ""), 692 (risposta[3] ? risposta[3] : ""), 693 5000 694 ); 695 696 if ($("#ecommerce-store-spedizione").length) 697 $("#ecommerce-store-spedizione").show(); 698 break; 699 700 case "KO": 701 avviso 702 ( 703 "attenzione", 704 (risposta[1] ? risposta[1] : messaggio_avviso), 705 "error", 706 (risposta[2] ? risposta[2] : "") 707 ); 708 709 if ($("#ecommerce-store-spedizione").length) 710 $("#ecommerce-store-spedizione").show(); 711 break; 712 713 default: 714 avviso 715 ( 716 "attenzione", 717 (risposta[0] ? risposta[0] : messaggio_avviso), 718 "error" 719 ); 720 721 if ($("#ecommerce-store-spedizione").length) 722 $("#ecommerce-store-spedizione").show(); 723 } 724 } 725 ); 726 727 request.fail( 728 function(jqXHR, textStatus) 729 { 730 avviso 731 ( 732 "attenzione", 733 messaggio_errore, 734 "warning" 735 ); 736 bloccaPagina(false, false); 737 738 if ($("#ecommerce-store-spedizione").length) 739 $("#ecommerce-store-spedizione").show(); 740 } 741 ); 742 }, 743 timer 744 ); 745 return false; 746} 747 748 749/* ######################## 750## FUNCTION fDonaformInterfaccia 751## @param mostra : 0 = nasconde, 1 = mostra 752## ##################### */ 753function fDonaformInterfaccia(mostra) 754{ 755 if (!mostra) 756 mostra = 0; 757 758 switch (mostra) 759 { 760 case 1: 761 setTimeout 762 ( 763 function() 764 { 765 if ($('#fstruct_contenitore').length) 766 setTimeout( function () { $('#fstruct_contenitore').show('fade', {}, 1000); }, 500); 767 }, 768 500 769 ); 770 break; 771 772 case 2: 773 if ($('#fstruct_contenitore').length) 774 $('#fstruct_contenitore').hide('fade', {}, 750); 775 break; 776 777 default: 778 if ($('#fstruct_contenitore').length) 779 $('#fstruct_contenitore').hide('fade', {}, 750); 780 781 setTimeout(function() { location.reload(); }, 750); 782 } 783 return false;
784} 785 786/* ######################## 787## FUNCTION fDonaformLink 788## @param page : pagina da caricare 789## @param target : target del link 790## ##################### */ 791function fDonaformLink (page, target) 792{ 793 if (!page) 794 page = '/'; 795 796 if (!target) 797 window.location.href = page; 798 else 799 window.open(page); 800 801 return false; 802} 803 804 805 806/* ######################## 807## AVVIO Automatico 808## ##################### */ 809$(window).on("load", 810 function() 811 { 812 $('a').click 813 ( 814 function (e) 815 { 816 if (this.className != 'myosotis_activelink') 817 e.preventDefault(); 818 } 819 ); 820 fDonaformAction("init"); 821 822 var btn = $('#bottone-donazione')[0]; 823 var frm = $('#form-donazione')[0]; 824 825 if (btn) 826 btn.addEventListener 827 ( 828 'click', 829 function(event) 830 { 831 832 if (frm.checkValidity() === false) 833 { 834 event.preventDefault(); 835 event.stopPropagation(); 836 setTimeout 837 ( 838 function () 839 { 840 if ($('.was-validated .form-control:invalid').first().offset()) 841 { 842 $('html,body').animate({scrollTop: $('.was-validated .form-control:invalid').first().offset().top - 50}, 'slow'); 843 setTimeout(function () { $('.was-validated .form-control:invalid').first().focus(); }, 250); 844 } 845 else 846 return fDonaformAction('check-campi', 'donazione', 'action'); 847 }, 848 100 849 ); 850 } 851 else 852 { 853 event.preventDefault(); 854 event.stopPropagation(); 855 return fDonaformAction('check-campi', 'donazione', 'action'); 856 } 857 frm.classList.add('was-validated'); 858 }, 859 false 860 ); 861 862 return false; 863 } 864);
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.