function ULSNKb(){var o=new Object;o.ULSTeamName="Microsoft SharePoint Foundation";o.ULSFileName="SP.UI.AllApps.js";return o;} Type.registerNamespace("SP.UI.AllApps");SP.UI.AllApps.SPAppUIState=function(){};SP.UI.AllApps.SPAppUIState.prototype={uninstalled:0,installedOk:1,installedFailedUpdateTryAgain:2,installedNormalUpdateAvailable:3,installedProblemWithUpgradeTryAgain:4,updateManuallyCancelledShowSameAsNormalUpdateAvailable:5,userCancelledUpdateRollingBack:6,initializedMiddownload:7,initializedDidntInstallRemoveOrInstallShouldWork:8,initializedInstallFailedCanRetry:9,installingSomeTroubleCanRetryMightNeedAdmin:10,upgradeStuckCanRetry:11,upgradeStuckOMEXWantsUnstuckNowCallAdmin:12,initializedDownloadInvalidatedUninstallTryAgain:13,somethingWentWrongThenWeBrokeUninstallAndAreStuck:14,systemDecidedToRemoveAppEverythingWorking:15,uninstallingInError:16,userTriedToRemoveButWeAreStuckOnUninstall:17,uninstallingInErrorOMEXSomethingWrongDoSameAsUpdateForOMEX:18,installedProblemWithUpgradeTryAgainImmediately:19,updateHadAnIssueWeAreRollingBack:20,installedFlagged:21,installedWithdrawnUpdateAvailable:22,installedWithdrawn:23,installedFlaggedUpdateAvailable:24,installedUpdateImmediatelyUpdateAvailable:25,installedRevoked:26,installedRevokedUpdateAvailable:27,somethingWentWrongKillbitting:28,weAreMidKillingAnApp:29,disabled:30,installedRemoved:31,installedRemovedUpdateAvailable:32,installingInProgress:33,registeringInstall:34,uninstallingNormal:35,userDecidedToRemoveAppEverythingWorking:36,notPossible:37,upgradingEverythingGood:38,registeringUpdate:39,updateDownloadInProgress:40,updateDownloadFailed:41};SP.UI.AllApps.SPAppUIState.registerEnum("SP.UI.AllApps.SPAppUIState",false);SP.UI.AllApps.CommandRecord=function(){};SP.UI.AllApps.CommandRecord.prototype={command:null,formdigest:null,sequence:0};SP.UI.AllApps.CallRecord=function(){};SP.UI.AllApps.CallRecord.prototype={commandRecord:null,onCommandCompleted:null,sequence:0};SP.UI.AllApps.CommandProxy=function(a){ULSNKb:;this.$$d_$4_0=Function.createDelegate(this,this.$4_0);this.$1_0=-1;this.$2_0=a;this.$0_0={}};SP.UI.AllApps.CommandProxy.prototype={$2_0:null,$3_0:0,$0_0:null,getNextSequenceNumber:function(){ULSNKb:;return++this.$1_0},executeCommand:function(a,d){ULSNKb:;if(this.$3_0>0)return-1;a.sequence=this.getNextSequenceNumber();var c=new SP.UI.AllApps.CallRecord;c.commandRecord=a;c.sequence=a.sequence;c.onCommandCompleted=d;this.$0_0[a.sequence.toString()]=c;var b=new Sys.Net.WebRequest;b.set_httpVerb("POST");b.set_url(this.$2_0);b.set_userContext(c);b.set_body(Sys.Serialization.JavaScriptSerializer.serialize(a));b.add_completed(this.$$d_$4_0);b.invoke();return a.sequence},$4_0:function(c){ULSNKb:;var a=c.get_webRequest().get_userContext(),b=null;try{b=c.get_object()}catch(d){}a.onCommandCompleted(a.commandRecord,b);this.$0_0[a.commandRecord.sequence.toString()]=null}};SP.UI.AllApps.CommandRecord.registerClass("SP.UI.AllApps.CommandRecord");SP.UI.AllApps.CallRecord.registerClass("SP.UI.AllApps.CallRecord");SP.UI.AllApps.CommandProxy.registerClass("SP.UI.AllApps.CommandProxy");function sp_ui_allapps_initialize(){}sp_ui_allapps_initialize();function GetAppLaunchFunction(b){ULSNKb:;var a=b;return function(){ULSNKb:;LaunchAppByClick(a);CancelDefaultBehavior();return false}}function getShowCalloutIconFunction(b){ULSNKb:;var a=b;return function(){ULSNKb:;showCalloutIcon(a)}}function getHideCalloutIconFunction(b){ULSNKb:;var a=b;return function(){ULSNKb:;hideCalloutIcon(a)}}function LaunchAppByClick(b){ULSNKb:;var a=appData[b];if(a.isTenantApp)LaunchAppFromPage(null,a.oauthId,a.launchUrl,null,true);else LaunchAppFromPage(b,a.oauthId,a.launchUrl,null,false)}function LaunchAppFromPage(a,d,e,b,c){ULSNKb:;LaunchApp(a,d,e,b,c);CancelDefaultBehavior();return false}function CancelDefaultBehavior(){ULSNKb:;typeof window.event!="undefined"&&window.event!=null&&cancelDefault(window.event)}function closeAndClearCallout(b){ULSNKb:;var a=appData[b];typeof a.callout!="undefined"&&a.callout!=null&&a.callout.close()}function handleManageAppPermissions(a){ULSNKb:;STSNavigate(getManagePermissionsUrl(a))}function handleDeployTSApp(a){ULSNKb:;var b=strWebLayoutsFolder+"DeployTSApp.aspx?AppId="+escapeProperly(a.id)+"&AppTitle="+escapeProperly(a.title)+"&Source="+escapeProperly(strWebLayoutsFolder)+"viewlsts.aspx";STSNavigate(b)}function handleListSettings(b){ULSNKb:;var a=strWebLayoutsFolder+"listedit.aspx?List="+escapeProperly(b);STSNavigate(a)}function handleAppSettings(a){ULSNKb:;var b=appData[a];LaunchAppFromPage(a,b.oauthId,b.appSettingsUrl,null)}function handleHelp(a){ULSNKb:;window.location=a}function handleViewInStorefront(b){ULSNKb:;var a=appData[b].appSource,d=appData[b].assetId,g=appData[b].productId,c=appData[b].contentMarket,f=d==null||d==""?g:d;if(f==null)return;if(a==0)a=2;else if(a==1)a=0;else if(a==2)a=1;var e=strWebLayoutsFolder+"storefront.aspx?Source="+escapeProperly(strWebLayoutsFolder)+"viewlsts.aspx#vw=AppDetailsView,app="+escapeProperly(f)+",clg="+a;if(c!=null&&c.length>0)e+=",cm="+escapeProperly(c);STSNavigate(e)}function handleManageSeats(a){ULSNKb:;STSNavigate("specificapplicensemanagement.aspx?ProductId="+escapeProperly(a))}function handleMonitorApp(b){ULSNKb:;var a=strWebLayoutsFolder+"AppMonitoringDetails.aspx?AppInstanceId="+escapeProperly(b);STSNavigate(a)}var req={};function handleRetryUninstallApp(a){ULSNKb:;closeAndClearCallout(a);handleUninstallAppCore(a,true,false)}function handleUninstallApp(a){ULSNKb:;closeAndClearCallout(a);var b=appData[a];handleUninstallAppCore(a,b.retryForRemove,true)}function handleUninstallAppCore(a,d,c){ULSNKb:;closeAndClearCallout(a);var b=appData[a],e=b.title;if(c)if(!confirm(appUninstallConfirm.replace("{0}",e))){b.callout.close();return}setAppRowMessage(a,strUninstalling);callMethodOnAppInstance(a,d?"retryAllJobs":"uninstall")}function callMethodOnAppInstance(a,b){ULSNKb:;var e=appData[a];req.ctx=SP.ClientContext.get_current();req.apps=SP.AppCatalog.getAppInstances(req.ctx,req.ctx.get_web());req.ctx.load(req.apps);var d=function(){ULSNKb:;var d={},g=req.apps.getEnumerator();while(g.moveNext()){var f=g.get_current();d[f.get_id()]=f}if(b==="retryAllJobs")d[a].retryAllJobs();else if(b==="uninstall")d[a].uninstall();else if(b==="install")d[a].install();else b==="cancelAllJobs"&&d[a].cancelAllJobs();req.ctx.load(d[a]);var h=function(){ULSNKb:;e.pending=true;ensureAppUpdating(a)};req.ctx.executeQueryAsync(Function.createDelegate(this,h),Function.createDelegate(this,c))},c=function(){ULSNKb:;setAppRowMessage(a,strGeneralError)};req.ctx.executeQueryAsync(Function.createDelegate(this,d),Function.createDelegate(this,c));return false}function removeAppRow(b){ULSNKb:;var a=document.getElementById("apptile-"+b);a&&a.parentNode&&a.parentNode.removeChild(a)}function setAppRowMessage(c,b){ULSNKb:;var a=document.getElementById("appstatus-"+c);if(a){a.className=a.className.replace("ms-error","");a.innerHTML=b}}function handleUninstallList(b){ULSNKb:;closeAndClearCallout(b);req.ctx=SP.ClientContext.get_current();var f=req.ctx.get_web().get_lists(),a=appData[b];if(a.uninstallInProgress)return;var g=a.title,h=f.getById(b),c=function(){ULSNKb:;removeAppRow(b);a.uninstallInProgress=false},d=function(f,d){ULSNKb:;var c=listUninstallFailed,e="";c=c.replace("{0}",e);c=c.replace("{1}","");setAppRowMessage(b,c);g_debugFile&&alert("Request failed. "+d.get_message()+"\n"+d.get_stackTrace());a.uninstallInProgress=false},e=g_recycleBinEnabled?appUninstallConfirmRecycle:appUninstallConfirm;if(confirm(e.replace("{0}",g)))h.recycle();else{a.callout.close();return}a.uninstallInProgress=true;req.ctx.executeQueryAsync(Function.createDelegate(this,c),Function.createDelegate(this,d));a.callout.close();return false}function handleUninstallFeature(b){ULSNKb:;closeAndClearCallout(b);var a=appData[b];if(a.uninstallInProgress)return;req.ctx=SP.ClientContext.get_current();var f=req.ctx.get_web().get_features(),c=a.title,d=function(){ULSNKb:;removeAppRow(b);a.uninstallInProgress=false},e=function(e,d){ULSNKb:;setAppRowMessage(b,appUninstallFailed.replace("{0}",c));g_debugFile&&alert("Request failed. "+d.get_message()+"\n"+d.get_stackTrace());a.uninstallInProgress=false};if(confirm(appUninstallConfirm.replace("{0}",c)))f.remove(b);else{a.callout.close();return}a.uninstallInProgress=true;req.ctx.executeQueryAsync(Function.createDelegate(this,d),Function.createDelegate(this,e));a.callout.close();return false}function isVisible(){ULSNKb:;return true}function onOpening(c){ULSNKb:;var a=appData[c.getID()];if(typeof a.callout.info!="undefined"||a.callout.waiting)return;a.callout.waiting=true;var b={};b.command="getcalloutinfo";b.appid=a.id;b.apptype=a.type;b.productid=a.productId;b.appsource=a.appSource;b.assetid=a.assetId;b.contentMarket="";if(typeof a.contentMarket!="undefined"&&a.contentMarket!=null)b.contentMarket=a.contentMarket;b.isTenantApp=a.isTenantApp;a.gettingData=true;getCommandProxy().executeCommand(b,onCalloutInfoReturned)}function onCalloutInfoReturned(k,b){ULSNKb:;var a=appData[k.appid];a.callout.info=b;var e=document.createElement("div");e.id="calloutcontentInner-"+a.id;e.className="ms-vl-calloutContent";var j="";if(b!=null&&b.eulaurl!=null)j=''+STSHtmlEncode(strAppTerms)+"";var g="";if(a.type==g_appTypeList)g+="
";else g+='
';g+='
'+j+"
";g+='
';e.innerHTML=g;var f="";if(b!=null&&b.publisher!=null&&b.publisher.length>0){f=strVersionAndPublisher.replace("{0}",a.version);f=f.replace("{1}",b.publisher)}else f=strVersion.replace("{0}",a.version);a.type!=g_appTypeList&&setInnerText(e.childNodes[0],f);b!=null&&b.description!=null&&setInnerText(e.childNodes[2],b.description);a.calloutContent=e;setCalloutContent(a.id,e);if(b==null){a.callout.waiting=false;return}var c=Array();if(a.type==g_appTypeApp){b.removeenabled&&!b.isanonymous&&b.putremovefirst&&addRemoveAction(c,a);b.supporturl!=null&&c.push({text:strHelp,onClickCallback:function(){ULSNKb:;handleHelp(b.supporturl)}});if(!b.isanonymous){if(!a.isTenantApp)b!=null&&b.manageseatsenabled&&a.appSource==g_appSourceMarketPlace&&c.push({text:strManageLicenses,onClickCallback:function(){ULSNKb:;handleManageSeats(a.productId)}});b.appsettingsenabled&&a.appSettingsUrl!=null&&c.push({text:strSettings,onClickCallback:function(){ULSNKb:;handleAppSettings(a.id)}});b.viewinmarketplaceenabled&&(a.appSource==g_appSourceMarketPlace||a.appSource==g_appSourceCorpCatalog)&&c.push({text:strViewInStorefront,onClickCallback:function(){ULSNKb:;handleViewInStorefront(a.id)}});if(!a.isTenantApp){g_isCorpSite&&b.managedeploymentenabled&&c.push({text:strDeploy,onClickCallback:function(){ULSNKb:;handleDeployTSApp(a)}});b.monitoringenabled&&c.push({text:strMonitorApp,onClickCallback:function(){ULSNKb:;handleMonitorApp(a.id)}});b.managepermissionsenabled&&c.push({text:strManagePermissions,onClickCallback:function(){ULSNKb:;handleManageAppPermissions(a)}});b.removeenabled&&!b.putremovefirst&&addRemoveAction(c,a)}}}else if(a.type==g_appTypeList){if(!b.isanonymous){!(a.assetId==null&&a.productId==null)&&c.push({text:strSettings,onClickCallback:function(){ULSNKb:;handleListSettings(a.id)}});b.viewinmarketplaceenabled&&c.push({text:strViewInStorefront,onClickCallback:function(){ULSNKb:;handleViewInStorefront(a.id)}});b.removeenabled&&c.push({text:strUninstall,onClickCallback:function(){ULSNKb:;handleUninstallList(a.id)}})}}else if(a.type==g_appTypeFeature)b.removeenabled&&!b.isanonymous&&c.push({text:strUninstall,onClickCallback:function(){ULSNKb:;handleUninstallFeature(a.id)}});for(var h=4,d=0;dh){for(var i=[],l=new CalloutActionMenu(a.callout.ID+"-actions"),d=h-1;d0&&ensureRealTimeUpdatesStarted()}function appSort(a,b){ULSNKb:;return a.title.localeCompare(b.title)}var appHtmlTemplate='
';function insertTenantApps(){ULSNKb:;var h=GetTenantAppData();if(h==null)return;var f=h.apps;if(f.length==0)return;for(var g=0;g0){if(!d)d={};for(var n in appData){var m=appData[n].productId;d[m]=true}}appSortList.sort(appSort);for(var i=document.getElementById("applist"),c=appSortList.length-1;c>=0;c--){var b=appSortList[c];if(b.isTenantApp){if(d[b.productId]){var e=b.title;if(typeof e=="undefined"||e==null)e="";b.title=strShared.replace("{0}",e)}b.statusMessage="";var j=constructAppElement(b),p=null;if(c'+strLoadingInfo+"";if(numCalloutWidth==null||isNaN(numCalloutWidth))numCalloutWidth=370;a.callout=CalloutManager.createNew({title:STSHtmlEncode(a.title),ID:a.id,launchPoint:b,content:c,contentWidth:numCalloutWidth,onOpenedCallback:onOpened,onClosedCallback:onClosed,onOpeningCallback:onOpening});a.callout.waiting=false;a.callout.addAction(new CalloutAction({text:"",onClickCallback:function(){},isVisibleCallback:function(){ULSNKb:;return false}}))}function handleRetryDownload(a){ULSNKb:;handleViewInStorefront(a)}function handleRetryInstallApp(a){ULSNKb:;closeAndClearCallout(a);setAppRowMessage(a,strInstalling);callMethodOnAppInstance(a,"install")}function handleRetryInstallAppFromError(a){ULSNKb:;closeAndClearCallout(a);setAppRowMessage(a,strInstalling);callMethodOnAppInstance(a,"retryAllJobs")}function handleRetryUpdateAppFromError(a){ULSNKb:;closeAndClearCallout(a);setAppRowMessage(a,strUpdatingNonAdmin);callMethodOnAppInstance(a,"retryAllJobs")}function handleRetryKillbitFromError(a){ULSNKb:;closeAndClearCallout(a);setAppRowMessage(a,strKillbitting);callMethodOnAppInstance(a,"retryAllJobs")}function handleSeeAppProblemDetails(b){ULSNKb:;var a=appData[b],c=a.problemUrl;if(typeof a.problemUrl!="undefined"&&a.problemUrl!=null&&a.problemUrl.length>0)window.location=c}function handleUpdateApp(a){ULSNKb:;handleViewInStorefront(a)}function handleCancelUpdate(a){ULSNKb:;closeAndClearCallout(a);cancelAllAppJobs(a,strCancelAppUpdateConfirm,strCancellingAppUpdate)}function handleCancelInstall(a){ULSNKb:;closeAndClearCallout(a);cancelAllAppJobs(a,strCancelAppInstallConfirm,strCancellingAppInstall)}function cancelAllAppJobs(a,c,b){ULSNKb:;var e=appData[a],d=e.title;if(!confirm(c.replace("{0}",d)))return;setAppRowMessage(a,b);callMethodOnAppInstance(a,"cancelAllJobs")}function navigateToAddAnApp(){ULSNKb:;STSNavigate(addAnAppUrl)}function showCalloutIcon(b){ULSNKb:;var a=document.getElementById(b+"-breadcrumb");if(a!=null)a.style.visibility="visible"}function hideCalloutIcon(b){ULSNKb:;var a=document.getElementById(b+"-breadcrumb");if(a!=null)a.style.visibility="hidden"}var g_updateIntervalIndex=0,g_updateIntervals=[5,5,10,10,10,20,20,40,80,160,320,640,1800,3600,7200,14e3],g_realtimeUpdatesOn=false,g_updatingInProgress=false;function ensureRealTimeUpdatesStarted(){ULSNKb:;if(!g_realtimeUpdatesOn){g_realtimeUpdatesOn=true;g_updateIntervalIndex=0;window.setTimeout(processUpdates,1)}else g_updateIntervalIndex=0}function stopRealTimeUpdates(){ULSNKb:;g_realtimeUpdatesOn=false}function processUpdates(){ULSNKb:;if(!g_realtimeUpdatesOn){g_updateIntervalIndex=0;return}queryForUpdates()}function onQueryForUpdatesReturned(j,f){ULSNKb:;if(f!=null){for(var g=false,b=0;b0&&g_updateIntervalIndex+1<=g_updateIntervals.length){++g_updateIntervalIndex;window.setTimeout(processUpdates,g_updateIntervals[g_updateIntervalIndex]*1e3)}else g_realtimeUpdatesOn=false}function queryForUpdates(){ULSNKb:;var a={};a.command="getappinfo";a.appids=g_updatableApps.join("|");getCommandProxy().executeCommand(a,onQueryForUpdatesReturned)}function isAppUpdatable(a){ULSNKb:;return a.updatable}function ensureAppUpdating(b){ULSNKb:;for(var a=0;a6&&a.id.substring(a.id.length-6)=="-image"){var f=a.id.substring(0,a.id.length-6),d=document.getElementById(f);if(!fIsNullOrUndefined(d))a=d}var g=typeof a.textContent=="undefined"?a.innerText:a.textContent,e=null;if(a.tagName.toUpperCase()=="A")e=a.href;var h=new SPSiteContentDragData(g,e);c.push(h);if(c.length>0){b.SetData(g_dndSiteContentDataKey,c);if(b.rawEvent&&b.rawEvent.dataTransfer)b.rawEvent.dataTransfer.effectAllowed="all"}}function SPSiteContentDragData(a,b){ULSNKb:;this.title=a;this.url=b}function _InitAllAppsGlobals(){ULSNKb:;req={};appHtmlTemplate='
';g_updateIntervalIndex=0;g_updateIntervals=[5,5,10,10,20,40,80,160,320,640,1800,3600,7200,14e3];g_realtimeUpdatesOn=false;g_updatingInProgress=false;g_dndSiteContentQL="sp-dragdrop-allsitecontent-qlmenu";g_dndSiteContentDataKey="SPSiteContentDragData";_spAllAppsScriptLoaded=true}_InitAllAppsGlobals();RegisterModuleInit("sp.ui.allapps.js",function(){ULSNKb:;sp_ui_allapps_initialize();_InitAllAppsGlobals()});typeof Sys!="undefined"&&Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded();NotifyScriptLoadedAndExecuteWaitingJobs("sp.ui.allapps.js");_spAllAppsScriptLoaded=true;