@microsoft/teams-js
Advanced tools
Comparing version 1.3.0-beta.2 to 1.3.0-beta.3
@@ -5,2 +5,5 @@ | ||
} | ||
interface String { | ||
startsWith(search: string, pos?: number): boolean; | ||
} | ||
interface MessageEvent { | ||
@@ -723,2 +726,11 @@ originalEvent: MessageEvent; | ||
baseUrl?: string; | ||
/** | ||
* Optional; indicates whether the file should be opened in edit mode | ||
*/ | ||
editFile?: boolean; | ||
/** | ||
* Optional; the developer-defined unique ID for the sub-entity to return to when the file stage closes. | ||
* This field should be used to restore to a specific state within an entity, such as scrolling to or activating a specific piece of content. | ||
*/ | ||
subEntityId?: string; | ||
} | ||
@@ -725,0 +737,0 @@ interface TaskInfo { |
@@ -10,2 +10,7 @@ ;(function(root, factory) { | ||
}(this, function() { | ||
if (!String.prototype.startsWith) { | ||
String.prototype.startsWith = function (search, pos) { | ||
return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; | ||
}; | ||
} | ||
/** | ||
@@ -17,3 +22,3 @@ * This is the root namespace for the JavaScript SDK. | ||
"use strict"; | ||
var version = "1.3.0-beta.2"; | ||
var version = "1.2"; | ||
var validOrigins = [ | ||
@@ -25,4 +30,27 @@ "https://teams.microsoft.com", | ||
"https://ssauth.skype.com", | ||
"http://dev.local" // local development | ||
"http://dev.local", | ||
"https://msft.spoppe.com", | ||
"https://*.sharepoint.com", | ||
"https://*.sharepoint-df.com", | ||
"https://*.sharepointonline.com" | ||
]; | ||
// This will return a reg expression a given url | ||
function generateRegExpFromUrl(url) { | ||
var urlRegExpPart = "^"; | ||
var urlParts = url.split("."); | ||
for (var j = 0; j < urlParts.length; j++) { | ||
urlRegExpPart += (j > 0 ? "[.]" : "") + urlParts[j].replace("*", "[^\/^.]+"); | ||
} | ||
urlRegExpPart += "$"; | ||
return urlRegExpPart; | ||
} | ||
// This will return a reg expression for list of url | ||
function generateRegExpFromUrls(urls) { | ||
var urlRegExp = ""; | ||
for (var i = 0; i < urls.length; i++) { | ||
urlRegExp += (i === 0 ? "" : "|") + generateRegExpFromUrl(urls[i]); | ||
} | ||
return new RegExp(urlRegExp); | ||
} | ||
var validOriginRegExp = generateRegExpFromUrls(validOrigins); | ||
var handlers = {}; | ||
@@ -368,7 +396,7 @@ // Ensure these declarations stay in sync with the framework. | ||
filePreviewParameters.webPreviewUrl, | ||
filePreviewParameters.webEditUrl | ||
filePreviewParameters.webEditUrl, | ||
filePreviewParameters.baseUrl, | ||
filePreviewParameters.editFile, | ||
filePreviewParameters.subEntityId | ||
]; | ||
if (filePreviewParameters.baseUrl) { | ||
params.push(filePreviewParameters.baseUrl); | ||
} | ||
sendMessageRequest(parentWindow, "openFilePreview", params); | ||
@@ -853,3 +881,3 @@ } | ||
(messageOrigin !== currentWindow.location.origin && | ||
validOrigins.indexOf(messageOrigin.toLowerCase()) === -1)) { | ||
!validOriginRegExp.test(messageOrigin.toLowerCase()))) { | ||
return; | ||
@@ -856,0 +884,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.microsoftTeams=e()}(this,function(){var t;return function(t){"use strict";function e(){if(!R){R=!0,x=this._window||window;var t=function(t){return m(t)};A=x.parent!==x.self?x.parent:x.opener,A?x.addEventListener("message",t,!1):(j=!0,window.onNativeMessage=w);try{D="*";var e=M(A,"initialize",[O]);q[e]=function(t,e){V=t,W=e}}finally{D=null}this._uninitialize=function(){V&&(i(null),a(null),s(null)),V===H.settings&&Q.registerOnSaveHandler(null),V===H.remove&&Q.registerOnRemoveHandler(null),j||x.removeEventListener("message",t,!1),R=!1,A=null,D=null,J=[],F=null,z=null,X=[],Y=0,q={},V=null,W=null,j=!1}}}function n(t){p();var e=M(A,"getContext");q[e]=t}function i(t){p(),_=t}function o(t){_&&_(t),F&&M(F,"themeChange",[t])}function a(t){p(),G=t}function r(t){G&&G(t)}function s(t){p(),K=t}function u(){K&&K()||c()}function c(){p();var t=M(A,"navigateBack",[]);q[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function f(t){p(H.content,H.settings,H.remove);var e=M(A,"navigateCrossDomain",[t]);q[e]=function(t){if(!t)throw new Error("Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.")}}function l(t,e){p();var n=M(A,"getTabInstances",[e]);q[n]=t}function h(t,e){p();var n=M(A,"getMruTabInstances",[e]);q[n]=t}function v(t){p(H.content),M(A,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])}function d(t){p(H.content);var e=[t.entityId,t.title,t.description,t.type,t.objectUrl,t.downloadUrl,t.webPreviewUrl,t.webEditUrl];t.baseUrl&&e.push(t.baseUrl),M(A,"openFilePreview",e)}function g(t){p();var e=M(A,"navigateToTab",[t]);q[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}}function p(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!R)throw new Error("The library has not yet been initialized");if(V&&t&&t.length>0){for(var n=!1,i=0;i<t.length;i++)if(t[i]===V){n=!0;break}if(!n)throw new Error("This call is not allowed in the '"+V+"' context")}}function m(t){if(t&&t.data&&"object"==typeof t.data){var e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===x||n!==x.location.origin&&B.indexOf(n.toLowerCase())===-1||(y(e,n),e===A?w(t):e===F&&b(t))}}function y(t,e){A&&t!==A?F&&t!==F||(F=t,z=e):(A=t,D=e),A&&A.closed&&(A=null,D=null),F&&F.closed&&(F=null,z=null),C(A),C(F)}function w(t){if("id"in t.data){var e=t.data,n=q[e.id];n&&(n.apply(null,e.args),delete q[e.id])}else if("func"in t.data){var e=t.data,i=L[e.func];i&&i.apply(this,e.args)}}function b(t){if("id"in t.data&&"func"in t.data){var e=t.data,n=L[e.func];if(n){var i=n.apply(this,e.args);i&&E(F,e.id,Array.isArray(i)?i:[i])}else{var o=M(A,e.func,e.args);q[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];F&&E(F,e.id,t)}}}}function k(t){return t===A?J:t===F?X:[]}function T(t){return t===A?D:t===F?z:null}function C(t){for(var e=T(t),n=k(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function I(t,e){var n=x.setInterval(function(){0===k(t).length&&(clearInterval(n),e())},100)}function M(t,e,n){var i=S(e,n);if(j)x.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=T(t);t&&o?t.postMessage(i,o):k(t).push(i)}return i.id}function E(t,e,n){var i=N(e,n),o=T(t);t&&o&&t.postMessage(i,o)}function S(t,e){return{id:Y++,func:t,args:e||[]}}function N(t,e){return{id:t,args:e||[]}}var U,O="1.3.0-beta.2",B=["https://teams.microsoft.com","https://teams.microsoft.us","https://int.teams.microsoft.com","https://devspaces.skype.com","https://ssauth.skype.com","http://dev.local"],L={},H={settings:"settings",content:"content",authentication:"authentication",remove:"remove"},P={desktop:"desktop",web:"web"};!function(t){function e(t,e){p(),l=e,M(A,"setUpViews",[t])}function n(t){l&&l(t)||(p(),M(A,"viewConfigItemPress",[t]))}function i(t,e){p(),c=e,M(A,"setNavBarMenu",[t])}function o(t){c&&c(t)||(p(),M(A,"handleNavBarMenuItemPress",[t]))}function a(t,e){p(),f=e,M(A,"showActionMenu",[t])}function r(t){f&&f(t)||(p(),M(A,"handleActionMenuItemPress",[t]))}var s=function(){function t(){this.enabled=!0}return t}();t.MenuItem=s;var u;!function(t){t.dropDown="dropDown",t.popOver="popOver"}(u=t.MenuListType||(t.MenuListType={}));var c;L.navBarMenuItemPress=o;var f;L.actionMenuItemPress=r;var l;L.setModuleView=n,t.setUpViews=e,t.setNavBarMenu=i,t.showActionMenu=a}(U=t.menus||(t.menus={}));var x,A,D,F,z,V,W,_,R=!1,j=!1,J=[],X=[],Y=0,q={};L.themeChange=o;var G;L.fullScreenChange=r;var K;L.backButtonPress=u,t.initialize=e,t.getContext=n,t.registerOnThemeChangeHandler=i,t.registerFullScreenHandler=a,t.registerBackButtonHandler=s,t.navigateBack=c,t.navigateCrossDomain=f,t.getTabInstances=l,t.getMruTabInstances=h,t.shareDeepLink=v,t.openFilePreview=d,t.navigateToTab=g;var Q;!function(t){function e(t){p(H.settings,H.remove),M(A,"settings.setValidityState",[t])}function n(t){p(H.settings,H.remove);var e=M(A,"settings.getSettings");q[e]=t}function i(t){p(H.settings),M(A,"settings.setSettings",[t])}function o(t){p(H.settings),u=t}function a(t){p(H.remove),c=t}function r(t){var e=new f(t);u?u(e):e.notifySuccess()}function s(){var t=new l;c?c(t):t.notifySuccess()}var u,c;L["settings.save"]=r,L["settings.remove"]=s,t.setValidityState=e,t.getSettings=n,t.setSettings=i,t.registerOnSaveHandler=o,t.registerOnRemoveHandler=a;var f=function(){function t(t){this.notified=!1,this.result=t?t:{}}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),M(A,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),M(A,"settings.save.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")},t}(),l=function(){function t(){this.notified=!1}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),M(A,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),M(A,"settings.remove.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The removeEvent may only notify success or failure once.")},t}()}(Q=t.settings||(t.settings={}));var Z;!function(t){function e(t){g=t}function n(t){var e=void 0!==t?t:g;if(p(H.content,H.settings,H.remove),W===P.desktop){var n=document.createElement("a");n.href=e.url;var i=M(A,"authentication.authenticate",[n.href,e.width,e.height]);q[i]=function(t,n){t?e.successCallback(n):e.failureCallback(n)}}else r(e)}function i(t){p();var e=M(A,"authentication.getAuthToken",[t.resources]);q[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}}function o(t){p();var e=M(A,"authentication.getUser");q[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}}function a(){s();try{F&&F.close()}finally{F=null,z=null}}function r(t){g=t,a();var e=g.width||600,n=g.height||400;e=Math.min(e,x.outerWidth-400),n=Math.min(n,x.outerHeight-200);var i=document.createElement("a");i.href=g.url;var o="undefined"!=typeof x.screenLeft?x.screenLeft:x.screenX,r="undefined"!=typeof x.screenTop?x.screenTop:x.screenY;o+=x.outerWidth/2-e/2,r+=x.outerHeight/2-n/2,F=x.open(i.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+r+", left="+o+", width="+e+", height="+n),F?u():h("FailedToOpenWindow")}function s(){m&&(clearInterval(m),m=0),delete L.initialize,delete L.navigateCrossDomain}function u(){s(),m=x.setInterval(function(){if(!F||F.closed)h("CancelledByUser");else{var t=z;try{z="*",M(F,"ping")}finally{z=t}}},100),L.initialize=function(){return[H.authentication,W]},L.navigateCrossDomain=function(t){return!1}}function c(t,e){v(e,"result",t),p(H.authentication),M(A,"authentication.authenticate.success",[t]),I(A,function(){return setTimeout(function(){return x.close()},200)})}function f(t,e){v(e,"reason",t),p(H.authentication),M(A,"authentication.authenticate.failure",[t]),I(A,function(){return setTimeout(function(){return x.close()},200)})}function l(t){try{g&&g.successCallback&&g.successCallback(t)}finally{g=null,a()}}function h(t){try{g&&g.failureCallback&&g.failureCallback(t)}finally{g=null,a()}}function v(t,e,n){if(t){var i=document.createElement("a");i.href=decodeURIComponent(t),i.host&&i.host!==window.location.host&&"outlook.office.com"===i.host&&i.search.indexOf("client_type=Win32_Outlook")>-1&&(e&&"result"===e&&(n&&(i.href=d(i.href,"result",n)),x.location.assign(d(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=d(i.href,"reason",n)),x.location.assign(d(i.href,"authFailure",""))))}}function d(t,e,n){var i=t.indexOf("#"),o=i===-1?"#":t.substr(i);return o=o+"&"+e+(""!==n?"="+n:""),t=i===-1?t:t.substr(0,i),t+o}var g,m;L["authentication.authenticate.success"]=l,L["authentication.authenticate.failure"]=h,t.registerAuthenticationHandlers=e,t.authenticate=n,t.getAuthToken=i,t.getUser=o,t.notifySuccess=c,t.notifyFailure=f}(Z=t.authentication||(t.authentication={}));var $;!function(t){function e(t,e){p(H.content);var n=M(A,"tasks.startTask",[t]);q[n]=e}function n(t,e){p(H.content),M(A,"tasks.completeTask",[t,e])}t.startTask=e,t.completeTask=n}($=t.tasks||(t.tasks={}))}(t||(t={})),t}); | ||
!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.microsoftTeams=e()}(this,function(){String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return this.substr(!e||e<0?0:+e,t.length)===t});var t;return function(t){"use strict";function e(t){for(var e="^",n=t.split("."),i=0;i<n.length;i++)e+=(i>0?"[.]":"")+n[i].replace("*","[^/^.]+");return e+="$"}function n(t){for(var n="",i=0;i<t.length;i++)n+=(0===i?"":"|")+e(t[i]);return new RegExp(n)}function i(){if(!X){X=!0,D=this._window||window;var t=function(t){return w(t)};W=D.parent!==D.self?D.parent:D.opener,W?D.addEventListener("message",t,!1):(Y=!0,window.onNativeMessage=k);try{z="*";var e=S(W,"initialize",[L]);K[e]=function(t,e){_=t,j=e}}finally{z=null}this._uninitialize=function(){_&&(r(null),s(null),c(null)),_===F.settings&&tt.registerOnSaveHandler(null),_===F.remove&&tt.registerOnRemoveHandler(null),Y||D.removeEventListener("message",t,!1),X=!1,W=null,z=null,$=[],R=null,V=null,q=[],G=0,K={},_=null,j=null,Y=!1}}}function o(t){y();var e=S(W,"getContext");K[e]=t}function r(t){y(),J=t}function a(t){J&&J(t),R&&S(R,"themeChange",[t])}function s(t){y(),Q=t}function u(t){Q&&Q(t)}function c(t){y(),Z=t}function f(){Z&&Z()||l()}function l(){y();var t=S(W,"navigateBack",[]);K[t]=function(t){if(!t)throw new Error("Back navigation is not supported in the current client or context.")}}function h(t){y(F.content,F.settings,F.remove);var e=S(W,"navigateCrossDomain",[t]);K[e]=function(t){if(!t)throw new Error("Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.")}}function v(t,e){y();var n=S(W,"getTabInstances",[e]);K[n]=t}function d(t,e){y();var n=S(W,"getMruTabInstances",[e]);K[n]=t}function g(t){y(F.content),S(W,"shareDeepLink",[t.subEntityId,t.subEntityLabel,t.subEntityWebUrl])}function p(t){y(F.content);var e=[t.entityId,t.title,t.description,t.type,t.objectUrl,t.downloadUrl,t.webPreviewUrl,t.webEditUrl,t.baseUrl,t.editFile,t.subEntityId];S(W,"openFilePreview",e)}function m(t){y();var e=S(W,"navigateToTab",[t]);K[e]=function(t){if(!t)throw new Error("Invalid internalTabInstanceId and/or channelId were/was provided")}}function y(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!X)throw new Error("The library has not yet been initialized");if(_&&t&&t.length>0){for(var n=!1,i=0;i<t.length;i++)if(t[i]===_){n=!0;break}if(!n)throw new Error("This call is not allowed in the '"+_+"' context")}}function w(t){if(t&&t.data&&"object"==typeof t.data){var e=t.source||t.originalEvent.source,n=t.origin||t.originalEvent.origin;e===D||n!==D.location.origin&&!P.test(n.toLowerCase())||(b(e,n),e===W?k(t):e===R&&T(t))}}function b(t,e){W&&t!==W?R&&t!==R||(R=t,V=e):(W=t,z=e),W&&W.closed&&(W=null,z=null),R&&R.closed&&(R=null,V=null),E(W),E(R)}function k(t){if("id"in t.data){var e=t.data,n=K[e.id];n&&(n.apply(null,e.args),delete K[e.id])}else if("func"in t.data){var e=t.data,i=x[e.func];i&&i.apply(this,e.args)}}function T(t){if("id"in t.data&&"func"in t.data){var e=t.data,n=x[e.func];if(n){var i=n.apply(this,e.args);i&&N(R,e.id,Array.isArray(i)?i:[i])}else{var o=S(W,e.func,e.args);K[o]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];R&&N(R,e.id,t)}}}}function C(t){return t===W?$:t===R?q:[]}function I(t){return t===W?z:t===R?V:null}function E(t){for(var e=I(t),n=C(t);t&&e&&n.length>0;)t.postMessage(n.shift(),e)}function M(t,e){var n=D.setInterval(function(){0===C(t).length&&(clearInterval(n),e())},100)}function S(t,e,n){var i=U(e,n);if(Y)D.nativeInterface.framelessPostMessage(JSON.stringify(i));else{var o=I(t);t&&o?t.postMessage(i,o):C(t).push(i)}return i.id}function N(t,e,n){var i=O(e,n),o=I(t);t&&o&&t.postMessage(i,o)}function U(t,e){return{id:G++,func:t,args:e||[]}}function O(t,e){return{id:t,args:e||[]}}var B,L="1.2",H=["https://teams.microsoft.com","https://teams.microsoft.us","https://int.teams.microsoft.com","https://devspaces.skype.com","https://ssauth.skype.com","http://dev.local","https://msft.spoppe.com","https://*.sharepoint.com","https://*.sharepoint-df.com","https://*.sharepointonline.com"],P=n(H),x={},F={settings:"settings",content:"content",authentication:"authentication",remove:"remove"},A={desktop:"desktop",web:"web"};!function(t){function e(t,e){y(),l=e,S(W,"setUpViews",[t])}function n(t){l&&l(t)||(y(),S(W,"viewConfigItemPress",[t]))}function i(t,e){y(),c=e,S(W,"setNavBarMenu",[t])}function o(t){c&&c(t)||(y(),S(W,"handleNavBarMenuItemPress",[t]))}function r(t,e){y(),f=e,S(W,"showActionMenu",[t])}function a(t){f&&f(t)||(y(),S(W,"handleActionMenuItemPress",[t]))}var s=function(){function t(){this.enabled=!0}return t}();t.MenuItem=s;var u;!function(t){t.dropDown="dropDown",t.popOver="popOver"}(u=t.MenuListType||(t.MenuListType={}));var c;x.navBarMenuItemPress=o;var f;x.actionMenuItemPress=a;var l;x.setModuleView=n,t.setUpViews=e,t.setNavBarMenu=i,t.showActionMenu=r}(B=t.menus||(t.menus={}));var D,W,z,R,V,_,j,J,X=!1,Y=!1,$=[],q=[],G=0,K={};x.themeChange=a;var Q;x.fullScreenChange=u;var Z;x.backButtonPress=f,t.initialize=i,t.getContext=o,t.registerOnThemeChangeHandler=r,t.registerFullScreenHandler=s,t.registerBackButtonHandler=c,t.navigateBack=l,t.navigateCrossDomain=h,t.getTabInstances=v,t.getMruTabInstances=d,t.shareDeepLink=g,t.openFilePreview=p,t.navigateToTab=m;var tt;!function(t){function e(t){y(F.settings,F.remove),S(W,"settings.setValidityState",[t])}function n(t){y(F.settings,F.remove);var e=S(W,"settings.getSettings");K[e]=t}function i(t){y(F.settings),S(W,"settings.setSettings",[t])}function o(t){y(F.settings),u=t}function r(t){y(F.remove),c=t}function a(t){var e=new f(t);u?u(e):e.notifySuccess()}function s(){var t=new l;c?c(t):t.notifySuccess()}var u,c;x["settings.save"]=a,x["settings.remove"]=s,t.setValidityState=e,t.getSettings=n,t.setSettings=i,t.registerOnSaveHandler=o,t.registerOnRemoveHandler=r;var f=function(){function t(t){this.notified=!1,this.result=t?t:{}}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),S(W,"settings.save.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),S(W,"settings.save.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")},t}(),l=function(){function t(){this.notified=!1}return t.prototype.notifySuccess=function(){this.ensureNotNotified(),S(W,"settings.remove.success"),this.notified=!0},t.prototype.notifyFailure=function(t){this.ensureNotNotified(),S(W,"settings.remove.failure",[t]),this.notified=!0},t.prototype.ensureNotNotified=function(){if(this.notified)throw new Error("The removeEvent may only notify success or failure once.")},t}()}(tt=t.settings||(t.settings={}));var et;!function(t){function e(t){g=t}function n(t){var e=void 0!==t?t:g;if(y(F.content,F.settings,F.remove),j===A.desktop){var n=document.createElement("a");n.href=e.url;var i=S(W,"authentication.authenticate",[n.href,e.width,e.height]);K[i]=function(t,n){t?e.successCallback(n):e.failureCallback(n)}}else a(e)}function i(t){y();var e=S(W,"authentication.getAuthToken",[t.resources]);K[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}}function o(t){y();var e=S(W,"authentication.getUser");K[e]=function(e,n){e?t.successCallback(n):t.failureCallback(n)}}function r(){s();try{R&&R.close()}finally{R=null,V=null}}function a(t){g=t,r();var e=g.width||600,n=g.height||400;e=Math.min(e,D.outerWidth-400),n=Math.min(n,D.outerHeight-200);var i=document.createElement("a");i.href=g.url;var o="undefined"!=typeof D.screenLeft?D.screenLeft:D.screenX,a="undefined"!=typeof D.screenTop?D.screenTop:D.screenY;o+=D.outerWidth/2-e/2,a+=D.outerHeight/2-n/2,R=D.open(i.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+a+", left="+o+", width="+e+", height="+n),R?u():h("FailedToOpenWindow")}function s(){p&&(clearInterval(p),p=0),delete x.initialize,delete x.navigateCrossDomain}function u(){s(),p=D.setInterval(function(){if(!R||R.closed)h("CancelledByUser");else{var t=V;try{V="*",S(R,"ping")}finally{V=t}}},100),x.initialize=function(){return[F.authentication,j]},x.navigateCrossDomain=function(t){return!1}}function c(t,e){v(e,"result",t),y(F.authentication),S(W,"authentication.authenticate.success",[t]),M(W,function(){return setTimeout(function(){return D.close()},200)})}function f(t,e){v(e,"reason",t),y(F.authentication),S(W,"authentication.authenticate.failure",[t]),M(W,function(){return setTimeout(function(){return D.close()},200)})}function l(t){try{g&&g.successCallback&&g.successCallback(t)}finally{g=null,r()}}function h(t){try{g&&g.failureCallback&&g.failureCallback(t)}finally{g=null,r()}}function v(t,e,n){if(t){var i=document.createElement("a");i.href=decodeURIComponent(t),i.host&&i.host!==window.location.host&&"outlook.office.com"===i.host&&i.search.indexOf("client_type=Win32_Outlook")>-1&&(e&&"result"===e&&(n&&(i.href=d(i.href,"result",n)),D.location.assign(d(i.href,"authSuccess",""))),e&&"reason"===e&&(n&&(i.href=d(i.href,"reason",n)),D.location.assign(d(i.href,"authFailure",""))))}}function d(t,e,n){var i=t.indexOf("#"),o=i===-1?"#":t.substr(i);return o=o+"&"+e+(""!==n?"="+n:""),t=i===-1?t:t.substr(0,i),t+o}var g,p;x["authentication.authenticate.success"]=l,x["authentication.authenticate.failure"]=h,t.registerAuthenticationHandlers=e,t.authenticate=n,t.getAuthToken=i,t.getUser=o,t.notifySuccess=c,t.notifyFailure=f}(et=t.authentication||(t.authentication={}));var nt;!function(t){function e(t,e){y(F.content);var n=S(W,"tasks.startTask",[t]);K[n]=e}function n(t,e){y(F.content),S(W,"tasks.completeTask",[t,e])}t.startTask=e,t.completeTask=n}(nt=t.tasks||(t.tasks={}))}(t||(t={})),t}); |
@@ -0,0 +0,0 @@ { |
{ | ||
"name": "@microsoft/teams-js", | ||
"author": "Microsoft Teams", | ||
"version": "1.3.0-beta.2", | ||
"version": "1.3.0-beta.3", | ||
"description": "Microsoft Client SDK for building app for Microsoft teams", | ||
@@ -6,0 +6,0 @@ "main": "./dist/MicrosoftTeams.min.js", |
@@ -0,0 +0,0 @@ # [Microsoft Teams JavaScript Library](https://msdn.microsoft.com/en-us/microsoft-teams/) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115303
2307
5
0
56