client.min.js 6.61 KB
if(typeof Joomla==="undefined")var Joomla={};Joomla.apps={view:"dashboard",id:0,ordering:"",cssfiles:[],jsfiles:[],list:0,loaded:0,update:!1},Joomla.loadweb=function(a){if(""==a)return!1;var b=new RegExp(apps_base_url),c=new RegExp("^index.php");if(!b.test(a)&&!c.test(a)){window.open(a,"_blank");return!1}a+="&product="+apps_product+"&release="+apps_release+"&dev_level="+apps_dev_level+"&list="+(Joomla.apps.list?"list":"grid")+"&pv="+apps_pv;var d=Joomla.apps.ordering;d!==""&&jQuery("#com-apps-ordering").val()&&(d=jQuery("#com-apps-ordering").val(),a+="&ordering="+d),jQuery("html, body").animate({scrollTop:0},0),jQuery("#myTabContent").length&&(jQuery("#appsloading").css("position","absolute").css("left","0").css("top","0").css("width","100%").css("height","100%").appendTo(jQuery("#web").css("position","relative")),jQuery.event.trigger("ajaxStart")),jQuery.ajax({url:a,dataType:"jsonp",cache:!0,jsonpCallback:"jedapps_jsonpcallback",timeout:2e4,success:function(a){jQuery("#web-loader").hide(),jQuery("#jed-container").html(a.data.html);if(!Joomla.apps.update&&a.data.pluginuptodate<1){Joomla.apps.update=!0;var b=apps_obsolete,c=apps_updateavail2;a.data.pluginuptodate==0&&(b=apps_updateavail1),apps_is_hathor?jQuery("#element-box").prepend(jQuery('<dl id="system-message"><dt class="info">info</dt><dd class="info message"><ul><li>'+b+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="btn" type="button" value="'+c+'" onclick="Joomla.submitbuttonInstallWebInstaller()" /></li></ul></dd></dl>')):jQuery("#web").prepend(jQuery('<div class="alert alert-info j-jed-message" style="margin-bottom: 20px; line-height: 2em; color:#333333;">'+b+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="btn" type="button" value="'+c+'" onclick="Joomla.submitbuttonInstallWebInstaller()" /></div>'))}jQuery("#myTabContent").length&&jQuery.event.trigger("ajaxStop")},fail:function(){jQuery("#web-loader").hide(),jQuery("#web-loader-error").show(),jQuery("#myTabContent").length&&jQuery.event.trigger("ajaxStop")},complete:function(){jQuery("#joomlaapsinstallatinput")&&jQuery("#joomlaapsinstallatinput").val(apps_installat_url),Joomla.apps.clickforlinks(),Joomla.apps.clicker(),Joomla.apps.list&&jQuery(".list-view").click(),jQuery("#myTabContent").length&&jQuery.event.trigger("ajaxStop")},error:function(a,b,c){a.responseText&&jQuery("#web-loader-error").html(a.responseText),jQuery("#web-loader").hide(),jQuery("#web-loader-error").show(),jQuery("#myTabContent").length&&jQuery.event.trigger("ajaxStop")}});return!0},Joomla.webpaginate=function(a,b){jQuery("#web-paginate-loader").show(),jQuery.get(a,function(a){jQuery("#web-paginate-loader").hide(),jQuery("#"+b).html(a.data.html)},"jsonp").fail(function(){jQuery("#web-paginate-loader").hide()})},Joomla.installfromwebexternal=function(a){var b=confirm("You will be redirected to the following link to complete the registration/purchase - \n"+a);if(!0==b){jQuery("#adminForm").attr("action",a),jQuery("input[name=task]").prop("disabled",!0),jQuery("input[name=install_directory]").prop("disabled",!0),jQuery("input[name=install_url]").prop("disabled",!0),jQuery("input[name=installtype]").prop("disabled",!0),jQuery("input[name=filter_search]").prop("disabled",!0);return!0}return!1},Joomla.installfromweb=function(a,b){if(""==a){alert("This extension cannot be installed via the web. Please visit the developer's website to purchase/download.");return!1}jQuery("#install_url").val(a),jQuery("#uploadform-web-url").text(a),b?(jQuery("#uploadform-web-name").text(b),jQuery("#uploadform-web-name-label").show()):jQuery("#uploadform-web-name-label").hide(),jQuery("#jed-container").slideUp(300),jQuery("#uploadform-web").show();return!0},Joomla.installfromwebcancel=function(){jQuery("#uploadform-web").hide(),jQuery("#jed-container").slideDown(300),Joomla.apps.list&&jQuery(".list-view").click()},Joomla.installfromwebajaxsubmit=function(){var a="&view="+Joomla.apps.view;Joomla.apps.id&&(a+="&id="+Joomla.apps.id);if(jQuery("#com-apps-searchbox").val()){var b=encodeURI(jQuery("#com-apps-searchbox").val().toLowerCase().replace(/ +/g,"_").replace(/[^a-z0-9-_]/g,"").trim());a+="&filter_search="+b}var c=Joomla.apps.ordering;c!==""&&jQuery("#com-apps-ordering").val()&&(c=jQuery("#com-apps-ordering").val()),c&&(a+="&ordering="+c),Joomla.loadweb(apps_base_url+"index.php?format=json&option=com_apps"+a)},Joomla.apps.clickforlinks=function(){jQuery("a.transcode").each(function(a,b){var c=jQuery(this).attr("href");(function(){var a=c;jQuery(b).live("click",function(b){var c=new RegExp(apps_base_url),d=new RegExp("^index.php");c.test(a)||d.test(a)?(Joomla.apps.view=a.replace(/^.+[&\?]view=(\w+).*$/,"$1"),Joomla.apps.view=="dashboard"?Joomla.apps.id=0:Joomla.apps.view=="category"&&(Joomla.apps.id=a.replace(/^.+[&\?]id=(\d+).*$/,"$1")),b.preventDefault(),Joomla.loadweb(apps_base_url+a)):(b.preventDefault(),Joomla.loadweb(a))})})(),jQuery(this).attr("href","#")})},Joomla.apps.initialize=function(){Joomla.apps.loaded=1,jQuery("#myTabContent").length&&(jQuery('<div id="appsloading"></div>').appendTo(jQuery("#web").css("position","absolute")),jQuery("#appsloading").ajaxStart(function(){jQuery("body").addClass("ifw-busy"),jQuery(this).show()}).ajaxStop(function(){jQuery(this).hide(),jQuery("body").removeClass("ifw-busy")})),Joomla.loadweb(apps_base_url+"index.php?format=json&option=com_apps&view=dashboard"),Joomla.apps.clickforlinks(),jQuery("#com-apps-searchbox").live("keypress",function(a){a.which==13&&Joomla.apps.initiateSearch()}),jQuery("#search-reset").live("click",function(a){jQuery("#com-apps-searchbox").val(""),Joomla.apps.initiateSearch()}),jQuery("#com-apps-ordering").live("change",function(a){Joomla.apps.ordering=jQuery(this).prop("selectedIndex"),Joomla.installfromwebajaxsubmit()}),apps_installfrom_url!=""&&Joomla.installfromweb(apps_installfrom_url)},Joomla.apps.initiateSearch=function(){Joomla.apps.view="dashboard",Joomla.installfromwebajaxsubmit()},Joomla.apps.clicker=function(){jQuery(".grid-view").live("click",function(){Joomla.apps.list=0,jQuery(".list-container").addClass("hidden"),jQuery(".grid-container").removeClass("hidden"),jQuery("#btn-list-view").removeClass("active"),jQuery("#btn-grid-view").addClass("active")}),jQuery(".list-view").live("click",function(){Joomla.apps.list=1,jQuery(".grid-container").addClass("hidden"),jQuery(".list-container").removeClass("hidden"),jQuery("#btn-grid-view").removeClass("active"),jQuery("#btn-list-view").addClass("active")})},Joomla.submitbutton5=function(a){var b=document.getElementById("adminForm");b.install_url.value!=""&&b.install_url.value!="http://"?Joomla.submitbutton4():b.install_url.value==""?alert(apps_btntxt):(apps_is_hathor||jQuery("#appsloading").css("display","block"),b.installtype.value="web",b.submit())}