var debug debug=0 var admin_function=Array(); function OpenclearFileBrowser( subpath,type ) { // oEditor must be defined. var iLeft = 50 ; var iTop = 50 ; var sOptions = "toolbar=yes,status=no,resizable=yes,dependent=yes,scrollbars=yes" ; sOptions += ",width=800" ; sOptions += ",height=600" ; sOptions += ",left=" + iLeft ; sOptions += ",top=" + iTop ; url='/fckeditor/filemanager/index.php?type='+(type?type:"Image")+'&Connector=/fckeditor/editor/filemanager/connectors/php/connector.php&subpath='+encodeURIComponent(subpath) ; window.open( url, 'FCKBrowseWindow', sOptions ) ; } var target_img; function SetUrl( url, width, height, alt ) { if (target_img) { jQuery('#'+target_img).val(url); jQuery('#'+target_img).change(); target_object=''; } } function show_admin() { jQuery.each(admin_function, function(index, value) { value(); }); } function show_hide(target,action) { if (doc=document.getElementById(target)) { if (action) { doc.style.display='block'; } else { doc.style.display='none'; } } } function show_one(group,id) { for(i=0;i"+obsah+""); } if (data.javascript) { eval(data.javascript); } if (data.infoLine) { infoLine=jQuery("#info_line"); infoLine.html(""); jQuery.each(data.infoLine, function(index, value) { infoLine.append('
'+value.message+'
'); }); } init_page(); } function makeOKDialog(nadpis,obsah,sirka,buttons,noclose,direct,type) { if (bootstrapdialog) { makeBootstrapdialog(nadpis,obsah,sirka,buttons,noclose,direct,type) } else { makeJquerydialog(nadpis,obsah,sirka,buttons,noclose,direct,type) } } function makeBootstrapdialog(nadpis,obsah,sirka,buttons,noclose,direct,type) { jQuery('#OkDialogNadpis').html(nadpis); jQuery('#OkDialogObsah').html(obsah); jQuery('#dialog-form').submit( function() {return(okdialog(noclose,direct)); }); jQuery('#OkDialogOK').attr('onclick',"okdialog("+(noclose==1?1:0)+","+(direct==1?1:0)+")"); jQuery('.dialog-bg').removeClass('bg-red'); jQuery('.dialog-bg').removeClass('bg-green'); jQuery('.dialog-bg').removeClass('bg-yellow'); if (type=='danger') jQuery('.dialog-bg').addClass('bg-red'); if (type=='warning') jQuery('.dialog-bg').addClass('bg-yellow'); if (type=='success') jQuery('.dialog-bg').addClass('bg-green'); jQuery('#OkDialog').modal('show'); if (sirka>0 && jQuery(window).width()>sirka) { jQuery('#OkDialog .modal-dialog').css('width',sirka); } else { jQuery('#OkDialog .modal-dialog').css('width',''); } } function makeJquerydialog(nadpis,obsah,sirka,buttons,noclose,direct,type) { if (debug) console.log('dialog'); jQuery('#dialog').dialog('close'); jQuery("#dialog_over").html("
"+obsah+"
"); var butt={ 'OK': function() { if (jQuery('#dialog-form').length ) { jQuery('#dialog-form').submit() } else { okdialog(noclose,direct); } }, Cancel: function() { jQuery(this).dialog('close'); jQuery('#dialog').dialog('close'); } } if (buttons) { jQuery.each(data.dialog.add_buttons, function(index, value) { butt [index] = function() { eval(value['onclick'] + (value['noclose'] ? "" : ";jQuery('#dialog').dialog('close');")) }; }); } jQuery("#dialog").dialog({bgiframe: true, autoOpen: false, modal: true, width: (sirka?sirka:500), buttons: butt, close: function() { jQuery('#dialog').remove(); } }); jQuery('#dialog-form').submit( function() {return(okdialog(noclose,direct)); }); jQuery('#dialog').dialog('open'); } function CKupdate() { if (typeof CKEDITOR != 'undefined') { for ( instance in CKEDITOR.instances ) CKEDITOR.instances[instance].updateElement(); } } function fillFormValues($form) { if (typeof CKEDITOR != 'undefined') { for ( instance in CKEDITOR.instances ) CKEDITOR.instances[instance].updateElement(); } } function closeDialog() { if (bootstrapdialog) { jQuery('#OkDialog').modal('hide'); } else { jQuery('#dialog').dialog('close'); } } function json_post_form(id) { fillFormValues(jQuery('#'+id)); var url=jQuery('#'+id).attr("action"); url=add_url_value(url,'via_ajax',1); url=add_url_value(url,'via_dialog',1); formData=jQuery('#'+id).formSerialize(); var formData = new FormData(jQuery('#'+id)[0]); console.log(formData); jQuery.ajax({ url: url, data: formData, async: true, contentType: false, processData: false, dataType:'json', cache: false, type: 'POST', success: function(data) { zpracuj_json_input(data); } }) } function okdialog(noclose,direct) { fillFormValues(jQuery('#dialog-form')); if (direct) { jQuery('#dialog-form')[ 0].submit(); return false; } else { var url=jQuery('#dialog-form').attr("action"); if (url) { url=add_url_value(url,'via_ajax',1); url=add_url_value(url,'via_dialog',1); formData=jQuery('#dialog-form').formSerialize(); var formData = new FormData(jQuery('#dialog-form')[0]); jQuery.ajax({ url: url, data: formData, async: true, contentType: false, processData: false, dataType:'json', cache: false, type: 'POST', success: function(data) { zpracuj_json_input(data); } }) } } if (!noclose) { closeDialog(); } return false; } function load_url_value(name,value) { var url; url=document.location+''; if (!url.indexOf('?')) url+='?' ; if (url.indexOf()) url+='&'+name+'='+encodeURIComponent(value); document.location=url; } jQuery.ajaxSetup({dataType:"json"}) function init_page() { if (typeof jQuery.ui !== 'undefined') { jQuery(".inputdatum").datepicker({ altFormat: "dd. mm. yy",dateFormat:'dd. mm. yy' }); jQuery(".svisliky").accordion(); } jQuery("a.ajax").unbind('click') $(document).off('click', 'a.ajax'); jQuery("a.ajax").bind('click',function(event) { event.preventDefault() call_json(this.href,''); return false; }) // jQuery( document ).tooltip(); if(jQuery().colpick) { colorpicker_init(); } else { } } jQuery(function() { if (jQuery.datepicker) { jQuery.datepicker.setDefaults(jQuery.datepicker.regional['cs']); } init_page(); }); var gt_tables=new Array(); var gt_table_loaded=0; if (typeof google != 'undefined') { google.load('visualization', '1', {packages:['table','corechart']}); google.setOnLoadCallback(gtinit); } function gtinit() { gt_table_loaded=1; jQuery.each(gt_tables, function(index, value) { drawGoogleTable(value[0],value[1],value[2],value[3]) }); gt_tables=new Array(); } function drawGoogleTable(id,columns,rows,shownumbers) { if (gt_table_loaded) { var dat = new google.visualization.DataTable(); jQuery.each(columns, function(index, value) { dat.addColumn(value['type'],value['name']); }); dat.addRows(rows); var table = new google.visualization.Table(document.getElementById(id)); table.draw(dat, { showRowNumber: false, allowHtml:true, frozenColumns:1, width:"100%", height:"900px" }); } else { gt_tables[gt_tables.length]=new Array(id,columns,rows,shownumbers); } } function CKupdate() { for ( instance in CKEDITOR.instances ) CKEDITOR.instances[instance].updateElement(); } var bootstrapdialog if (typeof bootstrapdialog == 'undefined') { bootstrapdialog=0; } jQuery(function(){ if (bootstrapdialog) { jQuery('html').append(''); } }) function isShown(hash) { if (!getCookie("shown_"+hash)) { call_json("?action=setShown"); } } function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; }