Current Path :
/
home
/
develito
/
www
/
components
/
com_sobipro
/
lib
/
js
/
adm
/
Or
Select Your Path :
Upload File :
New :
File
Dir
//home/develito/www/components/com_sobipro/lib/js/adm/requirements.js
var SPStartTime=0;var SPErrors=0;var SPWarnings=0;SobiPro.jQuery().ready(function(){"use strict";new SobiProRequirements();SobiPro.jQuery('#SobiPro').find('.repeat').click(function(){SobiPro.jQuery('#SobiPro').find('.bar').css('width','1%');setTimeout(function(){new SobiProRequirements()},1000)});SobiPro.jQuery('#SobiPro').find('.download').click(function(){document.location=SobiProAdmUrl.replace('%task%','requirements.download')+'&format=raw'});SobiPro.jQuery('#SobiPro').find('.next').click(function(){try{window.top.location.href=SobiPro.jQuery('#SP_redirect').val()}catch(e){}document.location=SobiPro.jQuery('#SP_redirect').val();return false})});function SobiProRequirements(){"use strict";SPStartTime=new Date().getTime();SobiPro.jQuery(' <span id="SpProgress"></span>').appendTo(SobiPro.jQuery('#SobiPro').find('.checkstatus'));this.elements=SobiPro.jQuery('.spOutput');this.spinner='<img src="'+SPLiveSite+'media/sobipro/adm/spinner.gif"/>';this.running=this.elements.length;var g=SobiPro.jQuery('#SP_method').next('input');this.request={'option':'com_sobipro','method':'xhr','format':'raw'};this.request[g.attr('name')]=g.val();SobiPro.jQuery('.buttons').addClass('hide');var h=this;this.setMessage=function(){if(this.running){SobiPro.jQuery('#SpProgress').html(SobiPro.Txt('REQUIREMENT_WORKING_MSG').replace('%d',this.running))}else{SobiPro.jQuery('.buttons').removeClass('hide');SobiPro.jQuery('#SpProgress').html(SobiPro.Txt('Done'));if(SPErrors){SobiPro.Alert('REQUIREMENT_ERR')}else if(SPWarnings){SobiPro.Alert('REQUIREMENT_WARN');SPStartTime=new Date().getTime()}}SobiPro.jQuery('#SobiPro').find('.bar').css('width',100/this.running+'%')};this.setMessage();this.getResponse=function(c,d){var e=SobiPro.jQuery(c);var f=h.request;f['task']='requirements.'+e.attr('id');e.html(this.spinner);SobiPro.jQuery.ajax({'type':'post','url':'index.php','data':f,'dataType':'json',success:function(a){if(a.type=='warning'){SPWarnings++}if(a.type=='error'){a.type='important';SPErrors++}var b={'important':'thumbs-down-alt','success':'thumbs-up-alt','warning':'hand-right'};e.html('<span class="label label-'+a.type+'"> <i class="icon-'+b[a.type]+'"></i> '+a.textType+'</span> '+a.message);h.running--;h.setMessage()},error:function(a,b){if(b=='timeout'){if(d<20){e.html(SobiPro.Txt('Too long answer'));h.getResponse(c,d++)}else{e.html(SobiPro.Txt('Too long answer. Limit expired. Skipping'))}}}})};this.elements.each(function(a,b){h.getResponse(b,0)})}