%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/nailstv/public_html/de.nails.tv/js/admin/
Upload File :
Create Path :
Current File : /home/nailstv/public_html/de.nails.tv/js/admin/functions.js

$(document).ready(function() {
    blankTarget();


    $("a.fancybox").fancybox({
        'zoomSpeedIn' : 300,
        'zoomSpeedOut' : 300,
        'overlayShow' : true,
        'overlayOpacity' : 0.7,
		'overlayColor' : '#000',
        'hideOnContentClick': false
	});

    $("a.iframe").fancybox({
        'zoomSpeedIn': 300,
        'zoomSpeedOut': 300,
        'overlayShow': true,
        'overlayOpacity': 0.7,
        'overlayColor': '#a4a4a4',
        'hideOnContentClick': false,
        'titleShow': false,
        'width': 800,
        'height': 220
    });

    /*$('a.cluetip').cluetip({
        delayedClose: 1500,
        positionBy: 'mouse',
        sticky: false,
        dropShadow: false,
        showTitle: false,
        mouseOutClose: true,
        closePosition: 'title',
        closeText: '<img src="img/cross.png" alt="close" />',
        fx: {open: 'fadeIn', openSpeed: 750}
    });*/

    // Initialise the table
    $("#sortable").tableDnD({
        onDragClass: "tr_drag",
        onDrop: function(table, row) {
            var order = '';
            var rows = table.tBodies[0].rows;
            for (var i=0; i<rows.length; i++) {
                var nodrop = $(rows[i]).hasClass("nodrop");
                if(!nodrop) {
                    if(i % 2) {
                        $(rows[i]).addClass('paratlan');
                    } else {
                         $(rows[i]).removeClass('paratlan');
                    }
                }
                if($(rows[i]).attr('id')) {
                    order += $(rows[i]).attr('id')+",";
                }
            };
            if($('#sorrend_field').length > 0)
            {
                var field = $('#sorrend_field').val();
            }
            else
            {
				if($('#cimkek').val() == '1'){
					var field = 'sorrend_cimkek';
				} else {
					var field = 'sorrend';
				}
            }
            ajax('_sort.php', 'order=' + order + '&field=' + field);
        }
    });

    // Initialise the table
    $("#sortable_cikkek").tableDnD({
        onDragClass: "tr_drag",
        onDrop: function(table, row) {
            var order = '';
            var rows = table.tBodies[0].rows;
            for (var i=0; i<rows.length; i++) {
                var nodrop = $(rows[i]).hasClass("nodrop");
                if(!nodrop) {
                    if(i % 2) {
                        $(rows[i]).addClass('paratlan');
                    } else {
                         $(rows[i]).removeClass('paratlan');
                    }
                }
                if($(rows[i]).attr('id')) {
                    order += $(rows[i]).attr('id')+",";
                }
            };
            if($('#sorrend_field').length > 0)
            {
                var field = $('#sorrend_field').val();
            }
            else
            {
                var field = 'sorrend';
            }
	
            ajax('_sort_cikk.php', 'order=' + order + '&field=' + field);
        }
    });

});

function blankTarget()
{
    if(!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for(var i=0; i<anchors.length; i++)
    {
        var anchor = anchors[i];
        anchor.tabindex = i;
        if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
        {
            anchor.target = "_blank";
        }
    }
}

function changeAll(id)
{
    var chkBox = null;

    for (i=0; i < document.getElementById(id).elements.length; i++)
    {
        if (document.getElementById(id).elements[i].name.search('torol') != -1)
        {
            document.getElementById(id).elements[i].checked = document.getElementById(id+'_checkall').checked;
        }
    }
}

function deletefile(id, tabla, mezo, dir)
{
    var d = '';
    d += 'id=' + id;
    d += '&tabla=' + tabla;
    d += '&mezo=' + mezo;
    d += '&dir=' + dir;

	ajax('_deletefile.php', d, false);
    $('#' + tabla + '_' + mezo + '_' + id).hide();
    $('#span_' + id).html('nincs feltöltve fájl');
}

function setAktiv(id, aktiv)
{
    var d = '';
    d += 'id=' + id;
    d += 'aktiv=' + aktiv;

    ajax('_setaktiv.php', d);
}

function setDefault(id, val, tipus)
{
    $.ajax({
		type: "GET",
		url: '_setdefaultpic.php',
		data: 'galeria_id='+val+'&id='+id+'&tipus='+tipus,
		complete: function(xhr) {
			if(xhr.responseText != '') {
				alert(xhr.responseText);
			}
		}
	});
}

function ajax(url, data, async, type, target, readyfunction)
{
    if(typeof async == 'undefined')
    {
        async = true;
    }

    if(typeof type == 'undefined')
    {
        type = 'html';
    }

    $.ajax({
		type: "POST",
		url: url,
		data: data,
        dataType: type,
        async: async,
		complete: function(xhr) {
		    if(typeof target == 'undefined' && xhr.responseText != '')
            {
                //alert(xhr.responseText);
            }
            else if(typeof target != 'undefined')
            {
                $( target ).html( xhr.responseText );
                if(typeof readyfunction != 'undefined')
                {
                    eval(readyfunction);
                }
            }
		}
	});
}

function reload(file, val, target_id, def)
{
    var fk = $(val).attr('id');
    var selected = $(val).val();

    var d = '';
    d += 'fk=' + fk;
    d += '&selected=' + selected;
    d += '&def=' + def;

    ajax(file, d, true, 'html', target_id, "$( target ).val("+ def +")");
}

function showLangTab(id, lnk)
{
    hideall();
    document.getElementById(id).style.display = 'block';
    lnk.className = 'tab_aktiv';
}

function hideall()
{
    var alldivs = document.getElementsByTagName('div');

    for (i = 0; i < alldivs.length; i++)
    {
        if(alldivs[i].className == 'language')
        {
            alldivs[i].style.display = 'none';
        }
    }

    var alltabs = document.getElementsByTagName('a');

    for (i = 0; i < alltabs.length; i++)
    {
        if(alltabs[i].className == 'tab_aktiv')
        {
            alltabs[i].className = 'tab';
        }
    }
}

function initTab(lang)
{
	var t = 'tab_'+lang;

	document.getElementById(lang).style.display = 'block';
	document.getElementById(t).className = 'tab_aktiv';
}

function reloadCaptcha(id)
{
	document.getElementById('captcha_'+id).src = 'include/kcaptcha/?'+Math.random();
}


function reloadKepzesek(val, target_id, def)
{
    var selected = $(val).val();

    var d = '';
    d += '&selected=' + selected;
    d += '&def=' + def;

    ajax('_reloadkepzesek.php', d, true, 'html', target_id, "$( target ).val("+ def +")");
}

Zerion Mini Shell 1.0