Current Path :
/
home
/
develito
/
public_html
/
components
/
com_sobipro
/
lib
/
js
/
adm
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/develito/public_html/components/com_sobipro/lib/js/adm/category.js
function SPSelectIcon(o,e){SobiPro.jQuery("#SP_categoryIconHolder").val(o),SobiPro.jQuery('[name^="category.icon"]').val(e),SobiPro.jQuery("#SP_categoryIconHolder").val()&&SobiPro.jQuery("#catIcoChooser").html('<img src="'+SobiPro.jQuery("#SP_categoryIconHolder").val()+'" class="spCatImage" />'),SobiPro.jQuery("#spIco").modal("hide")}SobiPro.jQuery(document).ready(function(){if(SobiPro.jQuery(".spCategoryChooser").click(function(){var o=SobiPro.jQuery(this).attr("rel");SobiPro.jQuery("#spCatsChooser").html('<iframe id="spCatSelectFrame" src="'+o+'"> </iframe>'),SobiPro.jQuery("#spCat").modal()}),SobiPro.jQuery("#spCatSelect").bind("click",function(o){SobiPro.jQuery("#SP_selectedCid").val()&&(SobiPro.jQuery("#selectedCatPath").html(SobiPro.jQuery("#SP_selectedCatPath").val()),SobiPro.jQuery('[name^="category.parent"]').val(SobiPro.jQuery("#SP_selectedCid").val()),SobiPro.jQuery("#categoryParentName").html(SobiPro.jQuery("#SP_selectedCatName").val()))}),SobiPro.jQuery("#SP_categoryIconHolder").val()&&SobiPro.jQuery("#catIcoChooser").html('<img src="'+SobiPro.jQuery("#SP_categoryIconHolder").val()+'" class="spCatImage" />'),SobiPro.jQuery('[name^="category.icon"]').val()&&-1!=SobiPro.jQuery('[name^="category.icon"]').val().indexOf("font-")){var o=JSON.parse(SobiPro.jQuery('[name^="category.icon"]').val().replace(/\\'/g,'"')),e=null!=o.content?o.content:"";SobiPro.jQuery("#catIcoChooser").html("<"+o.element+' class="spIconElement '+o.class+'">'+e+"</"+o.element+">")}SobiPro.jQuery("#category-params-icon-font").val()&&-1!=SobiPro.jQuery("#category-params-icon-font").val().indexOf("font-")&&SobiPro.jQuery(".ctrl-add-font-class").removeClass("hide"),SobiPro.jQuery.ajax({url:"index.php",type:"post",dataType:"json",data:{option:"com_sobipro",task:"category.iconFonts",sid:SobiProSection,selected:SobiPro.jQuery("#category-params-icon-font").children("option:selected").val(),format:"raw",tmpl:"component",method:"xhr"}}).done(function(o){SobiPro.jQuery("#category-params-icon-font option").each(function(e,r){var a=!1,t=SobiPro.jQuery(this).val();0!=t&&(SobiPro.jQuery.each(o,function(o,e){-1!=t.indexOf(e)&&(a=!0)}),a||SobiPro.jQuery(this).attr("disabled","disabled"))})}),SobiPro.jQuery("#category-params-icon-font").change(function(){SobiPro.jQuery(this).val()&&-1!=SobiPro.jQuery(this).val().indexOf("font-")?(SobiPro.jQuery(".ctrl-add-font-class").removeClass("hide"),SobiPro.jQuery("#spIco").addClass("spModalPopup"),SobiPro.jQuery("#spIco").removeClass("spModalIframe")):(SobiPro.jQuery(".ctrl-add-font-class").addClass("hide"),SobiPro.jQuery("#spIco").addClass("spModalIframe"),SobiPro.jQuery("#spIco").removeClass("spModalPopup"))}),SobiPro.jQuery("#catIcoChooser").click(function(){if(-1!=SobiPro.jQuery("#category-params-icon-font").val().indexOf("font-")){SobiPro.jQuery("#spIcoChooser").html("");var o={option:"com_sobipro",task:"category.icon",sid:SobiProSection,format:"raw",tmpl:"component",method:"xhr",font:SobiPro.jQuery("#category-params-icon-font").val()};SobiPro.jQuery.ajax({url:"index.php",type:"post",dataType:"json",data:o}).done(function(o){if(o.length){var e,r=1;try{r=SobiPro.jQuery("#category-params-icon-font option:selected").text().match(/\((.*?)\)/),r=parseInt(r[1])}catch(o){r=1}SobiPro.jQuery.each(o,function(o,r){var a=null!=r.content?r.content:"";e=r.element,r.font=SobiPro.jQuery("#category-params-icon-font").val(),SobiPro.jQuery("#spIcoChooser").append('<div class="spIconElCont"><'+r.element+' class="spIconElement '+r.class+'" title="'+r.class+'" data-setting="'+JSON.stringify(r).replace(/"/g,"'")+'">'+a+"</"+r.element+"></div>")}),SobiPro.jQuery("#spIcoChooser").find(e).click(function(){SobiPro.jQuery("#catIcoChooser").html(""),SobiPro.jQuery("#catIcoChooser").append(SobiPro.jQuery(this).clone()),SobiPro.jQuery('[name^="category.icon"]').val(SobiPro.jQuery(this).data("setting")),SobiPro.jQuery(".spIconElCont").removeClass("active"),SobiPro.jQuery(this).parent().addClass("active")}),SobiPro.jQuery("#spIco").addClass("spModalPopup"),SobiPro.jQuery("#spIco").removeClass("spModalIframe"),SobiPro.jQuery("#spIco").modal()}})}else{var e=SobiPro.jQuery(this).attr("rel");SobiPro.jQuery("#spIcoChooser").html('<iframe id="spIcoSelectFrame" src="'+e+'"> </iframe>'),SobiPro.jQuery("#spIco").addClass("spModalIframe"),SobiPro.jQuery("#spIco").removeClass("spModalPopup"),SobiPro.jQuery("#spIco").modal()}})});