var logo='1'; (function ($) { $(document).ready(function($){ $("#infoazi-custom-header").colpick({ color: $("#infoazi-custom-header").val(), onChange:function(hsb,hex,rgb,el,bySetColor) { $(el).css('border-color','#'+hex); // Fill the text box just if the color was set using the picker, and not the colpickSetColor function. if(!bySetColor) $(el).val(hex); updatePreview(); } }).keyup(function(){ $(this).colpickSetColor(this.value); });
$("#infoazi-custom-header-luna").colpick({ color: $("#infoazi-custom-header-luna").val(), onChange:function(hsb,hex,rgb,el,bySetColor) { $(el).css('border-color','#'+hex); // Fill the text box just if the color was set using the picker, and not the colpickSetColor function. if(!bySetColor) $(el).val(hex); updatePreview(); } }).keyup(function(){ $(this).colpickSetColor(this.value); }); $("#infoazi-custom-text-color").colpick({ color: $("#infoazi-custom-text-color").val(), onChange:function(hsb,hex,rgb,el,bySetColor) { $(el).css('border-color','#'+hex); // Fill the text box just if the color was set using the picker, and not the colpickSetColor function. if(!bySetColor) $(el).val(hex); updatePreview(); } }).keyup(function(){ $(this).colpickSetColor(this.value); }); $("#infoazi-custom-copyright").colpick({ color: $("#infoazi-custom-copyright").val(), onChange:function(hsb,hex,rgb,el,bySetColor) { $(el).css('border-color','#'+hex); // Fill the text box just if the color was set using the picker, and not the colpickSetColor function. if(!bySetColor) $(el).val(hex); updatePreview(); } }).keyup(function(){ $(this).colpickSetColor(this.value); }); $('.infoazi-colorpick-div').click(function(e) { $("#infoazi-custom-header").val(rgb2hex($('.bg',this).css('background-color'))); $("#infoazi-custom-header-luna").val(rgb2hex($('.mg',this).css('background-color'))); $("#infoazi-custom-text-color").val(rgb2hex($('.mg',this).css('background-color'))); $("#infoazi-custom-copyright").val(rgb2hex($('.mg',this).css('background-color'))); logo=$(this).attr('logo'); updatePreview(); });
});
})(jQuery);
function getCode() {
var ch = 'c6c6c6';
var dth = 'b2b2b2';
var pt = '9e9e9e';
if($('#infoazi-custom-header').val()) {
var bgval = $('#infoazi-custom-header').val();
ch = bgval;
}
if($('#infoazi-custom-header-luna').val()) {
var sbval = $('#infoazi-custom-header-luna').val();
dth= sbval;
}
if($('#infoazi-custom-text-color').val()) {
var ptval = $('#infoazi-custom-text-color').val();
pt= ptval;
}
if($('#infoazi-custom-copyright').val()) {
var cpval = $('#infoazi-custom-copyright').val();
cp = cpval;
}
var div = $('#iframe-window');
var elem ='
function pickPreset1() { $("#infoazi-custom-header").val('011c6f'); $("#infoazi-custom-header-luna").val('011964'); $("#infoazi-custom-text-color").val('011964'); $("#infoazi-custom-copyright").val('011c6f'); updatePreview(); } function pickPreset2() { $("#infoazi-custom-header").val('45aa96'); $("#infoazi-custom-header-luna").val('3e9987'); $("#infoazi-custom-text-color").val('3e9987'); $("#infoazi-custom-copyright").val('45aa96'); updatePreview(); } function pickPreset3() { $("#infoazi-custom-header").val('48aa45'); $("#infoazi-custom-header-luna").val('4f993e'); $("#infoazi-custom-text-color").val('4f993e'); $("#infoazi-custom-copyright").val('48aa45'); updatePreview(); } function pickPreset4() { $("#infoazi-custom-header").val('479ebb'); $("#infoazi-custom-header-luna").val('408ea8'); $("#infoazi-custom-text-color").val('408ea8'); $("#infoazi-custom-copyright").val('479ebb'); updatePreview(); } function pickPreset5() { $("#infoazi-custom-header").val('484848'); $("#infoazi-custom-header-luna").val('414141'); $("#infoazi-custom-text-color").val('414141'); $("#infoazi-custom-copyright").val('484848'); updatePreview(); } function pickPreset6() { $("#infoazi-custom-header").val('c6c6c6'); $("#infoazi-custom-header-luna").val('b2b2b2'); $("#infoazi-custom-text-color").val('b2b2b2'); $("#infoazi-custom-copyright").val('c6c6c6'); updatePreview(); } function pickPreset7() { $("#infoazi-custom-header").val('c7ab0f'); $("#infoazi-custom-header-luna").val('b39a0d'); $("#infoazi-custom-text-color").val('b39a0d'); $("#infoazi-custom-copyright").val('c7ab0f'); updatePreview(); } function pickPreset8() { $("#infoazi-custom-header").val('b85d5d'); $("#infoazi-custom-header-luna").val('d36969'); $("#infoazi-custom-text-color").val('d36969'); $("#infoazi-custom-copyright").val('b85d5d'); updatePreview(); } function pickPreset9() { $("#infoazi-custom-header").val('db3e3e'); $("#infoazi-custom-header-luna").val('c53838'); $("#infoazi-custom-text-color").val('c53838'); $("#infoazi-custom-copyright").val('db3e3e'); updatePreview(); } function pickPreset10() { $("#infoazi-custom-header").val('f67129'); $("#infoazi-custom-header-luna").val('dd6525'); $("#infoazi-custom-text-color").val('dd6525'); $("#infoazi-custom-copyright").val('f67129'); updatePreview(); } function updatePreview () { var src = $('#iframe-window').attr('src'); src= 'http://infoazi.ro/wp-content/plugins/infoazi-events/custom-script/script.php?ch='+$('#infoazi-custom-header').val()+'&dth='+$('#infoazi-custom-header-luna').val()+'&pt='+$('#infoazi-custom-text-color').val()+'&cp='+$('#infoazi-custom-copyright').val()+'&pw=1'; $( '#iframe-window' ).attr( 'src', src); $('#iframe').val(getCode()); } function rgb2hex(rgb) { rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); function hex(x) { return ("0" + parseInt(x).toString(16)).slice(-2); } return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); } $(document).ready(function(){ $("#infoazi-varianta1").mouseenter(function(){ var src = $(this).val();
//$("#infoazi-view-presets").html(src ? "" : "" ); alert("merge"); }) });