diff --git a/media/com_joomlaupdate/js/update.js b/media/com_joomlaupdate/js/update.js index c218078896cf4..65ebdedef934b 100644 --- a/media/com_joomlaupdate/js/update.js +++ b/media/com_joomlaupdate/js/update.js @@ -266,7 +266,7 @@ stepExtract = function(data) jQuery('#extpercent').text(stat_percent.toFixed(1)); jQuery('#extbytesin').text(stat_inbytes); jQuery('#extbytesout').text(stat_outbytes); - jQuery('#extfiles').text(data.lastfile); + jQuery('#extfiles').text(data.files); // Do AJAX post post = { diff --git a/media/com_joomlaupdate/js/update.min.js b/media/com_joomlaupdate/js/update.min.js index b1b614f30075e..0059da8e8a158 100644 --- a/media/com_joomlaupdate/js/update.min.js +++ b/media/com_joomlaupdate/js/update.min.js @@ -1 +1 @@ -function error_callback(t){alert("ERROR:\n"+t)}function empty(t){var r;if(""===t||0===t||"0"===t||null===t||t===!1||"undefined"==typeof t)return!0;if("object"==typeof t){for(r in t)return!1;return!0}return!1}function is_array(t){var r="",e=function(t){var r=/\W*function\s+([\w\$]+)\s*\(/.exec(t);return r?r[1]:"(Anonymous)"};if(!t)return!1;if(this.php_js=this.php_js||{},this.php_js.ini=this.php_js.ini||{},"object"==typeof t){if(this.php_js.ini["phpjs.objectsAsArrays"]&&(this.php_js.ini["phpjs.objectsAsArrays"].local_value.toLowerCase&&"off"===this.php_js.ini["phpjs.objectsAsArrays"].local_value.toLowerCase()||0===parseInt(this.php_js.ini["phpjs.objectsAsArrays"].local_value,10)))return t.hasOwnProperty("length")&&!t.propertyIsEnumerable("length")&&"String"!==e(t.constructor);if(t.hasOwnProperty)for(r in t)if(!1===t.hasOwnProperty(r))return!1;return!0}return!1}var stat_total=0,stat_files=0,stat_inbytes=0,stat_outbytes=0;doEncryptedAjax=function(t,r,e){var s=JSON.stringify(t);joomlaupdate_password.length>0&&(s=AesCtr.encrypt(s,joomlaupdate_password,128));var a={json:s},n={type:"POST",url:joomlaupdate_ajax_url,cache:!1,data:a,timeout:6e5,success:function(t,s){var a=null,n="",o=t.indexOf("###");if(-1==o)return t="Invalid AJAX data:\n"+t,void(null==e?null!=error_callback&&error_callback(t):e(t));0!=o?(a=t.substr(0,o),n=t.substr(o)):n=t,n=n.substr(3);var o=n.lastIndexOf("###");n=n.substr(0,o);var i=null;if(joomlaupdate_password.length>0)try{var i=JSON.parse(n)}catch(c){n=AesCtr.decrypt(n,joomlaupdate_password,128)}try{empty(i)&&(i=JSON.parse(n))}catch(c){var t=c.message+"\n
\n
\n"+n+"\n
";return void(null==e?null!=error_callback&&error_callback(t):e(t))}r(i)},error:function(t){var r="AJAX Loading Error: "+t.statusText;null==e?null!=error_callback&&error_callback(r):e(r)}};jQuery.ajax(n)},pingExtract=function(){this.stat_files=0,this.stat_inbytes=0,this.stat_outbytes=0;var t={task:"ping"};this.doEncryptedAjax(t,function(t){startExtract(t)})},startExtract=function(){console.log("started"),this.stat_files=0,this.stat_inbytes=0,this.stat_outbytes=0;var t={task:"startRestore"};this.doEncryptedAjax(t,function(t){stepExtract(t)})},stepExtract=function(t){return 0==t.status?void error_callback(t.message):(!empty(t.Warnings),empty(t.factory)||(extract_factory=t.factory),void(t.done?finalizeUpdate():(stat_inbytes+=t.bytesIn,stat_percent=100*stat_inbytes/joomlaupdate_totalsize,stat_inbytes+=t.bytesIn,stat_outbytes+=t.bytesOut,stat_files+=t.files,stat_percent<100?jQuery("#progress-bar").css("width",stat_percent+"%").attr("aria-valuenow",stat_percent):stat_percent>100?(stat_percent=100,jQuery("#progress-bar").css("width",stat_percent+"%").attr("aria-valuenow",stat_percent)):jQuery("#progress-bar").removeClass("bar-success"),jQuery("#extpercent").text(stat_percent.toFixed(1)),jQuery("#extbytesin").text(stat_inbytes),jQuery("#extbytesout").text(stat_outbytes),jQuery("#extfiles").text(t.lastfile),post={task:"stepRestore",factory:t.factory},doEncryptedAjax(post,function(t){stepExtract(t)}))))},finalizeUpdate=function(){var t={task:"finalizeRestore",factory:window.factory};doEncryptedAjax(t,function(t){window.location=joomlaupdate_return_url})}; +function error_callback(t){alert("ERROR:\n"+t)}function empty(t){var r;if(""===t||0===t||"0"===t||null===t||t===!1||"undefined"==typeof t)return!0;if("object"==typeof t){for(r in t)return!1;return!0}return!1}function is_array(t){var r="",e=function(t){var r=/\W*function\s+([\w\$]+)\s*\(/.exec(t);return r?r[1]:"(Anonymous)"};if(!t)return!1;if(this.php_js=this.php_js||{},this.php_js.ini=this.php_js.ini||{},"object"==typeof t){if(this.php_js.ini["phpjs.objectsAsArrays"]&&(this.php_js.ini["phpjs.objectsAsArrays"].local_value.toLowerCase&&"off"===this.php_js.ini["phpjs.objectsAsArrays"].local_value.toLowerCase()||0===parseInt(this.php_js.ini["phpjs.objectsAsArrays"].local_value,10)))return t.hasOwnProperty("length")&&!t.propertyIsEnumerable("length")&&"String"!==e(t.constructor);if(t.hasOwnProperty)for(r in t)if(!1===t.hasOwnProperty(r))return!1;return!0}return!1}var stat_total=0,stat_files=0,stat_inbytes=0,stat_outbytes=0;doEncryptedAjax=function(t,r,e){var s=JSON.stringify(t);joomlaupdate_password.length>0&&(s=AesCtr.encrypt(s,joomlaupdate_password,128));var a={json:s},n={type:"POST",url:joomlaupdate_ajax_url,cache:!1,data:a,timeout:6e5,success:function(t,s){var a=null,n="",o=t.indexOf("###");if(-1==o)return t="Invalid AJAX data:\n"+t,void(null==e?null!=error_callback&&error_callback(t):e(t));0!=o?(a=t.substr(0,o),n=t.substr(o)):n=t,n=n.substr(3);var o=n.lastIndexOf("###");n=n.substr(0,o);var i=null;if(joomlaupdate_password.length>0)try{var i=JSON.parse(n)}catch(c){n=AesCtr.decrypt(n,joomlaupdate_password,128)}try{empty(i)&&(i=JSON.parse(n))}catch(c){var t=c.message+"\n
\n
\n"+n+"\n
";return void(null==e?null!=error_callback&&error_callback(t):e(t))}r(i)},error:function(t){var r="AJAX Loading Error: "+t.statusText;null==e?null!=error_callback&&error_callback(r):e(r)}};jQuery.ajax(n)},pingExtract=function(){this.stat_files=0,this.stat_inbytes=0,this.stat_outbytes=0;var t={task:"ping"};this.doEncryptedAjax(t,function(t){startExtract(t)})},startExtract=function(){console.log("started"),this.stat_files=0,this.stat_inbytes=0,this.stat_outbytes=0;var t={task:"startRestore"};this.doEncryptedAjax(t,function(t){stepExtract(t)})},stepExtract=function(t){return 0==t.status?void error_callback(t.message):(!empty(t.Warnings),empty(t.factory)||(extract_factory=t.factory),void(t.done?finalizeUpdate():(stat_inbytes+=t.bytesIn,stat_percent=100*stat_inbytes/joomlaupdate_totalsize,stat_inbytes+=t.bytesIn,stat_outbytes+=t.bytesOut,stat_files+=t.files,stat_percent<100?jQuery("#progress-bar").css("width",stat_percent+"%").attr("aria-valuenow",stat_percent):stat_percent>100?(stat_percent=100,jQuery("#progress-bar").css("width",stat_percent+"%").attr("aria-valuenow",stat_percent)):jQuery("#progress-bar").removeClass("bar-success"),jQuery("#extpercent").text(stat_percent.toFixed(1)),jQuery("#extbytesin").text(stat_inbytes),jQuery("#extbytesout").text(stat_outbytes),jQuery("#extfiles").text(t.files),post={task:"stepRestore",factory:t.factory},doEncryptedAjax(post,function(t){stepExtract(t)}))))},finalizeUpdate=function(){var t={task:"finalizeRestore",factory:window.factory};doEncryptedAjax(t,function(t){window.location=joomlaupdate_return_url})};