1/* global id_language, id_country_code, path_request, type_request, cache_break, administration_id_language, administration_id_country_code */ 2 3/** 4 * @namespace BS 5 * @autor Jaroslav Trsek <[email protected]> 6 */ 7var BS = BS || {}; 8 9/** 10 * Parametr pro obnovu cache pÅi zmÄnÄ buildu 11 * @type String 12 */ 13BS.$cache_break_param = '_=' + (typeof cache_break !== 'undefined' ? cache_break : (new Date()).getTime()); 14 15/** 16 * RozÅ¡ÃÅà objekt1 (hlubokou kopiÃ) o objekt2 aniž by pÅepsal objekt1 17 * @param {Object} $default Původnà objekt. 18 * @param {Object} $request RozÅ¡iÅujÃcà objekt (Pokud nebudou existovat vlastnosti tak se pÅipÃÅ¡Ã. V opaÄném pÅÃpadÄ pÅepÃÅ¡ou původnà hodnoty) 19 * @return {Object} 20 */ 21BS.extend = function($default, $request) 22{ 23 var $tmp = {}; 24 $.extend(true, $tmp, $default); 25 $.extend(true, $tmp, $request); 26 return $tmp; 27}; 28 29/** -------------------------------------------------------------------------------- 30 * Definovánà defaultnÃch requestů 31 */ 32BS.Request = {}; 33 34/** 35 * defaultnà request, ze kterého dÄdà vÅ¡ichni ostatnà 36 */ 37BS.Request.$default = { 38 url: path_request, 39 type: type_request, 40 cache: false, 41 dataType: 'json', 42 error: function(jqXHR, textStatus, errorThrown){ 43 if(textStatus === "parsererror") 44 { 45 BS.Debug.info(errorThrown); 46 BS.Debug.log("Response text: "+ jqXHR.responseText); 47 } 48 }, 49 beforeSend: function() 50 { 51 var $live_xhr; 52 var $counter = $("body").attr('data-xhr-counter'); 53 if (typeof $counter === 'undefined') 54 { 55 $live_xhr = 0; 56 } 57 else 58 { 59 $live_xhr = parseInt($counter); 60 } 61 $("body").attr('data-xhr-counter', ++$live_xhr); 62 if ($live_xhr === 1) 63 { 64 $("body").addClass("bs-xhr-waiting"); 65 } 66 }, 67 complete: function() 68 { 69 var $live_xhr = parseInt($("body").attr('data-xhr-counter')); 70 $("body").attr('data-xhr-counter', --$live_xhr); 71 if ($live_xhr === 0) 72 { 73 $("body").removeClass("bs-xhr-waiting"); 74 } 75 76 }, 77 statusCode: { 78 //TODO: doplnit kontrolu odhlášeného uživatele - 401 Unauthorized 79 401: function($xhr) { 80 }, 81 //TODO: doplnit kontrolu placených Äástà aplikace - 402 Payment Required 82 402: function($xhr) { 83 }, 84 500: function($xhr) { 85 var $server_path_of_exception = $xhr.getResponseHeader("X-Nette-Error-Log"); 86 if ($server_path_of_exception !== null) 87 { 88 var $url_part = $server_path_of_exception.split("/"); 89 var $url_exception = 'http://' + window.location.hostname + '/log/' + $url_part[$url_part.length - 1]; 90 window.open($url_exception, '_newtab'); 91 } 92 else 93 { 94 BS.Debug.warn($xhr.responseText); 95 } 96 } 97 }, 98 data: { 99 id_language: id_language, 100 id_country_code: id_country_code 101 } 102}; 103 104/** 105 * DoplnÄnà requestu o pÅesmÄrovánà pÅi úspÄchu 106 */ 107BS.Request.$default_with_redirect = BS.extend(BS.Request.$default, { 108 success: function(data) { 109 if (data) 110 { 111 if (data.redirect_url) 112 { 113 window.location.replace(data.redirect_url); 114 } 115 else 116 { 117 $(BS).trigger('e_request_message_received', [data]); 118 } 119 } 120 } 121}); 122 123/** 124 * Requesty s jazykem administrace 125 */ 126BS.Request.$default_admin = BS.extend(BS.Request.$default, { 127 data: { 128 id_language: administration_id_language, 129 id_country_code: administration_id_country_code 130 } 131}); 132BS.Request.$default_admin_with_redirect = BS.extend(BS.Request.$default_with_redirect, { 133 data: { 134 id_language: administration_id_language, 135 id_country_code: administration_id_country_code 136 } 137}); 138/** 139 * konec definovánà requestů 140 * --------------------------------------------------------------------------------- */ 141 142/** 143 * Obnovà obrázek v elementu <img> 144 * !!! OdstraÅuje vÅ¡echny parametry z URL, pokud nebude výhledovÄ vyhovovat, tak pÅepsat za nahrazovánà !!! 145 * @param {String|Object} $image Selector obrázku, nebo jQuery ($) instance obrázku 146 * @return {Boolean} 147 */ 148BS.refresh_image = function($image) 149{ 150 var $element = $image; 151 if (typeof $image === "string") 152 { 153 $element = $($image); 154 } 155 // pokud nemáme $ instanci elementu, tak ukonÄÃme provádÄnà 156 if (!($element instanceof $)) 157 { 158 BS.Debug.error("Prametr nenà instancà $"); 159 return false;
160 } 161 var $src = $element.attr("src"); 162 var $query_position = $src.indexOf('?'); 163 // odstranÃme staré parametry url adresy 164 if ($query_position !== -1) 165 { 166 var $amp_position = $src.substring($query_position).indexOf('&'); 167 if ($amp_position !== -1) 168 { 169 // pokud budou odstranÄny i dakšà parametry URL, tak pro jistotu vypÃÅ¡ema varovánà 170 BS.Debug.warn("BS.refresh_image(): z URL byly odstranÄny parametry (" + $src.substring($query_position + $amp_position + 1) + ")"); 171 } 172 $src = $src.substring(0, $query_position); 173 } 174 $element.attr('src', $src + '?_=' + Math.random()); 175 return true; 176}; 177 178/** 179 * PÅevede barvu z RGB do HEX 180 * @param {String} $css_color Barva v rgb "rgb( 255, 255, 255)" 181 * @return {String} 182 */ 183BS.get_hex_color = function($css_color) 184{ 185 var $digits = /(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec($css_color); 186 var $red = parseInt($digits[2]); 187 var $green = parseInt($digits[3]); 188 var $blue = parseInt($digits[4]); 189 var $rgb = $blue | ($green << 8) | ($red << 16); 190 var $color = '#' + $rgb.toString(16); 191 if ($color === '#0') 192 { 193 $color = "#000000"; 194 } 195 return $digits[1] + $color; 196}; 197 198/** 199 * Upožnà k parametrům z GETu pÅistupovat jako k poli 200 * @example BS.get_url_vars()["id"] // stejné jako PHP-kové $_GET["id"] 201 * @return {Array} 202 */ 203BS.get_url_vars = function() 204{ 205 var vars = {}; 206 var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { 207 vars[key] = value; 208 }); 209 return vars; 210}; 211 212/** 213 * OdpoÄet, spustà callback když vypršà Äas 214 * @param {Numeric} $seconds 215 * @param {Function} $change_callback 216 * @param {Function} $finish_callback 217 */ 218BS.countdown_timer = function($seconds, $change_callback, $finish_callback) 219{ 220 function countdown() 221 { 222 if ($seconds === 0) 223 { 224 if (typeof $finish_callback !== "undefined") 225 { 226 $finish_callback($seconds); 227 } 228 } 229 else 230 { 231 if (typeof $change_callback !== "undefined") 232 { 233 $change_callback($seconds); 234 } 235 $seconds--; 236 setTimeout(countdown, 1000); 237 } 238 } 239 countdown(); 240}; 241 242/** 243 * @class 244 */ 245BS.Debug = { 246 /** 247 * Identifikátor inicializace 248 * @type {Boolean} 249 * @private 250 */ 251 $is_initialized: false, 252 /** 253 * DefaultnÄ vypneme, aby jsme uživatele donutili inicializovat. OÅ¡etÅenà podpory objektu console bude až v initu 254 * @type {Boolean} 255 * @private 256 */ 257 $enable_console: false, 258 /** 259 * DefaultnÄ vypneme. Debug bude zapÃnat APP 260 * @type {Boolean} 261 * @private 262 */ 263 $enable_debug: false, 264 /** 265 * Pole pro uchovávánà informace o skupinách debugovacÃch hlášek. Bude fungovat jako bug fix pro prohlÞeÄe 266 * které nativnÄ nepodporujà console.group() a console.groupEnd() 267 * @type {Array} 268 */ 269 $options: { 270 enable_debug: false, 271 enable_logging: false 272 }, 273 $group: [], 274 /** 275 * @type Array ZasÃbnÃk poslenÃch N debugů 276 */ 277 $debug_bin: [], 278 /** 279 * @type Number Max poÄet debugů v zásobnÃku 280 */ 281 $debug_bin_limit: 10, 282 /** 283 * Inicializace Debugu 284 * @method 285 * @param {Object} options 286 * @example 287 * <code> 288 * BS.Debug.init(true); // zapnuté debugovánà 289 * ... 290 * BS.Debug.init(false); // vypnuté debugovánà 291 * ... 292 * BS.Debug.init(); // vypnuté debugovánà 293 * </code> 294 */ 295 init: function(options) 296 { 297 this.$options = BS.extend(this.$options, options); 298 // nastavÃme zobrazenà debugovacÃch informacà 299 if (typeof $enable_debug === "boolean") 300 { 301 this.$is_initialized = true; 302 this.$options.enable_debug = $enable_debug; 303 } 304 // uližÃme si vypnutÃ/zapnutà konzole 305 // pokud bude vypnutá a debug bude zapnutý, tak se zprávy budou zobrazovat v alertech 306 if (typeof console === "object") 307 { 308 this.$enable_console = true; 309 } 310 if (this.$options.enable_logging) 311 { 312 window.onerror = function(msg, url, lineNo) 313 { 314 BS.Debug.error_handler(msg, url, lineNo); 315 }; 316 } 317 }, 318 /* 319 *Zjistà jestli je povolen debug 320 *@return {Boolean} 321 */ 322 is_debug_enable: function() 323 { 324 if (this.$is_initialized) 325 { 326 return this.$options.enable_debug; 327 } 328 else 329 { 330 this.init(false); 331 return this.$options.enable_debug; 332 } 333 }, 334 /* 335 *Zjistà jestli je dostupná konzole 336 *@return {Boolean} 337 */ 338 is_console_enable: function() 339 { 340 if (this.$is_initialized) 341 { 342 return this.$enable_console; 343 } 344 else 345 { 346 this.init(false); 347 return this.$enable_console; 348 } 349 }, 350 /** 351 * ObyÄejná zápis do logu. Pokud nenà dostupný, tak se zavolá alert. PoužÃje se v prohlÞeÄÃch, které nepodporujà konzoli 352 * @method 353 * @example 354 * <code>
355 * BS.Debug.log('BS test console.log'); // bez odkazu na objekt v DOMu 356 * ... 357 * BS.Debug.log('BS test console.log','test'); // s odkazem na element s id="test" 358 * </code> 359 * @param {String} $message Zpráva která se zobrazà do konzole 360 * @param {String} $id ID elementu na která se má v konzoli vytvoÅit odkaz 361 */ 362 log: function($message, $id) 363 { 364 // Konzole nenà dostupná, vyhoÄ alert 365 if (this.$enable_console === false && this.is_debug_enable() === true) 366 { 367 //Tady zaÄÃná a konÄà alertové peklo 368 //alert($message); 369 } 370 else 371 { 372 if (this.is_debug_enable() === true) 373 { 374 if (typeof $id === "string") 375 { 376 console.log(document.getElementById($id), $message); 377 } 378 else 379 { 380 console.log($message); 381 } 382 } 383 } 384 this.add_to_bin($message); 385 }, 386 /** 387 * Metoda pro zápis informativnà chyby do konzole (ve vÄtÅ¡inÄ prohlÞeÄů se podbarvà modÅe). 388 * @method 389 * @example 390 * <code> 391 * BS.Debug.info('BS test console.log'); // bez odkazu na objekt v DOMu 392 * ... 393 * BS.Debug.info('BS test console.log','test'); // s odkazem na element s id="test" 394 * </code> 395 * @param {String} $message Zpráva která se zobrazà do konzole 396 * @param {String} $id ID elementu na která se má v konzoli vytvoÅit odkaz 397 */ 398 info: function($message, $id) 399 { 400 // Konzole nenà dostupná vyhoÄ alert 401 if (this.is_debug_enable() === true) 402 { 403 if (this.$enable_console === false) 404 { 405 this.log('Info:' + $message); 406 } 407 else 408 { 409 if (typeof $id === "string") 410 { 411 console.info(document.getElementById($id), $message); 412 } 413 else 414 { 415 console.info($message); 416 } 417 } 418 } 419 this.add_to_bin($message); 420 }, 421 /** 422 * Metoda pro zápis varovánà do konzole (ve vÄtÅ¡inÄ prohlÞeÄů se podbarvà žlutÄ). 423 * @method 424 * @example 425 * <code> 426 * BS.Debug.warn('BS test console.log'); // bez odkazu na objekt v DOMu 427 * ... 428 * BS.Debug.warn('BS test console.log','test'); // s odkazem na element s id="test" 429 * </code> 430 * @param {String} $message Zpráva která se zobrazà do konzole 431 * @param {String} $id ID elementu na která se má v konzoli vytvoÅit odkaz 432 */ 433 warn: function($message, $id) 434 { 435 // Konzole nenà dostupná vyhoÄ alert 436 if (this.$enable_console === false) 437 { 438 this.log('Warn:' + $message); 439 } 440 else 441 { 442 if (this.is_debug_enable() === true) 443 { 444 if (typeof $id === "string") 445 { 446 console.warn(document.getElementById($id), $message); 447 } 448 else 449 { 450 console.warn($message); 451 } 452 } 453 } 454 this.add_to_bin($message); 455 }, 456 /** 457 * Metoda pro zápis kritické chyby do konzole (ve vÄtÅ¡inÄ prohlÞeÄů se podbarvà ÄervenÄ). 458 * @method 459 * @example 460 * <code> 461 * BS.Debug.error('BS test console.log'); // bez odkazu na objekt v DOMu 462 * ... 463 * BS.Debug.error('BS test console.log','test'); // s odkazem na element s id="test" 464 * </code> 465 * @param {String} $message Zpráva která se zobrazà do konzole 466 * @param {String} $id ID elementu na která se má v konzoli vytvoÅit odkaz 467 */ 468 error: function($message, $id) 469 { 470 // Konzole nenà dostupná vyhoÄ alert 471 if (this.$enable_console === false) 472 { 473 this.log('Error:' + $message); 474 } 475 else 476 { 477 if (this.is_debug_enable() === true) 478 { 479 if (typeof $id === "string") 480 { 481 console.error(document.getElementById($id), $message); 482 } 483 else 484 { 485 //Objekt je povinný, ale může být prázdný, tak proÄ tÃm otravovat vývojáÅe 486 console.error('', $message); 487 } 488 } 489 } 490 this.add_to_bin($message); 491 }, 492 /** 493 * Vymazánà konzole. 494 * Mazánà se nedoporuÄuje a podporuje ho jenom FF. Vložà tedy odÅádkovánà pro ptické oddÄlenà debugovacÃch informacà 495 * @method 496 * @example 497 * <code> 498 * BS.Debug.clear(); 499 * </code> 500 */ 501 clear: function() 502 { 503 this.log("\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); 504 }, 505 /** 506 * VytvoÅà seskupenà pro debugovacà výpisy, které za nÃm následujÃ. Dajà se do sebe vnoÅovat. 507 * Automaticky se zmÄÅà Äas celé skupiny 508 * IE skupyny v konzoli nepodporuje, takže se zobrazà pouze informativnà text a vytvoÅenà skupiny požadovaného jména. 509 * Pro IE nelze dosadit ani odsazenÃ, protože si tam IE doplÅuje vlastnà texty 510 * @method 511 * @example 512 * <code> 513 * BS.Debug.group_start('Jmeno skupiny'); 514 * BS.Debug.warn('Chyba blublable1'); 515 * BS.Debug.warn('Chyba blublable2'); 516 * BS.Debug.warn('Chyba blublable3'); 517 * BS.Debug.group_end(); 518 * </code> 519 * @param {String} $title Nadpis seskupenà 520 */ 521 group_start: function($title) 522 { 523 this.$group[this.$group.length] = $title; 524 BS.Timer.start($title); 525 var $alternative_title = '- Nova skupina: ' + $title + ' ----------------------------------------------------------'; 526 if (typeof console.group === "function") 527 { 528 console.group($title); 529 } 530 else 531 { 532 this.info($alternative_title); 533 } 534 this.add_to_bin($alternative_title); 535 }, 536 /** 537 * UkonÄenà naposledy vytvoÅeného seskupenà debugovacÃch výpisů 538 * IE skupyny v konzoli nepodporuje, takže se zobrazà pouze informativnà text o ukonÄenà naposled vytvoÅené skupiny. 539 * @method 540 * @example 541 * //viz.: BS.Debug.group_start(); 542 */ 543 group_end: function() 544 { 545 var $title_group = this.$group[this.$group.length - 1];
546 var $alternative_title = 'Konec skupiny: ' + $title_group; 547 if (typeof console.groupEnd === "function") 548 { 549 console.groupEnd(); 550 this.info($alternative_title); 551 } 552 else 553 { 554 this.info('- ' + $alternative_title + ' -'); 555 } 556 BS.Timer.end($title_group); 557 this.$group.pop(); 558 this.add_to_bin($alternative_title); 559 }, 560 /** 561 * ZpoÄÃtá výskyt použità this.count(). Pouze ve FF se zobrazà správnÄ jen jedna Åádka. Ostatnà prohlÞeÄe vypisujà 562 * každý výskyt. Pro IE jsem nenaÅ¡el alternativu vůbec. 563 * @method 564 * @example 565 * <code> 566 * for (x=0;x<12;x++) 567 * { 568 * BS.Debug.count("Otoceni for"); 569 * } 570 * // MÄlo by vypsat pouze: Otoceni for 12 571 * // Ve vsech prohlÞeÄÃch (kromÄ FF), se ale vypÃÅ¡e tolik Åádek kolik je obrátek v cyklu:/ 572 * </code> 573 * @param {String} $title Popisek vápisu 574 */ 575 count: function($title) 576 { 577 if (typeof console.count === "function") 578 { 579 console.count($title); 580 } 581 }, 582 /** 583 * Zobrazà tabulková data (z objektu nebo pole). NormálnÄ funguje pouze ve FF 584 * @method 585 * @example 586 * <code> 587 * var team = new Array(); 588 * team[0] = { 589 * jmeno: 'Franta', 590 * prijmeni: 'Trotl', 591 * pozice: 'tester' 592 * }; 593 * team[1] = { 594 * jmeno: 'Delsi', 595 * prijmeni: 'Emil', 596 * pozice: 'lepsi tester' 597 * }; 598 * 599 * BS.Debug.table(team);// vypise vsechny sloupce 600 * ... 601 * BS.Debug.table(team, ["jmeno","prijmeni"]);// vypise pouze sloupce jmeno a prijmeni 602 * </code> 603 * @param {Array} $data Objekt nebo pole které se má vypsat do tabulky. 604 * @param {Array} $filter Polo názvů hodnot, keré se majà vypsat. Pokud nebude vyplnÄno nic, tak se vypÃÅ¡ou vÅ¡echny sloupce 605 */ 606 table: function($data, $filter) 607 { 608 if (typeof console.table === "function") 609 { 610 if (typeof $filter === "object") 611 { 612 console.table($data, $filter); 613 } 614 else 615 { 616 console.table($data); 617 } 618 } 619 else 620 { 621 //console.log($data); 622 } 623 }, 624 error_handler: function($message, $url, $line_number) 625 { 626 var $data = { 627 'action': 'Log_js_error', 628 'message': $message, 629 'url': $url, 630 'line_number': $line_number, 631 'debug': BS.Debug.get_bin() 632 }; 633 // requirejs loading error 634 if ($url.search('requirejs.js') > -1) 635 { 636 $data.requirejs_order = {}; 637 $('head script').each(function(index) { 638 var $name = $(this).data('requiremodule'); 639 if (typeof $name !== 'undefined') 640 { 641 $data.requirejs_order[$name] = $(this).attr('src'); 642 } 643 }); 644 } 645 var $request = BS.extend(BS.Request.$default_admin, { 646 data: $data 647 }); 648 $.ajax($request); 649 }, 650 /** 651 * @param {String} $message 652 */ 653 add_to_bin: function($message) 654 { 655 if (this.$debug_bin.length >= this.$debug_bin_limit) 656 { 657 this.$debug_bin.shift(); 658 } 659 this.$debug_bin.push($message); 660 }, 661 /** 662 * @returns {Array} 663 */ 664 get_bin: function() 665 { 666 return this.$debug_bin; 667 } 668}; 669/** 670 * Objekt pro mÄÅenà Äasu chodu aplikace 671 * @class 672 */ 673BS.Timer = { 674 /** 675 * Nastavenà ÄasovaÄe. Jednotlivé Å¡asovaÄe je možné v APP kÅÞit 676 * @method 677 * @example 678 * <code> 679 * BS.Timer.start("Prubeh cyklu"); 680 * for (x=0;x<12;x++) 681 * { 682 * //... 683 * } 684 * BS.Timer.end("Prubeh cyklu"); 685 * </code> 686 * @param {String}
686 $title Jméno ÄasovaÄe 687 */ 688 start: function($title) 689 { 690 if (typeof console.time === "function") 691 { 692 console.time($title); 693 } 694 else 695 { 696 BS.Debug.info("Casovac neni podporovan (vysledek nebude tak presny)"); 697 this.alternative_time_start($title); 698 } 699 }, 700 /** 701 * UkonÄenà ÄasovaÄe 702 * @method 703 * @example 704 * // viz. BS.Timer.start(); 705 * @param {String} $title Jméno ÄasovaÄe. Musà se shodovat s $title v BS.Timer.start($title); 706 */ 707 end: function($title) 708 { 709 // nemá smysl vypisovat dvÄ stejné hlášky o nefunkÄnosti ÄasovaÄe 710 if (typeof console.timeEnd === "function") 711 { 712 console.timeEnd($title); 713 } 714 else 715 { 716 this.alternative_time_end($title); 717 } 718 }, 719 /** 720 * Náhradnà ÄasovaÄ pro prohlÞeÄe, které nepodporujà console.time() 721 * Nenà tak pÅesné, jako time pÅÃmo od prohlÞeÄe 722 * PÅevzato z: http://stackoverflow.com/questions/3516515/console-time-in-ie8-developer-tools?answertab=active#tab-top 723 * @private 724 * @param {String} $name 725 * @param {Boolean} $reset 726 */ 727 alternative_time_start: function($name, $reset) 728 { 729 if (!$name) 730 { 731 return; 732 } 733 var time = new Date().getTime(); 734 if (!console.timeCounters) 735 { 736 console.timeCounters = {}; 737 } 738 var key = "KEY" + $name.toString(); 739 if (!$reset && console.timeCounters[key]) 740 { 741 return; 742 } 743 console.timeCounters[key] = time; 744 }, 745 /** 746 * UkonÄenà náhradnÃho ÄasovaÄe 747 * PÅevzato z: http://stackoverflow.com/questions/3516515/console-time-in-ie8-developer-tools?answertab=active#tab-top 748 * @private 749 * @param {String} $name 750 */ 751 alternative_time_end: function($name) 752 { 753 var time = new Date().getTime(); 754 if (!console.timeCounters) 755 { 756 return; 757 } 758 var key = "KEY" + $name.toString(); 759 var timeCounter = console.timeCounters[key]; 760 if (timeCounter) 761 { 762 var diff = time - timeCounter; 763 var label = $name + ": " + diff + "ms"; 764 BS.Debug.info(label); 765 delete console.timeCounters[key]; 766 } 767 } 768}; 769/** 770 * Zapne profilovánà na urÄité Äásti kódu 771 * @class 772 */ 773BS.Profiler = { 774 /** 775 * Zapnutà profileru. Lze spustit pouze jeden v jednom Äase 776 * @method 777 * @example 778 * BS.Profiler.start("Profil 1"); 779 * function testFor() 780 * { 781 * for (x = 0; x <= 10; x++) 782 * { 783 * document.write(x+"<br />"); 784 * } 785 * } 786 * testFor(); 787 * BS.Profiler.end(); 788 * @param {String} $title Název profileru 789 */ 790 start: function($title) 791 { 792 console.profile($title); 793 }, 794 /** 795 * Vypnutà profileru. Nepožaduje název, protože může bÄžet vždy jen jedno profilovánà 796 * @method 797 */ 798 end: function() 799 { 800 console.profileEnd(); 801 } 802}; 803 804// KomentáÅe událostà 805 806/** 807 * Událost pÅijetà systémové zprávy, aby by každém systému Å¡lo obsluhovat výsledek requestu vlastnà metodou na zobrazenà zprávy. 808 * @example 809 * Pokud využÃváte v extend pro ajax BS.Request.$default_with_redirect, událost je aktivována. Pokud máte vlastnà success funkci, pro oznámenà události uvnitÅ použijte: 810 * <code> 811 * $(BS).trigger('e_request_message_received', [data]); 812 * </code> 813 * 814 * @example 815 * <code> 816 * BS.on('e_request_message_received', function($event, $report){ 817 * Vas_projekt_namespace.vase_funkce_na_zobrazeni_zpravy($report); 818 * }); 819 * </code> 820 * 821 * @name BS#BS:e_request_message_received 822 * @event 823 * 824 * @param {Object} $event Event object 825 * @param {String} $report Zpráva 826 */ 827 828/** 829 * Událost uzavÅenà filemanageru 830 * 831 * @example 832 * <code> 833 * $(BS).on('e_fm_close', function($event){ 834 * Vas_projekt_namespace.vase_funkce(); 835 * }); 836 * </code> 837 * 838 * @name BS#BS:e_fm_close 839 * @event 840 * 841 * @param {Object} $event Event object 842 */ 843 844/** 845 * Událost potvrzenà filemanageru s vybranými soubory (Ok, Vybrat, PoužÃt) 846 * 847 * @example 848 * <code> 849 * $(BS).on('e_fm_files_selected', function($event, $selected_files){ 850 * Vas_projekt_namespace.vase_funkce($selected_files); 851 * }); 852 * </code> 853 * 854 * @name BS#BS:e_fm_files_selected 855 * @event 856 * 857 * @param {Object} $event Event object 858 * @param {Array} $selected_files Pole objektů obsahujÃcà informace o souborech. TÃm že je to pole, tak poÄet parametrů je poÄet souborů - 1 859 */
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.