PHP Classes

File: admin/js/install-app.js

Recommend this page to a friend!
  Classes of Subin Siby   Lobby   admin/js/install-app.js   Download  
File: admin/js/install-app.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Lobby
Web OS to install and run Web applications
Author: By
Last change: Lobby 1.0 Cobra
Date: 7 years ago
Size: 1,254 bytes
 

Contents

Class file image Download
lobby.installApp=function(id,area){var retryIntervalStarted=0;var startRetryCountdown=function(){if(retryIntervalStarted==0){setInterval(function(){if($("#retryInstallCountdown:last").text()=="0"){area.html('');check();}else{$("#retryInstallCountdown").text(parseInt($("#retryInstallCountdown").text())-1);}},1000);retryIntervalStarted=1;}};var check=function(force){var requestData={"id":id};if(typeof force!=="undefined") requestData["force-install"]=1;lobby.ar("admin/install-app",requestData,function(r){r=JSON.parse(r);if(r.statusID=="error"){html="<li class='collection-item' style='color: red;' data-status-id='error'>"+r.status+"<br/>Will try again in <span id='retryInstallCountdown'>20</span> seconds.<cl/><a id='retryInstallNow' class='btn green'>Try Again Now</a><a href='"+lobby.url+"/admin/lobby-store.php?app="+id+"' class='btn red'>Cancel</a></li>";startRetryCountdown();}else{html="<li class='collection-item' data-status-id='"+r.statusID+"'>"+r.status+"</li>";if(r.statusID!=="install_finished"){setTimeout(check,1000);}} if(area.find("li:last").attr("data-status-id")==r.statusID){area.find("li:last").replaceWith(html);}else{area.append(html);}});};check();$("#retryInstallNow").live("click",function(){area.html("");check(true);});};