",t+=n[i].Title,t+="<\/td> | ",t+=n[i].Path,t+="<\/td><\/tr>";return t+"<\/table>"}};t.init($("#resultsDiv"));t.load()}$("#toolbarDiv").show();$("#toolbarDiv input[type=button]").click(function(){n($("#queryTerms").val())});$("#toolbarDiv input[type=text]").keypress(function(t){t.keyCode==13&&(n($("#queryTerms").val()),t.preventDefault())})});
2 | /*
3 | //# sourceMappingURL=Search.min.js.map
4 | */
--------------------------------------------------------------------------------
/Sample_SearchCSOM/SearchCSOM/Search.min.js.map:
--------------------------------------------------------------------------------
1 | {
2 | "version":3,
3 | "file":"Search.min.js",
4 | "lineCount":1,
5 | "mappings":"AAAAA,CAAC,CAAC,QAAS,CAAA,CAAG,CAYVC,SAASA,CAAY,CAACC,CAAD,CAAa,CAC9B,IAAIC,EAAU,CACV,OAAO,CAAEH,CAAC,CAAC,EAAD,CAAI,CACd,GAAG,CAAE,EAAE,CACP,IAAI,CAAEI,QAAS,CAACC,CAAD,CAAU,CACrBF,CAAOE,QAAS,CAAEA,CAAO,CACzBF,CAAOG,IAAK,CAAEC,kBAAkBC,eAAgB,CAAE,gCAAiC,CAAEN,CAAW,CAAE,GAF7E,CAGxB,CACD,IAAI,CAAEO,QAAS,CAAA,CAAG,CACd,IAAIC,EAAQ,IAAI,CAChBC,EAAEC,IAAIC,gCAAgC,CAAC,QAAS,CAAA,CAAG,CAC/C,IAAIC,EAASC,SAASC,WAAWC,OAAOH,OAAOI,OAC3CC,EAAMR,EAAES,cAAcC,YAAY,CAAA,EAClCC,EAAQ,IAAIR,CAAMS,aAAa,CAACJ,CAAD,EAE/BK,EACAC,CALiD,CAGrDH,CAAKI,cAAc,CAACxB,CAAD,CAAY,CAC3BsB,CAAS,CAAE,IAAIV,CAAMa,eAAe,CAACR,CAAD,C,CACpCM,CAAO,CAAED,CAAQvB,aAAa,CAACqB,CAAD,C,CAClCH,CAAGS,kBAAkB,CAAC,QAAS,CAAA,CAAG,CAE9B,IAAIC,EAAkB,IAAIf,CAAMgB,uBAG5BC,CAHoD,CACxDF,CAAeG,uBAAuB,CAACP,CAAMQ,UAAU,CAAA,CAAjB,CAAoB,CAEtDF,CAAK,CAAEF,CAAeK,SAAS,CAAC,CAAD,CAAGC,eAAe,CAAA,C,CACrDhC,CAAOE,QAAQ+B,KAAK,CAAC1B,CAAK2B,WAAW,CAACN,CAAD,CAAjB,CANU,CAOjC,CAAE,QAAS,CAACO,CAAM,CAAEC,CAAT,CAAe,CACvBC,KAAK,CAACD,CAAIE,YAAY,CAAA,CAAjB,CADkB,CAPN,CAP0B,CAiBlD,CAAE,cAjBmC,CAFxB,CAoBjB,CACD,UAAU,CAAEJ,QAAS,CAACN,CAAD,CAAO,CAGxB,IAAK,IAFDK,EAAO,UAEFM,EAAI,CAAC,CAAEA,CAAE,CAAEX,CAAIY,OAAO,CAAED,CAAC,EAAlC,CACIN,CAAK,EAAG,UAAU,CAClBA,CAAK,EAAGL,CAAK,CAAAW,CAAA,CAAGE,MAAQ,CACxBR,CAAK,EAAG,YAAW,CACnBA,CAAK,EAAGL,CAAK,CAAAW,CAAA,CAAGG,KAAO,CACvBT,CAAK,EAAG,cACZ,CAGA,OADAA,CAAK,CAAG,WAXgB,CA5BlB,CA0Cb,CAEDjC,CAAOC,KAAK,CAACJ,CAAC,CAAC,aAAD,CAAF,CAAkB,CAC9BG,CAAOM,KAAK,CAAA,CA9CkB,CAXlCT,CAAC,CAAC,aAAD,CAAe8C,KAAK,CAAA,CAAE,CACvB9C,CAAC,CAAC,gCAAD,CAAkC+C,MAAM,CAAC,QAAS,CAAA,CAAI,CACnD9C,CAAY,CAACD,CAAC,CAAC,aAAD,CAAegD,IAAI,CAAA,CAArB,CADuC,CAAd,CAEvC,CACFhD,CAAC,CAAC,8BAAD,CAAgCiD,SAAS,CAAC,QAAS,CAACC,CAAD,CAAI,CAChDA,CAACC,QAAS,EAAG,E,GACblD,CAAY,CAACD,CAAC,CAAC,aAAD,CAAegD,IAAI,CAAA,CAArB,CAAwB,CACpCE,CAACE,eAAe,CAAA,EAHgC,CAAd,CALhC,CAAb,CA4DC",
6 | "sources":["Search.js"],
7 | "names":["$","executeQuery","queryTerms","Results","init","element","url","_spPageContextInfo","webAbsoluteUrl","load","_this","SP","SOD","executeOrDelayUntilScriptLoaded","Search","Microsoft","SharePoint","Client","Query","ctx","ClientContext","get_current","query","KeywordQuery","executor","result","set_queryText","SearchExecutor","executeQueryAsync","tableCollection","ResultTableCollection","rows","initPropertiesFromJson","get_value","get_item","get_resultRows","html","createHtml","sender","args","alert","get_message","i","length","Title","Path","show","click","val","keypress","e","keyCode","preventDefault"]
8 | }
9 |
--------------------------------------------------------------------------------
/Sample_SearchCSOM/SearchCSOM/Search.ts:
--------------------------------------------------------------------------------
1 | $(() => {
2 | $("#toolbarDiv").show();
3 | $("#toolbarDiv input[type=button]").click(e => {
4 | executeQuery($('#queryTerms').val());
5 | });
6 | $("#toolbarDiv input[type=text]").keypress(e => {
7 | if (e.keyCode == 13) {
8 | executeQuery($('#queryTerms').val());
9 | e.preventDefault();
10 | }
11 | });
12 |
13 | function executeQuery(queryTerms:string) {
14 |
15 | var element = $('');
16 | var url = '';
17 |
18 | function init (element:JQuery) {
19 | element = element;
20 | url = _spPageContextInfo.webAbsoluteUrl + "/_api/search/query?querytext='" + queryTerms + "'";
21 | }
22 |
23 | function load () {
24 | SP.SOD.executeOrDelayUntilScriptLoaded(() => {
25 |
26 | var Search = Microsoft.SharePoint.Client.Search.Query;
27 | var ctx = SP.ClientContext.get_current();
28 | var query = new Search.KeywordQuery(ctx);
29 | query.set_queryText(queryTerms);
30 | var executor = new Search.SearchExecutor(ctx);
31 | var result = executor.executeQuery(query);
32 | ctx.executeQueryAsync(
33 | () => {
34 | //TODO: Discover proper way to load collection
35 | var tableCollection = new Search.ResultTableCollection();
36 | tableCollection.initPropertiesFromJson(result.get_value());
37 |
38 | var rows = tableCollection.get_item(0).get_resultRows();
39 | element.html(createHtml(rows));
40 | },
41 | (sender, args) => { alert(args.get_message()); }
42 | );
43 | }, "sp.search.js");
44 |
45 | }
46 |
47 | function createHtml (rows: { [key: string]: any; }[]) {
48 | var html = "";
49 |
50 | for (var i = 0; i < rows.length; i++) {
51 | html += "";
52 | html += rows[i]['Title'];
53 | html += " | "
54 | html += rows[i]['Path'];
55 | html += " | ";
56 | }
57 |
58 | html += " ";
59 | return html;
60 | }
61 |
62 |
63 |
64 | init($('#resultsDiv'));
65 | load();
66 |
67 | }
68 |
69 |
70 | });
71 |
--------------------------------------------------------------------------------
/Sample_SearchCSOM/SearchCSOM/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sample_Social/Default.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" Language="C#" %>
2 |
3 | <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
4 | <%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
5 | <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | Loading data from service...
19 |
20 |
21 |
22 |
23 |
24 |
25 | SharePoint Social features
26 |
27 |
28 |
29 | SharePoint Social features
30 |
--------------------------------------------------------------------------------
/Sample_Social/Elements.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sample_Social/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sample_Social/Social.d.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gandjustas/sptypescript/e2c0d58f2b36bd10193fdc3552bacdd3cca82f0a/Sample_Social/Social.d.ts
--------------------------------------------------------------------------------
/Sample_Social/Social.ts:
--------------------------------------------------------------------------------
1 |
2 |
3 | // App permissions required for this example to work: Tenant Write
4 |
5 | SP.SOD.executeOrDelayUntilScriptLoaded(() => {
6 | var context = SP.ClientContext.get_current();
7 | var followingManager = new SP.Social.SocialFollowingManager(context);
8 | var info = new SP.Social.SocialActorInfo();
9 | info.set_actorType(SP.Social.SocialActorType.site);
10 | info.set_contentUri(GetUrlKeyValue("SPHostUrl"));
11 | var isFollowed = followingManager.isFollowed(info);
12 |
13 | context.executeQueryAsync((sender, args) => {
14 | if (isFollowed.get_value())
15 | $get("results").innerHTML = "You are already following the app host site!";
16 | else {
17 | var followResult = followingManager.follow(info);
18 | context.executeQueryAsync((sender, args) => {
19 | if (followResult.get_value() == 0)
20 | $get("results").innerHTML = "Now you're following the app host site! Check it on your profile page.";
21 | else
22 | $get("results").innerHTML = "You failed to follow the app host site due to some mysterious error.";
23 | }, (sender, args) => { alert('Error trying to follow the app host site: ' + args.get_message()); });
24 | }
25 | }, (sender, args) => { alert('Error: ' + args.get_message()); });
26 |
27 | }, 'sp.userprofiles.js');
--------------------------------------------------------------------------------
/Sample_Taxonomy/Taxonomy/App.d.ts:
--------------------------------------------------------------------------------
1 | declare module _ {
2 | }
3 |
--------------------------------------------------------------------------------
/Sample_Taxonomy/Taxonomy/App.min.js:
--------------------------------------------------------------------------------
1 | var _;(function(){function u(){r=SP.Taxonomy.TaxonomySession.getTaxonomySession(n);t=r.getDefaultSiteCollectionTermStore();n.load(r);n.load(t);n.executeQueryAsync(o,a)}function o(){i=t.get_groups();n.load(i);n.executeQueryAsync(s,l)}function s(){$("#report").children().remove();for(var n=i.getEnumerator();n.moveNext();)(function(){var r=n.get_current(),t=document.createElement("div"),i;t.setAttribute("style","float:none;cursor:pointer");i=r.get_id();t.setAttribute("id",i.toString());$(t).click(function(){return h(i)});t.appendChild(document.createTextNode(r.get_name()));$("#report").append(t)})()}function h(t){for(var r=document.getElementById(t.toString()),u,f;r.childNodes.length>1;)r.removeChild(r.lastChild);u=i.getById(t);n.load(u);n.executeQueryPromise().then(function(){return f=u.get_termSets(),n.load(f),n.executeQueryPromise()}).then(function(){for(var n=f.getEnumerator();n.moveNext();)(function(){var f=n.get_current(),i=document.createElement("div"),u;i.appendChild(document.createTextNode(" + "+f.get_name()));i.setAttribute("style","float:none;cursor:pointer;");u=f.get_id();i.setAttribute("id",u.toString());$(i).click(function(n){return c(n,t,u)});r.appendChild(i)})()}).fail(function(){return r.appendChild(document.createTextNode("An error occurred in loading the term sets for this group"))})}function c(t,r,u){var f,e,o,s,h;for(t.cancelBubble=!0,f=document.getElementById(u.toString());f.childNodes.length>1;)f.removeChild(f.lastChild);e=i.getById(r);n.load(e);n.executeQueryPromise().then(function(){return o=e.get_termSets(),n.load(o),n.executeQueryPromise()}).then(function(){return s=o.getById(u),n.load(s),n.executeQueryPromise()}).then(function(){return h=s.get_terms(),n.load(h),n.executeQueryPromise()}).then(function(){for(var t=h.getEnumerator(),i,n;t.moveNext();)i=t.get_current(),n=document.createElement("div"),n.appendChild(document.createTextNode(" - "+i.get_name())),n.setAttribute("style","float:none;margin-left:10px;"),f.appendChild(n)}).fail(function(){return f.appendChild(document.createTextNode("An error occurred when trying to retrieve terms in this term set"))})}function l(n,t){$("#report").children().remove();$("#report").append("Failed to retrieve groups. Error:"+t.get_message())}function a(n,t){$("#report").children().remove();$("#report").append("Failed to get session. Error: "+t.get_message())}function v(){r=SP.Taxonomy.TaxonomySession.getTaxonomySession(n);t=r.getDefaultSiteCollectionTermStore();n.load(r);n.load(t);n.executeQueryAsync(y,b)}function y(){var u=SP.Guid.newGuid(),f=SP.Guid.newGuid(),e=SP.Guid.newGuid(),o=SP.Guid.newGuid(),s=SP.Guid.newGuid(),h=SP.Guid.newGuid(),c=t.createGroup("CustomTerms",u),r=c.createTermSet("Privacy",f,1033);r.createTerm("Top Secret",1033,e);r.createTerm("Company Confidential",1033,o);r.createTerm("Partners Only",1033,s);r.createTerm("Public",1033,h);i=t.get_groups();n.load(i);n.executeQueryAsync(p,w)}function p(){u()}function w(n,t){$("#report").children().remove();$("#report").append("Failed to add terms. Error: "+t.get_message())}function b(n,t){$("#report").children().remove();$("#report").append("Failed to get session. Error: "+t.get_message())}var n,f,e,r,t,i;$(document).ready(function(){n=SP.ClientContextPromise.get_current();e=n.get_site();f=n.get_web();$("#listExisting").click(function(){u()});$("#createTerms").click(function(){v()})})})(_||(_={}));
2 | //# sourceMappingURL=App.min.js.map
3 |
--------------------------------------------------------------------------------
/Sample_Taxonomy/Taxonomy/Default.aspx:
--------------------------------------------------------------------------------
1 | <%-- The following 4 lines are ASP.NET directives needed when using SharePoint components --%>
2 |
3 | <%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" Language="C#" %>
4 |
5 | <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
6 | <%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
7 | <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
8 |
9 | <%-- The markup and script in the following Content element will be placed in the of the page --%>
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | <%-- The markup and script in the following Content element will be placed in the of the page --%>
26 |
27 |
33 |
34 |
35 |
36 |
37 | Taxonomy
38 |
39 |
40 |
41 | Taxonomy
42 |
--------------------------------------------------------------------------------
/Sample_Taxonomy/Taxonomy/Elements.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sample_Taxonomy/Taxonomy/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sample_UserProfiles/Default.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" Language="C#" %>
2 |
3 | <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
4 | <%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
5 | <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | For futher demo add "Who Is?" app part to page on host web.
17 |
18 |
19 |
20 | Loading data from service...
21 |
22 |
23 |
24 |
25 |
26 |
27 | My User Profile Properties
28 |
29 |
30 |
31 | My User Profile Properties
32 |
--------------------------------------------------------------------------------
/Sample_UserProfiles/Elements.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sample_UserProfiles/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sample_UserProfiles/UserProfiles.d.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gandjustas/sptypescript/e2c0d58f2b36bd10193fdc3552bacdd3cca82f0a/Sample_UserProfiles/UserProfiles.d.ts
--------------------------------------------------------------------------------
/Sample_UserProfiles/UserProfiles.ts:
--------------------------------------------------------------------------------
1 |
2 |
3 | SP.SOD.executeOrDelayUntilScriptLoaded(() => {
4 | var context = SP.ClientContext.get_current();
5 |
6 | var peopleManager = new SP.UserProfiles.PeopleManager(context);
7 | var personProperties = peopleManager.getMyProperties();
8 | context.load(personProperties);
9 |
10 | context.executeQueryAsync((sender, args) => {
11 | var properties = personProperties.get_userProfileProperties();
12 | var messageText = "";
13 | for (var key in properties) {
14 | messageText += " [" + key + "]: \"" + properties[key] + "\"";
15 | }
16 | $get("results").innerHTML = messageText;
17 | }, (sender, args) => { alert('Error: ' + args.get_message()); });
18 |
19 | }, 'sp.userprofiles.js');
--------------------------------------------------------------------------------
/Sample_WhoIsWebPart/Elements.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Sample_WhoIsWebPart/Part.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
2 |
3 | <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
4 | <%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
5 | <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
6 |
7 |
8 |
9 |
10 |
11 | Who is?
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | Add "Who is?" app part to page on the host site.
34 |
35 |
36 | Part in edit mode.
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/Sample_WhoIsWebPart/Part.css:
--------------------------------------------------------------------------------
1 | body
2 | {
3 | /*Mandatory styles for apppart*/
4 | background-color: transparent;
5 |
6 | min-height:120px;
7 | }
8 |
9 | body.ms-backgroundImage {
10 | /*Mandatory styles for apppart*/
11 | background-image: none;
12 | }
--------------------------------------------------------------------------------
/Sample_WhoIsWebPart/Part.d.ts:
--------------------------------------------------------------------------------
1 | declare module _ {
2 | }
3 |
--------------------------------------------------------------------------------
/Sample_WhoIsWebPart/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Sample_WhoIsWebPart/WhoIsWebPart/Elements.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Sample_WhoIsWebPart/WhoIsWebPart/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Sample_WorkflowServices/Default.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" Language="C#" %>
2 |
3 | <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
4 | <%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
5 | <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | Loading data from service...
19 |
20 |
21 |
22 |
23 |
24 |
25 | Available Workflow Actions
26 |
27 |
28 |
29 | Available Workflow Actions
30 |
--------------------------------------------------------------------------------
/Sample_WorkflowServices/Elements.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sample_WorkflowServices/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sample_WorkflowServices/WorkflowServices.d.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gandjustas/sptypescript/e2c0d58f2b36bd10193fdc3552bacdd3cca82f0a/Sample_WorkflowServices/WorkflowServices.d.ts
--------------------------------------------------------------------------------
/Sample_WorkflowServices/WorkflowServices.ts:
--------------------------------------------------------------------------------
1 |
2 | SP.SOD.executeOrDelayUntilScriptLoaded(() => {
3 | var context = SP.ClientContext.get_current();
4 |
5 | var web = context.get_web();
6 | context.load(web);
7 |
8 | context.executeQueryAsync((sender, args) => {
9 |
10 | var servicesManager = SP.WorkflowServices.WorkflowServicesManager.newObject(context, web);
11 | context.load(servicesManager);
12 |
13 | context.executeQueryAsync((sender, args) => {
14 |
15 | var deploymentService = servicesManager.getWorkflowDeploymentService();
16 | context.load(deploymentService);
17 | var instanceService = servicesManager.getWorkflowInstanceService();
18 | context.load(instanceService);
19 | var subscriptionService = servicesManager.getWorkflowSubscriptionService();
20 | context.load(subscriptionService);
21 |
22 | context.executeQueryAsync((sender, args) => {
23 |
24 | var designerActions = deploymentService.getDesignerActions(web);
25 | // perform other actions with services here
26 | // for example, get all workflow definitions:
27 | //var workflowDefinitions = deploymentService.enumerateDefinitions(false);
28 | //context.load(workflowDefinitions);
29 |
30 | context.executeQueryAsync((sender, args) => {
31 |
32 | $get('results').innerHTML = STSHtmlEncode(designerActions.get_value());
33 |
34 | // example enumerating workflow definitions
35 | //console.info("Workflow definitions:");
36 | //var enumerator = workflowDefinitions.getEnumerator();
37 | //while (enumerator.moveNext()) {
38 | // var definition = enumerator.get_current();
39 | // console.log(definition.get_displayName());
40 | //}
41 |
42 | }, (sender, args) => { alert("Error operating with services! " + args.get_message()) });
43 |
44 | }, (sender, args) => { alert("Error loading services! " + args.get_message()) });
45 |
46 | }, (sender, args) => { alert("Error loading serviceManager! " + args.get_message()) });
47 |
48 | }, (sender, args) => { alert("Error loading web! " + args.get_message()) });
49 |
50 | }, "sp.workflowservices.js");
51 |
--------------------------------------------------------------------------------
/Sample_mQuery/Elements.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Sample_mQuery/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Sample_mQuery/mquery.d.ts:
--------------------------------------------------------------------------------
1 | declare module spdevlab {
2 | module mQuery {
3 | class DynamicTable {
4 | _domContainer: HTMLElement;
5 | _tableContainer: MQueryResultSetElements;
6 | _rowTemplateId: string;
7 | _rowTemplateContent: string;
8 | _options: {
9 | tableCnt: string;
10 | addCnt: string;
11 | removeCnt: string;
12 | };
13 | init(domContainer: HTMLElement, options: any): void;
14 | _initContainers(domContainer: any): void;
15 | _showUI(): void;
16 | _initEvents(): void;
17 | _initRowTemplate(): void;
18 | static _templates: string[];
19 | static initTables(): void;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Scripts/typings/angularjs/angular-cookies.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for Angular JS 1.2 (ngCookies module)
2 | // Project: http://angularjs.org
3 | // Definitions by: Diego Vilar
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 |
7 | ///
8 |
9 | ///////////////////////////////////////////////////////////////////////////////
10 | // ngCookies module (angular-cookies.js)
11 | ///////////////////////////////////////////////////////////////////////////////
12 | declare module ng.cookies {
13 |
14 | ///////////////////////////////////////////////////////////////////////////
15 | // CookieService
16 | // see http://docs.angularjs.org/api/ngCookies.$cookies
17 | ///////////////////////////////////////////////////////////////////////////
18 | interface ICookiesService {}
19 |
20 | ///////////////////////////////////////////////////////////////////////////
21 | // CookieStoreService
22 | // see http://docs.angularjs.org/api/ngCookies.$cookieStore
23 | ///////////////////////////////////////////////////////////////////////////
24 | interface ICookieStoreService {
25 | get(key: string): any;
26 | put(key: string, value: any): void;
27 | remove(key: string): void;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/Scripts/typings/angularjs/angular-sanitize.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for Angular JS 1.2 (ngSanitize module)
2 | // Project: http://angularjs.org
3 | // Definitions by: Diego Vilar
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 |
7 | ///
8 |
9 | ///////////////////////////////////////////////////////////////////////////////
10 | // ngSanitize module (angular-sanitize.js)
11 | ///////////////////////////////////////////////////////////////////////////////
12 | declare module ng.sanitize {
13 |
14 | ///////////////////////////////////////////////////////////////////////////
15 | // SanitizeService
16 | // see http://docs.angularjs.org/api/ngSanitize.$sanitize
17 | ///////////////////////////////////////////////////////////////////////////
18 | interface ISanitizeService {
19 | (html: string): string;
20 | }
21 |
22 | ///////////////////////////////////////////////////////////////////////////
23 | // Filters included with the ngSanitize
24 | // see https://github.com/angular/angular.js/tree/v1.2.0/src/ngSanitize/filter
25 | ///////////////////////////////////////////////////////////////////////////
26 | export module filter {
27 |
28 | // Finds links in text input and turns them into html links.
29 | // Supports http/https/ftp/mailto and plain email address links.
30 | // see http://code.angularjs.org/1.2.0/docs/api/ngSanitize.filter:linky
31 | interface ILinky {
32 | (text: string, target?: string): string;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/AssetPickers.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | declare class AssetPickerConfig {
7 | constructor(controlId: string);
8 |
9 | AllowExternalUrls: boolean;
10 | AssetTextClientID: string;
11 | AssetType: string;
12 | AssetUrlClientID: string;
13 | CurrentWebBaseUrl: string;
14 | DefaultAssetImageLocation: string;
15 | DefaultAssetLocation: string;
16 | DefaultToLastUsedLocation: boolean;
17 | DisplayLookInSection: boolean;
18 | OverrideDialogDesc: string;
19 | OverrideDialogFeatures: object;
20 | OverrideDialogImageUrl: string;
21 | OverrideDialogTitle: string;
22 | UseImageAssetPicker: boolean;
23 | ReturnCallback: any;
24 | }
25 |
26 | declare function APD_LaunchAssetPicker(config: AssetPickerConfig, controlId: string): void;
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/SP.DocumentManagement.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare namespace SP {
9 | export namespace DocumentSet {
10 | export class DocumentSet extends ClientObject {
11 | static create(context: ClientContext, parentFolder: Folder, name: string, ctid: ContentTypeId): StringResult;
12 | }
13 | }
14 |
15 | export namespace Video {
16 | export class EmbedCodeConfiguration extends ClientValueObject {
17 | public get_autoPlay(): boolean;
18 | public set_autoPlay(value: boolean): boolean;
19 |
20 | public get_displayTitle(): boolean;
21 | public set_displayTitle(value: boolean): boolean;
22 |
23 | public get_linkToOwnerProfilePage(): boolean;
24 | public set_linkToOwnerProfilePage(value: boolean): boolean;
25 |
26 | public get_linkToVideoHomePage(): boolean;
27 | public set_linkToVideoHomePage(value: boolean): boolean;
28 |
29 | public get_loop(): boolean;
30 | public set_loop(value: boolean): boolean;
31 |
32 | public get_pixelHeight(): number;
33 | public set_pixelHeight(value: number): number;
34 |
35 | public get_pixelWidth(): number;
36 | public set_pixelWidth(value: number): number;
37 |
38 | public get_startTime(): number;
39 | public set_startTime(value: number): number;
40 |
41 | public get_previewImagePath(): string;
42 | public set_previewImagePath(value: string): string;
43 | }
44 |
45 | export class VideoSet extends DocumentSet.DocumentSet {
46 | static createVideo(context: ClientContext, parentFolder: Folder, name: string, ctid: ContentTypeId): StringResult;
47 | static uploadVideo(context: ClientContext, list: List, fileName: string, file: any[], overwriteIfExists: boolean, parentFolderPath: string): StringResult;
48 | static getEmbedCode(context: ClientContext, videoPath: string, properties: EmbedCodeConfiguration): StringResult;
49 | static migrateVideo(context: ClientContext, videoFile: File): SP.ListItem;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/SP.RequestExecutor.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare namespace SP {
9 | export enum RequestExecutorErrors {
10 | requestAbortedOrTimedout,
11 | unexpectedResponse,
12 | httpError,
13 | noAppWeb,
14 | domainDoesNotMatch,
15 | noTrustedOrigins,
16 | iFrameLoadError
17 | }
18 |
19 | export class RequestExecutor {
20 | constructor(url: string, options?: any);
21 | get_formDigestHandlingEnabled(): boolean;
22 | set_formDigestHandlingEnabled(value: boolean): void;
23 | get_iFrameSourceUrl(): string;
24 | set_iFrameSourceUrl(value: string): void;
25 | executeAsync(requestInfo: RequestInfo): void;
26 | attemptLogin(returnUrl: string, success: (response: ResponseInfo) => void, error?: (response: ResponseInfo, error: RequestExecutorErrors, statusText: string) => void): void;
27 | }
28 |
29 | export interface RequestInfo {
30 | url: string;
31 | method?: string;
32 | headers?: { [key: string]: string; };
33 | /** Can be string or bytearray depending on binaryStringRequestBody field */
34 | body?: string | Uint8Array;
35 | binaryStringRequestBody?: boolean;
36 |
37 | /** Currently need fix to get ginary response. Details: http://techmikael.blogspot.ru/2013/07/how-to-copy-files-between-sites-using.html */
38 | binaryStringResponseBody?: boolean;
39 | timeout?: number;
40 | success?: (response: ResponseInfo) => void;
41 | error?: (response: ResponseInfo, error: RequestExecutorErrors, statusText: string) => void;
42 | state?: any;
43 | }
44 |
45 | export interface ResponseInfo {
46 | statusCode?: number;
47 | statusText?: string;
48 | responseAvailable: boolean;
49 | allResponseHeaders?: string;
50 | headers?: { [key: string]: string; };
51 | contentType?: string;
52 | /** Can be string or bytearray depending on request.binaryStringResponseBody field */
53 | body?: string | Uint8Array;
54 | state?: any;
55 | }
56 |
57 | export class ProxyWebRequestExecutor extends Sys.Net.WebRequestExecutor {
58 | constructor(url: string, options?: any);
59 | }
60 |
61 | export class ProxyWebRequestExecutorFactory implements SP.IWebRequestExecutorFactory {
62 | constructor(url: string, options?: any);
63 | createWebRequestExecutor(): ProxyWebRequestExecutor;
64 | }
65 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/SP.Res.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare namespace SP {
9 | export var Res: {
10 | dialogLoading15: string;
11 | }
12 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/SP.Ribbon.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare namespace SP {
9 | export namespace Ribbon {
10 | export class PageManager {
11 | static get_instance(): PageManager;
12 | addPageComponent(component: CUI.Page.PageComponent): void;
13 | add_ribbonInited(handler: () => void): void;
14 | get_ribbon(): CUI.Ribbon;
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/SP.Sharing.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare namespace SP {
9 | export namespace Sharing {
10 | export class DocumentSharingManager {
11 | static getRoleDefinition(context: SP.ClientRuntimeContext, role: SP.Sharing.Role): SP.RoleDefinition;
12 | static isDocumentSharingEnabled(context: SP.ClientRuntimeContext, list: SP.List): SP.BooleanResult;
13 | static updateDocumentSharingInfo(context: SP.ClientRuntimeContext, resourceAddress: string, userRoleAssignments: SP.Sharing.UserRoleAssignment[], validateExistingPermissions: boolean, additiveMode: boolean, sendServerManagedNotification: boolean, customMessage: string, includeAnonymousLinksInNotification: boolean): SP.Sharing.UserSharingResult[];
14 | }
15 | export enum Role {
16 | none,
17 | view,
18 | edit,
19 | owner,
20 | }
21 | export class UserRoleAssignment extends SP.ClientValueObject {
22 | get_role(): SP.Sharing.Role;
23 | set_role(value: SP.Sharing.Role): void;
24 | get_userId(): string;
25 | set_userId(value: string): void;
26 | get_typeId(): string;
27 | writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
28 | constructor();
29 | }
30 | export class UserSharingResult extends SP.ClientValueObject {
31 | get_allowedRoles(): SP.Sharing.Role[];
32 | get_currentRole(): SP.Sharing.Role;
33 | get_isUserKnown(): boolean;
34 | get_message(): string;
35 | get_status(): boolean;
36 | get_user(): string;
37 | get_typeId(): string;
38 | writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
39 | constructor();
40 | }
41 | }
42 |
43 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/SP.UI.Controls.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare namespace SP {
9 | export namespace UI {
10 | export namespace Controls {
11 |
12 | export interface INavigationOptions {
13 | assetId?: string;
14 | siteTitle?: string;
15 | siteUrl?: string;
16 | appTitle?: string;
17 | appTitleIconUrl?: string;
18 | rightToLeft?: boolean;
19 | appStartPage?: string;
20 | appIconUrl?: string;
21 | appHelpPageUrl?: string;
22 | appHelpPageOnClick?: string;
23 | settingsLinks?: ISettingsLink[];
24 | language?: string;
25 | clientTag?: string;
26 | appWebUrl?: string;
27 | onCssLoaded?: string;
28 |
29 |
30 | bottomHeaderVisible?: boolean;
31 | topHeaderVisible?: boolean;
32 | }
33 |
34 | export class NavigationOptions implements INavigationOptions { }
35 |
36 |
37 | export interface ISettingsLink {
38 | linkUrl: string;
39 | displayName: string;
40 | }
41 |
42 | export class SettingsLink implements ISettingsLink {
43 | linkUrl: string;
44 | displayName: string;
45 | }
46 |
47 |
48 | export class Navigation {
49 | constructor(placeholderDOMElementId: string, options: INavigationOptions);
50 | public get_assetId(): string;
51 | public get_siteTitle(): string;
52 | public get_siteUrl(): string;
53 |
54 | public get_appTitle(): string;
55 | public set_appTitle(value: string): string;
56 |
57 | public get_appTitleIconUrl(): string;
58 | public set_appTitleIconUrl(value: string): string;
59 |
60 | public get_rightToLeft(): boolean;
61 | public set_rightToLeft(value: boolean): boolean;
62 |
63 | public get_appStartPage(): string;
64 | public set_appStartPage(value: string): string;
65 |
66 | public get_appIconUrl(): string;
67 | public set_appIconUrl(value: string): string;
68 |
69 | public get_appHelpPageUrl(): string;
70 | public set_appHelpPageUrl(value: string): string;
71 |
72 | public get_appHelpPageOnClick(): string;
73 | public set_appHelpPageOnClick(value: string): string;
74 |
75 | public get_settingsLinks(): ISettingsLink[];
76 | public set_settingsLinks(value: ISettingsLink[]): ISettingsLink[];
77 |
78 | public setVisible(value: boolean): void;
79 |
80 | public setTopHeaderVisible(value: boolean): void;
81 | public setBottomHeaderVisible(value: boolean): void;
82 | public remove(): void;
83 |
84 | static getVersionedLayoutsUrl(pageName: string): string;
85 | }
86 |
87 |
88 | export class ControlManager {
89 | static getControl(placeHolderId: string): any;
90 | }
91 | }
92 | }
93 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/SP.UI.RTE.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | declare namespace RTE {
7 | export class CanvasRange {
8 | insertBefore(node: Node): void;
9 | insertAfter(node: Node): void;
10 | wrapRange(node: Node): void;
11 | }
12 |
13 | export class Cursor {
14 | static getCurrentElement(): HTMLElement;
15 | static get_range(): CanvasRange;
16 | static update(): void;
17 | static updateRangeToCurrentSelection(): void;
18 | }
19 |
20 | export class Canvas {
21 | static sendApplicationStateChangedEvent(): void;
22 | }
23 |
24 | export class CommandState {
25 | get_applied(): boolean;
26 | }
27 |
28 | export class ParagraphCommands {
29 | static queryBulletedList(): CommandState;
30 | }
31 |
32 | export class SnapshotManager {
33 | static takeSnapshot(): void;
34 | static undo(): void;
35 | static redo(): void;
36 | }
37 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/SP.WebParts.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare namespace SP {
9 | export namespace WebParts {
10 | export class LimitedWebPartManager extends SP.ClientObject {
11 | get_hasPersonalizedParts(): boolean;
12 | get_scope(): SP.WebParts.PersonalizationScope;
13 | get_webParts(): SP.WebParts.WebPartDefinitionCollection;
14 | addWebPart(webPart: SP.WebParts.WebPart, zoneId: string, zoneIndex: number): SP.WebParts.WebPartDefinition;
15 | importWebPart(webPartXml: string): SP.WebParts.WebPartDefinition;
16 | }
17 | export enum PersonalizationScope {
18 | user,
19 | shared,
20 | }
21 | export class TileData extends SP.ClientValueObject {
22 | get_backgroundImageLocation(): string;
23 | set_backgroundImageLocation(value: string): void;
24 | get_description(): string;
25 | set_description(value: string): void;
26 | get_iD(): number;
27 | set_iD(value: number): void;
28 | get_linkLocation(): string;
29 | set_linkLocation(value: string): void;
30 | get_tileOrder(): number;
31 | set_tileOrder(value: number): void;
32 | get_title(): string;
33 | set_title(value: string): void;
34 | get_typeId(): string;
35 | writeToXml(writer: SP.XmlWriter, serializationContext: SP.SerializationContext): void;
36 | constructor();
37 | }
38 | export class WebPart extends SP.ClientObject {
39 | get_hidden(): boolean;
40 | set_hidden(value: boolean): void;
41 | get_isClosed(): boolean;
42 | get_properties(): SP.PropertyValues;
43 | get_subtitle(): string;
44 | get_title(): string;
45 | set_title(value: string): void;
46 | get_titleUrl(): string;
47 | set_titleUrl(value: string): void;
48 | get_zoneIndex(): number;
49 | }
50 | export class WebPartDefinition extends SP.ClientObject {
51 | get_id(): SP.Guid;
52 | get_webPart(): SP.WebParts.WebPart;
53 | saveWebPartChanges(): void;
54 | closeWebPart(): void;
55 | openWebPart(): void;
56 | deleteWebPart(): void;
57 | moveWebPartTo(zoneID: string, zoneIndex: number): void;
58 | }
59 | export class WebPartDefinitionCollection extends SP.ClientObjectCollection {
60 | itemAt(index: number): SP.WebParts.WebPartDefinition;
61 | get_item(index: number): SP.WebParts.WebPartDefinition;
62 | getById(id: SP.Guid): SP.WebParts.WebPartDefinition;
63 | getByControlId(controlId: string): SP.WebParts.WebPartDefinition;
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/SPGantt.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare namespace SP {
9 | export class GanttControl {
10 | static WaitForGanttCreation(callack: (control: GanttControl) => void): void;
11 | static Instances: GanttControl[];
12 | static FnGanttCreationCallback: { (control: GanttControl): void }[];
13 |
14 | get_Columns(): SP.JsGrid.ColumnInfo[];
15 | }
16 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/autofill.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | declare class SPClientAutoFill {
7 | static MenuOptionType: {
8 | Option: number;
9 | Footer: number;
10 | Separator: number;
11 | Loading: number;
12 | }
13 |
14 | static KeyProperty: string; //= 'AutoFillKey';
15 | static DisplayTextProperty: string;// = 'AutoFillDisplayText';
16 | static SubDisplayTextProperty: string; //= 'AutoFillSubDisplayText';
17 | static TitleTextProperty: string; //= 'AutoFillTitleText';
18 | static MenuOptionTypeProperty: string;//= 'AutoFillMenuOptionType';
19 |
20 | static GetAutoFillObjFromInput(elmText: HTMLInputElement): SPClientAutoFill;
21 | static GetAutoFillObjFromContainer(elmChild: HTMLElement): SPClientAutoFill;
22 | static GetAutoFillMenuItemFromOption(elmChild: HTMLElement): HTMLElement;
23 |
24 | constructor(elmTextId: string, elmContainerId: string, fnPopulateAutoFill: (targetElement: HTMLInputElement) => void);
25 | public TextElementId: string;
26 | public AutoFillContainerId: string;
27 | public AutoFillMenuId: string;
28 | public VisibleItemCount: number;
29 | public CurrentFocusOption: number;
30 | public AutoFillMinTextLength: number;
31 | public AutoFillTimeout: number;
32 | public AutoFillCallbackTimeoutID: string;
33 | public FuncOnAutoFillClose: (elmTextId: string, ojData: ISPClientAutoFillData) => void;
34 | public FuncPopulateAutoFill: (targetElement: HTMLElement) => void;
35 | public AllOptionData: { [key: string]: ISPClientAutoFillData };
36 |
37 | PopulateAutoFill(jsonObjSuggestions: ISPClientAutoFillData[], fnOnAutoFillCloseFuncName: (elmTextId: string, objData: ISPClientAutoFillData) => void): void;
38 | IsAutoFillOpen(): boolean;
39 | SetAutoFillHeight(): void;
40 | SelectAutoFillOption(elemOption: HTMLElement): void;
41 | FocusAutoFill(): void;
42 | BlurAutoFill(): void;
43 | CloseAutoFill(ojData: ISPClientAutoFillData): void;
44 | UpdateAutoFillMenuFocus(bMoveNextLink: boolean): void;
45 | UpdateAutoFillPosition(): void;
46 | }
47 |
48 | interface ISPClientAutoFillData {
49 | AutoFillKey?: any;
50 | AutoFillDisplayText?: string;
51 | AutoFillSubDisplayText?: string;
52 | AutoFillTitleText?: string;
53 | AutoFillMenuOptionType?: number;
54 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/core.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | declare function FilterFieldV3(view: string, fieldName: string, fieldValue: string, selOption: number, queryString: string, bReturnUrl: boolean): void;
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/dragdrop.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | declare enum DragDropMode {
7 | NOTSUPPORTED, // -1
8 | IE8, // 0
9 | IE9, // 1
10 | HTML5 // 3
11 | }
12 |
13 | declare enum UploadType {
14 | NOT_SUPPORTED, // 0
15 | ACTIVEX, // 1
16 | ACTIVEXNA, // 2
17 | HTML5 // 3
18 | }
19 |
20 | declare var g_uploadType: UploadType;
21 |
22 | declare var SPDragDropManager: {
23 | DragDropMode: DragDropMode;
24 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/inplview.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare var inplview: {
9 | RefreshInplViewUrlByContext: (ctxParam: SPClientTemplates.RenderContext) => void;
10 | HandleRefreshViewByContext: (ctxParam: SPClientTemplates.RenderContext, bClearPagingParam: boolean) => void;
11 | };
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/reputation.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare module Microsoft {
9 | export module Office {
10 | export module Server {
11 | export module ReputationModel {
12 | export class Reputation {
13 | constructor();
14 | static setLike(context: SP.ClientContext, listId: string, itemId: number, like: boolean): void;
15 | static setRating(context: SP.ClientContext, listId: string, itemId: number, rating: number): void;
16 | }
17 | }
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/Scripts/typings/sharepoint/strings.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for SharePoint JSOM
2 | // Project: https://github.com/gandjustas/sptypescript
3 | // Definitions by: Stanislav Vyshchepan , Andrey Markeev
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 |
6 | declare var Strings: {
7 | STS: {
8 | L_DateTimeFieldSelectTitle: string;
9 | L_FilterThrottled_Text: string;
10 | L_LookupFieldNoneOption: string;
11 | L_RequiredField_Text: string;
12 | L_RequiredField_Tooltip: string;
13 | L_SPClientNext: string;
14 | L_SPClientPrevious: string;
15 | }
16 | };
--------------------------------------------------------------------------------
/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "typescripttemplates",
3 | "version": "0.0.0",
4 | "homepage": "https://github.com/gandjustas/sptypescript",
5 | "authors": [
6 | "Stanislav Vyschepan"
7 | ],
8 | "description": "SharePoint TypeScript Client-Side Rendering (CSR) templates and helpers",
9 | "main": "Extensions/sp-ts-csr.ts",
10 | "moduleType": [],
11 | "keywords": [
12 | "sharepoint",
13 | "typescript",
14 | "CSR"
15 | ],
16 | "license": "MS-PL",
17 | "ignore": [
18 | "*",
19 | "!Extensions",
20 | "Extensions/*",
21 | "!Extensions/sp-ts-csr.ts"
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | var gulp = require('gulp');
2 | var Nuget = require('nuget-runner');
3 | var args = require('yargs').argv;
4 | var del = require('del');
5 |
6 | gulp.task('clean', function() {
7 | return del(['release', '*.nupkg']);
8 |
9 | });
10 |
11 | gulp.task('nuget', ['clean'], function() {
12 | var nuget = Nuget({ apiKey: args.nugetApiKey });
13 |
14 | return nuget
15 | .pack({
16 | spec: 'typescripttemplates.nuspec',
17 | version: args.buildVersion
18 | })
19 | //.then(function() { return nuget.push('*.nupkg'); })
20 | ;
21 | });
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sptypescript",
3 | "version": "1.0.1",
4 | "devDependencies": {
5 | "del": "^2.0.2",
6 | "gulp": "^3.9.1",
7 | "gulp-concat": "^2.6.0",
8 | "gulp-delete-lines": "0.0.7",
9 | "gulp-flatten": "^0.2.0",
10 | "gulp-header": "^1.7.1",
11 | "gulp-typescript": "^2.9.2",
12 | "gulp-uglify": "^1.4.1",
13 | "merge2": "^0.3.6",
14 | "nuget-runner": "^0.1.6",
15 | "typescript": "^2.0.6",
16 | "yargs": "^3.26.0"
17 | },
18 | "repository": {
19 | "type": "git",
20 | "url": "https://github.com/gandjustas/sptypescript.git"
21 | },
22 | "private": true,
23 | "license": "MIT"
24 | }
25 |
--------------------------------------------------------------------------------
/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "none",
4 | "noImplicitAny": true,
5 | "noImplicitReturns": true,
6 | "suppressImplicitAnyIndexErrors": true,
7 | "sourceMap": true
8 | },
9 | "exclude": [
10 | "node_modules", "distr", "packages", "pkg", "obj", "bin", "pkgobj"
11 | ]
12 | }
--------------------------------------------------------------------------------
/typescripttemplates.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | typescripttemplates
5 | 1.0.0
6 | SharePoint TypeScript CSR templates and helpers
7 | Stanislav Vyschepan
8 | false
9 | TypeScript Templates is a set of SharePoint Client-Side Rendering (CSR) templates and helper functions to change behaviour of standard forms.
10 | sharepoint typescript CSR
11 | https://github.com/gandjustas/sptypescript
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
|