Your IP : 216.73.216.68


Current Path : /home/sunflowe/www2/vacancesfloride/templates/yoo_revista/warp/config/js/
Upload File :
Current File : /home/sunflowe/www2/vacancesfloride/templates/yoo_revista/warp/config/js/config.js

/* Copyright (C) YOOtheme GmbH, http://www.gnu.org/licenses/gpl.html GNU/GPL */

!function(e){e.fn.profiles=function(t){function a(t){"default"==t?s.addClass("default"):s.removeClass("default"),e("[data-profile]").not(e('[data-profile="'+t+'"]').show()).hide()}function i(a){if(a&&!e('option[value="'+a+'"]',d[0]).length){var i=e(t).clone(!0).attr("data-profile",a);i.find('[name^="profile_data"]').attr("name",function(e,t){return t.replace("profile_data[default]","profile_data["+a+"]")}),i.children("li").each(function(){e(this).addClass("ignore").children(".wlabel").before('<input class="ignore" type="checkbox" />')}),i.appendTo(e(t).parent()),d.append('<option value="'+a+'">'+a+"</option>"),e(d[0]).val(a).trigger("change")}}function n(t,a){a&&t!=a&&!e('option[value="'+a+'"]',d[0]).length&&(e('[data-profile="'+t+'"]').attr("data-profile",a).find('[name^="profile_data"]').attr("name",function(e,i){return i.replace("profile_data["+t+"]","profile_data["+a+"]")}),e('input[name^="profile_map"][value="'+t+'"]',s).attr("value",a),d.find('option[value="'+t+'"]').attr("value",a).html(a))}function l(t){e('[data-profile="'+t+'"]').remove(),e('input[name^="profile_map"][value="'+t+'"]',s).remove(),d.find('option[value="'+t+'"]').remove(),e(d[0]).trigger("change")}function o(t){c.find("option:selected").attr("selected",!1),c.find("option:disabled").attr("disabled",!1),e('input[type="hidden"]',s).each(function(){var a=e(this).attr("name").replace(/^profile_map\[(.*)\]$/i,"$1"),i=e(this).val()==t?"selected":"disabled";c.find('[value="'+a+'"]').attr(i,!0)}),c.show().find("select").focus()}function r(t){e('input[name^="profile_map"][value="'+t+'"]',s).remove(),c.find("option:selected").each(function(){s.append('<input type="hidden" name="profile_map['+e(this).val()+']" value="'+t+'" />')})}var s=this.first(),d=e.merge(e("> select",s),e("select.profile")),c=e(".items",s);return e('[data-profile][data-profile!="default"] > li').each(function(){e(this).children(".wlabel").before(e('<input class="ignore" type="checkbox" />').attr("checked",!e(this).hasClass("ignore")))}),a("default"),e("#config").delegate("input.ignore","change",function(t){e(this).is(":checked")?e(this).closest("li").removeClass("ignore"):e(this).closest("li").addClass("ignore")}),e(d[0]).bind("change",function(t){a(e(this).val())}),e("> a.add",s).bind("click",function(e){e.preventDefault(),i(prompt("Please enter a profile name"))}),e("> a.rename",s).bind("click",function(t){t.preventDefault();var a=e(d[0]).val(),i=prompt("Please enter a profile name",a);n(a,i)}),e("> a.remove",s).bind("click",function(t){t.preventDefault(),l(e(d[0]).val())}),e("> a.assign",s).bind("click",function(t){t.preventDefault(),o(e(d[0]).val())}),e("select",c).bind("blur",function(t){r(e(d[0]).val()),c.hide()}),this};var t={get:function(e){return window.sessionStorage?sessionStorage.getItem(e):0},set:function(e,t){window.sessionStorage&&sessionStorage.setItem(e,t)}};e.fn.tabs=function(){return this.each(function(){var a=e(this).addClass("content").wrap('<div class="tabs-box" />').before('<ul class="nav" />'),i=e(this).prev("ul.nav");a.children("li").each(function(){i.append("<li><a>"+e(this).hide().attr("data-name")+"</a></li>")}),i.children("li").bind("click",function(n){n.preventDefault();var l=e("li",i).removeClass("active").index(e(this).addClass("active").get(0)),o=a.children("li").hide();e(o[l]).show(),t.set("warp.settings.index",l)});var n=t.get("warp.settings.index")?t.get("warp.settings.index"):0,l=i.children();n>=l.length&&(n=0),l.eq(n).trigger("click")})}}(jQuery);