1// JavaScript Document 2/* 3 * Determine which web browser we have here. 4 */ 5var isIE=document.all?true:false; /* IE4, IE5, IE6 */ 6var isDOM=document.getElementById?true:false; /* IE6, NS6 */ 7 8/* 9 * Function SH :: SHOW HIDE 10 * Paramter: _objName - name of the object to hide or show 11 * _formObj - object that was clicked. 12 */ 13function SH(_objName,_formObj) 14{ 15 /* 16 * This creates an object inside the object passed to it. 17 * It retains the state of show or hide. 18 * This works when the check box is by default not checked. 19 * (FIRST CLICK CHECKS AND MAKES DIV SHOW UP) 20 */ 21 _formObj._show=_formObj._show?false:true; 22 23 /* 24 * Determine web browser type, then if to show or hide. 25 */ 26 if(isDOM) 27 { 28 _formObj._show=document.getElementById(_objName).style.display=='none'?true:false; 29 if(_formObj._show) 30 document.getElementById(_objName).style.display="block"; 31 else 32 document.getElementById(_objName).style.display="none"; 33 } 34 else if(isIE) 35 { 36 _formObj._show=document.all._objName.style.display='none'?true:false; 37 if(_formObj._show)
38 eval("document.all."+_objName+".style.display='block'"); 39 else 40 eval("document.all."+_objName+".style.display='none'"); 41 } 42} 43 44/* 45function vypis(_SEKCE,_ID,_CO) { 46window.open('vypis.php?'+_SEKCE+'='+_ID+'&detail='+_CO, 'mojeokno', 'resizable,status=no,scrollbars=yes,width=200,top=100,left=200') 47} 48 */ 49 50function vypis(_SEKCE,_ID,_CO) { 51 win_size_x=260; //horizontálnà velikost okna - sirka 52 win_size_y=360; //vertikálnà velikost okna - vyska 53 win_pos_x=(screen.width-win_size_x)/2; //horizontálnà pozice okna 54 win_pos_y=(screen.height-win_size_y)/2; //vertikálnà velikost okna 55 56 window.open('/vypis.php?'+_SEKCE+'='+_ID+'&detail='+_CO, 'vycentrovaneokno', 'resizable=no,scrollbars=yes,width=' + win_size_x + ',height=' + win_size_y + ',top=200,left=' + win_pos_x) 57} 58 59function searchautor(_SEKCE,_ID) { 60 win_size_x=300; //horizontálnà velikost okna 61 win_size_y=260; //vertikálnà velikost okna 62 win_pos_x=(screen.width-win_size_x)/2; //horizontálnà pozice okna 63 win_pos_y=(screen.height-win_size_y)/2; //vertikálnà velikost okna 64 65 window.open('/plus_autor.php?'+_SEKCE+'='+_ID, 'vycentrovaneokno', 'resizable=no,scrollbars=yes,width=' + win_size_x + ',height=' + win_size_y + ',top=200,left=' + win_pos_x) 66} 67 68function searchpovidka(_SEKCE,_ID) { 69 win_size_x=300; //horizontálnà velikost okna 70 win_size_y=260; //vertikálnà velikost okna 71 win_pos_x=(screen.width-win_size_x)/2; //horizontálnà pozice okna 72 win_pos_y=(screen.height-win_size_y)/2; //vertikálnà velikost okna 73 74 window.open('/plus_povidka.php?'+_SEKCE+'='+_ID, 'vycentrovaneokno', 'resizable=no,scrollbars=yes,width=' + win_size_x + ',height=' + win_size_y + ',top=200,left=' + win_pos_x) 75} 76 77function searchkniha(_SEKCE,_ID) { 78 win_size_x=300; //horizontálnà velikost okna 79 win_size_y=260; //vertikálnà velikost okna 80 win_pos_x=(screen.width-win_size_x)/2; //horizontálnà pozice okna 81 win_pos_y=(screen.height-win_size_y)/2; //vertikálnà velikost okna 82 83 window.open('/plus_kniha.php?'+_SEKCE+'='+_ID, 'vycentrovaneokno', 'resizable=no,scrollbars=yes,width=' + win_size_x + ',height=' + win_size_y + ',top=200,left=' + win_pos_x) 84} 85 86function razenipovidek(_ID) { 87 win_size_x=450; //horizontálnà velikost okna 88 win_size_y=400; //vertikálnà velikost okna 89 win_pos_x=(screen.width-win_size_x)/2; //horizontálnà pozice okna 90 win_pos_y=(screen.height-win_size_y)/2; //vertikálnà velikost okna 91 92 window.open('/razenipovidek.php?kniha='+_ID, 'vycentrovaneokno', 'resizable=no,scrollbars=yes,width=' + win_size_x + ',height=' + win_size_y + ',top=200,left=' + win_pos_x) 93} 94 95function tagovani(_ID, _DILO) { 96 win_size_x=550; //horizontálnà velikost okna 97 win_size_y=500; //vertikálnà velikost okna 98 win_pos_x=(screen.width-win_size_x)/2; //horizontálnà pozice okna 99 win_pos_y=(screen.height-win_size_y)/2; //vertikálnà velikost okna 100 101 window.open('/tagovani.php?'+_DILO+'='+_ID, 'vycentrovaneokno', 'resizable=no,scrollbars=no,width=' + win_size_x + ',height=' + win_size_y + ',top=200,left=' + win_pos_x) 102} 103 104function up(co) { 105 idecko = document.form.elements['id['+co+']'].value 106 hodnota = document.form.elements['value['+co+']'].value 107 kam = co - 1; 108 document.form.elements['id['+co+']'].value = document.form.elements['id['+kam+']'].value 109 document.form.elements['value['+co+']'].value = document.form.elements['value['+kam+']'].value 110 document.form.elements['id['+kam+']'].value = idecko 111 document.form.elements['value['+kam+']'].value = hodnota 112} 113 114function down(co) { 115 //idecko = window.document.forms['form'].elements['id['+co+']'].value // absolutne spravna cesta 116 idecko = document.form.elements['id['+co+']'].value 117 hodnota = document.form.elements['value['+co+']'].value 118 kam = co + 1; 119 document.form.elements['id['+co+']'].value = document.form.elements['id['+kam+']'].value 120 document.form.elements['value['+co+']'].value = document.form.elements['value['+kam+']'].value 121 document.form.elements['id['+kam+']'].value = idecko 122 document.form.elements['value['+kam+']'].value = hodnota 123} 124 125function hh(text) 126{ 127 document.getElementById('hodnocenihelp').firstChild.data = text; 128} 129 130/* ajax skripty */ 131 132function GetXmlHttpObject(handler) 133{ 134 var objXMLHttp=null 135 if (window.XMLHttpRequest) 136 { 137 objXMLHttp=new XMLHttpRequest() 138 } 139 else if (window.ActiveXObject) 140 { 141 // objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") 142 try { 143 objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); 144 } catch (eror) { 145 objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); 146 } 147 } 148 return objXMLHttp 149} 150 151function ajaxvypis(_kam) 152{ 153 if (xmlHttp.readyState == 4) { 154 if (xmlHttp.status == 200) { 155 document.getElementById(_kam).innerHTML=xmlHttp.responseText; 156 } 157 else { 158 alert('Chyba'); 159 } 160 } 161} 162 163function ohodnot(co, id, jak) 164{ 165 xmlHttp=GetXmlHttpObject() 166 if (xmlHttp==null) 167 { 168 alert ("ProhlÞeÄ nepodporuje HTTP Request") 169 return 170 } 171 var url="/4ajax/hlasuj.php" 172 url=url+"?hodnoceni_"+co+"="+id 173 url=url+"&hodnoceni="+jak 174 175 xmlHttp.onreadystatechange=function () { 176 ajaxvypis('hodnoceni'); 177 } 178 xmlHttp.open("GET",url,true) 179 xmlHttp.send(null) 180} 181 182function zobraz_hlasovani(co,id) 183{ 184 xmlHttp=GetXmlHttpObject() 185 if (xmlHttp==null) 186 { 187 alert ("ProhlÞeÄ nepodporuje HTTP Request") 188 return 189 } 190 var url="/4ajax/zobraz_hlasovani.php" 191 url=url+"?"+co+"="+id 192 193 xmlHttp.onreadystatechange=function () { 194 ajaxvypis('hodnoceni'); 195 } 196 xmlHttp.open("GET",url,true) 197 xmlHttp.send(null) 198} 199 200function schovej_zdroj () { 201 var box = document.getElementById('zdroj'); 202 box.className='nezobrazuj'; 203} 204 205function editdiskuze(id, editovat) 206{ 207 xmlHttp=GetXmlHttpObject() 208 if (xmlHttp==null) 209 { 210 alert ("ProhlÞeÄ nepodporuje HTTP Request") 211 return 212 } 213 var url="/4ajax/edit_diskuze.php" 214 url=url+"?id="+id 215 url=url+"&editovat="+editovat 216 217 xmlHttp.onreadystatechange=function () { 218 ajaxvypis('bunka_prispevek_'+id); 219 } 220 xmlHttp.open("GET",url,true) 221 xmlHttp.send(null) 222} 223 224function zmen_vysku(id, vyska) { 225 document.getElementById(id).style.height = vyska+"px"; 226} 227 228function uloz_obalku_k_vydani(img) 229{ 230 xmlHttp=GetXmlHttpObject() 231 if (xmlHttp==null) 232 { 233 alert ("ProhlÞeÄ nepodporuje HTTP Request") 234 return 235 } 236 var id_selectu = 'vydani_obalka_'+img; 237 var url="/4ajax/add_obalka.php"; 238 url=url+"?id="+document.getElementById(id_selectu).value; 239 url=url+"&img="+img;
240 url=url+"&akce=add"; 241 242 xmlHttp.onreadystatechange=function () { 243 xml_obalky(); 244 } 245 246 xmlHttp.open("GET",url,true) 247 xmlHttp.send(null) 248} 249 250 251function odstranit_obalku_od_vydani(vydani, img) 252{ 253 xmlHttp=GetXmlHttpObject() 254 if (xmlHttp==null) 255 { 256 alert ("ProhlÞeÄ nepodporuje HTTP Request") 257 return 258 } 259 var url="/4ajax/add_obalka.php"; 260 url=url+"?id="+vydani; 261 url=url+"&img="+img; 262 url=url+"&akce=smaz"; 263 264 xmlHttp.onreadystatechange=function () { 265 xml_obalky(); 266 } 267 268 xmlHttp.open("GET",url,true) 269 xmlHttp.send(null) 270} 271 272function zobraz_form_pro_pridani_vydani(img) 273{ 274 xmlHttp=GetXmlHttpObject() 275 if (xmlHttp==null) 276 { 277 alert ("ProhlÞeÄ nepodporuje HTTP Request") 278 return 279 } 280 var url="/4ajax/add_obalka.php"; 281 url=url+"?img="+img; 282 url=url+"&zobraz_form=ano"; 283 284 xmlHttp.onreadystatechange = function () { 285 xml_obalky(); 286 } 287 288 xmlHttp.open("GET",url,true) 289 xmlHttp.send(null) 290 291} 292 293function nova_serie_form() 294{ 295 xmlHttp=GetXmlHttpObject() 296 if (xmlHttp==null) 297 { 298 alert ("ProhlÞeÄ nepodporuje HTTP Request") 299 return 300 } 301 var url="/4ajax/add_serie_form.php"; 302 303 xmlHttp.onreadystatechange = function () { 304 ajaxvypis('serie_u_knihy'); 305 } 306 307 xmlHttp.open("GET",url,true) 308 xmlHttp.send(null) 309 310} 311 312function nova_serie_save(ukladani) 313{ 314 serie_nazev = document.getElementById("serie_nazev").value; 315 var serie_nazev = serie_nazev.replace(/^\s+|\s+$/g, ''); 316 317 if (serie_nazev.length == 0 && ukladani == 1) { 318 alert('neuložÃm prázdný název série'); 319 } 320 else { 321 322 xmlHttp=GetXmlHttpObject() 323 if (xmlHttp==null) 324 { 325 alert ("ProhlÞeÄ nepodporuje HTTP Request") 326 return 327 } 328 var url="/exec/add-serie-save.php"; 329 if (ukladani == 1) { 330 url=url+"?serie_nazev=" + serie_nazev; 331 } 332 333 xmlHttp.onreadystatechange = function () { 334 ajaxvypis('serie_u_knihy'); 335 } 336 337 xmlHttp.open("GET",url,true) 338 xmlHttp.send(null) 339 340 } 341} 342 343function xml_obalky(_kam) 344{ 345 var xmldoc; 346 var img; 347 var vydani; 348 var vypis_vydani = ""; 349 var select_vydani = ""; 350 var plus_ikona; 351 var form_kam; 352 353 if (xmlHttp.readyState == 4) { 354 if (xmlHttp.status == 200) { 355 xmldoc = xmlHttp.responseXML; 356 // --------- zpracovani xml ------------- 357 img = xmldoc.getElementsByTagName('obalka')[0].firstChild.data; 358 mazat = xmldoc.getElementsByTagName('mazat')[0].firstChild.data; 359 pridat = xmldoc.getElementsByTagName('pridat')[0].firstChild.data; 360 zobraz_form = xmldoc.getElementsByTagName('zobraz_form')[0].firstChild.data; 361 362 form_kam = "form-"+img; 363 364 vydani = xmldoc.getElementsByTagName('obalka_vydani'); 365 if (vydani.length > 0) { 366 vypis_vydani += "<div>\n"; 367 for (var i=0;i<vydani.length;i++){ 368 //vytahnu spravna data 369 nazev = vydani[i].getElementsByTagName('nazev')[0].firstChild.data; 370 id = vydani[i].getElementsByTagName('id')[0].firstChild.data; 371 // poskladam 372 vypis_vydani += ""+nazev; 373 if (mazat == 1) { // zde bude JS pro mazani 374 vypis_vydani += " <a href=\"javascript:odstranit_obalku_od_vydani('"+id+"', '"+img+"')\"><img src=\"engine/smazat.png\" alt=\"smazat vydánà u této obálky\" /></a>"; 375 } 376 vypis_vydani += "<br />\n"; 377 } 378 vypis_vydani += "</div>\n"; 379 // plus tlacitko, jen kdyz mam prava = jsem prihlasen 380 if (pridat == 1) { 381 vypis_vydani += "<div class=\"c\">\n"; 382 vypis_vydani += '<a href="javascript:zobraz_form_pro_pridani_vydani(\''+img+'\')"><img src="engine/pridat.png" alt="pÅidat vydánà k této obálce"></a>'+"\n"; 383 vypis_vydani += "</div>\n"; 384 } 385 } 386 //alert(vypis_vydani);
387 // pokud nejsou zadna vydani, tj. prave jsem smazal posledni, zobrazim select 388 if (vypis_vydani == '' || zobraz_form == 1) { 389 // vyberu blok dat 390 vydani = xmldoc.getElementsByTagName('select_vydani'); 391 // poskladam select / i kdyz prazdny bo ho stejne reloadnu pomoci fce dole 392 select_vydani += '<select name="vydani_obalka_'+img+'" id="vydani_obalka_'+img+'" class="obalka_ke_knize">'; 393 select_vydani += ' <option value="">- vyber -</option>'; 394 select_vydani += '</select>'; 395 select_vydani += '<input value="ok" onclick="javascript:uloz_obalku_k_vydani(\''+img+'\');" type="button">'; 396 } 397 398 document.getElementById(form_kam).innerHTML = vypis_vydani+select_vydani; 399 400 // reloadnu ostatni selecty na strance 401 reload_selectu(xmldoc.getElementsByTagName('select_vydani')); 402 } 403 else { 404 alert('Chyba'); 405 } 406 } 407} 408 409function reload_selectu(xml_vydani) 410{ 411 var y = document.getElementsByTagName("select"); 412 var pocet_selectu = y.length; 413 414 var hodnota; 415 416 // projedeme ziskane selecty 417 for (i=0;i<pocet_selectu;i++) { 418 // nejdrive smazeme komplet vnitrek 419 pocet_option = y[i].options.length; 420 for (j=0;j<pocet_option; j++ ) { 421 y[i].remove(0); 422 } 423 424 // do vsech nahrajeme spravny obsah 425 for (j=0;j<xml_vydani.length; j++ ) { 426 // jako prvni hodim text "- vyber -" 427 if (j == 0) { 428 hodnota = document.createElement('option'); 429 hodnota.value = ''; 430 hodnota.text = '- vyber -'; 431 try { 432 y[i].add(hodnota,null); // standards compliant 433 } 434 catch(ex) 435 { 436 y[i].add(hodnota); // IE only 437 } 438 } 439 //vytahnu spravna data 440 hodnota = document.createElement('option'); 441 hodnota.value = xml_vydani[j].getElementsByTagName('id')[0].firstChild.data; 442 hodnota.text = xml_vydani[j].getElementsByTagName('nazev')[0].firstChild.data; 443 try { 444 y[i].add(hodnota,null); // standards compliant 445 } 446 catch(ex) 447 { 448 y[i].add(hodnota); // IE only 449 } 450 } 451 } 452} 453 454 455/* funkce neprazdne_odesli(_id, _form) 456 * zkontroluje, zda element s id = _id obsahuje nejaka data, pokud ne, vypise 457 * hlasku a umozni Ano/Ne odeslat formular s name = _form 458 * 459 */ 460 461function neprazdne_odesli(id, form) 462{ 463 var vstup = document.getElementById(id).value; 464 vstup = vstup.replace(/^\s+|\s+$/g, ''); 465 466 if (form == '') { 467 form = 0 468 } 469 else { 470 //form 471 } 472 473 if (vstup.length == 0) { 474 if (confirm('vkládáte prázdné pole [' + id + ']') ){ 475 this.document.forms[form].submit(); 476 } 477 else { 478 // nic 479 } 480 } 481 else { 482 this.document.forms[form].submit(); 483 } 484} 485 486 487 488function vyslo_nebo_pridano(co) 489{ 490 document.getElementById('prave_vyslo_a_nove_knihy').innerHTML='<p class="c">NaÄÃtám data...</p><p class="c"><img src="engine/ajax-loader.gif" style="margin-top:1em;" /></p>'; 491 492 xmlHttp=GetXmlHttpObject() 493 if (xmlHttp==null) 494 { 495 alert ("ProhlÞeÄ nepodporuje HTTP Request") 496 return 497 } 498 var url="/4ajax/prvni_vyslo_a_pridano.php" 499 url=url+"?zobraz="+co 500 501 xmlHttp.onreadystatechange=function () { 502 ajaxvypis('prave_vyslo_a_nove_knihy'); 503 } 504 xmlHttp.open("GET",url,true) 505 xmlHttp.send(null) 506} 507 508function posledni_komentar(co) 509{ 510 document.getElementById('posledni_komentar').innerHTML='<p class="c">NaÄÃtám data...</p><p class="c"><img src="engine/ajax-loader.gif" style="margin-top:1em;" /></p>'; 511 512 xmlHttp=GetXmlHttpObject() 513 if (xmlHttp==null) 514 { 515 alert ("ProhlÞeÄ nepodporuje HTTP Request") 516 return 517 } 518 var url="/4ajax/posledni_komentar.php" 519 url=url+"?zobraz="+co 520 521 xmlHttp.onreadystatechange=function () { 522 ajaxvypis('posledni_komentar'); 523 } 524 xmlHttp.open("GET",url,true) 525 xmlHttp.send(null) 526} 527 528function nejnavstevovanejsi(co) 529{ 530 /* 531 spravny_tag = document.getElementById('dnes_nejnavstevovanejsi'); 532 vyska = spravny_tag.offsetHeight; 533 spravny_tag.style.textAlign="center"; 534 spravny_tag.innerHTML='<img src="engine/ajax-loader.gif" style="margin-top:'+((vyska - (2*20))/ 2 )+'px;" />'; 535 */ 536 document.getElementById('dnes_nejnavstevovanejsi').innerHTML='<p class="c">NaÄÃtám data...</p><p class="c"><img src="engine/ajax-loader.gif" style="margin-top:1em;" /></p>'; 537 538 xmlHttp=GetXmlHttpObject() 539 if (xmlHttp==null) 540 { 541 alert ("ProhlÞeÄ nepodporuje HTTP Request") 542 return 543 } 544 var url="/4ajax/dnes_nejnavstevovanejsi.php" 545 url=url+"?zobraz="+co 546 547 xmlHttp.onreadystatechange=function () { 548 ajaxvypis('dnes_nejnavstevovanejsi'); 549 } 550 xmlHttp.open("GET",url,true) 551 xmlHttp.send(null) 552} 553 554/***************************************************************************** 555 * zobrazi formular text 556 *****************************************************************************/ 557/* 558function edit_text(this_tag, co){ 559 xmlHttp=GetXmlHttpObject() 560 kam = this_tag.parentNode.id; 561 if (xmlHttp==null) 562 { 563 alert ("ProhlÞeÄ nepodporuje HTTP Request") 564 return 565 } 566 var url="/4ajax/edit_text.php" 567 url=url+"?id="+co 568 url=url+"&kam="+kam 569 570 xmlHttp.onreadystatechange=function () { ajaxvypis(kam, xmlHttp); } 571 xmlHttp.open("GET",url,true) 572 xmlHttp.send(null) 573} 574 */ 575 576function edit_text(kam, co){ 577 kam = kam.parentNode.id; 578 $.get("/4ajax/edit_text.php", { 579 id: co, 580 kam: kam 581 }, function(vystup) { 582 $("#"+kam).html(vystup) 583 } ); 584} 585 586/***************************************************************************** 587 * ulozi formular s textem 588 *****************************************************************************/ 589 590function uloz_text(kam_vypsat) 591{ 592 var xData="idtexty="+document.getElementById('idtexty').value; 593 xData=xData+"&text="+document.getElementById('text').value; 594 xData=xData+"&nadpis="+document.getElementById('nadpis').value; 595 if (document.getElementById('prava_editace') != undefined) 596 { 597 xData=xData+"&prava_editace="+document.getElementById('prava_editace').value; 598 } 599 600 $.ajax({
601 type: "POST" , 602 url: "exec/edit-text.php", 603 data: xData, 604 success: function(html){ 605 $("#"+kam_vypsat).html(html); 606 } 607 }); 608} 609 610/***************************************************************************** 611 * zmen_vysku(id_elementu, o_kolik) 612 * pouziti pro textarea = zmeni vysku elementu, jehoz id je prvni parametr, 613 * o hodnotu z druheho parametru (kladna i zaporna) 614 * uprava 615 * kladna hodnota nasobi 2x vysku 616 * zaporna hodnota vysku 2x deli 617 * pokud by vysledek byl mensi nez 100, nastavi se 100 px a vyhodi se hlaska 618 *****************************************************************************/ 619 620function zmen_vysku(id, vyska) { 621 akt_vyska = document.getElementById(id).clientHeight; 622 //nova_vyska = (akt_vyska + vyska); 623 if (vyska > 0) { 624 nova_vyska = akt_vyska * 2; 625 } 626 else { 627 nova_vyska = akt_vyska / 2; 628 } 629 if (nova_vyska < 100) { 630 document.getElementById(id).style.height = "100px"; 631 alert('min vyska bloku pro text je 100px'); 632 } 633 else { 634 document.getElementById(id).style.height = nova_vyska+"px"; 635 } 636} 637 638 639 640function nejlepsi_dila_autora(autor_id, kp) 641{ 642 document.getElementById('nejlepsi_dila_obsah').innerHTML='<p class="c">NaÄÃtám data...</p><p class="c"><img src="engine/ajax-loader.gif" style="margin-top:1em;" /></p>'; 643 644 xmlHttp=GetXmlHttpObject() 645 if (xmlHttp==null) 646 { 647 alert ("ProhlÞeÄ nepodporuje HTTP Request") 648 return 649 } 650 var url="/4ajax/nejlepsi_dila_autora.php" 651 url=url+"?zobraz="+kp 652 url=url+"&autor_id="+autor_id 653 654 xmlHttp.onreadystatechange=function () { 655 ajaxvypis('nejlepsi_dila_obsah'); 656 } 657 xmlHttp.open("GET",url,true) 658 xmlHttp.send(null) 659} 660 661/****************************************************************************** 662 * JQuery Plugins 663 ****************************************************************************** / 664(function($) { 665 666 /* 667 * Auto-growing textareas; technique ripped from Facebook 668 * / 669 $.fn.autogrow = function(options) { 670 671 this.filter('textarea').each(function() { 672 673 var $this = $(this), 674 minHeight = $this.height(), 675 lineHeight = $this.css('lineHeight'); 676 677 var shadow = $('<div></div>').css({ 678 position: 'absolute', 679 top: -10000, 680 left: -10000, 681 width: $(this).width(), 682 fontSize: $this.css('fontSize'), 683 fontFamily: $this.css('fontFamily'), 684 lineHeight: $this.css('lineHeight'), 685 resize: 'none' 686 }).appendTo(document.body); 687 688 var update = function() { 689 690 var val = this.value.replace(/</g, '<') 691 .replace(/>/g, '>') 692 .replace(/&/g, '&') 693 .replace(/\n/g, '<br/>'); 694 695 shadow.html(val); 696 697 if (lineHeight == 'normal') 698 { 699 lineHeight = 14; 700 } 701 702 var newMax = Math.max(shadow.height() + parseInt(lineHeight), minHeight); 703 if (newMax < $(window).height() ) { 704 $(this).css('height', newMax); 705 } 706 else { 707 $(this).css('height', $(window).height() - parseInt(lineHeight) ) ; 708 } 709 710 } 711 712 $(this).change(update).keyup(update).keydown(update); 713 714 update.apply(this); 715 716 }); 717 718 return this; 719 720 } 721 722})(jQuery); 723 */ 724 725/***************************************************************************** 726 * pro udrzeni session / prihlaseni 727 *****************************************************************************/ 728function autoLogin() 729{ 730 setTimeout("autoLogin()", 60000); 731 $.get("autologin.php", function(){} ); 732} 733 734/****************************************************************************** 735 * JQuery load 736 ******************************************************************************/ 737 738$(document).ready (function() { 739 740 // tooltipy 741 vtip("a[title]"); 742 // $("a[title]").live('mouseout', function(){ 743 // vtip("a[title]"); 744 // });
745 746 // prodluzovani textovych vstupnich poli 747 //$('textarea').autogrow(); 748 749 // pro zalozeni knihovny 750 $('#zalozit-knihovnu').click(function() { 751 $.ajax({ 752 type: "GET", 753 url: "4ajax/zalozit-knihovnu.php", 754 // data: klicove_slovo + "=0&kasp=kniha&kasp_id=" + id, 755 success: function(html){ 756 $('#vizualni_knihovna').html(html); 757 } 758 }); 759 }); 760 761 $('.toggleNominace').click(function() { 762 $('.nominace').toggle(); 763 }); 764 765 $('.zobraz-vsechny-podrobnosti-antiku').click(function() { 766 $('.podrobneji').show(); 767 $('.zobraz-podrobnosti-antiku').html('<img src="engine/hide.png" alt="hide" />'); 768 }); 769 770 $('.skryj-vsechny-podrobnosti-antiku').click(function() { 771 $('.podrobneji').hide(); 772 $('.zobraz-podrobnosti-antiku').html('<img src="engine/show.png" alt="show" />'); 773 }); 774 775 $('.zvyrazni:not(.podrobneji)').click(function() { 776 var druhy_radek = $(this).attr("title"); 777 $(".podrobneji."+druhy_radek).toggle(); 778 if ($(this).find('img').attr("alt") == 'hide') 779 { 780 $(this).find('img').attr('src', 'engine/show.png').attr('alt','show'); 781 } 782 else 783 { 784 $(this).find('img').attr('src', 'engine/hide.png').attr('alt','hide'); 785 } 786 }); 787 788 789 790 // zvyrazneni radku v tabulce antik 791 $('.zvyrazni').mouseover(function() { 792 $(this).css("background-color","#E6DDBC"); 793 var druhy_radek = $(this).attr("title"); 794 $("."+druhy_radek).css("background-color","#E6DDBC"); 795 //$("."+druhy_radek+" td").css("color","#000"); 796 }).mouseout(function(){ 797 $(this).css("background-color","#fff"); 798 var druhy_radek = $(this).attr("title"); 799 $("."+druhy_radek).css("background-color","#fff"); 800 //$("."+druhy_radek+" td").css("color","gray"); 801 }); 802 803 804 // oznacovani diskuznich prispevku 805 $('.diskuzeTodo').click(function() { 806 var id_diskuze = $(this).attr("rel"); 807 var thisthis = $(this); 808 $.ajax({
809 type: "GET", 810 url: "4ajax/diskuze_todo.php", 811 data: "id_diskuze=" + id_diskuze, 812 success: function(html){ 813 thisthis.html(html); 814 } 815 }); 816 }); 817 818 // oznacovani diskuznich prispevku 819 $('.diskuzeTechnicka').click(function() { 820 var id_diskuze = $(this).attr("rel"); 821 var thisthis = $(this); 822 $.ajax({ 823 type: "GET", 824 url: "4ajax/diskuze_technicka.php", 825 data: "id_diskuze=" + id_diskuze, 826 success: function(html){ 827 thisthis.html(html); 828 } 829 }); 830 }); 831 832 // oznacovani diskuznich prispevku 833 $('.diskuzeSpoiler').click(function() { 834 var id_diskuze = $(this).attr("rel"); 835 var thisthis = $(this); 836 $.ajax({ 837 type: "GET", 838 url: "4ajax/diskuze_spoiler.php", 839 data: "id_diskuze=" + id_diskuze, 840 success: function(html){ 841 thisthis.html(html); 842 } 843 }); 844 }); 845 846 // zobrazeni kompletnich informaci o vydani v detailu antiku 847 $('#uplne_info_vydani').click(function(){ 848 $(this).parent().hide(); 849 $(this).parent().next().show(); 850 }); 851 852 // schova kompletni informace o vydani 853 $('#skryj_komplet_vydani').click(function(){ 854 $(this).parent().hide(); 855 $(this).parent().prev().show(); 856 }); 857 858 // vyhledavani vs statistika antikvariatu 859 $('#antik_search_label').click(function(){ 860 $('#antik_search').removeClass('hidden'); 861 $('#antik_stats').addClass('hidden'); 862 $('.open').removeClass('open'); 863 $(this).addClass('open'); 864 }); 865 866 $('#antik_stats_label').click(function(){ 867 $('#antik_search').addClass('hidden'); 868 $('#antik_stats').removeClass('hidden'); 869 $('.open').removeClass('open'); 870 $(this).addClass('open'); 871 }); 872 873 // mazani pripraveneho textu 874 $('.napoveda').focus(function(){ 875 // ziskat posledni cast id (min,max,od,do) 876 var id = this.id; 877 var rv = new RegExp("[a-z]+_[a-z]+_([a-z]+)"); 878 var id_parts = rv.exec(id); 879 // a v pripade souhlasu vymazat a odstranit sedou 880 if ($(this).val() == id_parts[1]) 881 { 882 $(this).val(''); 883 $(this).removeClass('gray'); 884 } 885 }); 886 887 $('.napoveda').blur(function(){ 888 // ziskat posledni cast id (min,max,od,do) 889 var id = this.id; 890 var rv = new RegExp("[a-z]+_[a-z]+_([a-z]+)"); 891 var id_parts = rv.exec(id); 892 // a v pripade souhlasu vymazat a odstranit sedou 893 if ($(this).val() == '') 894 { 895 $(this).val(id_parts[1]); 896 $(this).addClass('gray'); 897 } 898 }); 899 900 $("#antik_search").submit(function(){ 901 var submit_form = false 902 // smazat napovedni texty 903 $('.napoveda').each(function(){ 904 // ziskat posledni cast id (min,max,od,do) 905 var id = this.id; 906 var rv = new RegExp("[a-z]+_[a-z]+_([a-z]+)"); 907 var id_parts = rv.exec(id); 908 // a v pripade souhlasu vymazat a odstranit sedou 909 if ($(this).val() == id_parts[1]) 910 { 911 $(this).val(''); 912 } 913 }) 914 // kontrola vstupu formulare 915 916 $('input:text').each(function(){ 917 if ($(this).val() != '') 918 { 919 submit_form = true; 920 } 921 }) 922 923 // kontrola vyberu prodavajiciho 924 $('select').each(function(){ 925 if ($(this).val().length) 926 { 927 submit_form = true; 928 } 929 }); 930 931 if (!submit_form) { 932 // u neuspechu nastavit pomocne texty 933 $('.napoveda').each(function(){ 934 // ziskat posledni cast id (min,max,od,do) 935 var id = this.id; 936 var rv = new RegExp("[a-z]+_[a-z]+_([a-z]+)"); 937 var id_parts = rv.exec(id); 938 // a v pripade souhlasu vymazat a odstranit sedou 939 if ($(this).val() == '') 940 { 941 $(this).val(id_parts[1]); 942 $(this).addClass('gray'); 943 } 944 }); 945 } 946 947 return submit_form; 948 });
949 950 // nastaveni rel tagu hlavicky dokumentu 951 // prvni 952 if ($("a[rel=first]").length) { 953 var url = $('a[rel=first]').attr("href"); 954 $('head').append('<link rel="first" href="' + url + '" />'); 955 } 956 // predchozi 957 if ($("a[rel=prev]").length) { 958 var url = $('a[rel=prev]').attr("href"); 959 $('head').append('<link rel="prev" href="' + url + '" />'); 960 } 961 // dalsi 962 if ($("a[rel=next]").length) { 963 var url = $('a[rel=next]').attr("href"); 964 $('head').append('<link rel="next" href="' + url + '" />'); 965 } 966 // posledni 967 if ($("a[rel=last]").length) { 968 var url = $('a[rel=last]').attr("href"); 969 $('head').append('<link rel="last" href="' + url + '" />'); 970 } 971 972 // zobrazovani a skryvani prispevku v diskuzi 973 $('#zobrazitVsechnySkryte').click(function(){ 974 $('.alternativniTextPrispevku').hide(1000); 975 $('.prispevekDiskuze').show(1000); 976 $('.odkryvac').addClass('hidden'); 977 }); 978 979 $('#zobrazitVsechnyTechnicke').click(function(){ 980 $('.alternativniTextPrispevku.technicky').hide(1000); 981 $('.prispevekDiskuze.technicky').show(1000); 982 $(this).next().addClass('hidden'); 983 $(this).addClass('hidden'); 984 }); 985 986 $('#zobrazitVsechnySpoilery').click(function(){ 987 $('.alternativniTextPrispevku.spoiler').hide(1000); 988 $('.prispevekDiskuze.spoiler').show(1000); 989 $(this).next().addClass('hidden'); 990 $(this).addClass('hidden'); 991 }); 992 993 $('.zobrazTextPrispevku').click(function() { 994 var blok = $(this).parents('tr:first'); 995 blok.find('.alternativniTextPrispevku').hide(1000); 996 blok.find('.prispevekDiskuze').show(1000); 997 }); 998 999 $('#content a').filter(function() { 1000 return this.hostname && this.hostname !== location.hostname; 1001 }).addClass('external'); 1002 1003 $('#zobraz_filtry_a_pocty').click(function() { 1004 $(this).hide(); 1005 $("#filtry_a_pocty p").show("slow"); 1006 }); 1007 1008 1009 $('.najdiPovidku').keyup(function(e){ 1010 var str = $(this).val(); 1011 if (str.length > 2) 1012 { 1013 1014 if ($(this).attr('id') == 'najdiBpovidku') 1015 { 1016 var boxProPovidku = 'boxProPovidkuB'; 1017 if ($('#povA').length) 1018 { 1019 str += '&a=' + $('#povA').val(); 1020 } 1021 str += '&hledam=b'; 1022 } 1023 else 1024 { 1025 var boxProPovidku = 'boxProPovidkuA'; 1026 if ($('#povB').length) 1027 { 1028 str += '&b=' + $('#povB').val(); 1029 } 1030 str += '&hledam=a'; 1031 } 1032 1033 $.ajax({
1034 type: "GET", 1035 url: "4ajax/najdi-povidku.php", 1036 data: "q=" + str , 1037 success: function(html){ 1038 $('#' + boxProPovidku).html(html); 1039 } 1040 }); 1041 } 1042 }); 1043 1044 $('.najdiKnihu').keyup(function(e){ 1045 var str = $(this).val(); 1046 if (str.length > 2) 1047 { 1048 if ($('#idvydani').length) 1049 { 1050 str += '&idvydani=' + $('#idvydani').val(); 1051 } 1052 $.ajax({ 1053 type: "GET", 1054 url: "4ajax/najdi-knihu.php", 1055 data: "q=" + str , 1056 success: function(html){ 1057 $('#boxProKnihu').html(html); 1058 } 1059 }); 1060 } 1061 }); 1062 1063 // vydani knihy - oznaceni, ze je poznamka ok 1064 $('.poznamka_je_ok').click(function() { 1065 var id_vydani = $(this).attr("rel"); 1066 var thisthis = $(this); 1067 $.ajax({ 1068 type: "GET", 1069 url: "4ajax/vydani_poznamka_ok.php", 1070 data: "id_vydani=" + id_vydani, 1071 success: function(html){ 1072 thisthis.hide(); 1073 } 1074 }); 1075 1076 }); 1077 1078 // diskuze - presun prispevku do drbarny 1079 $('.diskuzeDoDrbarny').click(function() { 1080 var id_diskuze = $(this).attr("rel"); 1081 var thisthis = $(this); 1082 $.ajax({
1083 type: "GET", 1084 url: "4ajax/diskuze_do_drbarny.php", 1085 data: "id_diskuze=" + id_diskuze, 1086 success: function(html){ 1087 $('div#prispevek_'+id_diskuze).hide(); 1088 } 1089 }); 1090 1091 }); 1092 1093 // zobrazeni povidek shodneho nazvu 1094 $('#povidky_shodneho_nazvu a').click(function() { 1095 var id_povidka = $(this).attr("rel"); 1096 var thisthis = $(this); 1097 $.ajax({ 1098 type: "GET", 1099 url: "4ajax/povidka_zobrazit_duplicitni.php", 1100 data: "id_povidka=" + id_povidka, 1101 success: function(html){ 1102 $("#povidky_shodneho_nazvu").html(html); 1103 } 1104 }); 1105 1106 }); 1107 1108 // zobrazeni komentaroveho prostoru na strance 1109 $(".addComment").click(function() { 1110 $("#detail").html(''); 1111 $.ajax({ 1112 type: "GET" , 1113 url: "4ajax/add_komentar.php", 1114 data: $("#druhKarty").attr('name') + "=" + $(this).attr('name'), 1115 success: function(html){ 1116 $("#detail").html(html); 1117 } 1118 1119 }); 1120 }); 1121 1122 // zobrazeni do knihovny formu do prostoru na strance 1123 $(".addDoKnihovny").click(function() { 1124 $("#detail").html(''); 1125 $.ajax({
1126 type: "GET" , 1127 url: "4ajax/add_doknihovny.php", 1128 data: $("#druhKarty").attr('name') + "=" + $(this).attr('name'), 1129 success: function(html){ 1130 $("#detail").html(html); 1131 } 1132 1133 }); 1134 }); 1135 1136 // zobrazeni novy link formu do prostoru na strance 1137 $(".addLink").click(function() { 1138 $("#detail").html(''); 1139 $.ajax({ 1140 type: "GET" , 1141 url: "4ajax/add_link.php", 1142 data: $("#druhKarty").attr('name') + "=" + $(this).attr('name'), 1143 success: function(html){ 1144 $("#detail").html(html); 1145 } 1146 1147 }); 1148 }); 1149 1150 // zobrazeni vydani formu do prostoru na strance 1151 $(".addVydani").click(function() { 1152 $("#detail").html(''); 1153 $.ajax({ 1154 type: "GET" , 1155 url: "4ajax/add_vydani.php", 1156 data: $("#druhKarty").attr('name') + "=" + $(this).attr('name'), 1157 success: function(html){ 1158 $("#detail").html(html); 1159 } 1160 1161 }); 1162 }); 1163 1164 // menic velikosti textarei 1165 $('textarea:not(.processed)').TextAreaResizer(); 1166 1167 // schovani textu v bunce 1168 $("th a.pointer.hideShow").click(function() { 1169 $(this).removeClass('hideShow').addClass('showHide'); 1170 var columnClass = $(this).attr('name'); 1171 $('td.'+columnClass + " span").hide(); 1172 $(this).find('img').attr('src', 'engine/show.png'); 1173 1174 // zobrazeni textu v bunce 1175 $("th a.pointer.showHide").click(function(){ 1176 $(this).removeClass('showHide').addClass('hideShow'); 1177 var columnClass = $(this).attr('name'); 1178 $('td.'+columnClass + " span").show(); 1179 //$(this).find('img').attr('src', 'engine/hide.png'); 1180 $(this).find('img').hide(); 1181 }); 1182 1183 }); 1184 1185 1186 // nahrani obalky jako hlavni 1187 $('.vydani div.ob img').click(function(){ 1188 var vydani = $(this).attr('alt'); 1189 if ($("#select_vydani").length) { 1190 $('#select_vydani').val(vydani); 1191 } 1192 }); 1193 1194 $('.vydani div.ob img').dblclick(function(){ 1195 if ($("#select_vydani").length) { 1196 $('#priradit_obalky').submit(); 1197 } 1198 }); 1199 1200 1201 // zobrazeni prirazenych obalek na karte knihy, pro opetovne prirazeni 1202 $('#zobraz-prirazene').click(function(){ 1203 $("#prirazene-obalky").toggle(); 1204 }); 1205 1206 // zobrazi hodnoceni uzivatelu v pravem sloupci misto bocniho menu 1207 $('#sidebarBack').live('click', function(){ 1208 $.ajax({
1209 type: "GET" , 1210 url: "4ajax/sidebar.php", 1211 success: function(html){ 1212 $("#sidebar-a").html(html); 1213 } 1214 1215 }); 1216 }); 1217 1218 // zobrazi hodnoceni uzivatelu v pravem sloupci misto bocniho menu 1219 $('#showUserRatings').click(function(){ 1220 $.ajax({ 1221 type: "GET" , 1222 url: "4ajax/vypis.php", 1223 data: "co=hodnoceni&identifikator=" + $(this).attr('rel'), 1224 success: function(html){ 1225 $("#sidebar-a").html(html); 1226 } 1227 }); 1228 }); 1229 1230 // zobrazi seznam uzivatelu s dilev v top10 v pravem sloupci misto bocniho menu 1231 $('#showUserTop').click(function(){ 1232 $.ajax({ 1233 type: "GET" , 1234 url: "4ajax/vypis.php", 1235 data: "co=top10&identifikator=" + $(this).attr('rel'), 1236 success: function(html){ 1237 $("#sidebar-a").html(html); 1238 } 1239 }); 1240 }); 1241 1242 // zobrazi seznam uzivatelu co chteji cist v pravem sloupci misto bocniho menu 1243 $('#showUserWishRead').click(function(){ 1244 $.ajax({
1245 type: "GET" , 1246 url: "4ajax/vypis.php", 1247 data: "co=chcecist&identifikator=" + $(this).attr('rel'), 1248 success: function(html){ 1249 $("#sidebar-a").html(html); 1250 } 1251 }); 1252 }); 1253 1254 // zobrazi seznam uzivatelu co chteji mit v pravem sloupci misto bocniho menu 1255 $('#showUserWishBuy').click(function(){ 1256 $.ajax({ 1257 type: "GET" , 1258 url: "4ajax/vypis.php", 1259 data: "co=doknihovny&identifikator=" + $(this).attr('rel'), 1260 success: function(html){ 1261 $("#sidebar-a").html(html); 1262 } 1263 }); 1264 }); 1265 1266 // uvodni stranka - filtruje nejzivejsi diskuze 1267 $(".zalozkaDiskuze").live("click", function(){ 1268 1269 $.ajax({ 1270 type: "GET" , 1271 url: "4ajax/posledni_aktivni_diskuze.php", 1272 data: "diskuze-zalozka=" + $(this).attr("data-key"), 1273 success: function(html){ 1274 $("#poslendni_aktivni_diskuze").html(html); 1275 } 1276 }); 1277 }); 1278 1279 // editace prispevku diskuze 1280 $(".uloz_prispevek").live("click", function(){ 1281 var form = $(this).parents('form').first; 1282 var iddiskuze = $(form).find("#iddiskuze").val(); 1283 $.ajax({
1284 type: "POST" , 1285 url: "/exec/uloz-prispevek.php", 1286 data: ({ 1287 iddiskuze : iddiskuze, 1288 text: $(form).find("#edit_text").val(), 1289 titulek: $(form).find("#edit_titulek").val() 1290 }) , 1291 success: function(html){ 1292 $("#bunka_prispevek_"+iddiskuze).html(html); 1293 } 1294 }); 1295 }); 1296 1297 1298 // odpoved v diskuzi 1299 $(".reDiskuze").click(function(){ 1300 obsah_textu = $('#text').val(); 1301 //if (obsah_textu != "") obsah_textu = obsah_textu+"\n\n"; 1302 var _id = $(this).attr('rel'); 1303 $('#text').val(obsah_textu+"@"+jQuery.trim(_id)+" ") ; 1304 $('#text').focus(); 1305 }); 1306 1307 // zobrazeni prispevku na ktery se odpovida 1308 $(".showCommentSource").unbind().hover(function(a){ 1309 var xOffset=-10; 1310 var yOffset=10; 1311 $.ajax({ 1312 type: "GET" , 1313 url: "4ajax/ukaz_zdroj_v_komentarich.php", 1314 data: ({ 1315 urceni_zdroje: $(this).attr('rel'), 1316 diloUrl: $(this).attr('href') 1317 }), 1318 success: function(html){ 1319 t = html; 1320 if (t != "") { 1321 var top=(a.pageY+yOffset); 1322 var left=(a.pageX+xOffset); 1323 $("body").append('<div id="vtip"><img id="vtipArrow" />'+t+"</div>"); 1324 $("#vtip #vtipArrow").attr("src","engine/vtip_arrow.png"); 1325 $("#vtip").css("top",top+"px").css("left",left+"px").fadeIn("slow"); 1326 } 1327 } 1328 }); 1329 },function(){ 1330 $("div#vtip").fadeOut("slow").remove() 1331 }).mousemove(function(a){ 1332 xOffset=-10; 1333 yOffset=10; 1334 top=(a.pageY+yOffset); 1335 left=(a.pageX+xOffset); 1336 $("div#vtip").css("top",top+"px").css("left",left+"px") 1337 }) 1338 1339 // zobrazeni komentare na ktery se odpovida 1340 $(".showDiskuzeSource").unbind().hover(function(a){ 1341 var xOffset=-10; 1342 var yOffset=10; 1343 $.ajax({
1344 type: "GET" , 1345 url: "4ajax/ukaz_zdroj_v_diskuzi.php", 1346 data: "urceni_zdroje=" + $(this).attr('rel'), 1347 success: function(html){ 1348 t = html; 1349 if (t != "") { 1350 var top=(a.pageY+yOffset); 1351 var left=(a.pageX+xOffset); 1352 $("body").append('<div id="vtip"><img id="vtipArrow" />'+t+"</div>"); 1353 $("#vtip #vtipArrow").attr("src","engine/vtip_arrow.png"); 1354 $("#vtip").css("top",top+"px").css("left",left+"px").fadeIn("slow"); 1355 } 1356 } 1357 }); 1358 },function(){ 1359 $("div#vtip").fadeOut("slow").remove() 1360 }).mousemove(function(a){ 1361 xOffset=-10; 1362 yOffset=10; 1363 top=(a.pageY+yOffset); 1364 left=(a.pageX+xOffset); 1365 $("div#vtip").css("top",top+"px").css("left",left+"px") 1366 }) 1367 1368 // stejna vyska li v carouselu 1369 $('.carousel ul li').equalHeights(); 1370 1371 // zobrazeni komentaroveho prostoru na strance 1372 $(".addJineVydani").click(function() { 1373 $("#detail").html(''); 1374 $.ajax({
1375 type: "GET" , 1376 url: "4ajax/add_jine_vydani.php", 1377 data: "identifikator=" + $(this).attr('rel'), 1378 success: function(html){ 1379 $("#detail").html(html); 1380 } 1381 1382 }); 1383 }); 1384 1385 $(".editJineVydani").click(function() { 1386 $("#detail").html(''); 1387 $.ajax({ 1388 type: "GET" , 1389 url: "4ajax/add_jine_vydani.php", 1390 data: ({ 1391 identifikator : $(this).attr('rel'), 1392 klic : $(this).attr('tabindex') 1393 }), 1394 success: function(html){ 1395 $("#detail").html(html); 1396 } 1397 }); 1398 }); 1399 1400 $(".smazJineVydani").click(function() { 1401 var button = $(this); 1402 $.ajax({ 1403 type: "GET" , 1404 url: "exec/jine-vydani-akce.php", 1405 data: ({ 1406 smazJineVydani : 1, 1407 idpovidka : $(this).attr('rel'), 1408 klic : $(this).attr('tabindex') 1409 }), 1410 success: function(html){ 1411 button.parents('li').hide(); 1412 } 1413 }); 1414 }); 1415 1416 $("#addOceneniRok").click(function() { 1417 var id = $(this).attr('rel'); 1418 if ($("#edit_blok_" + id).length) { 1419 $("#edit_blok_" + id).remove(); 1420 } 1421 else { 1422 $(this).parents("h1:first").after('<div id="edit_blok_' + id + '" />'); 1423 $.ajax({
1424 type: "GET" , 1425 url: "4ajax/add_oceneni_rok.php", 1426 data: ({ 1427 idoceneni : id 1428 }), 1429 success: function(html){ 1430 $("#edit_blok_" + id).html(html); 1431 } 1432 }); 1433 } 1434 }); 1435 1436 $(".editOceneniRok").click(function() { 1437 var id = $(this).attr('rel'); 1438 if ($("#edit_blok_" + id).length) { 1439 $("#edit_blok_" + id).remove(); 1440 } 1441 else { 1442 $(this).parents("h2:first").after('<div id="edit_blok_' + id + '" />'); 1443 1444 $.ajax({ 1445 type: "GET" , 1446 url: "4ajax/add_oceneni_rok.php", 1447 data: ({ 1448 identifikator : id 1449 }), 1450 success: function(html){ 1451 $("#edit_blok_" + id).html(html); 1452 } 1453 }); 1454 } 1455 }); 1456 1457 1458 $(".copyOceneniRok").click(function() { 1459 var id = $(this).attr('rel'); 1460 if ($("#edit_blok_" + id).length) { 1461 $("#edit_blok_" + id).remove(); 1462 } 1463 else { 1464 $(this).parents("h2:first").after('<div id="edit_blok_' + id + '" />'); 1465 1466 $.ajax({
1467 type: "GET" , 1468 url: "4ajax/copy_oceneni_rok.php", 1469 data: ({ 1470 identifikator : id 1471 }), 1472 success: function(html){ 1473 $("#edit_blok_" + id).html(html); 1474 } 1475 }); 1476 } 1477 }); 1478 1479 $("#addOceneniKategorie").click(function() { 1480 var id = $(this).attr('rel'); 1481 if ($("#edit_blok_" + id).length) { 1482 $("#edit_blok_" + id).remove(); 1483 } 1484 else { 1485 $(this).parents("h1:first").after('<div id="edit_blok_' + id + '" />'); 1486 $.ajax({ 1487 type: "GET" , 1488 url: "4ajax/add_oceneni_kategorie.php", 1489 data: ({ 1490 idoceneni : id 1491 }), 1492 success: function(html){ 1493 $("#edit_blok_" + id).html(html); 1494 } 1495 }); 1496 } 1497 }); 1498 1499 $(".editOceneniKategorie").click(function() { 1500 var id = $(this).attr('rel'); 1501 if ($("#edit_blok_" + id).length) { 1502 $("#edit_blok_" + id).remove(); 1503 } 1504 else { 1505 $(this).parents("h2:first").after('<div id="edit_blok_' + id + '" />'); 1506 $.ajax({
1507 type: "GET" , 1508 url: "4ajax/add_oceneni_kategorie.php", 1509 data: ({ 1510 identifikator : id 1511 }), 1512 success: function(html){ 1513 $("#edit_blok_" + id).html(html); 1514 } 1515 }); 1516 } 1517 }); 1518 1519 1520 $(".sortOceneniKategorie").click(function() { 1521 var id = $(this).attr('rel'); 1522 if ($("#edit_blok_" + id).length) { 1523 $("#edit_blok_" + id).remove(); 1524 } 1525 else { 1526 $(this).parents("h3:first").after('<div id="edit_blok_' + id + '" />'); 1527 $.ajax({ 1528 type: "GET" , 1529 url: "4ajax/sort_oceneni_kategorie.php", 1530 data: ({ 1531 identifikator : id 1532 }), 1533 success: function(html){ 1534 $("#edit_blok_" + id).html(html); 1535 } 1536 }); 1537 } 1538 }); 1539 1540 $(".addRocnikTema").click(function() { 1541 var id = $(this).attr('rel'); 1542 if ($("#edit_blok_" + id).length) { 1543 $("#edit_blok_" + id).remove(); 1544 } 1545 else { 1546 $(this).parents("h2:first").after('<div id="edit_blok_' + id + '" />'); 1547 1548 $.ajax({
1549 type: "GET" , 1550 url: "4ajax/add_oceneni_rocnik_tema.php", 1551 data: ({ 1552 idrok : id 1553 }), 1554 success: function(html){ 1555 $("#edit_blok_" + id).html(html); 1556 } 1557 }); 1558 } 1559 }); 1560 1561 $(".newWorldNote").click(function() { 1562 var id = $(this).attr('rel'); 1563 if ($("#edit_blok_" + id).length) { 1564 $("#edit_blok_" + id).remove(); 1565 } 1566 else { 1567 $(this).parents("h1:first").after('<div id="edit_blok_' + id + '" />'); 1568 1569 $.ajax({ 1570 type: "GET" , 1571 url: "4ajax/add_svet_poznamka.php", 1572 data: ({ 1573 idSvet : id 1574 }), 1575 success: function(html){ 1576 $("#edit_blok_" + id).html(html); 1577 } 1578 }); 1579 } 1580 }); 1581 1582 $(".editWorldNote").click(function() { 1583 var id = $(this).attr('rel'); 1584 if ($("#edit_blok_" + id).length) { 1585 $("#edit_blok_" + id).remove(); 1586 } 1587 else { 1588 $(this).parents("li:first").append('<div id="edit_blok_' + id + '" />'); 1589 1590 $.ajax({
1591 type: "GET" , 1592 url: "4ajax/add_svet_poznamka.php", 1593 data: ({ 1594 idSvetDilo : id 1595 }), 1596 success: function(html){ 1597 $("#edit_blok_" + id).html(html); 1598 } 1599 }); 1600 } 1601 }); 1602 1603 1604 1605 // zobrazeni formulare pro pridani k oceneni 1606 $(".addOceneni").click(function() { 1607 $("#detail").html(''); 1608 $.ajax({ 1609 type: "POST" , 1610 url: "4ajax/add_oceneni.php", 1611 data: ({ 1612 karta : $("#druhKarty").attr('name'), 1613 identifikator: $(this).attr('rel') 1614 }), 1615 success: function(html){ 1616 $("#detail").html(html); 1617 } 1618 1619 }); 1620 }); 1621 1622 $(".addSvet").click(function() { 1623 $("#detail").html(''); 1624 $.ajax({ 1625 type: "POST" , 1626 url: "4ajax/add_svet.php", 1627 data: ({ 1628 karta : $("#druhKarty").attr('name'), 1629 identifikator: $(this).attr('rel') 1630 }), 1631 success: function(html){ 1632 $("#detail").html(html); 1633 } 1634 1635 }); 1636 }); 1637 1638 $(".sortWorld").click(function(){ 1639 $(".sortWorldList").attr("id", "sortable"); 1640 $.ajax({
1641 type: "GET" , 1642 url: "4ajax/sortable_css_js.php", 1643 success: function(html){ 1644 $(".sortWorldList").after(html); 1645 $("#sortWorldSubmit").show(); 1646 } 1647 }); 1648 }); 1649 1650 $(".reagovatNaKomentar").live('click', function(){ 1651 var id = $(this).attr('rel'); 1652 var _id = "reakce_blok_" + id; 1653 if ($("#" + _id).length) { 1654 $("#" + _id).remove(); 1655 } 1656 else { 1657 1658 $(this).parents(".komentar:first").after('<div id="' + _id + '" />'); 1659 $("#" + _id).html('<p class="c"><img src="engine/ajax-loader.gif" style="margin-top:1em;" /></p>'); 1660 1661 $.ajax({ 1662 type: "POST" , 1663 url: "x/diskuze_formular.php", 1664 data: ({ 1665 identifikatorKomentare: id 1666 }), 1667 success: function(html){ 1668 $("#" + _id).html(html); 1669 } 1670 }); 1671 } 1672 }); 1673 1674 // 1675 $(".editRocnikTema").click(function() { 1676 var id = $(this).attr('rel'); 1677 if ($("#edit_blok_" + id).length) { 1678 $("#edit_blok_" + id).remove(); 1679 } 1680 else { 1681 $(this).parents("strong:first").after('<div id="edit_blok_' + id + '" />'); 1682 1683 $.ajax({
1684 type: "POST" , 1685 url: "4ajax/edit_tema_text.php", 1686 data: ({ 1687 identifikator: id 1688 }), 1689 success: function(html){ 1690 $("#edit_blok_" + id).html(html); 1691 } 1692 1693 }); 1694 } 1695 }); 1696 1697 $(".deActiveRocnikTema").click(function() { 1698 var a = $(this); 1699 $.ajax({ 1700 type: "GET" , 1701 url: "exec/oceneni-rocniky-temata-akce.php", 1702 data: ({ 1703 deAktivId: a.attr('rel') 1704 }), 1705 success: function(html){ 1706 if (a.hasClass('show')) { 1707 a.removeClass('show').addClass('hide'); 1708 a.find('img').attr('src', 'engine/hide.png'); 1709 a.parents('dt').removeClass('neaktivni').next().removeClass('neaktivni'); 1710 a.next('.deleteRocnikTema').hide(); 1711 1712 } 1713 else { 1714 a.removeClass('hide').addClass('show'); 1715 a.find('img').attr('src', 'engine/show.png'); 1716 a.parents('dt').addClass('neaktivni').next().addClass('neaktivni'); 1717 a.next('.deleteRocnikTema').show(); 1718 1719 } 1720 } 1721 }); 1722 }); 1723 1724 $.pageKeyNavigation(); 1725 $.ie6Alert('Tento web nemá rád Internet Explorer 6, prohlÞeÄ z roku 2001 by již nemÄl být použÃván.'); 1726 1727 1728 var hash = window.location.hash; 1729 /* 1730 if (hash) { 1731 $(hash).addClass('necteno'); 1732 } 1733 */ 1734 1735 // odebrat href kvuli ajax pocitani poctu kliku 1736 $("a.affilLink-off").each(function(){ 1737 $(this).attr('data-href', $(this).attr('href')); 1738 $(this).removeAttr('href'); 1739 }); 1740 1741 // zapocitat klik a prejit na adresu... 1742 $("a.affilLink-off").click(function(){ 1743 var aTag = $(this); 1744 $.ajax({
1745 type: "get" , 1746 url: "4ajax/affil-klik.php", 1747 data: ({ 1748 identifikator: $(this).attr('data-id') 1749 }), 1750 success: function(){ 1751 window.location = aTag.attr('data-href'); 1752 } 1753 }); 1754 }); 1755 1756 // zobrazit poznamku 1757 $("#detail a.note").click(function(){ 1758 var aTag = $(this); 1759 $.ajax({ 1760 type: "get" , 1761 url: "4ajax/poznamka.php", 1762 data: ({ 1763 kasp_id: $(this).closest('*[data-kasp-id]').attr('data-kasp-id'), 1764 kasp: $(this).closest('*[data-kasp]').attr('data-kasp') 1765 }), 1766 success: function(html){ 1767 $(aTag).closest('div').html(html); 1768 } 1769 }); 1770 }); 1771 1772 // schovat poznamku, zobrazit jeji formular 1773 $("#detail .editNote").live('dblclick', function(){ 1774 var divTag = $(this); 1775 $("div.note", divTag).toggle(); 1776 $("div.form", divTag).toggle(); 1777 }); 1778 1779 // schovat poznamku, zobrazit jeji formular 1780 $("#detail .editNote .note p a").live('click', function(){ 1781 var divTag = $(this).closest(".editNote"); 1782 $("div.note", divTag).toggle(); 1783 $("div.form", divTag).toggle(); 1784 }); 1785 1786 $("#detail .editNote input.close").live('click', function(){ 1787 var divTag = $(this).closest(".editNote"); 1788 $("div.note", divTag).toggle(); 1789 $("div.form", divTag).toggle(); 1790 }); 1791 1792 $("#detail .editNote input.save").live('click', function(){ 1793 var divTag = $(this).closest(".editNote"); 1794 $.ajax({
1795 type: "post" , 1796 url: "4ajax/edit_poznamka.php", 1797 data: ({ 1798 //identifikator: $(this).closest('*[data-id]').attr('data-id'), 1799 kasp_id: $(this).closest('*[data-kasp-id]').attr('data-kasp-id'), 1800 kasp: $(this).closest('*[data-kasp]').attr('data-kasp'), 1801 note: $('textarea', divTag).val() 1802 }), 1803 success: function(html){ 1804 $("div.note", divTag).html(html); 1805 } 1806 }); 1807 $("div.note", divTag).toggle(); 1808 $("div.form", divTag).toggle(); 1809 }); 1810 1811 $(".deleteNote").live('click', function() { 1812 var divTag = $(this).closest(".editNote"); 1813 $.ajax({ 1814 type: "post" , 1815 url: "4ajax/delete_poznamka.php", 1816 data: ({ 1817 kasp_id: $(this).closest('*[data-kasp-id]').attr('data-kasp-id'), 1818 kasp: $(this).closest('*[data-kasp]').attr('data-kasp'), 1819 id: $(this).attr('data-id') 1820 }), 1821 success: function(html){ 1822 $("div.note", divTag).html(html); 1823 } 1824 }); 1825 }); 1826 1827 1828 $(".show_spoiler").click(function(){ 1829 $(this).hide(); 1830 $("#kniha_spoiler").show(); 1831 }); 1832});
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.