Skip to content

Commit

Permalink
Merge pull request OfficeDev#195 from TBag/ContentUpdatesO3651-2b
Browse files Browse the repository at this point in the history
Added completed project for exercise 3.
  • Loading branch information
jthake committed Dec 22, 2015
2 parents 922108f + d341487 commit 957b58d
Show file tree
Hide file tree
Showing 256 changed files with 171,016 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContentGenerator", "ContentGenerator\ContentGenerator.csproj", "{795AE0C3-6949-43A8-B041-C32CCB920298}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContentGeneratorWeb", "ContentGeneratorWeb\ContentGeneratorWeb.csproj", "{6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{795AE0C3-6949-43A8-B041-C32CCB920298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{795AE0C3-6949-43A8-B041-C32CCB920298}.Debug|Any CPU.Build.0 = Debug|Any CPU
{795AE0C3-6949-43A8-B041-C32CCB920298}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{795AE0C3-6949-43A8-B041-C32CCB920298}.Release|Any CPU.ActiveCfg = Release|Any CPU
{795AE0C3-6949-43A8-B041-C32CCB920298}.Release|Any CPU.Build.0 = Release|Any CPU
{795AE0C3-6949-43A8-B041-C32CCB920298}.Release|Any CPU.Deploy.0 = Release|Any CPU
{6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{795AE0C3-6949-43A8-B041-C32CCB920298}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ContentGenerator</RootNamespace>
<AssemblyName>ContentGenerator</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetOfficeVersion>15.0</TargetOfficeVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{C1CDDADD-2546-481F-9697-4EA41081F2FC};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<IncludeAssemblyInPackage>False</IncludeAssemblyInPackage>
<AppFeaturePartId>{4fc56ad6-f2bc-47ed-921c-768a6c44d786}</AppFeaturePartId>
<WspPartId>{f2971228-b3f7-47c6-9c23-a4e94bccf72f}</WspPartId>
<WorkflowPartId>{1b1e5af9-62f5-47c4-9edf-403a72c24313}</WorkflowPartId>
<CspkgPartId>{0f9c3ec7-dfde-4916-9887-03880cff2ad9}</CspkgPartId>
<SqlPackagePartId>{45916d3b-a56a-402f-b83b-33d039aab8bd}</SqlPackagePartId>
<ProjectMode>OfficeApp</ProjectMode>
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
<MinimumOfficeToolsVersion>12.2</MinimumOfficeToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<ItemGroup>
<None Include="ContentGeneratorManifest\SharePointProjectItem.spdata">
<SharePointProjectItemId>{42736422-ce18-4deb-a078-9827098e0a68}</SharePointProjectItemId>
</None>
<Content Include="ContentGeneratorManifest\ContentGenerator.xml">
<OpcRelationship>manifest-oemanifest</OpcRelationship>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ContentGeneratorWeb\ContentGeneratorWeb.csproj">
<Project>{6CF8FD56-91D1-4C8A-8578-05E2E02B95E6}</Project>
<Name>ContentGeneratorWeb</Name>
<Private>True</Private>
<RoleType>Web</RoleType>
<OutputItemType>SharePointWebProjectOutput</OutputItemType>
<RoleName>ContentGeneratorWeb</RoleName>
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\SharePointTools\Microsoft.VisualStudio.SharePoint.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TaskPaneApp">
<Id>a97e3b13-b1b5-4660-b17c-2048e9024e11</Id>
<Version>1.0.0.0</Version>
<ProviderName>[Provider name]</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Content Generator" />
<Description DefaultValue="ContentGenerator"/>
<Hosts>
<Host Name="Document" />
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="~remoteAppUrl/AddIn/Home/Home.html" />
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
</OfficeApp>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ProjectItem Type="Microsoft.VisualStudio.SharePoint.OfficeApp" DefaultFile="ContentGenerator.xml" SupportedTrustLevels="All" SupportedDeploymentScopes="AppPackage" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
<Files>
<ProjectItemFile Source="ContentGenerator.xml" Type="AppPackage" />
</Files>
<ExtensionData>
<ExtensionDataItem Key="OfficeAppManifestRelativePath" Value="ContentGeneratorManifest\ContentGenerator.xml" />
</ExtensionData>
</ProjectItem>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* Common app styling */

#content-header {
background: #2a8dd4;
color: #fff;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 80px; /* Fixed header height */
overflow: hidden; /* Disable scrollbars for header */
}

#content-main {
background: #fff;
position: fixed;
top: 80px; /* Same value as #content-header's height */
left: 0;
right: 0;
bottom: 0;
overflow: auto; /* Enable scrollbars within main content section */
}

.padding {
padding: 15px;
}

#notification-message {
background-color: #818285;
color: #fff;
position: absolute;
width: 100%;
min-height: 80px;
right: 0;
z-index: 100;
bottom: 0;
display: none; /* Hidden until invoked */
}

#notification-message #notification-message-header {
font-size: medium;
margin-bottom: 10px;
}

#notification-message #notification-message-close {
background-image: url("../Images/Close.png");
background-repeat: no-repeat;
width: 24px;
height: 24px;
position: absolute;
right: 5px;
top: 5px;
cursor: pointer;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Common app functionality */

var app = (function () {
"use strict";

var app = {};

// Common initialization function (to be called from each page)
app.initialize = function () {
$('body').append(
'<div id="notification-message">' +
'<div class="padding">' +
'<div id="notification-message-close"></div>' +
'<div id="notification-message-header"></div>' +
'<div id="notification-message-body"></div>' +
'</div>' +
'</div>');

$('#notification-message-close').click(function () {
$('#notification-message').hide();
});


// After initialization, expose a common notification function
app.showNotification = function (header, text) {
$('#notification-message-header').text(header);
$('#notification-message-body').text(text);
$('#notification-message').slideDown('fast');
};
};

return app;
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
body {
margin: 0;
}

#topDiv {
background-color: white;
padding: 0;
}

#topDiv h2 {
margin: 0;
font-size: 24pt;
color: white;
background-color: #0a00ff;
padding: 12px;
height: 24px;
}

#topDiv .toolbar {
background-color: #fbeba0;
margin: 0;
padding: 2px;
}

#topDiv .toolbar input {
margin: 4px;
}

#topDiv .displayPanel {
margin: 0;
border: 1px solid black;
padding: 6px;
font-size: 12px;
font-family: "Garamond, Arial, sans-serif";
background-color: white;
color: blue;
min-height: 320px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title></title>
<script src="../../Scripts/jquery-1.9.1.js" type="text/javascript"></script>

<link href="../../Content/Office.css" rel="stylesheet" type="text/css" />
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>

<!-- To enable offline debugging using a local reference to Office.js, use: -->
<!-- <script src="../../Scripts/Office/MicrosoftAjax.js" type="text/javascript"></script> -->
<!-- <script src="../../Scripts/Office/1/office.js" type="text/javascript"></script> -->

<link href="../App.css" rel="stylesheet" type="text/css" />
<script src="../App.js" type="text/javascript"></script>

<link href="Home.css" rel="stylesheet" type="text/css" />
<script src="Home.js" type="text/javascript"></script>
</head>
<body>

<div id="topDiv">

<h2>Get a Quote</h2>

<div class="toolbar">
<input id="cmdGetContent" type="button" value="Get Content" />
<input id="cmdInsertContent" type="button" value="Insert Content" />
</div>

<div class="displayPanel">
<div id="contentArea"></div>
</div>

</div>

</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
(function () {
"use strict";

Office.initialize = function (reason) {
$(document).ready(function () {
app.initialize();
// adding event handlers for app command buttons
$("#cmdGetContent").click(cmdGetContent);
$("#cmdInsertContent").click(cmdInsertContent);
});
};

function getQuote() {

var quotes = [
"I would rather have an Agave bottle in front of me than a frontal lobatomy.",
"Better to remain silent and be thought a fool than to speak and erase all doubt.",
"A two-year-old is kind of like having a blender, but you don't have a top for it.",
"Between two evils, I always pick the one I never tried before."
];

var index = Math.floor(Math.random() * quotes.length);
return quotes[index];
}

function cmdGetContent() {
// display quote inside Agave
$("#contentArea").html(getQuote());
}

function cmdInsertContent() {
// insert current quote in Active Word document
var quote = $("#contentArea").html();
Office.context.document.setSelectedDataAsync(quote, {}, function () { });
}

})();
Loading

0 comments on commit 957b58d

Please sign in to comment.