This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Web; | |
using System.Web.UI; | |
using System.Web.UI.WebControls; | |
using System.Xml.Linq; | |
namespace COB.SharePointAutohostedAppWeb.Pages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchResults.aspx.cs" Inherits="COB.SharePointAutohostedAppWeb.Pages.SearchResults" %> | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title>Using SP2013 search REST API from provider-hosted/auto-hosted app</title> | |
</head> | |
<body> | |
<form id="form1" runat="server"> | |
<h1>Search results</h1> | |
<div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSearchResultsUsingREST(queryText) { | |
// search can use the app web URL as the base, so no need to use SP.AppContextSite(@target) to access the host web.. | |
var searchUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/search/query?querytext='" + queryText + "'"; | |
var executor = new SP.RequestExecutor(_spPageContextInfo.webAbsoluteUrl); | |
executor.executeAsync( | |
{ | |
url: searchUrl, | |
method: "GET", | |
headers: { "Accept": "application/json; odata=verbose" }, | |
success: onGetSearchResultsSuccess, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[site]/_api/search/query?querytext='timesheets' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="related-content-results" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<AppPermissionRequests> | |
<AppPermissionRequest Scope="http://sharepoint/search" Right="QueryAsUserIgnoreAppPrincipal" /> | |
</AppPermissionRequests> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function to process an accordion item.. | |
window.COB = window.COB || {}; | |
window.COB.accordionItem = { | |
customItemHtml: function (ctx) { | |
var accordionItemHtml = "<h3>" + ctx.CurrentItem.Title + "</h3>"; | |
accordionItemHtml += "<div>" + ctx.CurrentItem.AccordionItemDescription + "</div>"; | |
return accordionItemHtml; | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> | |
<CustomAction | |
ScriptSrc="~SiteCollection/SiteAssets/jquery-1.8.3.min.js" | |
Location="ScriptLink" | |
Sequence="10"> | |
</CustomAction> | |
<CustomAction | |
ScriptSrc="~SiteCollection/SiteAssets/jquery-ui-1.9.2.custom.js" | |
Location="ScriptLink" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
using System.Security.Permissions; | |
using Microsoft.SharePoint; | |
namespace COB.SharePoint.AccordionList.Features.AccordionList | |
{ | |
/// <summary> | |
/// Adds a custom CSS file reference so that jQuery UI branding is applied. Also deletes the accordion list on deactivation. | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> | |
<Module Name="SiteAssets" Url="SiteAssets"> | |
<File Path="SiteAssets\AccordionListView.js" Url="AccordionListView.js" /> | |
<File Path="SiteAssets\jquery-1.8.3.min.js" Url="jquery-1.8.3.min.js" /> | |
<File Path="SiteAssets\jquery.ui.accordion.min.js" Url="jquery.ui.accordion.min.js" /> | |
<File Path="SiteAssets\CSS\jquery-ui-1.9.2.custom.min.css" Url="CSS/jquery-ui-1.9.2.custom.min.css" /> | |
<File Path="SiteAssets\CSS\images\ui-bg_flat_0_aaaaaa_40x100.png" Url="CSS/images/ui-bg_flat_0_aaaaaa_40x100.png" /> | |
<File Path="SiteAssets\CSS\images\ui-bg_flat_0_eeeeee_40x100.png" Url="CSS/images/ui-bg_flat_0_eeeeee_40x100.png" /> | |
<File Path="SiteAssets\CSS\images\ui-bg_flat_55_c0402a_40x100.png" Url="CSS/images/ui-bg_flat_55_c0402a_40x100.png" /> |
OlderNewer