1function log(d) { 2 if (typeof console != "undefined") { 3 try { 4 //console.log(d); 5 } catch (e) {} 6 } 7} 8 9function MapyUdalosti() { 10 this.baseAjaxUrl = location.protocol + "//" + location.host + '/aplikace/mapy-udalosti/ajax.php'; 11 this.key = '93bf7706890459779170a38525b58d7f'; 12 this.userItemsOnMap = []; 13 this.points = null; 14 this.editorTpl = [ 15 ['mode', 'separator', 'cut', 'copy', 'paste', 'word', 'separator', 'undo', 'cancel', 'separator', 'italic', 'bold', 'separator', 'link', 'link_article', 'link_file'] 16 ]; 17} 18 19MapyUdalosti.prototype.toPopup = function(el, w, h, popupId, afterCloseCallback, callback) { 20 var url = el.href.replace("index.php", "ajax.php") + '&htmlAjax=yes'; 21 if (!w) 22 var w = 0; 23 if (!h) 24 var h = 0; 25 if (popupId) { 26 27 } else { 28 if (!afterCloseCallback) 29 var afterCloseCallback = null; 30 as4uPopup.show(url, w, h, callback, null, afterCloseCallback); 31 } 32 return false; 33}; 34//odeslani formu ajaxem - jako get 35MapyUdalosti.prototype.sendForm = function(form, cil, post, callback) { 36 $("#mapa_oznameni_legenda").remove(); 37 var url = form.action; 38 39 if (post) { 40 //poslat postem 41 this.ajaxLink({ url: url, data: $(form).serializeArray() }, cil, callback); 42 43 } else { 44 url += '&' + $(form).serialize(); 45 log(url); 46 this.ajaxLink(url, cil, callback); 47 } 48 49 return false; 50}; 51//provede refresh na patricna mista 52MapyUdalosti.prototype.refresher = function() { 53 var toto = this; 54 log('refresher'); 55 $('input.refresher').each(function() { 56 var arr = this.value.split('||'); 57 log(this.value); 58 if (arr[0]) 59 toto.ajaxLink(arr[0], arr[1]); 60 }); 61 62}; 63//odesalni formulare s prehledem 64MapyUdalosti.prototype.sendFiltrForm = function() { 65 $('#prehledFiltrForm').submit(); 66 as4uPopup.close(); 67}; 68//smazani zprav 69MapyUdalosti.prototype.clearMessage = function(timer) { 70 71 var killEmAll = function() { 72 $('p.message').fadeOut(650, function() { 73 $(this).detach(); 74 }); 75 }; 76 if (timer) { 77 setTimeout(killEmAll, timer); 78 } else { 79 killEmAll(); 80 } 81 82}; 83//zobrazeni popup okna nad mapou 84MapyUdalosti.prototype.showPopup = function(parentElement, urlParams, w, h) { 85 var parentElement = this.detectElement(parentElement); 86 87 if (!w) { 88 var w = 450; 89 } 90 if (!h) { 91 var h = 400; 92 } 93 log(urlParams); 94 as4uPopup.show(urlParams, w, h); 95 96 return; 97 } 98 //udrozovat v danem elementu jeden prazdny input 99MapyUdalosti.prototype.keepOneEmptyInput = function(input, id) { 100 101 var kont = $('#' + id); 102 if (kont.length > 0) { 103 var emptyCount = 0; 104 kont.find('input[type=text]').each(function() { 105 if (this.value == '' || this.value == ' ') { 106 emptyCount++; 107 } 108 if (emptyCount > 1) { 109 $(this).detach(); 110 } 111 }); 112 if (emptyCount == 0) { 113 kont.find('input[type=text]').eq(0).clone().val('').appendTo(kont); 114 } 115 116 } 117 118}; 119 120MapyUdalosti.prototype.log = function(data) { 121 if ($('#logPlace')) { 122 $('#logPlace').html($('#logPlace').html() + '<br />' + data); 123 124 } 125} 126 127MapyUdalosti.prototype.getPopupContent2 = function(objectId) { 128 var content; 129 if (!objectId) 130 return false; 131 132 var aaa = $.ajax({ 133 url: mapyUdalosti.baseAjaxUrl + '?akce=popup&subakce=buble&htmlAjax=yes&id=' + objectId, 134 async: false, 135 success: function(html) { 136 content = html; 137 } 138 }); 139 return content; 140}; 141 142String.prototype.escapeSpecialChars = function() {
143 return this.replace(/\\n/g, "\\n") 144 .replace("/\\'/g", "\\'") 145 .replace('/\\"/g', '"\\""') 146 .replace(/\\&/g, "\\&") 147 .replace(/\\r/g, "\\r") 148 .replace(/\\t/g, "\\t") 149 .replace(/\\b/g, "\\b") 150 .replace(/\\f/g, "\\f"); 151}; 152 153function obrUploadFinish(img, status, errors, msg, skatID, pointToShow) { 154 if (!skatID) 155 var skatID = this.def_skatID; 156 if (status == "OK") { 157 alert(msg); 158 159 if (typeof(mapyUdalosti.afterObrUpload) == "function") { 160 mapyUdalosti.afterObrUpload(); 161 mapyUdalosti.afterObrUpload = ""; 162 } 163 } else { 164 alert(errors); 165 } 166 as4uPopup.close(); 167 168} 169//vyvolani celeho adminu do pozadovaneho divu 170MapyUdalosti.prototype.showAdmin = function() { 171 if (!cw) { 172 var cw = Math.round($(window).width() * 0.6); 173 } 174 if (!ch) { 175 var ch = Math.round($(window).height() * 0.75); 176 } 177 var top = Math.round($(window).height() / 2 - ch / 2); 178 var left = Math.round($(window).width() / 2 - cw / 2); 179 180 var contOver = $('<div>', { id: "mapyUdalosti-adminAjaxContOver", style: "width:" + cw + "px;height:" + ch + "px;padding-top:30px;position:absolute;z-index:2;border:4px solid #333333;top:" + top + "px;left:" + left + "px;" }).appendTo('body'); 181 $('<input>', { 182 id: "mapyUdalosti-adminAjaxClose", 183 type: "button", 184 style: "width:25px;position:absolute;top: 2px; right: 5px;text-align:center;", 185 val: "X", 186 click: function() { 187 try { 188 contOver.detach(); 189 } catch (e) { 190 if ($('#mapyUdalosti-adminAjaxContOver')) 191 $('#mapyUdalosti-adminAjaxContOver').detach(); 192 } 193 } 194 }).appendTo(contOver); 195 $('<div>', { id: "mapyUdalosti-adminAjaxCont", style: "overflow:auto;padding:5px 10px 10px 10px;width:" + (parseInt(cw) - 20) + "px;height:" + (parseInt(ch) - 45) + "px;" }).appendTo(contOver); 196 197 var id = "mapyUdalosti-adminAjaxCont"; 198 199 this.showAdminId = id; 200 var url = this.baseAjaxUrl + '?akce=admin&htmlAjax=yes'; 201 $.ajax({
202 url: url, 203 success: function(html) { 204 $('#' + id).html(html); 205 } 206 }); 207 } 208 // Jednoduchy parser json objectu na string 209MapyUdalosti.prototype.simpleJson2String = function(json, depth) { 210 if (!depth) 211 var depth = 0; 212 213 if (depth > 30) { //kontrola prilisneho zanoreni -> ochrana pred zacyklenim 214 log('Moc hluboke'); 215 return; 216 } 217 218 if (typeof json == "object") { 219 if (Object.prototype.toString.call(json) === '[object Array]') { //pokud je to pole 220 var str = "["; 221 var isArray = true; 222 } else { 223 var str = "{"; 224 var isArray = false; 225 } 226 try { 227 var carka = ""; 228 for (var i in json) { 229 if (isArray) { 230 str += carka; 231 } else { 232 str += carka + '"' + i + '":'; 233 } 234 switch (typeof json[i]) { 235 case "string": 236 str += '"' + json[i].escapeSpecialChars() + '"'; 237 break; 238 case "number": 239 str += json[i]; 240 break; 241 case "object": 242 str += this.simpleJson2String(json[i], depth + 1); 243 break; 244 case "boolean": 245 str += json[i] ? '"true"' : '"false"'; 246 break; 247 default: 248 str += '""'; 249 break; 250 } 251 carka = ","; 252 } 253 } catch (e) { 254 log('Error in simpleJson2String' + e.message); 255 } 256 if (isArray) { 257 str += "]"; 258 } else { 259 str += "}"; 260 } 261 } 262 263 return str; 264 265}; 266 267var mapyUdalosti = new MapyUdalosti(); 268 269function editovat_db_ulice(id) { 270 if (!$("#editace_obal").length) { 271 as4uPopup.show($("#nastaveni_ajax").val() + "&akce=nastaveni&subakce=editovatt_db_ulice&id=" + id, 500, 320); 272 } 273} 274 275function smazat_db_ulice(id) { 276 if (confirm("Opravdu chcete smazat tuto ulici?")) { 277 $.get($("#nastaveni_ajax").val() + "&akce=nastaveni&subakce=smazatt_db_ulice&id=" + id, function() { 278 $("#nastaveniShowCont").load($("#nastaveni_ajax").val() + "&akce=nastaveni&subakce=databaze_ulic"); 279 }); 280 } 281} 282 283function ulozit_db_ulice(modid, id) { 284 $.post($("#nastaveni_ajax").val() + "&akce=nastaveni&subakce=ulozitt_db_ulice&id=" + id, { 285 ulice: $("#ulice").val(), 286 souradnice: encodeURI($("#souradnice").val()) 287 }, function() { 288 as4uPopup.close(modid); 289 $("#nastaveniShowCont").load($("#nastaveni_ajax").val() + "&akce=nastaveni&subakce=databaze_ulic"); 290 }); 291} 292 293 294/* ------------------------------------------ Zkontrolováno ------------------------------------------ Zkontrolováno ------------------------------------------*/ 295//odeslani formulare -> prerozdeleni dle typu na patricnou fci 296MapyUdalosti.prototype.sendDrawForm = function(form, type, callback, popupId, tematicke) { 297 298 var url = form.action; 299 var toto = this; 300 301 var dataArr = $(form).serializeArray(); 302 303 $(form).find('input[type=submit]').attr('disabled', true); 304 var data = {}; 305 for (var i in dataArr) { 306 data[dataArr[i].name] = dataArr[i].value; 307 } 308 309 $('.mapy_json_data').each(function() { 310 var jsonData = {}; 311 var idParts = $(this).attr('id').split('_'); 312 var id = idParts[idParts.length - 1]; 313 314 //Prepate json object 315 //Jedna se o editaci objektu 316 try { 317 if (id > 0) { 318 jsonData = $.parseJSON($('#mapy_json_data_' + id).val()); 319 } else { 320 jsonData.points = toto.aktualLinePoints; 321 } 322 var oznameni_druhy = data["objekt_vlastnosti[" + id + "]"]; 323 var arr = oznameni_druhy.split('|');
324 var druhy_oznameni_icon = arr[0]; 325 if (druhy_oznameni_icon.indexOf('http') === -1) { 326 druhy_oznameni_icon = $('#map_icon_dir').val() + druhy_oznameni_icon; 327 } 328 data.color = arr[1]; 329 data.lineWidth = arr[2]; 330 data.opacity = arr[3]; 331 332 var type = data["objectTyp[" + id + "]"]; 333 334 switch (type) { 335 case "line": 336 jsonData.type = 'line'; 337 jsonData.lineWidth = data.lineWidth; 338 jsonData.color = data.color; 339 jsonData.points = JSON.parse('[' + data['coords'] + ']'); 340 break; 341 case "polygon": 342 jsonData.type = 'polygon'; 343 jsonData.opacity = data.opacity; 344 jsonData.color = data.color; 345 jsonData.points = JSON.parse('[' + data['coords'] + ']'); 346 break; 347 case "point": 348 jsonData.type = 'point'; 349 jsonData.icon = druhy_oznameni_icon;
350 jsonData.points = JSON.parse('[' + data['coords'] + ']'); 351 break; 352 case "box": 353 jsonData.type = 'box'; 354 jsonData.color = data.color; 355 break; 356 } 357 } catch (e) { 358 log('Chyba sendDrawForm ' + e.message); 359 } 360 try { 361 var jsonString = toto.simpleJson2String(jsonData); 362 $('#mapy_json_data_' + id).val(jsonString); 363 } catch (e) { 364 log('Chyba set json data' + e.message); 365 } 366 }); 367 368 var addObject = $("#addObject").val(); 369 370 try { 371 //Poslani pozadavku na ulozeni 372 this.ajaxLink({ url: url, data: $(form).serializeArray() }, null, function(xml) { 373 try { 374 if ($(xml).find('status').text() == 'OK') { 375 if ($(xml).find('IDoznameni').text()) { 376 if (tematicke > 0) { 377 prenacti_mapu(); 378 refreshseznam(tematicke); 379 } else { 380 mapyUdalosti.drawOznameniOnMap(null, $(xml).find('IDoznameni').text()); 381 } 382 } 383 } else { 384 alert($(xml).find('status').text()); 385 } 386 } catch (e) { 387 log('Error ajax sendDrawForm ' + e.message); 388 } 389 as4uPopup.close(popupId); 390 391 if (addObject == "add") { //pridavame novy objekt 392 as4uPopup.show($("#baseAjaxUrl").val() + '&akce=oznameni&htmlAjax=yes&subakce=addButtons&id=' + $(xml).find('IDoznameni').text(), 350, 250); 393 } 394 }); 395 } catch (e) { 396 log('Chyba sendDrawForm ' + e.message); 397 } 398 return false; 399}; 400//Set full size - nastaveni plne sirky mapoveho kontejneru 401MapyUdalosti.prototype.setFullSize = function(div, div2, vyskaOnly, rodic_or_widnow) { 402 try { 403 var d2w = 0; 404 405 if ($('#' + div2).length > 0) { 406 d2w = $('#' + div2).width(); 407 } 408 409 var w = window; 410 if (typeof rodic_or_widnow != "undefined") { 411 var w = $(rodic_or_widnow); 412 } 413 414 var sirka = $(w).width() - 1 - d2w; 415 var vyska = $(window).height() - $('#mapyUdalostiTopCont').outerHeight() - $('#top-frame').outerHeight() - 40 + ((vyskaOnly) ? $('#mapyUdalostiTopCont').height() : 0); 416 417 $('#' + div).css("height", vyska); 418 419 if (!vyskaOnly) { 420 $('#' + div).css("width", sirka); 421 } 422 } catch (e) {} 423}; 424//submenu - záložky 425MapyUdalosti.prototype.initZalozky = function(id, zalozkyCont) { 426 $('#' + id).find('span').each(function(index, element) { 427 if (index == 0) { 428 $(element).parent().addClass('active'); 429 } 430 $(element).attr("id", "zalozka-" + index); 431 $(element).parent().click(function() { 432 if (zalozkyCont) { 433 $('#' + zalozkyCont).find('.zalozkaObsah').hide(); 434 } 435 $('#' + id).find('span').each(function(index, element) { 436 $(element).parent().removeClass('active'); 437 $('#sub-' + $(element).attr('id')).css('display', 'none'); 438 }); 439 $('#sub-' + $(this).attr('id')).css('display', 'block'); 440 $(this).addClass('active'); 441 if (zalozkyCont) { 442 $('#' + zalozkyCont).find('.zalozkaObsah').eq(index).show(); 443 } 444 $('#mapaContMain').css({ 445 width: $('#allZalozkyCont').width(), 446 height: $('#allZalozkyCont').innerHeight() - $('#container-search').outerHeight() 447 }); 448 $('#mapCont').css({ 449 width: $('#allZalozkyCont').width(), 450 height: $('#allZalozkyCont').innerHeight() - $('#container-search').outerHeight() 451 }); 452 $('#pozadavkyPrehledCont').parent().css({ 453 height: $('#allZalozkyCont').innerHeight() 454 }); 455 $('#pozadavkyPrehledCont').css({ 456 height: $('#pozadavkyPrehledCont').parent().height() 457 }); 458 $('#oznameniPrehledCont').parent().css({ 459 height: $('#allZalozkyCont').innerHeight() 460 }); 461 $('#oznameniPrehledCont').css({ 462 height: $('#oznameniPrehledCont').parent().height() 463 }); 464 }); 465 });
466} 467 468/****************************************************** 469 * Funkce pro kresleni objektu a tvaru nad mapou 470 ******************************************************/ 471 472MapyUdalosti.prototype.drawOznameniOnMap = function(druhyID, IDoznameni) { 473 if (IDoznameni > 0) { 474 detail_tmp = IDoznameni; 475 } 476 delall(); 477 this.userItemsOnMap = []; 478 //odeslani formu 479 if ($('#prehledFiltrForm').length > 0) { 480 if (druhyID) { 481 $('#druhy_oznameni').val(druhyID); 482 } 483 $('#prehledFiltrForm').submit(); 484 } else { 485 mapfiltr(); 486 } 487 488 var baseAjaxUrlInput = $('#mapyUdalostiBaseAjaxUrl'); 489 if ($('#baseAjaxUrl').length > 0) { 490 baseAjaxUrlInput = $('#baseAjaxUrl'); 491 } 492 493 //vykrelseni legendy 494 if ($('#mapaContMain').length > 0) { 495 if (IDoznameni) { 496 if ($('#mapaContMain').find('#mapa_oznameni_legenda').length == 0) { 497 var legenda = $('<div>').attr('id', 'mapa_oznameni_legenda').appendTo($('#mapaContMain')); 498 } else { 499 var legenda = $('#mapaContMain').find('#mapa_oznameni_legenda'); 500 } 501 legenda.load(baseAjaxUrlInput.val() + 'akce=oznameni&subakce=oznameni_legenda&htmlAjax=yes&IDoznameni=' + IDoznameni) 502 } else { 503 if ($('#mapaContMain').find('#mapa_oznameni_legenda').length > 0) { 504 $('#mapaContMain').find('#mapa_oznameni_legenda').html(''); 505 } 506 } 507 } 508} 509 510MapyUdalosti.prototype.ajaxLink = function(link, cil, callback) { 511 var method = "GET"; 512 var data = null; 513 514 if (typeof link == "string") { 515 var url = link; 516 if (url.indexOf('ajax.php') == -1) { 517 location.href = url; 518 return false; 519 } 520 } else { 521 if (link.url && link.data) { 522 var url = link.url; 523 var data = link.data; 524 method = 'POST'; 525 } else { 526 var url = link.href; 527 if (url.indexOf('ajax.php') == -1) { //neni to ajax 528 return true; 529 } 530 } 531 } 532 533 if (cil) { 534 if (!cil) { 535 var cil = this.showAdminId; 536 } 537 cil = $('#' + cil); 538 cil.addClass("loadingAjax"); 539 } 540 $.ajax({
541 url: url, 542 type: method, 543 data: data, 544 success: function(html) { 545 try { 546 if (cil) { 547 cil.html(html); 548 cil.removeClass("loadingAjax"); 549 } 550 } catch (e) { 551 alert(e); 552 } 553 554 if (typeof callback == "function") { 555 callback(html); 556 } 557 } 558 }); 559 return false; 560 } 561 //Zpracovani popupu definice parametru objektu u oznameni 562MapyUdalosti.prototype.initDefParamOzn = function(id) { 563 if ($('#oznameni_objekt_vlastnosti_' + id).length > 0) { 564 var pArr = $('#oznameni_objekt_vlastnosti_' + id).val().split('|'); 565 var nazev = $('#oznameni_nazev_objekt_' + id).val(); 566 $('#nazev_objektu_' + id).val(nazev); 567 568 $('#kategorie_objektu_' + id).val($('#oznameni_kategorie_objekt_' + id).val()); 569 $('#popis_objektu_' + id).val($('#oznameni_popis_objekt_' + id).val()); 570 $('#psc_objektu_' + id).val($('#oznameni_psc_objekt_' + id).val()); 571 $('#ulice_objektu_' + id).val($('#oznameni_ulice_objekt_' + id).val()); 572 $('#mesto_objektu_' + id).val($('#oznameni_mesto_objekt_' + id).val()); 573 $('#telefon_objektu_' + id).val($('#oznameni_telefon_objekt_' + id).val()); 574 $('#www_objektu_' + id).val($('#oznameni_www_objekt_' + id).val()); 575 $('#email_objektu_' + id).val($('#oznameni_email_objekt_' + id).val()); 576 577 if ($('#color_objektu_' + id).length > 0) { 578 $('#color_objektu_' + id).val(pArr[1]); 579 } 580 $('#specialSelectIcons_' + id).find('input[name=icon]').each(function() { 581 if (this.value == pArr[0]) { 582 this.checked = true; 583 } 584 }); 585 if ($('#lineWidth_objektu_' + id).length > 0) { 586 $('#lineWidth_objektu_' + id).val(pArr[2]); 587 } 588 if ($('#opacity_objektu_' + id).length > 0) { 589 $('#opacity_objektu_' + id).val(pArr[3]); 590 } 591 } 592 } 593 //nastaveni parametru objektu do skryte promene 594MapyUdalosti.prototype.setParamOzn = function(id, pip) { 595 if (id) { 596 if ($('#oznameni_objekt_vlastnosti_' + id).length > 0) { 597 var icon = '', 598 color = '', 599 lineWidth = '', 600 opacity = ''; 601 if ($('#nazev_objektu_' + id).length > 0 && $('#oznameni_nazev_objekt_' + id).length > 0) { 602 $('#oznameni_nazev_objekt_' + id).val($('#nazev_objektu_' + id).val()); 603 } 604 605 $('#oznameni_kategorie_objekt_' + id).val($('#kategorie_objektu_' + id).val()); 606 $('#oznameni_popis_objekt_' + id).val($('#popis_objektu_' + id).val()); 607 $('#oznameni_psc_objekt_' + id).val($('#psc_objektu_' + id).val()); 608 $('#oznameni_ulice_objekt_' + id).val($('#ulice_objektu_' + id).val()); 609 $('#oznameni_mesto_objekt_' + id).val($('#mesto_objektu_' + id).val()); 610 $('#oznameni_telefon_objekt_' + id).val($('#telefon_objektu_' + id).val()); 611 $('#oznameni_www_objekt_' + id).val($('#www_objektu_' + id).val()); 612 $('#oznameni_email_objekt_' + id).val($('#email_objektu_' + id).val()); 613 614 $('#specialSelectIcons_' + id).find('input[name=icon]').each(function() { 615 if (this.checked) { 616 icon = this.value; 617 } 618 }); 619 620 if ($('#color_objektu_' + id).length > 0) { 621 color = $('#color_objektu_' + id).val(); 622 } 623 if ($('#lineWidth_objektu_' + id).length > 0) { 624 lineWidth = $('#lineWidth_objektu_' + id).val(); 625 } 626 if ($('#opacity_objektu_' + id).length > 0) { 627 opacity = $('#opacity_objektu_' + id).val(); 628 } 629 $('#oznameni_objekt_vlastnosti_' + id).val(icon + '|' + color + '|' + lineWidth + '|' + opacity); 630 as4uPopup.close(pip); 631 } 632 } 633}; 634// Odeslani noveho pozadavku, upload veskera obsluha v popup oknu 635MapyUdalosti.prototype.sendPozadavekData = function(url, modal) { 636 $('#dataFormCont').css('position', "relative"); 637 $('<div>
637', { "class": "loadingAjax", style: "width:" + parseInt($('#dataFormCont').css('width')) + "px;height: " + parseInt($('#dataFormCont').css('height')) + "px;position:absolute;top:0;left:0;z-index:100;" }).css('opacity', "0.6").appendTo($('#dataFormCont')); 638 639 var url = url + '&' 640 641 var ajaxurl = this.baseAjaxUrl; 642 if ($('#IDstatusu')) { 643 var idstatusu = $('#IDstatusu').val(); 644 } else { 645 var idstatusu = ""; 646 } 647 //kontrola povinnych polozek 648 var msgAlerts = [] 649 650 if ($('#upload-form-nazev').val() == "") { 651 msgAlerts.push("Nenà vyplnÄn název požadavku."); 652 } 653 654 if ($('#upload-form-jmeno_prijmeni').val() == "") { 655 msgAlerts.push("Nenà vyplnÄno jméno."); 656 } 657 658 if ($('#upload-form-email').val() == "" && $('#upload-form-telefon').val() == "") { 659 msgAlerts.push("Nenà vyplnÄn email nebo telefon."); 660 } 661 662 if ($('#gpsx').val() == "" || $('#gpsy').val() == "") { 663 msgAlerts.push("Nejsou vyplnÄny suÅadnice."); 664 } 665 666 if ($('#gpsx').val() == "" || $('#gpsy').val() == "") { 667 msgAlerts.push("Nejsou vyplnÄny suÅadnice."); 668 } 669 670 if ($('#gdpr').length > 0) { 671 if ($('#gdpr').prop("checked") == false) { 672 msgAlerts.push("MusÃte potvrdit pÅeÄtenà a souhlas podmÃnekami ochrany osobnÃch údajů."); 673 } 674 } 675 676 if (msgAlerts.length > 0) { 677 alert(msgAlerts.join("\n")); 678 try { 679 $('.loadingAjax').detach(); 680 } catch (e) {} 681 return false; 682 } 683 684 $.ajax({
685 type: "POST", 686 url: url, 687 data: { 688 'nazev': $('#upload-form-nazev').val(), 689 'jmeno_prijmeni': $('#upload-form-jmeno_prijmeni').val(), 690 'email': $('#upload-form-email').val(), 691 'telefon': $('#upload-form-telefon').val(), 692 'popis': $('#upload-form-popis').val(), 693 'gpsx': $('#gpsx').val(), 694 'gpsy': $('#gpsy').val(), 695 'IDstatusu': idstatusu 696 }, 697 success: function(html) { 698 if (html) { 699 var request = html.split("::"); 700 if (request[0] == 200) { 701 var url = $('#uploadUrl').val(); 702 $('#IDudalosti').val(request[2]); 703 $('#IDstatusu').val(request[3]); 704 $('#adrID').val(request[1]); 705 706 var gpsx = $('#gpsx').val(); 707 var gpsy = $('#gpsy').val(); 708 mapyUdalosti.afterObrUpload = function() { 709 if (modal > 0) { 710 as4uPopup.close(modal); 711 } else { 712 var pointsParam = []; 713 var popUpContentFce = new Function("return mapyUdalosti.getPopupContent2(" + request[4] + ")"); 714 pointsParam.push({ 715 coordX: gpsx, 716 coordY: gpsy, 717 iconUrl: location.protocol + "//" + location.hostname + '/mapy/icons/public4u/blue-pushpin.png', 718 iconWidth: 20, 719 iconHeight: 20, 720 popupContent: popUpContentFce 721 }); 722 } 723 }; 724 725 $('#nazevprosoapexport').val($('#upload-form-nazev').val()); 726 $('#popisprosoapexport').val($('#upload-form-popis').val()); 727 $('#xprosoapexport').val($('#gpsx').val()); 728 $('#yprosoapexport').val($('#gpsy').val()); 729 $('#upload-form').submit(); 730 } else { 731 alert(request[3]); 732 } 733 } 734 } 735 }); 736} 737 738$(document).ready(function() { 739 if ($("#outermap").val() != 1) { 740 if ($("#left-column").length) { 741 mapyUdalosti.setFullSize('left-column', null, true); 742 } 743 if ($("#allZalozkyCont").length) { 744 mapyUdalosti.setFullSize('allZalozkyCont', null, false, $('#right-column')); 745 mapyUdalosti.initZalozky('menu', 'allZalozkyCont'); 746 } 747 } 748}); 749 750function prepocitej_stred_in(t) { 751 if (detail_tmp > 0) { 752 if (t == 1) { 753 if (Array.isArray(objektyuozn[detail_tmp])) { 754 if (objektyuozn[detail_tmp].length > 0) { 755 var group = new L.featureGroup(objektyuozn[detail_tmp]); 756 var bounds = group.getBounds(); 757 var zoom = map_leaflet.getBoundsZoom(bounds); 758 map_leaflet.setView(bounds.getCenter(), zoom); 759 } else if (defaultzoom) { 760 defzoom(); 761 } 762 } 763 detail_tmp = 0; 764 } else if (defaultzoom) { 765 defzoom(); 766 } 767 } else { 768 if (prvkynamape.length > 0) { 769 var group = new L.featureGroup(prvkynamape); 770 var bounds = group.getBounds(); 771 var zoom = map_leaflet.getBoundsZoom(bounds); 772 if (zoom < 8) { 773 var tmp = []; 774 var tmp1 = vytvor_marker($("#start_maxy").val(), $("#start_minx").val(), ""); 775 var tmp2 = vytvor_marker($("#start_miny").val(), $("#start_maxx").val(), ""); 776 tmp.push(tmp1); 777 tmp.push(tmp2); 778 var group2 = new L.featureGroup(tmp); 779 var bounds2 = group2.getBounds(); 780 var zoom = map_leaflet.getBoundsZoom(bounds2); 781 map_leaflet.setView(bounds2.getCenter(), zoom); 782 } else { 783 map_leaflet.setView(bounds.getCenter(), zoom); 784 } 785 } else if (defaultzoom) { 786 defzoom(); 787 } 788 } 789} 790// 791function defzoom() { 792 if (defaultzoom.length > 0) { 793 var zoom = map_leaflet.getBoundsZoom(defaultzoom[0]); 794 map_leaflet.setView(defaultzoom[0].getCenter(), zoom); 795 } 796} 797// 798function vytvor_marker(wsgn, wsge, title, ico) { 799 var ikona = L.icon({ 800 iconUrl: ((ico) ? ico : '/js/leaflet/mapiko/drop-red.png'), 801 /*iconSize: [22, 31], 802 iconAnchor: [11, 31]*/ 803 });
804 var marker = L.marker([wsgn, wsge], { 805 title: title, 806 icon: ikona 807 }); 808 return marker; 809} 810// 811function vytvor_geometrii(souradnice, vlastnosti, polygon) { 812 if (souradnice) { 813 if (polygon == 1) { 814 prvek = L.polygon(souradnice, vlastnosti); 815 } else { 816 prvek = L.polyline(souradnice, vlastnosti); 817 } 818 return prvek; 819 } 820} 821// 822function lokalita_formular(id) { 823 if (!$("#obal_lokalita_formular").length) { 824 as4uPopup.show($("#nastaveni_ajax").val() + "akce=nastaveni&subakce=lokalita_formular&htmlAjax=yes" + ((id > 0) ? "&id=" + id : ""), 400, 200); 825 } 826} 827// 828function lokalita_smazat(id) { 829 if (confirm("Opravdu chcete smazat tuto lokalitu?")) { 830 $.get($("#nastaveni_ajax").val() + "akce=nastaveni&subakce=smazat_lokalitu&htmlAjax=yes&id=" + id, function() { 831 $("#nastaveniShowCont").load($("#nastaveni_ajax").val() + "akce=nastaveni&subakce=lokality&htmlAjax=yes"); 832 }); 833 } 834} 835// 836function ulozit_lokalitu(id, popid) { 837 $.post($("#nastaveni_ajax").val() + "akce=nastaveni&subakce=ulozit_lokalitu&htmlAjax=yes" + ((id > 0) ? "&id=" + id : ""), { 838 data: $("#lokalita_form").serialize() 839 }, function() { 840 as4uPopup.close(popid); 841 $("#nastaveniShowCont").load($("#nastaveni_ajax").val() + "akce=nastaveni&subakce=lokality&htmlAjax=yes"); 842 }); 843}
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.