Skip to content

Instantly share code, notes, and snippets.

@spdustin
Last active December 13, 2015 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spdustin/4988365 to your computer and use it in GitHub Desktop.
Save spdustin/4988365 to your computer and use it in GitHub Desktop.
WebDev 2013-02

What is this about?

If you're not in my SharePoint Web Developer Experience class, you're missing out. This is just some of the sample code we're discussing in the February 2013 delivery. There's another one coming up in May. And you get even more code than is shared here to the public.

Feel free to poke around. Geek out a bit. And if your curiosity is piqued, sign up for the next one.

webdev201302.sublime-project
/stylesheets
webdev201302.sublime-workspace
webdev201302.xpr
/sass
/.sass-cache
config.rb

Welcome!

Yes, your welcome is in a text editor and not a slide deck. It's gonna get geeky in here.

[content snipped]

<vehicles>
<cars>
<car make="Ford" model="Pinto"/>
<car make="Toyota" model="Prius"/>
<car make="Lexus" model="RX350"/>
</cars>
<trucks>
<truck make="Ford" model="F150"/>
<truck make="Toyota" model="Tacoma"/>
</trucks>
</vehicles>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ul>
<xsl:apply-templates />
</ul>
</xsl:template>
<xsl:template match="truck">
<li>
<xsl:value-of select="@make"/>
<xsl:value-of select="@model"/>
</li>
</xsl:template>
</xsl:stylesheet>
<Employees>
<Row FirstName="John" LastName="Doe" Email="john@doe.com" URLToPhoto="http://placehold.it/75x75" Department="Accounting"/>
<Row FirstName="Jane" LastName="Smith" Email="jane@smith.com" URLToPhoto="http://placehold.it/75x75" Department="Accounting"/>
<Row FirstName="Jack" LastName="Anderson" Email="jack@andersoncorp.com" URLToPhoto="http://placehold.it/75x75" Department="Sales"/>
<Row FirstName="Joe" LastName="Miller" Email="joe@millerinc.com" URLToPhoto="http://placehold.it/75x75" Department="Sales"/>
<Row FirstName="Jim" LastName="Bo" Email="jim@boenterprises.com" URLToPhoto="http://placehold.it/75x75" Department="IT"/>
</Employees>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ul class="peopledirectory">
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="Row">
<li>
<h2>
<xsl:value-of select="@LastName"/>,
<xsl:value-of select="@FirstName"/>
</h2>
<img alt="Photo of {@FirstName} {@LastName}" src="{@URLToPhoto}" title="Photo of {@FirstName} {@LastName}"/>
<a href="mailto:{@Email}">
<xsl:value-of select="@Email"/>
</a>
<p>Department:
<xsl:value-of select="@Department"/>
</p>
</li>
</xsl:template>
</xsl:stylesheet>
<!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css"
rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js">
</script>
<meta charset=utf-8 />
<title>
SharePoint Experience
</title>
</head>
<body>
<div id="tabs">
<ul>
<li>
<a href="#tabs-1">Accounting</a>
</li>
<li>
<a href="#tabs-2">Sales</a>
</li>
<li>
<a href="#tabs-3">IT</a>
</li>
</ul>
<div id="tabs-1">
<ul class="peopledirectory">
<li>
<h2>
Doe, John
</h2>
<img src="http://placehold.it/75x75" alt="Photo of John Doe" title="Photo of John Doe"
/>
<a href="mailto:john@doe.com">john@doe.com</a>
<p>
Department: Accounting
</p>
</li>
<li>
<h2>
Smith, Jane
</h2>
<img src="http://placehold.it/75x75" alt="Photo of Jane Smith" title="Photo of Jane Smith"
/>
<a href="mailto:jane@smith.com">jane@smith.com</a>
<p>
Department: Accounting
</p>
</li>
</ul>
</div>
<div id="tabs-2">
<ul class="peopledirectory">
<li>
<h2>
Anderson, Jack
</h2>
<img src="http://placehold.it/75x75" alt="Photo of Jack Anderson" title="Photo of Jack Anderson"
/>
<a href="mailto:jack@andersoncorp.com">jack@andersoncorp.com</a>
<p>
Department: Sales
</p>
</li>
<li>
<h2>
Miller, Joe
</h2>
<img src="http://placehold.it/75x75" alt="Photo of Joe Miller" title="Photo of Joe Miller"
/>
<a href="mailto:joe@millerinc.com">joe@millerinc.com</a>
<p>
Department: Sales
</p>
</li>
</ul>
</div>
<div id="tabs-3">
<ul class="peopledirectory">
<li>
<h2>
Bo, Jim
</h2>
<img src="http://placehold.it/75x75" alt="Photo of Jim Bo" title="Photo of Jim Bo"
/>
<a href="mailto:jim@boenterprises.com">jim@boenterprises.com</a>
<p>
Department: IT
</p>
</li>
</ul>
</div>
</div>
</body>
</html>

Objects

Properties

* Color
* Smell
* Make
* Model
* WheelCondition(0-5)
* BodyType
* EngineDisplacement
* EngineCylinders
* FuelLevel
* LowFuelLamp
* Cleanliness
* BodyCondition
* TirePressure
* Velocity['speed|direction']
* Location['lat|long|alt']
* NumPassengers

Methods

* Wash()
* TuneUp(serviceType) - one of OilChange, SparkPlugChange, TransFluidChange
* ChangeIgnitionStatus(status) - one of off, acc, on, start
* Accelerate(speed,direction) - speed can be negative
* ShiftGears(gear)
* Refuel(fuelAmount)
* WindowChange(window,height)
* Wiper(placement,speed)
* LightingToggle(light)
* Crash()
* CallOnstar()

Events

* MIL (check engine light)
* FuelWarning
* DoorAjar(e.door)
* Crash
* AirbagsDeployed
* MaintenanceIndicator

Inheritance

* Genes passed down to descendants
* e.g. Opacity, position context, font-size

Propagation

* Events are propagated to ancestors
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- This XSL Stylesheet created by SharePoint Experts, Inc. -->
<!-- http://sharepointexperience.com -->
<xsl:output method="html" indent="yes"/>
<!-- This template is the "wrapper" or "container" for the custom view. -->
<xsl:template match="/">
<!-- This is the actual wrapper element that will be emitted -->
<div>
<!-- This will tell the data view to look for the actual content
and come back when it's done. -->
<xsl:apply-templates/>
</div>
<!-- end wrapper -->
</xsl:template>
<xsl:template match="/dsQueryResponse/Rows/Row">
<!-- This markup is used for each item in the list -->
<p><xsl:value-of select="@Title"/></p>
</xsl:template>
</xsl:stylesheet>
@spdustin
Copy link
Author

Note: In a commit I made Wednesday during our lunch break, I changed the "Text" attribute in the NavLinks sample to "Title". A second follow-up commit updated the previous XSL sample that depended on that XML file to use the correct attribute in its templates. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment