jQuery(document).ready(function () { var input = $("input:file").val(); var init_width; if (jQuery('#fileInput').ajaxfileuploader) { jQuery('#fileInput').ajaxfileuploader({ SCRIPT: process_script, PATH: path, PATH_THEME: path_theme, PATH_IMG: path_theme_images, VALIDFORMAT: ['jpeg', 'jpg', 'png', 'gif', 'bmp'], MAXUPLOAD: 9, TABLEHEAD: { name: 'name', imgname: 'image name', operation: 'Operation' } } ) jQuery.fn.ajaxfileuploader.defaults = { SCRIPT: process_script, PATH: path, PATH_THEME: path_theme, PATH_IMG: path_theme_images, ACTION: '', VALIDFORMAT: ['jpeg', 'jpg', 'png', 'gif', 'bmp'], MAXUPLOAD: 5, TABLEHEAD: { name: 'name', imgname: 'image name', operation: 'Operation' } } } jQuery(window).resize(function (i) { if (jQuery("#picker").lenght > 0) { init_left = jQuery("#picker").offset().left - jQuery("#field_content").offset().left; init_left = jQuery("#picker").width() + init_left; width = jQuery("#field_content").width() - init_left - 60; marge = jQuery("#test").css("border"); jQuery("#test").width(width); jQuery("#test").css({ float: "right", right: "0px" }); } }); jQuery(".image").live('change', function (e) { imgname = jQuery(".image").css("background-image"); }); //=================================== // jQuery("#fileinput").trigger("ON"); //=================================== jQuery("#fileinput").live('ON', function (e) { target = e.target.id; url = jQuery("#img_cuise").val(); url = url.substr(url.lastIndexOf("\\") + 1); ing = jQuery("#img_cuise"); id = this.id; jQuery("#fileinput").val(url); jQuery('#thePicturePage').css("background-image", 'url(' + url + ')'); }); var text_id = ""; jQuery("*").mouseover(function (i) { return; id = jQuery(i.currentTarget).attr("id"); name = jQuery(i.currentTarget).attr("name"); var yourClass = i.currentTarget.className; if (yourClass == "select") return; current = jQuery(i.currentTarget); jQuery("#infos").text(id); if (text_id != "") { jQuery(i.currentTarget).css("border", "solid 0px red"); jQuery("#infos").text(text_id); text_id = ""; } return; }); jQuery("*").mouseout(function (i) { return; id = jQuery(i.currentTarget).attr("id"); name = jQuery(i.currentTarget).attr("name"); var yourClass = i.currentTarget.className; if (yourClass == "select") jQuery(i.currentTarget).css("border", "solid 0px red"); return; }); jQuery(window).load(function (i) { jQuery(window).resize(); options = Get_Options(); jQuery(".image").css(options.direct); jQuery(".image a").css("color", options.direct.color); jQuery(".image a:hover").css("color", options.Hover.color); jQuery(".image:hover border-color").css("color", options.Hover.color); jQuery("#selTab input").click(function (i) { return; id = jQuery(i.currentTarget).attr("id"); name = jQuery(i.currentTarget).attr("name"); if (name == "sel_tab") { options = Get_Options(); switch (i.currentTarget.value) { case "0": break; case "1": break; case "2": break; case "3": break; case "4": break; } if (!options) return; jQuery("." + name).css(options); jQuery(".image").css(options.direct); jQuery(".image").css(options.direct); jQuery(".image a").css("color", options.direct.color); jQuery(".image a:hover").css("color", options.Hover.color); jQuery(".image:hover border-color").css("color", options.Hover.color); return; } var yourClass = i.currentTarget.className; if (text_id == "") { text_id = id + " ," + yourClass + " ," + i.currentTarget.nodeName; jQuery("#infos").text(text_id); } }); }); function Get_Options() { options = { direct: { rayon: jQuery("#rayon_cuise").val(), chk_cuise: jQuery("#chk_cuise").val(), backgroundColor: jQuery("#bg_cuise").val(), backgroundImage: "url(" + jQuery("#img_src").text() + ")", borderColor: jQuery("#bd_cuise").val(), borderWidth: jQuery("#bd_width").val(), //backgroundRepeat: jQuery("." + name).css('backgroundRepeat'), backgroundPosition: "center center", color: jQuery("#co_cuise").val() }, Hover: { backgroundColor: jQuery("#bgho_cuise").val(), borderColor: jQuery("#bdho_cuise").val(), color: jQuery("#coho_cuise").val() } } return options; } jQuery("input").click(function (i) { tg = i.target; name_tpl = name_tpl; n = jQuery(this).attr("name"); if (n == "sel_tab") return; types = n.split("_"); if (n.lastIndexOf("_") < 0) return; id = n.substring(n.lastIndexOf("_") + 1); if (!isNaN(id)) { name = name_tpl[id]; type = types[0]; new_val = jQuery(tg).val(); options = Get_Options(); switch (type) { case 'rayon': options.direct['MozBorderRadius'] = new_val; options.direct['borderRadius'] = new_val + " " + new_val; break; case 'bg': options.direct['backgroundColor'] = new_val; break; case 'bgho': name = name + ""; options.Hover['backgroundColor'] = new_val; break; case 'bd': if (types[1] == 'width') { options.direct['borderStyle'] = "Solid"; options.direct['borderWidth'] = new_val; } else { options.direct['borderColor'] = new_val; } break; case 'bdho': name = name + ""; options.Hover['borderColor'] = new_val; break; case 'co': name = name + " a"; options.direct['color'] = new_val; break; case 'coho': name = name + " a"; options.Hover['color'] = new_val; break; case 'chk': switch (types[2]) { case 'x': options.direct['backgroundRepeat'] = 'repeat-x'; break; case 'y': options.direct['backgroundRepeat'] = 'repeat-y'; break; case id: img_src = jQuery("#img_src").text(); if (tg.checked) { options.direct['backgroundImage'] = 'none'; } else { options.direct['backgroundColor'] = 'Transparent'; options.direct['backgroundImage'] = "url(" + img_src + ")"; options.direct['backgroundPosition'] = "center center"; } break; } break; } delta = parseInt(options['borderWidth']) * 2; width = jQuery("#fldres").width() - jQuery("#picker").width() - 55; width -= delta; jQuery("#test").width(width); jQuery("." + name).css( options.direct ); jQuery("." + name +":hover" ).css( "color",options.Hover.color ); } }); jQuery("#img_cuise").click(function (i) { n = 1; }); });