jQuery.noConflict();
jQuery(function($) {
if ( ($.cookie('infinity_customcolor') != null)) {
var loadColor = $.cookie('infinity_customcolor');
} else {
var loadColor = "007bff"; //ta linijka odpowiada właśnie za zmianę podstawowego koloru
}
var widt = false;
$('#colorSelector').bind('click', function() {
$('#colorpickerHolder').stop().animate({height: widt ? 0 : 173}, 500);
widt = !widt;
});
var textColorElements = "#logo_row h1 > span, .breadcrumb .active a, a.main_button, .pagination .pagination_current";
var backgroundColorElements = "#buuttonynowe, .button, #login_button, .belkatlo, .showthread_post_options a, .icon_back, a.main_button, a.button_multiquote_on, #colorSelector div, .pagination .pagination_current, .reply";
var borderColorElements = " .button, #login_button, #loginrow, .pagination .pagination_current";
$('#colorpickerHolder').ColorPicker({
flat: true,
color: '#' + loadColor,
onSubmit: function(hsb, hex, rgb) {
$(textColorElements).css("color", "#" + hex);
$(backgroundColorElements).css("background", "#" + hex);
$(borderColorElements).css("border-color", "#" + hex);
$.cookie('infinity_customcolor',hex,{ expires: 365, path: '/'});
$('#colorpickerHolder').stop().animate({height: widt ? 0 : 173}, 500);
widt = !widt;
},
onBeforeShow: function () {
$(this).ColorPickerSetColor(this.value);
},
onChange: function (hsb, hex, rgb) {
$(textColorElements).css("color", "#" + hex);
$(backgroundColorElements).css("background", "url('images/infinity/thead.png') repeat-x 100% 50% #" + hex);
$(borderColorElements).css("border-color", "#" + hex);
$.cookie('infinity_customcolor',hex,{ expires: 365, path: '/'});
$('#colorSelector div').css('backgroundColor', '#' + hex);
}
})
.bind('keyup', function(){
$(this).ColorPickerSetColor(this.value);
});
if ( ($.cookie('infinity_customcolor') != null)) {
var loadColor = $.cookie('infinity_customcolor');
$(textColorElements).css("color", "#" + loadColor);
$(backgroundColorElements).css("background", "url('images/infinity/thead.png') repeat-x 100% 50% #" + loadColor);
$(borderColorElements).css("border-color", "#" + loadColor);
$("#colorSelector").val("#" + loadColor);
}
else{
$(textColorElements).css("color", "#" + loadColor);
$(backgroundColorElements).css("background", "url('images/infinity/thead.png') repeat-x 100% 50% #" + loadColor);
$(borderColorElements).css("border-color", "#" + loadColor);
}
});