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) { $('#'+target_img).val(url); $('#'+target_img).change(); target_object=''; } } function show_admin() { $.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); } 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) { $('#OkDialogNadpis').html(nadpis); $('#OkDialogObsah').html(obsah); $('#dialog-form').submit( function() {return(okdialog(noclose,direct)); }); $('#OkDialogOK').attr('onclick',"okdialog("+(noclose==1?1:0)+","+(direct==1?1:0)+")"); $('.dialog-bg').removeClass('bg-red'); $('.dialog-bg').removeClass('bg-green'); $('.dialog-bg').removeClass('bg-yellow'); if (type=='danger') $('.dialog-bg').addClass('bg-red'); if (type=='warning') $('.dialog-bg').addClass('bg-yellow'); if (type=='success') $('.dialog-bg').addClass('bg-green'); $('#OkDialog').modal('show'); if (sirka>0 && $(window).width()>sirka) { $('#OkDialog .modal-dialog').css('width',sirka); } else { $('#OkDialog .modal-dialog').css('width',''); } } function makeJquerydialog(nadpis,obsah,sirka,buttons,noclose,direct,type) { if (debug) console.log('dialog'); $('#dialog').dialog('close'); $("#dialog_over").html("
"+obsah+"
"); var butt={ 'OK': function() { if ($('#dialog-form').size() ) { $('#dialog-form').submit() } else { okdialog(noclose,direct); } }, Cancel: function() { $(this).dialog('close'); $('#dialog').dialog('close'); } } if (buttons) { $.each(data.dialog.add_buttons, function(index, value) { butt [index] = function() { eval(value['onclick'] + (value['noclose'] ? "" : ";$('#dialog').dialog('close');")) }; }); } $("#dialog").dialog({bgiframe: true, autoOpen: false, modal: true, width: (sirka?sirka:500), buttons: butt, close: function() { $('#dialog').remove(); } }); $('#dialog-form').submit( function() {return(okdialog(noclose,direct)); }); $('#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) { $('#OkDialog').modal('hide'); } else { $('#dialog').dialog('close'); } } function json_post_form(id) { fillFormValues($('#'+id)); var url=$('#'+id).attr("action"); url=add_url_value(url,'via_ajax',1); url=add_url_value(url,'via_dialog',1); formData=$('#'+id).formSerialize(); var formData = new FormData($('#'+id)[0]); console.log(formData); $.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($('#dialog-form')); if (direct) { $('#dialog-form')[ 0].submit(); return false; } else { var url=$('#dialog-form').attr("action"); if (url) { url=add_url_value(url,'via_ajax',1); url=add_url_value(url,'via_dialog',1); formData=$('#dialog-form').formSerialize(); var formData = new FormData($('#dialog-form')[0]); $.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; } $.ajaxSetup({dataType:"json"}) function init_page() { if (typeof jQuery.ui !== 'undefined') { $(".inputdatum").datepicker({ altFormat: "dd. mm. yy",dateFormat:'dd. mm. yy' }); $(".svisliky").accordion(); } $(".ajax").unbind('click') $(".ajax").bind('click',function(event) { event.preventDefault() call_json(this.href,''); }) // $( document ).tooltip(); if(jQuery().colpick) { colorpicker_init(); } else { } } $(function() { if ($.datepicker) { $.datepicker.setDefaults($.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; $.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(); $.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; } $(function(){ if (bootstrapdialog) { $('html').append(''); } }) //