1//add emotikon 2function smilesImg(pole, znaczek) { 3 smiles_pole = document.getElementById(pole); 4 smiles_pole.value = smiles_pole.value + znaczek; 5 smiles_pole.focus(); 6} 7 8 9var cms = { 10 11 version: '1.0', 12 conf: {}, 13 lang: {}, 14 15 init: function (conf) { 16 17 cms.prototypeFunc(); 18 cms.conf = conf; 19 20 $(function () { 21 cms.validationInit(); 22 cms.fixAnchors(); 23 }); 24 }, 25 26 registerSelectAll: function () { 27 28 $(document).on('click', '.select-all', function () { 29 $(this).focus().select(); 30 }); 31 }, 32 33 /* 34 * emotikony 35 * @returns {undefined} 36 */ 37 registerSmilesAdd: function () { 38 39 $(document).on('click', '.smiles-add', function () { 40 var smile = $(this), 41 field = smile.data('field'), 42 icon = smile.data('icon'); 43 if (icon) 44 $(field).val($(field).val() + ' ' + icon + ' ').focus(); 45 }); 46 }, 47 48 /* 49 * checkbox show/hide 50 * @returns {undefined} 51 */ 52 registerCheckShow: function () { 53 54 $('.check-show').each(function () { 55 var checker = $(this); 56 var selector = checker.data('selector'); 57 58 cms.showHideSelector(selector, checker.is(":checked")); 59 }); 60 61 $(document).on('click', '.check-show', function () { 62 var checker = $(this); 63 var selector = checker.data('selector'); 64 65 cms.showHideSelector(selector, checker.is(":checked")); 66 }); 67 }, 68 69 /* 70 * pokaż ukryj element 71 * @param {string} selector - selektor z jquery 72 * @param {boolean} show - true - pokaż 73 * @returns {undefined} 74 */ 75 showHideSelector: function (selector, show) { 76 if (show) 77 $(selector).slideDown(); 78 else 79 $(selector).slideUp(); 80 }, 81 82 registerSelectdeselect: function () { 83 $(document).on('click', '.selectdeselect', function () { 84 85 var data = $(this).data(); 86 var typ = parseInt(data.typ); 87 $('form[name="' + data.form + '"]').find('input[type="checkbox"][name^="' + data.tab + '"]').prop("checked", function (index, val) { 88 if (typ === 3) 89 return !val; 90 else if (typ === 2) 91 return false; 92 93 return true; 94 }); 95 }); 96 }, 97 98 registerCite: function () { 99 100 $(document).on('click', '.cite-btn', function () { 101 var data = $(this).data(); 102 103 if (data.hasOwnProperty('tr') && data.hasOwnProperty('target')) { 104 var cite = $('#' + data.tr), 105 citeTarget = $('#' + data.target); 106 107 if (cite.length > 0 && citeTarget.length > 0 && cite.val()) { 108 citeTarget.val(cite.val()); 109 cite.val(''); 110 } 111 } 112 }); 113 }, 114 115 registerSetFontSize: function () { 116 $(document).on('click', '.set-font-size', function () { 117 118 var size = parseInt(cms.getCookie('sizev')), 119 inc = $(this).data('inc'), 120 maxsize = 6, 121 minsize = 0; 122 123 if (inc === "reset") { 124 size = minsize; 125 inc = 0; 126 } else { 127 128 inc = parseInt(inc); 129 130 if (!inc) 131 inc = 0; 132 if (!size) 133 size = minsize; 134 size += inc; 135 if (size < minsize) 136 size = minsize; 137 if (size > maxsize) 138 size = maxsize; 139 140 } 141 $("#csssize").attr("href", 'public/css/sizes/' + size + '.css'); 142 143 cms.setCookie('sizev', size, 24 * 30); 144 145 return false; 146 147 }); 148 }, 149 150 checkLogin: function () { 151 152 if (cms.conf.getData('loginextend')) { 153 setInterval(function () { 154 cms.getLoginInfo(); 155 }, parseInt(cms.conf.getData('loginextend_duration'))); 156 } 157 }, 158 159 getLoginInfo: function () { 160 161 var url = {}; 162 163 url['act'] = 'users_checklogin'; 164 165 $.ajax({ 166 type: "GET", 167 url: "index.php", 168 data: url, 169 cache: false, 170 async: true, 171 success: function (returnval) { 172 try 173 { 174 var jobj = JSON && JSON.parse(returnval) || $.parseJSON(returnval); 175 if (jobj.status !== "ok") { 176 swal({ 177 title: cms.lang.loginError, 178 text: cms.lang.loginErrorTxt, 179 confirmButtonColor: "#EF5350", 180 type: "error", 181 timer: 10000, 182 closeOnConfirm: false 183 }, function () { 184 location.href = "users/panel"; 185 }); 186 } 187 } catch (e) { 188 cms.logError(cms.lang.errorSR); 189 } 190 } 191 }); 192 }, 193 194 validationInitDefault: function (form) { 195 form.data('hadError', false); 196 form.data('submited', false); 197 198 cms.validateAddComm(form); 199 200 $(form).validate({ 201 202 ignore: ".validate-ignore", 203 errorClass: "has-error", 204 validClass: "has-success", 205 focusInvalid: false, 206 207 invalidHandler: function (event, validator) { 208 form.data('submited', true); 209 cms.validateInvalidHandler(validator); 210 $.scrollTo('#' + form.attr('name') + '-comm-section', 200, {offset: {left: 0, top: -($('.navbar-fixed-top').first().length ? $('.navbar-fixed-top').first().height() : 0)}}); 211 }, 212 showErrors: function (errorMap, errorList) { 213 cms.validateInvalidHandler(this); 214 215 this.defaultShowErrors(); 216 }, 217 highlight: function (element, errorClass, validClass) { 218 cms.validateError(element, errorClass, validClass); 219 }, 220 unhighlight: function (element, errorClass, validClass) { 221 cms.validateSuccess(element, errorClass, validClass); 222 }, 223 errorPlacement: function (error, element) { 224 cms.validateErrorPlacement(error, element); 225 } 226 }); 227 }, 228 229 validationInitCompressed: function (form) { 230 cms.validateAddComm(form); 231 $('#' + form.attr('name') + '-comm-section').append($('<ul>')); 232 $(form).validate({ 233 234 ignore: ".validate-ignore", 235 errorClass: "has-error", 236 validClass: "has-success", 237 focusInvalid: false, 238 wrapper: "li", 239 errorLabelContainer: '#' + form.attr('name') + '-comm-section ul', 240 241 showErrors: function (errorMap, errorList) { 242 cms.validateInvalidHandler(this); 243 244 this.defaultShowErrors(); 245 }, 246 invalidHandler: function (event, validator) { 247 form.data('submited', true); 248 cms.validateInvalidHandler(validator); 249 $.scrollTo('#' + form.attr('name') + '-comm-section', 200, {offset: {left: 0, top: -($('.navbar-fixed-top').first().length ? $('.navbar-fixed-top').first().height() : 0)}}); 250 }, 251 highlight: function (element, errorClass, validClass) { 252 cms.validateError(element, errorClass, validClass); 253 }, 254 unhighlight: function (element, errorClass, validClass) { 255 cms.validateSuccess(element, errorClass, validClass); 256 }, 257 errorPlacement: function (error, element) { 258 cms.validateErrorPlacement(error, element); 259 } 260 }); 261 }, 262 263 validationInitNoComm: function (form) { 264 265 $(form).validate({ 266 267 ignore: ".validate-ignore", 268 errorClass: "has-error", 269 validClass: "has-success", 270 focusInvalid: false, 271 272 showErrors: function (errorMap, errorList) { 273 this.defaultShowErrors(); 274 }, 275 invalidHandler: function (event, validator) { 276 277 }, 278 highlight: function (element, errorClass, validClass) { 279 cms.validateError(element, errorClass, validClass); 280 }, 281 unhighlight: function (element, errorClass, validClass) { 282 cms.validateSuccess(element, errorClass, validClass); 283 }, 284 errorPlacement: function (error, element) { 285 286 } 287 }); 288 }, 289 290 validationInitAlert: function (form) { 291 292 cms.validateAddComm(form); 293 $('#' + form.attr('name') + '-comm-section').append($('<div>').prop('id', form.attr('name') + '-comm-section-error-wrap')); 294 295 $(form).validate({ 296 297 ignore: ".validate-ignore", 298 errorClass: "has-error", 299 validClass: "has-success", 300 focusInvalid: false, 301 onfocusout: false, 302 onkeyup: false, 303 onclick: false, 304 wrapper: "div", 305 errorLabelContainer: '#' + form.attr('name') + '-comm-section div#' + form.attr('name') + '-comm-section-error-wrap', 306 307 showErrors: function (errorMap, errorList) { 308 this.defaultShowErrors(); 309 form.data('errorsready', true); 310 cms.validateInvalidHandlerAlert(this); 311 312 }, 313 invalidHandler: function (event, validator) { 314 315 form.data('submited', true); 316 cms.validateInvalidHandlerAlert(validator); 317 }, 318 highlight: function (element, errorClass, validClass) { 319 cms.validateError(element, errorClass, validClass); 320 }, 321 unhighlight: function (element, errorClass, validClass) { 322 cms.validateSuccess(element, errorClass, validClass); 323 }, 324 errorPlacement: function (error, element) { 325 cms.validateErrorPlacement(error, element); 326 } 327 }); 328 }, 329 330 validationInit: function () {
331 if (jQuery().validate) { 332 333 if (cms.conf.getData('ays')) { //are you sure script 334 335 $('form.ays').dirtyForms({ 336 dialog: { 337 title: cms.lang.aysTitle, 338 proceedButtonText: cms.lang.aysProceed, 339 stayButtonText: cms.lang.aysStay 340 }, 341 message: cms.lang.aysMessage 342 }); 343 344 $('form.ays').dirtyForms({ 345 dialog: { 346 347 open: function(choice, message, ignoreClass) { 348 cms.alertWarning(cms.lang.aysTitle, message, function (result) { 349 if (result) { 350 choice.proceed = false; 351 } else { 352 choice.proceed = true; 353 } 354 }, true, cms.lang.aysProceed, cms.lang.aysStay); 355 356 choice.staySelector = '.sa-confirm-button-container button.confirm'; 357 choice.proceedSelector = '.sa-confirm-button-container button.cancel'; 358 } 359 }, 360 message: cms.lang.aysMessage 361 }); 362 } 363 364 $('form.validate').each(function () { //walidacja zwykÅych formularzy 365 366 var form = $(this); 367 368 cms.validationInitDefault(form); 369 }); 370 371 $('form.validate-compressed').each(function () { //walidacja dla formularzy skompresowanych 372 373 var form = $(this); 374 375 cms.validationInitCompressed(form); 376 }); 377 378 $('form.validate-nocomm').each(function () { //walidacja bez komunikatów 379 380 var form = $(this); 381 382 cms.validationInitNoComm(form); 383 }); 384 385 $('form.validate-alert').each(function () { //walidacja z alertem 386 387 var form = $(this); 388 389 cms.validationInitAlert(form); 390 }); 391 } 392 393 $(document).on('click', '.link-confirm', function () { 394 395 var link = $(this); 396 var txt = cms.lang.actionConfirm; 397 if (link.data('confirmtxt')) { 398 txt = link.data('confirmtxt'); 399 } 400 401 cms.alertWarning(cms.lang.warning, txt, function (result) { 402 if (result) { 403 location.href = link.prop('href'); 404 } 405 }); 406 407 return false; 408 }); 409 410 }, 411 412 /* 413 * WywoÅywana przy bÅÄdnej walidacji formularz 414 * @param {type} validator 415 * @returns {undefined} 416 */ 417 validateInvalidHandlerAlert: function (validator) { 418 var errors = validator.numberOfInvalids(); 419 var form = $(validator.currentForm); 420 var submited = form.data('submited'); 421 var errorsready = form.data('errorsready'); 422 $('#' + form.attr('name') + '-comm-section-success').hide(); 423 $('#' + form.attr('name') + '-comm-section').hide(); 424 425 if (errors && submited && errorsready) { 426 427 swal({ 428 title: cms.lang.error, 429 text: $('#' + form.attr('name') + '-comm-section').html(), 430 html: true, 431 confirmButtonColor: "#EF5350", 432 type: "error", 433 timer: 10000 434 }); 435 436 form.data('submited', false); 437 form.data('errorsready', false); 438 } 439 }, 440 441 /* 442 * WywoÅywana przy bÅÄdnej walidacji formularz 443 * @param {type} validator 444 * @returns {undefined} 445 */ 446 validateInvalidHandler: function (validator) { 447 var errors = validator.numberOfInvalids(); 448 var form = $(validator.currentForm); 449 var hadError = form.data('hadError'); 450 var submited = form.data('submited'); 451 if (errors && submited) { 452 $('#' + form.attr('name') + '-comm-section-success').hide(); 453 $('#' + form.attr('name') + '-comm-section').show(); 454 455 var errorMessage = cms.validateGetErrorMsg(errors); 456 457 $('#' + form.attr('name') + '-comm-section > div').text(errorMessage); 458 459 form.data('hadError', true); 460 461 } else if (hadError && submited) { 462 $('#' + form.attr('name') + '-comm-section').hide(); 463 $('#' + form.attr('name') + '-comm-section-success').show(); 464 } 465 }, 466 467 /* 468 * Zwraca wiadomoÅÄ o iloÅci bÅÄdów 469 * @param {string} errors iloÅÄ bÅÄdów 470 * @returns {String} komunikat 471 */ 472 validateGetErrorMsg: function (errors) { 473 474 var n = parseInt(errors); 475 476 if (n === 1) { 477 return cms.lang.validateErrorMsg1.replace('{n}', errors); 478 } else if (n <= 4) { 479 return cms.lang.validateErrorMsg2.replace('{n}', errors); 480 } 481 482 return cms.lang.validateErrorMsgDefault.replace('{n}', errors); 483 }, 484 485 /* 486 * Dodaje ukryty alert z informacjÄ o iloÅci bÅÄdów 487 * @param {jquery} form formularz 488 * @returns {undefined} 489 */ 490 validateAddComm: function (form) { 491 492 var commtarget = form.data('commtarget'); 493 var insert = $('body').first(); 494 495 if (commtarget && $(commtarget).length) { 496 insert = $(commtarget).first(); 497 } 498 499 $('<div>').addClass('alert alert-danger alert-styled-left alert-bordered') //komunikat bÅÄdu 500 .attr('id', form.attr('name') + '-comm-section') 501 .append($('<div>')) 502 .prependTo(insert) 503 .hide(); 504 505 $('<div>').addClass('alert alert-success alert-styled-left alert-bordered') //sukces 506 .attr('id', form.attr('name') + '-comm-section-success') 507 .text(cms.lang.validateSuccessMsg) 508 .prependTo(insert) 509 .hide(); 510 }, 511 512 /* 513 * Umiejscownie komunikatu o bÅÄdzie 514 * @param {jquery} error label z bÅÄdem 515 * @param {jquery} element element którego dotyczy bÅÄ d 516 * @returns {undefined} 517 */ 518 validateErrorPlacement: function (error, element) { 519 error.addClass("help-block"); 520 521 if (element.parents('.input-group.date').length) { //kalendarz 522 error.insertAfter(element.parents(".input-group.date")); 523 } else if (element.parents('.input-group.color').length) { //colorpicker 524 error.insertAfter(element.parents(".input-group.color")); 525 } else if (element.parents('.uploader').length) { //plik 526 error.insertAfter(element.parents(".uploader")); 527 } else if (element.prop("type") === "checkbox" || element.prop("type") === "radio") { //checbox i radio 528 error.insertAfter(element.parents(".form-group").find('label')); 529 } else if (element.parents('.input-group').length) { //grupy np. input z przyciskiem 530 error.insertAfter(element.parents(".input-group")); 531 } else { //pozostaÅe 532 error.insertAfter(element); 533 } 534 }, 535 536 /* 537 * PodÅwietlenie bÅÄdu walidacji 538 * @param {jquery object} element formularza z bÅÄdem 539 * @param {string} errorClass klasa bÅÄdu 540 * @param {string} validClass klasa poprawna 541 * @returns {undefined} 542 */ 543 validateError: function (element, errorClass, validClass) { 544 var formGroup = $(element).parents('.form-group'); 545 546 if (formGroup) { 547 formGroup.removeClass(validClass).addClass(errorClass); 548 } else { 549 $(element).removeClass(validClass).addClass(errorClass); 550 } 551 }, 552 553 /* 554 * PodÅwietlenie prawidÅowej walidacji 555 * @param {jquery object} element formularza z bÅÄdem 556 * @param {string} errorClass klasa bÅÄdu 557 * @param {string} validClass klasa poprawna 558 * @returns {undefined} 559 */ 560 validateSuccess: function (element, errorClass, validClass) { 561 var formGroup = $(element).parents('.form-group'); 562 563 if (formGroup) { 564 formGroup.removeClass(errorClass).addClass(validClass); 565 } else { 566 $(element).removeClass(errorClass).addClass(validClass); 567 } 568 }, 569 570 /* 571 * Pobieranie danych za pomocÄ ajax 572 * @param {object} js object zawierajÄ cy dane do przekazania do skryptu 573 * @param {bool} czy wykonywaÄ asynchronicznie - najlepiej true, false wyjÄ tkowo 574 * @param {string} metoda POST/GET 575 * @param {bool}
575 czy informowaÄ o bÅÄdach użytkownika - true zapisuje bÅÄdy w konsoli 576 * @returns {object} cokolwiek co zwróci skrypt 577 */ 578 loadAjaxData: function (vars, async, method, silent) { 579 580 var returnjobj = {}, 581 error = ""; 582 583 $.ajax({ 584 585 type: method, 586 url: "index.php", 587 data: vars, 588 cache: false, 589 async: async, 590 success: function (returnval) { 591 592 try { 593 var jobj = JSON && JSON.parse(returnval) || $.parseJSON(returnval); 594 if (jobj.status === "ok") { 595 returnjobj = jobj; 596 } else { 597 error = jobj.error; 598 } 599 } catch (e) { 600 error = cms.lang.errorSR; 601 } 602 603 } 604 605 }); 606 607 if (silent && error) { 608 cms.logError(error); 609 } else if (error) { 610 cms.alertError(cms.lang.error, error); 611 } 612 613 return returnjobj; 614 615 }, 616 617 /* 618 * usuwanie ciasteczka 619 * @param {string} name nazwa ciasteczka 620 */ 621 deleteCookie: function (name) { 622 623 Cookies.remove(name, {domain: cms.conf.getData('domain')}); 624 }, 625 626 /* 627 * pobieranie ciasteczka 628 * @param {string} name nazwa ciasteczka 629 */ 630 getCookie: function (name) { 631 return Cookies.get(name); 632 }, 633 634 /* 635 * pobieranie ciasteczka jako biektu JSON 636 * @param {string} name nazwa ciasteczka 637 */ 638 getJSONCookie: function (name) { 639 return Cookies.getJSON(name); 640 }, 641 642 /* 643 * pobieranie ciasteczka jako biektu JSON 644 * @param {string} name nazwa ciasteczka 645 * @param {string} value wartoÅÄ, może byÄ JSON 646 * @param {int} dni do wygaÅniÄcia - domyÅlnie z konfiguracji 647 */ 648 setCookie: function (name, value, expires) { 649 650 if (arguments.length === 2) { 651 expires = cms.conf.getData('defaultCookieExpires'); 652 } 653 654 Cookies.set(name, value, {expires: expires, domain: cms.conf.getData('domain')}); 655 }, 656 657 /* 658 * logowanie infromacji w konsoli 659 * @param {string} msg info msg 660 */ 661 logInfo: function (msg) { 662 console.info(msg); 663 }, 664 665 /* 666 * logowanie bÅÄdu w konsoli, tylko dla trybu debug 667 * @param {string} msg error msg 668 */ 669 logError: function (msg) { 670 671 if (cms.conf.getData('debug')&&msg) { 672 console.error(msg); 673 } 674 }, 675 676 /* 677 * alert poprawne zakoÅczenie 678 * @param {string} tekst nagÅówka 679 * @param {string} tekst alarmu 680 */ 681 alertSuccess: function (title, text) { 682 683 swal({ 684 title: title, 685 text: text, 686 confirmButtonColor: "#66BB6A", 687 type: "success", 688 timer: 10000 689 }); 690 }, 691 692 /* 693 * alert bÅÄdne zakoÅczenie 694 * @param {string} tekst nagÅówka 695 * @param {string} tekst alarmu 696 */ 697 alertError: function (title, text) { 698 swal({ 699 title: title, 700 text: text, 701 confirmButtonColor: "#EF5350", 702 type: "error", 703 timer: 10000 704 }); 705 }, 706 707 /* 708 * alert informacja 709 * @param {string} tekst nagÅówka 710 * @param {string} tekst alarmu 711 */ 712 alertInfo: function (title, text) { 713 swal({ 714 title: title, 715 text: text, 716 confirmButtonColor: "#2196F3", 717 type: "info", 718 timer: 10000 719 }); 720 }, 721 722 /* 723 * alert ostrzeżenie z potwierdzeniem zakoÅczenie 724 * @param {string} tekst nagÅówka 725 * @param {string} tekst alarmu 726 * @param {string/boolean} przycisk anulowania (true) bÄ dź opis przycisku np "Anuluj" 727 * @param {string} opis przycisku potwierdzenia 728 * @param {function} anonimowa funkcja wykonywana po potwierdzeniu 729 */ 730 alertWarning: function (title, text, confirmf, cancelShow, cancelText, confirmText) { 731 732 cancelShow = typeof cancelShow !== 'undefined' ? cancelShow : true; 733 cancelText = typeof cancelText !== 'undefined' ? cancelText : cms.lang.cancel; 734 confirmText = typeof confirmText !== 'undefined' ? confirmText : cms.lang.ok; 735 confirmf = typeof confirmText !== 'undefined' ? confirmf : function () { 736 return true; 737 }; 738 739 swal({ 740 title: title, 741 text: text, 742 type: "warning", 743 showCancelButton: cancelShow, 744 cancelButtonText: cancelText, 745 confirmButtonColor: "#FF7043", 746 confirmButtonText: confirmText 747 }, confirmf); 748 }, 749 750 /* 751 * alert 752 * @param {string} tekst nagÅówka 753 * @param {string} tekst alarmu 754 */ 755 alert: function (title, text) { 756 swal({ 757 title: title, 758 text: text, 759 confirmButtonColor: "#2196F3", 760 timer: 10000 761 }); 762 }, 763 764 facebookPanInit: function () { 765 $("#facebook_pan").hover(function () { 766 $("#facebook_pan").stop(true, false).animate({right: "0"}, "medium"); 767 }, function () { 768 $("#facebook_pan").stop(true, false).animate({right: "-295"}, "medium"); 769 }, 500); 770 }, 771 772 plusMinusInit: function () { 773 774 $(document).on('click', '.plus, .minus', function () { 775 776 var id = $(this).attr('rel'), 777 step = parseInt($(this).data('step')), 778 min = parseInt($(this).data('min')), 779 max = parseInt($(this).data('max')); 780 781 if(id && step && !isNaN(step)) { 782 var present = $('#'+id), 783 presentVal = parseInt(present.val()); 784 } 785 786 if(present.length) { 787 var newVal = presentVal + step; 788 789 if(!isNaN(min) && newVal < min) newVal = min; 790 else if(!isNaN(max) && newVal > max) newVal = max; 791 792 present.val(newVal); 793 } 794 795 return false;
796 }); 797 798 }, 799 800 /* 801 * fix anchors links problem 802 */ 803 fixAnchors: function () { 804 $("a[href^='\#']").each(function () { 805 var anchor = $(this); 806 var href = anchor.prop('href'); 807 anchor.prop('href', location.href.split("#")[0] + '#' + href.substr(href.indexOf('#') + 1)); 808 }); 809 }, 810 811 prototypeFunc: function () { 812 //trim 813 String.prototype.trim = function () { 814 return this.replace(/^\s*|\s*$/g, ""); 815 }; 816 817 /** 818 * Number.prototype.format(n, x, s, c) 819 * 820 * @param integer n: length of decimal 821 * @param integer x: length of whole part 822 * @param mixed s: sections delimiter 823 * @param mixed c: decimal delimiter 824 */ 825 Number.prototype.format = function (n, x, s, c) { 826 var re = '\\d(?=(\\d{' + (x || 3) + '})+' + (n > 0 ? '\\D' : '$') + ')', 827 num = this.toFixed(Math.max(0, ~~n)); 828 829 return (c ? num.replace('.', c) : num).replace(new RegExp(re, 'g'), '$&' + (s || '')); 830 }; 831 832 }, 833 834 /* 835 * round function 836 */ 837 round: function (num, pp) { 838 var pr = 1; 839 for (var i = 0; i < pp; i++) { 840 pr = pr * 10; 841 } 842 return Math.round(num * pr) / pr; 843 }, 844 845 /* 846 * add to favourite 847 */ 848 addFavorite: function (tytul, adres) { 849 850 //FireFox 851 if (window.sidebar) { 852 window.sidebar.addPanel(tytul, adres, ""); 853 //IE 854 } else if (window.external) { 855 window.external.AddFavorite(adres, tytul); 856 //Opera 857 } else if (window.opera && window.print) { 858 var a = document.createElement('a'); 859 a.setAttribute('href', adres); 860 a.setAttribute('title', tytul); 861 a.setAttribute('rel', 'sidebar'); 862 a.click(); 863 } 864 865 } 866}; 867 868
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.