/*
* JavaScript for Auto AnimateImage
* Copyright (C) 2012 attosoft
* This file is distributed under the same license as the Auto AnimateImage package.
* attosoft , 2012.
*/
jQuery(function($) {
postboxes.add_postbox_toggles(pagenow);
$(".colorpicker").each(function() {
var text = $(this).prevAll(".colortext");
var preview = $(this).prevAll(".colorpreview");
var fb = $.farbtastic(this);
if (text.val()[0] == '#') fb.setColor(text.val()); // color in hex
preview.css("backgroundColor", text.val());
fb.linkTo(function(color) {
text.val(color);
preview.css("backgroundColor", color);
});
});
$(".pickcolor").click(function() { $(this).nextAll(".colorpicker").show(); return false; });
$(document).mousedown(function() { $(".colorpicker:visible").hide(); });
if ($.isFunction($().slider)) {
$(".opacity-slider").each(function() {
var text = $(this).prevAll("input[type='number']");
$(this).slider({
max: 1,
step: 0.05,
value: text.val(),
slide: function(event, ui) { text.val(ui.value); },
change: function(event, ui) { text.val(ui.value); }
});
});
$(".opacity-trans").click(function() { $(this).next(".opacity-slider").slider("value", 0); });
$(".opacity-opaque").click(function() { $(this).prev(".opacity-slider").slider("value", 1); });
}
});
function onRepeatChange(input) {
document.form[input.name][1].checked = input.value == '-1';
}