function jsDialogue() { this.zalozky = Array(); this.kategorie = Array(); this.data = Array(); this.fckArray = Array(); this.parent = 0; this.okButton = 0; this.cancellButton = 0; this.menuSave = null; this.name = null; this.pageWidth = null; this.pageHeight = null; this.windowWidth = null; this.windowHeight = null; this.dialogWidth = null; this.dialogHeight = null; var pageSize = getPageSiz(); this.pageWidth = pageSize[0]; this.pageHeight = pageSize[1]; this.windowWidth = pageSize[2]; this.windowHeight = pageSize[3]; } jsDialogue.prototype.menuSelect = function(cId) { if(this.menuSave != cId) { var text = document.getElementById('dmenu-text-' + this.parent + '-'+cId); if(text) text.className = "dgZalozka dgZalozka-sel"; //text.setAttribute("class", "menu-t"); } } jsDialogue.prototype.menuHiden = function(cId) { if(this.menuSave != cId) { var text = document.getElementById('dmenu-text-' + this.parent + '-'+cId); if(text) text.className = "dgZalozka"; //text.setAttribute("class", "menu-t-n"); } } jsDialogue.prototype.menuShow = function(cId) { var pom = this.menuSave; var objData = document.getElementById("dialog-data-" + this.parent + "-" + pom); var objData2 = document.getElementById("dialog-data-" + this.parent + "-" + cId); this.menuSave = ''; this.menuHiden(pom); this.menuSelect(cId); if(objData) objData.style.display = 'none'; if(objData2) objData2.style.display = 'block'; //alert(objData2.innerHTML); this.menuSave = cId; } jsDialogue.prototype.createZalozky = function() { if(this.zalozky.length > 0) { var count = this.zalozky.length; var menu = ''; var data = ''; for( i=0;i'+ this.zalozky[i] +'' + "\n"; if(dgShow.res[i]) {data += '
' + dgShow.res[i] + '
';} } //alert(data); var objMenu = document.getElementById("dialogue-menu-"+this.parent); var objData = document.getElementById("dialogue-data-"+this.parent); objMenu.innerHTML = menu; objData.innerHTML = data; //alert(objData.innerHTML); } } jsDialogue.prototype.createKategorie = function(cId) { var data = ''; var clas = ''; var display = ''; if(this.kategorie.length > 0) { for( var i=0;i'; data += '
 
'; if(this.kategorie[i]['readonley'] == 1) data += '
'; else data += '
'; if(this.kategorie[i]['edit'] == 1) data += '
editovat
'; else data += '
 
'; if(this.kategorie[i]['poradi'] != '') data += '
'; else data += '
 
'; if(this.kategorie[i]['del'] == 1) data += '
 
'; else data += '
 
'; data += ''; } } } if(this.kategorie['noadd'] != 1) data += '
'; //alert(data); var objMenu = document.getElementById("dialogue-menu-"+this.parent); var objButton = document.getElementById("dialogue-button-"+this.parent); var objData = document.getElementById("dialogue-data-"+this.parent); objData.innerHTML = data; objMenu.style.display = 'none'; objButton.style.display = 'none'; objData.style.height = (Number(this.dialogHeight) - 80) + 'px'; } jsDialogue.prototype.create = function() { // The rest of this code inserts html at the bottom of the page that looks similar to this: // //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var left = (Number(this.windowWidth) / 2) - (Number(this.dialogWidth) / 2); var top = (Number(this.windowHeight) / 2) - (Number(this.dialogHeight) / 2); var marginLeft = Number(this.dialogWidth) - 26; this.parent = this.parent + 1; if(this.dialogHeight > this.windowHeight) top = "150"; var objBody = document.getElementsByTagName("body").item(0); var objBlanket = document.createElement("div"); objBlanket.setAttribute('id','blanket-'+this.parent); objBlanket.className = 'blanket'; objBlanket.style.display = 'none'; objBlanket.style.zIndex = 9 + (this.parent * 2); objBlanket.onclick = function() { dg.end(); return false; } objBody.appendChild(objBlanket); var objDialogue = document.createElement("div"); objDialogue.setAttribute('id','dialogue-'+this.parent); objDialogue.className = 'dialogue'; objDialogue.style.display = 'none'; objDialogue.style.zIndex = 10 + (this.parent * 2); objDialogue.style.left = left + 'px'; objDialogue.style.top = top + 'px'; objDialogue.style.width = this.dialogWidth + 'px'; objDialogue.style.height = this.dialogHeight + 'px'; objBody.appendChild(objDialogue); var objTop = document.createElement("div"); objTop.setAttribute('id','dialogue-top-'+this.parent); objTop.className = 'top'; objTop.style.width = (Number(this.dialogWidth) - 0) + 'px'; objDialogue.appendChild(objTop); var objName = document.createElement("div"); objName.setAttribute('id','dialogue-name-'+this.parent); objName.className = 'name'; objName.innerHTML = this.name; objName.style.width = (Number(this.dialogWidth) - 33) + 'px'; objTop.appendChild(objName); var objCancel = document.createElement("div"); objCancel.setAttribute('id','dialogue-cancel-'+this.parent); objCancel.className = 'cancel'; objCancel.onclick = function() { dg.end(); return false; } objTop.appendChild(objCancel); var objMiddle = document.createElement("div"); objMiddle.setAttribute('id','dialogue-middle-'+this.parent); objMiddle.className = 'middle'; objMiddle.style.width = this.dialogWidth + 'px'; objMiddle.style.height = (Number(this.dialogHeight) - 55) + 'px'; objDialogue.appendChild(objMiddle); var objContent = document.createElement("div"); objContent.setAttribute('id','dialogue-content-'+this.parent); objContent.className = 'content'; objContent.style.width = (Number(this.dialogWidth) - 12) + 'px'; objContent.style.height = (Number(this.dialogHeight) - 23) + 'px'; objMiddle.appendChild(objContent); var objMenu = document.createElement("div"); objMenu.setAttribute('id','dialogue-menu-'+this.parent); objMenu.className = 'menu'; objMenu.style.width = (Number(this.dialogWidth) - 20) + 'px'; objContent.appendChild(objMenu); var objData = document.createElement("div"); objData.setAttribute('id','dialogue-data-'+this.parent); objData.className = 'data'; objData.style.width = (Number(this.dialogWidth) - 20) + 'px'; objData.style.height = (Number(this.dialogHeight) - 102) + 'px'; objContent.appendChild(objData); var objBottom = document.createElement("div"); objBottom.setAttribute('id','dialogue-bottom-'+this.parent); objBottom.className = 'bottom'; objBottom.style.width = this.dialogWidth + 'px'; objDialogue.appendChild(objBottom); if(this.cancellButton == 1) { var objButtonCancel = document.createElement("div"); objButtonCancel.setAttribute('id','dialogue-button-cancel-'+this.parent); objButtonCancel.className = 'button-cancel'; objButtonCancel.innerHTML = 'storno'; objButtonCancel.onclick = function() { dg.end(); return false; } objBottom.appendChild(objButtonCancel); } if(this.okButton == 1) { var objButtonOk = document.createElement("div"); objButtonOk.setAttribute('id','dialogue-button-ok-'+this.parent); objButtonOk.className = 'button-ok'; objButtonOk.innerHTML = 'ok'; objButtonOk.onclick = function() { fn.saveData('saveDialog', '', 'dialogue-data-'+dg.parent, 'Opravdu chcete uložit položku?'); return false; } objBottom.appendChild(objButtonOk); } } jsDialogue.prototype.show = function() { var objBlanket = document.getElementById('blanket-' + this.parent); var objDialogue = document.getElementById('dialogue-' + this.parent); if(objBlanket) objBlanket.style.display = 'block'; if(objDialogue) objDialogue.style.display = 'block'; this.menuShow('0'); this.menuSave = '0'; } jsDialogue.prototype.end = function() { if(confirm('Opravdu chcete zavřit položku?')) { var objBody = document.getElementsByTagName("body").item(0); var objDialog = document.getElementById("dialogue-"+this.parent); var objBlanket = document.getElementById("blanket-"+this.parent); if(this.fckArray[this.parent].length > 0) { for(var i=0;i 0) this.parent = this.parent - 1; fn.rowSelect = ''; if(dgShow.makce == 'fotky') { fn.zboziFotkyReload(dgShow.dialog_id); } if(dgShow.makce == 'clanky-fotky') { fn.clankyFotkyReload(dgShow.dialog_id); } if(dgShow.makce == 'fotogalerie-fotky') { fn.fotogalerieFotkyReload(dgShow.dialog_id); } if(dgShow.makce == 'download-files') { fn.downloadFileReload(dgShow.dialog_id); } } } jsDialogue.prototype.endNo = function() { var objBody = document.getElementsByTagName("body").item(0); var objDialog = document.getElementById("dialogue-"+this.parent); var objBlanket = document.getElementById("blanket-"+this.parent); if(this.fckArray[this.parent].length > 0) { for(var i=0;i 0) this.parent = this.parent - 1; fn.rowSelect = ''; } jsDialogue.prototype.endSave = function() { var objBody = document.getElementsByTagName("body").item(0); var objDialog = document.getElementById("dialogue-"+this.parent); var objBlanket = document.getElementById("blanket-"+this.parent); if(this.fckArray[this.parent].length > 0) { for(var i=0;i 0) this.parent = this.parent - 1; fn.rowSelect = ''; if(dgShow.makce == 'montazni_plan' && dgShow.sakce == 'getPlan') { fn.setMontazniPlan(dgShow.dialog_id); } if(dgShow.makce == 'montazni_vozy' && dgShow.sakce == 'getPHM') { fn.setMontazniVozyPHM(dgShow.dialog_id); } if(dgShow.makce == 'montazni_vozy' && dgShow.sakce == 'getTrasa') { fn.setMontazniVozyTrasa(dgShow.dialog_id); } }