Skip to content

Instantly share code, notes, and snippets.

View RainerAtSpirit's full-sized avatar

Rainer Wittmann RainerAtSpirit

View GitHub Profile
@RainerAtSpirit
RainerAtSpirit / OOTB_apps.js
Created August 26, 2012 11:23
Napa OOTB Apps.js leaking globals
var context;
var web;
var user;
// This code runs when the DOM is ready. It ensures the SharePoint
// script file sp.js is loaded and then executes sharePointReady()
$(document).ready(function () {
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);
});
@RainerAtSpirit
RainerAtSpirit / ResultDefault.aspx
Created August 23, 2012 12:50
Goodbye Ferrari, hello Napa
<!DOCTYPE HTML>
<html>
<head>
<title>
Goodbye Ferrari, hello Napa
</title>
<!-- Add your CSS styles to the following file -->
<link rel="Stylesheet" type="text/css" href="../Content/App.css" />
</head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="ltr" lang="en-US">
<head><meta name="GENERATOR" content="Microsoft SharePoint" /><meta http-equiv="Content-type" content="text/html; charset=utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=10" /><meta http-equiv="Expires" content="0" /><meta content="width=device-width, initial-scale=1" name="viewport" /><meta name="msApplication-TileImage" value="/_layouts/15/images/SharePointMetroAppTile.png" /><meta name="msApplication-TileColor" value="0072C6" /><title>
SharePointApp1
</title><link rel="shortcut icon" href="/_layouts/15/images/favicon.ico" type="image/vnd.microsoft.icon" id="favicon" /><link rel="stylesheet" type="text/css" href="https://spirit2013preview.sharepoint.com/sites/dev/_layouts/15/defaultcss.ashx?ctag=0"/>
<script type="text/javascript" src="https://cdn.sharepointonline.com/2776/_layouts/15/init.js?rev=msptCBHw90mLJ2YXhvPe5Q%3D%3D"></script>
@RainerAtSpirit
RainerAtSpirit / _api$metadata.xml
Created August 6, 2012 10:44
SharePoint 2013 Developer Preview REST API
<?xml version="1.0" encoding="utf-8"?><edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"><edmx:DataServices m:DataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><Schema Namespace="SP" xmlns="http://schemas.microsoft.com/ado/2009/11/edm"><ComplexType Name="KeyValue"><Property Name="Key" Type="Edm.String" /><Property Name="Value" Type="Edm.String" /><Property Name="ValueType" Type="Edm.String" /></ComplexType><ComplexType Name="SimpleDataRow"><Property Name="Cells" Type="Collection(SP.KeyValue)" /></ComplexType><ComplexType Name="SimpleDataTable"><Property Name="Rows" Type="Collection(SP.SimpleDataRow)" /></ComplexType><ComplexType Name="MethodInformation"><Property Name="Name" Type="Edm.String" /><Property Name="Parameters" Type="Collection(SP.ParameterInformation)" /><Property Name="ReturnTypeFullName" Type="Edm.String" /></ComplexType><ComplexType Name="ParameterInformation"><Property Name="Name" Type="Edm.String" /><Property Nam
@RainerAtSpirit
RainerAtSpirit / CustomBindingHandler.js
Created August 2, 2012 15:14
KnockoutJS, RequireJS and the revealing module pattern
define (['knockout', 'jquery', 'prettyDate', 'metrojs'], function ( ko, $ ) {
"use strict";
// See https://github.com/SteveSanderson/knockout/wiki/Bindings---class
ko.bindingHandlers['class'] = {
'update' : function ( element, valueAccessor ) {
if ( element['__ko__previousClassValue__'] ) {
ko.utils.toggleDomNodeCssClass (element, element['__ko__previousClassValue__'], false);
}
var value = ko.utils.unwrapObservable (valueAccessor ());
@RainerAtSpirit
RainerAtSpirit / ListingView.html
Created August 1, 2012 14:08
Ferrari meets JayData
<div class="row" id="listingVM">
<div class="nine columns" style="display:none"
data-bind="visible: showTable()">
<div class="twelve columns">
<div class="two columns">
<a href="#" title="Go back"><img src="images/48/arrow_left.png" style="border: none"/></a>
</div>
<div class="ten columns">
<h3 data-bind="text: $root.selectedList"></h3>
@RainerAtSpirit
RainerAtSpirit / ListingViewModel.js
Created July 29, 2012 13:20
JayData + Knockout
define(['knockout', 'postbox', 'underscore'], function (ko, postbox) {
"use strict";
return function () {
var selectedList, allItems, take, takeValues, includeArray, orderBy, orderAsc, handleAfterRender, showTable,
chooseMap;
selectedList = ko.observable('No list selected').syncWith('selectedList');
allItems = ko.observableArray([]);
@RainerAtSpirit
RainerAtSpirit / app.js
Created July 26, 2012 17:00
draft version of Odata chooseMap
/**
* User: RainerAtSpirit
* Date: 24.07.12
* Time: 15:35
*/
define(['knockout', 'helper', 'postbox', 'underscore', 'jaydata', 'appData', 'jd2ko'], function (ko, fn, postbox, _) {
var app = window.app || {},
TileViewModel, LogonViewModel, ListingModel, init;
@RainerAtSpirit
RainerAtSpirit / SP2013_apimetadata.xml
Created July 21, 2012 15:15
SP2013 _api $metadata
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
<edmx:DataServices m:DataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<Schema Namespace="SP" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<ComplexType Name="KeyValue">
<Property Name="Key" Type="Edm.String"/>
<Property Name="Value" Type="Edm.String"/>
<Property Name="ValueType" Type="Edm.String"/>
</ComplexType>
<ComplexType Name="SimpleDataRow">
@RainerAtSpirit
RainerAtSpirit / WebPartPage.aspx
Created July 15, 2012 12:53
SharePoint DVWP From workhorse to html5 ferrari (html source)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:o="urn:schemas-microsoft-com:office:office" lang="en-us" dir="ltr">
<head><meta http-equiv="X-UA-Compatible" content="IE=8" /><meta name="GENERATOR" content="Microsoft SharePoint" /><meta name="progid" content="SharePoint.WebPartPage.Document" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Expires" content="0" /><title>
WebPartPage
</title><link rel="stylesheet" type="text/css" href="/_layouts/1033/styles/Themable/corev4.css?rev=iIikGkMuXBs8CWzKDAyjsQ%3D%3D"/>
<script type="text/javascript">