Skip to content
Browse files

Sample updates/additions

  • Loading branch information...
1 parent 2f6a24d commit b32f43d78be45b5d692f3a4bf12ba3d28ed6324f @nikhilk committed Sep 8, 2012
View
3 samples/AroundMe/AroundMeTests/AroundMeTests.csproj
@@ -33,8 +33,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="ScriptSharp.Testing, Version=0.7.0.0, Culture=neutral, PublicKeyToken=8fc0e3af5abcb6c4, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
+ <Reference Include="ScriptSharp.Testing">
<HintPath>..\packages\ScriptSharp.Testing.0.7.5.0\lib\ScriptSharp.Testing.dll</HintPath>
</Reference>
<Reference Include="System" />
View
3 samples/Photos/PhotoListTests/PhotoListTests.csproj
@@ -32,8 +32,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="ScriptSharp.Testing, Version=0.7.0.0, Culture=neutral, PublicKeyToken=8fc0e3af5abcb6c4, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
+ <Reference Include="ScriptSharp.Testing">
<HintPath>..\packages\ScriptSharp.Testing.0.7.5.0\lib\ScriptSharp.Testing.dll</HintPath>
</Reference>
<Reference Include="System" />
View
67 samples/Photos/PhotoTiles/PhotoTiles.csproj
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{2F542547-7B1D-4C43-AF1F-092AEE556FC2}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>PhotoTiles</RootNamespace>
+ <AssemblyName>PhotoTiles</AssemblyName>
+ <ScriptTemplate>Properties\Script.template</ScriptTemplate>
+ <CodeAnalysisRuleSet>Properties\FxCop.ruleset</CodeAnalysisRuleSet>
+ <GenerateScript>True</GenerateScript>
+ <GenerateResources>True</GenerateResources>
+ <DeploymentPath>..\PhotosWeb\Scripts</DeploymentPath>
+ <RestoreNugetPackages>true</RestoreNugetPackages>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;CODE_ANALYSIS;SCRIPTSHARP</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>0028, 1591, 1684</NoWarn>
+ <DocumentationFile>bin\Debug\PhotoTiles.xml</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>CODE_ANALYSIS;SCRIPTSHARP</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <NoWarn>0028, 1591, 1684</NoWarn>
+ <DocumentationFile>bin\Release\PhotoTiles.xml</DocumentationFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ <None Include="Properties\FxCop.ruleset" />
+ <None Include="Properties\Script.template" />
+ <Compile Include="PhotoTilesPage.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Reference Include="Script.jQuery">
+ <HintPath>..\packages\ScriptSharp.Lib.jQuery.0.7.5.0\lib\Script.jQuery.dll</HintPath>
+ </Reference>
+ <Reference Include="Script.jQuery.Templating">
+ <HintPath>..\packages\ScriptSharp.Lib.jQuery.Templating.0.7.5.0\lib\Script.jQuery.Templating.dll</HintPath>
+ </Reference>
+ <Reference Include="Script.Web">
+ <HintPath>..\packages\ScriptSharp.Lib.HTML.0.7.5.0\lib\Script.Web.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Photos\Photos.csproj">
+ <Project>{336cc726-e62d-484b-a15e-3e70a676d989}</Project>
+ <Name>Photos</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Plugins\Plugins.csproj">
+ <Project>{a441a116-8f91-4fbc-8420-d21c98283bd3}</Project>
+ <Name>Plugins</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="..\packages\ScriptSharp.0.7.5.0\tools\ScriptSharp.targets" Condition="Exists('..\packages\ScriptSharp.0.7.5.0\tools\ScriptSharp.targets')" />
+ <Import Project="..\packages\nuget.targets" />
+</Project>
View
81 samples/Photos/PhotoTiles/PhotoTilesPage.cs
@@ -0,0 +1,81 @@
+// PhotoTilesPage.cs
+//
+
+using System;
+using System.Collections.Generic;
+using System.Html;
+using System.Runtime.CompilerServices;
+using jQueryApi;
+using jQueryApi.Templating;
+using jQueryApi.Gridster;
+using jQueryApi.LightBox;
+using Photos;
+
+namespace PhotoGrid {
+
+ [GlobalMethods]
+ internal static class PhotoTilesPage {
+
+ static PhotoTilesPage() {
+ jQuery.OnDocumentReady(delegate() {
+ string apiKey = (string)jQuery.FromElement(Document.Body).GetDataValue("flickrKey");
+ IPhotoService flickrService = new FlickrPhotoService();
+
+ jQuery.Select("#searchButton").Click(delegate(jQueryEvent e) {
+ string tags = jQuery.Select("#tagsTextBox").GetValue();
+
+ flickrService.SearchPhotos(tags, 20).Done(
+ delegate(IEnumerable<Photo> photos) {
+ jQueryObject thumbnailList = jQuery.Select("#thumbsList");
+ thumbnailList.Empty();
+
+ if (photos == null) {
+ return;
+ }
+
+ int photoIndex = 0;
+ foreach (Photo photo in photos) {
+ if (photoIndex % 6 == 0) {
+ jQuery.Select("#bigThumbnailTemplate").Plugin<jQueryTemplateObject>()
+ .RenderTemplate(photo)
+ .AppendTo(thumbnailList);
+ }
+ else if ((photoIndex % 3 == 0) || (photo.imageWidth == photo.imageHeight)) {
+ jQuery.Select("#sqThumbnailTemplate").Plugin<jQueryTemplateObject>()
+ .RenderTemplate(photo)
+ .AppendTo(thumbnailList);
+ }
+ else if (photo.thumbnailWidth > photo.thumbnailHeight) {
+ jQuery.Select("#horzThumbnailTemplate").Plugin<jQueryTemplateObject>()
+ .RenderTemplate(photo)
+ .AppendTo(thumbnailList);
+ }
+ else {
+ jQuery.Select("#vertThumbnailTemplate").Plugin<jQueryTemplateObject>()
+ .RenderTemplate(photo)
+ .AppendTo(thumbnailList);
+ }
+
+ photoIndex++;
+ }
+
+ GridsterOptions gridOptions = new GridsterOptions();
+ gridOptions.Margins = new int[] { 10, 10 };
+ gridOptions.BaseDimensions = new int[] { 140, 140 };
+
+ thumbnailList.Plugin<jQueryGridsterObject>().Gridster(gridOptions)
+ .Find("a")
+ .Plugin<jQueryLightBoxObject>().LightBox();
+
+ GridsterObject gridster =
+ (GridsterObject)thumbnailList.GetDataValue("gridster");
+ gridster.DisableDragging();
+ });
+
+ jQuery.FromElement(Document.Body).Focus();
+ e.PreventDefault();
+ });
+ });
+ }
+ }
+}
View
22 samples/Photos/PhotoTiles/Properties/AssemblyInfo.cs
@@ -0,0 +1,22 @@
+// AssemblyInfo.cs
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("PhotoGrid")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Script# Samples")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly: ScriptAssembly("PhotoGrid")]
View
101 samples/Photos/PhotoTiles/Properties/FxCop.ruleset
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RuleSet Name="Script# Rules" Description="General Script Rules" ToolsVersion="10.0">
+ <Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
+ <Rule Id="CA1000" Action="Warning" />
+ <Rule Id="CA1001" Action="Warning" />
+ <Rule Id="CA1008" Action="Warning" />
+ <Rule Id="CA1009" Action="Warning" />
+ <Rule Id="CA1010" Action="Warning" />
+ <Rule Id="CA1011" Action="Warning" />
+ <Rule Id="CA1012" Action="Warning" />
+ <Rule Id="CA1013" Action="Warning" />
+ <Rule Id="CA1016" Action="Warning" />
+ <Rule Id="CA1018" Action="Warning" />
+ <Rule Id="CA1019" Action="Warning" />
+ <Rule Id="CA1020" Action="Warning" />
+ <Rule Id="CA1021" Action="Warning" />
+ <Rule Id="CA1023" Action="Warning" />
+ <Rule Id="CA1024" Action="Warning" />
+ <Rule Id="CA1026" Action="Warning" />
+ <Rule Id="CA1027" Action="Warning" />
+ <Rule Id="CA1028" Action="Warning" />
+ <Rule Id="CA1030" Action="Warning" />
+ <Rule Id="CA1032" Action="Warning" />
+ <Rule Id="CA1033" Action="Warning" />
+ <Rule Id="CA1034" Action="Warning" />
+ <Rule Id="CA1036" Action="Warning" />
+ <Rule Id="CA1040" Action="Warning" />
+ <Rule Id="CA1041" Action="Warning" />
+ <Rule Id="CA1043" Action="Warning" />
+ <Rule Id="CA1044" Action="Warning" />
+ <Rule Id="CA1045" Action="Warning" />
+ <Rule Id="CA1046" Action="Warning" />
+ <Rule Id="CA1047" Action="Warning" />
+ <Rule Id="CA1048" Action="Warning" />
+ <Rule Id="CA1052" Action="Warning" />
+ <Rule Id="CA1053" Action="Warning" />
+ <Rule Id="CA1058" Action="Warning" />
+ <Rule Id="CA1059" Action="Warning" />
+ <Rule Id="CA1061" Action="Warning" />
+ <Rule Id="CA1065" Action="Warning" />
+ <Rule Id="CA1500" Action="Warning" />
+ <Rule Id="CA1501" Action="Warning" />
+ <Rule Id="CA1502" Action="Warning" />
+ <Rule Id="CA1504" Action="Warning" />
+ <Rule Id="CA1505" Action="Warning" />
+ <Rule Id="CA1506" Action="Warning" />
+ <Rule Id="CA1700" Action="Warning" />
+ <Rule Id="CA1701" Action="Warning" />
+ <Rule Id="CA1702" Action="Warning" />
+ <Rule Id="CA1703" Action="Warning" />
+ <Rule Id="CA1704" Action="Warning" />
+ <Rule Id="CA1707" Action="Warning" />
+ <Rule Id="CA1708" Action="Warning" />
+ <Rule Id="CA1709" Action="Warning" />
+ <Rule Id="CA1710" Action="Warning" />
+ <Rule Id="CA1711" Action="Warning" />
+ <Rule Id="CA1712" Action="Warning" />
+ <Rule Id="CA1713" Action="Warning" />
+ <Rule Id="CA1714" Action="Warning" />
+ <Rule Id="CA1715" Action="Warning" />
+ <Rule Id="CA1716" Action="Warning" />
+ <Rule Id="CA1717" Action="Warning" />
+ <Rule Id="CA1719" Action="Warning" />
+ <Rule Id="CA1720" Action="Warning" />
+ <Rule Id="CA1721" Action="Warning" />
+ <Rule Id="CA1722" Action="Warning" />
+ <Rule Id="CA1724" Action="Warning" />
+ <Rule Id="CA1725" Action="Warning" />
+ <Rule Id="CA1726" Action="Warning" />
+ <Rule Id="CA1800" Action="Warning" />
+ <Rule Id="CA1801" Action="Warning" />
+ <Rule Id="CA1802" Action="Warning" />
+ <Rule Id="CA1804" Action="Warning" />
+ <Rule Id="CA1806" Action="Warning" />
+ <Rule Id="CA1809" Action="Warning" />
+ <Rule Id="CA1811" Action="Warning" />
+ <Rule Id="CA1812" Action="Warning" />
+ <Rule Id="CA1813" Action="Warning" />
+ <Rule Id="CA1814" Action="Warning" />
+ <Rule Id="CA1815" Action="Warning" />
+ <Rule Id="CA1819" Action="Warning" />
+ <Rule Id="CA1820" Action="Warning" />
+ <Rule Id="CA1821" Action="Warning" />
+ <Rule Id="CA2201" Action="Warning" />
+ <Rule Id="CA2202" Action="Warning" />
+ <Rule Id="CA2204" Action="Warning" />
+ <Rule Id="CA2207" Action="Warning" />
+ <Rule Id="CA2213" Action="Warning" />
+ <Rule Id="CA2214" Action="Warning" />
+ <Rule Id="CA2215" Action="Warning" />
+ <Rule Id="CA2217" Action="Warning" />
+ <Rule Id="CA2218" Action="Warning" />
+ <Rule Id="CA2219" Action="Warning" />
+ <Rule Id="CA2222" Action="Warning" />
+ <Rule Id="CA2223" Action="Warning" />
+ <Rule Id="CA2224" Action="Warning" />
+ <Rule Id="CA2226" Action="Warning" />
+ <Rule Id="CA2227" Action="Warning" />
+ <Rule Id="CA2233" Action="Warning" />
+ </Rules>
+</RuleSet>
View
8 samples/Photos/PhotoTiles/Properties/Script.template
@@ -0,0 +1,8 @@
+//! #= ScriptFile ##
+//
+
+(function($) {
+#include[as-is] "%code%"
+})(jQuery);
+
+//! This script was generated using Script# v#= CompilerVersion ##
View
7 samples/Photos/PhotoTiles/packages.config
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="ScriptSharp" version="0.7.5.0" targetFramework="net40" />
+ <package id="ScriptSharp.Lib.HTML" version="0.7.5.0" targetFramework="net40" />
+ <package id="ScriptSharp.Lib.jQuery" version="0.7.5.0" targetFramework="net40" />
+ <package id="ScriptSharp.Lib.jQuery.Templating" version="0.7.5.0" targetFramework="net40" />
+</packages>
View
30 samples/Photos/Photos.sln
@@ -18,36 +18,42 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
PhotoListTests.testsettings = PhotoListTests.testsettings
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PhotoTiles", "PhotoTiles\PhotoTiles.csproj", "{2F542547-7B1D-4C43-AF1F-092AEE556FC2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {2F542546-7B1D-4C43-AF1F-092AEE556FC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2F542546-7B1D-4C43-AF1F-092AEE556FC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2F542546-7B1D-4C43-AF1F-092AEE556FC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2F542546-7B1D-4C43-AF1F-092AEE556FC2}.Release|Any CPU.Build.0 = Release|Any CPU
{336CC726-E62D-484B-A15E-3E70A676D989}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{336CC726-E62D-484B-A15E-3E70A676D989}.Debug|Any CPU.Build.0 = Debug|Any CPU
{336CC726-E62D-484B-A15E-3E70A676D989}.Release|Any CPU.ActiveCfg = Release|Any CPU
{336CC726-E62D-484B-A15E-3E70A676D989}.Release|Any CPU.Build.0 = Release|Any CPU
- {99344CB4-B164-4635-8795-D44E53357EE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {99344CB4-B164-4635-8795-D44E53357EE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {99344CB4-B164-4635-8795-D44E53357EE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {99344CB4-B164-4635-8795-D44E53357EE8}.Release|Any CPU.Build.0 = Release|Any CPU
{A441A116-8F91-4FBC-8420-D21C98283BD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A441A116-8F91-4FBC-8420-D21C98283BD3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A441A116-8F91-4FBC-8420-D21C98283BD3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A441A116-8F91-4FBC-8420-D21C98283BD3}.Release|Any CPU.Build.0 = Release|Any CPU
- {D1A2D374-10B7-45A6-A699-AFDE6AD62150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D1A2D374-10B7-45A6-A699-AFDE6AD62150}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D1A2D374-10B7-45A6-A699-AFDE6AD62150}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D1A2D374-10B7-45A6-A699-AFDE6AD62150}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2F542546-7B1D-4C43-AF1F-092AEE556FC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2F542546-7B1D-4C43-AF1F-092AEE556FC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2F542546-7B1D-4C43-AF1F-092AEE556FC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2F542546-7B1D-4C43-AF1F-092AEE556FC2}.Release|Any CPU.Build.0 = Release|Any CPU
{D4DF1CC1-C044-4C90-AB09-9744E9ACFCC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D4DF1CC1-C044-4C90-AB09-9744E9ACFCC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4DF1CC1-C044-4C90-AB09-9744E9ACFCC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4DF1CC1-C044-4C90-AB09-9744E9ACFCC9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D1A2D374-10B7-45A6-A699-AFDE6AD62150}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D1A2D374-10B7-45A6-A699-AFDE6AD62150}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D1A2D374-10B7-45A6-A699-AFDE6AD62150}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D1A2D374-10B7-45A6-A699-AFDE6AD62150}.Release|Any CPU.Build.0 = Release|Any CPU
+ {99344CB4-B164-4635-8795-D44E53357EE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {99344CB4-B164-4635-8795-D44E53357EE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {99344CB4-B164-4635-8795-D44E53357EE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {99344CB4-B164-4635-8795-D44E53357EE8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2F542547-7B1D-4C43-AF1F-092AEE556FC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2F542547-7B1D-4C43-AF1F-092AEE556FC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2F542547-7B1D-4C43-AF1F-092AEE556FC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2F542547-7B1D-4C43-AF1F-092AEE556FC2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
3 samples/Photos/Photos/FlickrPhotoService.cs
@@ -49,7 +49,8 @@ public sealed class FlickrPhotoService : IPhotoService {
Int32.Parse(photoResult.Width_m),
Int32.Parse(photoResult.Height_m),
Int32.Parse(photoResult.Width_t),
- Int32.Parse(photoResult.Height_t));
+ Int32.Parse(photoResult.Height_t),
+ photoResult.Url_sq);
});
return photos;
View
4 samples/Photos/Photos/Photo.cs
@@ -17,14 +17,15 @@ public sealed class Photo : Record {
public string url;
public string thumbnailUrl;
public string imageUrl;
+ public string squareImageUrl;
public int imageWidth;
public int imageHeight;
public int thumbnailWidth;
public int thumbnailHeight;
- public Photo(string id, string title, string url, string imageUrl, string thumbnailUrl, int imageWidth, int imageHeight, int thumbnailWidth, int thumbnailHeight) {
+ public Photo(string id, string title, string url, string imageUrl, string thumbnailUrl, int imageWidth, int imageHeight, int thumbnailWidth, int thumbnailHeight, string squareImageUrl) {
this.id = id;
this.title = title;
this.url = url;
@@ -34,6 +35,7 @@ public sealed class Photo : Record {
this.thumbnailWidth = thumbnailWidth;
this.thumbnailHeight = thumbnailHeight;
this.thumbnailUrl = thumbnailUrl;
+ this.squareImageUrl = squareImageUrl;
}
}
}
View
64 samples/Photos/PhotosWeb/Content/jquery.gridster.css
@@ -0,0 +1,64 @@
+/*! gridster.js - v0.1.0 - 2012-08-20
+* http://gridster.net/
+* Copyright (c) 2012 ducksboard; Licensed MIT */
+
+.gridster {
+ position:relative;
+}
+
+.gridster > * {
+ margin: 0 auto;
+ -webkit-transition: height .4s;
+ -moz-transition: height .4s;
+ -o-transition: height .4s;
+ -ms-transition: height .4s;
+ transition: height .4s;
+}
+
+.gridster .gs_w{
+ z-index: 2;
+ position: absolute;
+}
+
+.ready .gs_w:not(.preview-holder) {
+ -webkit-transition: opacity .3s, left .3s, top .3s;
+ -moz-transition: opacity .3s, left .3s, top .3s;
+ -o-transition: opacity .3s, left .3s, top .3s;
+ transition: opacity .3s, left .3s, top .3s;
+}
+
+.ready .gs_w:not(.preview-holder) {
+ -webkit-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
+ -moz-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
+ -o-transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
+ transition: opacity .3s, left .3s, top .3s, width .3s, height .3s;
+}
+
+.gridster .preview-holder {
+ z-index: 1;
+ position: absolute;
+ background-color: #fff;
+ border-color: #fff;
+ opacity: 0.3;
+}
+
+.gridster .player-revert {
+ z-index: 10!important;
+ -webkit-transition: left .3s, top .3s!important;
+ -moz-transition: left .3s, top .3s!important;
+ -o-transition: left .3s, top .3s!important;
+ transition: left .3s, top .3s!important;
+}
+
+.gridster .dragging {
+ z-index: 10!important;
+ -webkit-transition: all 0s !important;
+ -moz-transition: all 0s !important;
+ -o-transition: all 0s !important;
+ transition: all 0s !important;
+}
+
+/* Uncomment this if you set helper : "clone" in draggable options */
+/*.gridster .player {
+ opacity:0;
+}*/
View
61 samples/Photos/PhotosWeb/PhotoTiles.htm
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Photo Tiles</title>
+ <style type="text/css">
+ body { background-color: white; text-align: center; }
+ input, button { font-family: Segoe UI; font-size: 11pt; }
+ #searchForm, #thumbsList { margin-bottom: 10px; }
+ #thumbsList { font-size: 0pt; }
+ #thumbsList li { display: inline-block; background: white; box-sizing: border-box; margin: 10px; }
+ #thumbsList li a { text-decoration: none; background-size: cover; background-repeat: no-repeat; background-position: center center; display: inline-block; box-shadow: 0 0 15px #888; }
+ #thumbsList li img { display: none; }
+ </style>
+ <link rel="stylesheet" type="text/css" href="/Content/jquery.lightbox-0.5.css" />
+ <link rel="stylesheet" type="text/css" href="/Content/jquery.gridster.css" />
+</head>
+<body data-flickr-key="be9b6f66bd7a1c0c0f1465a1b7e8a764">
+ <form id="searchForm">
+ <input type="search" id="tagsTextBox" size="40" placeholder="search for interestingness" />
+ <button type="submit" id="searchButton">Search</button><br />
+ </form>
+ <div id="photoTiles">
+ <ul id="thumbsList"></ul>
+ </div>
+ <script type="text/html" id="bigThumbnailTemplate">
+ <li data-sizex="2" data-sizey="2" data-row="1" data-col="1">
+ <a href="${imageUrl}" title="${title}" style="width: 280px; height: 280px; background-image: url(${imageUrl})">
+ <img src="${imageUrl}" title="${title}" />
+ </a>
+ </li>
+ </script>
+ <script type="text/html" id="sqThumbnailTemplate">
+ <li data-sizex="1" data-sizey="1" data-row="1" data-col="1">
+ <a href="${imageUrl}" title="${title}" style="width: 140px; height: 140px; background-image: url(${imageUrl})">
+ <img src="${imageUrl}" title="${title}" />
+ </a>
+ </li>
+ </script>
+ <script type="text/html" id="horzThumbnailTemplate">
+ <li data-sizex="2" data-sizey="1" data-row="1" data-col="1">
+ <a href="${imageUrl}" title="${title}" style="width: 280px; height: 140px; background-image: url(${imageUrl})">
+ <img src="${imageUrl}" title="${title}" />
+ </a>
+ </li>
+ </script>
+ <script type="text/html" id="vertThumbnailTemplate">
+ <li data-sizex="1" data-sizey="2" data-row="1" data-col="1">
+ <a href="${imageUrl}" title="${title}" style="width: 140px; height: 280px; background-image: url(${imageUrl})">
+ <img src="${imageUrl}" title="${title}" />
+ </a>
+ </li>
+ </script>
+ <script type="text/javascript" src="/Scripts/mscorlib.debug.js"></script>
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
+ <script type="text/javascript" src="/Scripts/jquery.tmpl.js"></script>
+ <script type="text/javascript" src="/Scripts/jquery.lightbox-0.5.js"></script>
+ <script type="text/javascript" src="/Scripts/jquery.gridster.js"></script>
+ <script type="text/javascript" src="/Scripts/Photos.debug.js"></script>
+ <script type="text/javascript" src="/Scripts/PhotoTiles.debug.js"></script>
+</body>
+</html>
View
3 samples/Photos/PhotosWeb/PhotosWeb.csproj
@@ -60,10 +60,13 @@
<Content Include="Content\Images\lightbox-btn-next.gif" />
<Content Include="Content\Images\lightbox-btn-prev.gif" />
<Content Include="Content\Images\lightbox-ico-loading.gif" />
+ <Content Include="Content\jquery.gridster.css" />
<Content Include="Content\jquery.lightbox-0.5.css" />
+ <Content Include="PhotoTiles.htm" />
<Content Include="PhotoGrid.htm" />
<Content Include="PhotoList.htm" />
<Content Include="Scripts\jquery.bbq.js" />
+ <Content Include="Scripts\jquery.gridster.js" />
<Content Include="Scripts\jquery.isotope.min.js" />
<Content Include="Scripts\jquery.lightbox-0.5.js" />
<Content Include="Scripts\jquery.tmpl.js" />
View
3,148 samples/Photos/PhotosWeb/Scripts/jquery.gridster.js
3,148 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
203 samples/Photos/Plugins/Gridster.cs
@@ -0,0 +1,203 @@
+// Isotope.cs
+//
+
+using System;
+using System.Html;
+using System.Runtime.CompilerServices;
+using jQueryApi;
+
+namespace jQueryApi.Gridster {
+
+ [Imported]
+ [IgnoreNamespace]
+ [ScriptName("Object")]
+ public sealed class GridsterCollision {
+ }
+
+ [Imported]
+ [IgnoreNamespace]
+ [ScriptName("Object")]
+ public sealed class GridsterDraggable {
+ }
+
+ [Imported]
+ [IgnoreNamespace]
+ [ScriptName("Object")]
+ public sealed class GridsterCoordinates {
+
+ [ScriptName("col")]
+ [IntrinsicProperty]
+ public int Column {
+ get;
+ set;
+ }
+
+ [IntrinsicProperty]
+ public int Row {
+ get;
+ set;
+ }
+
+ [ScriptName("size_x")]
+ [IntrinsicProperty]
+ public int SizeX {
+ get;
+ set;
+ }
+
+ [ScriptName("size_y")]
+ [IntrinsicProperty]
+ public int SizeY {
+ get;
+ set;
+ }
+ }
+
+ [Imported]
+ [IgnoreNamespace]
+ public delegate object GridsterSerializationCallback(jQueryObject widget, GridsterCoordinates coords);
+
+ [Imported]
+ [IgnoreNamespace]
+ [ScriptName("Object")]
+ public sealed class GridsterOptions {
+
+ public GridsterOptions() {
+ }
+
+ public GridsterOptions(params object[] nameValuePairs) {
+ }
+
+ [ScriptName("autogenerate_stylesheet")]
+ [IntrinsicProperty]
+ public bool AutoGenerateStyleSheet {
+ get;
+ set;
+ }
+
+ [ScriptName("avoid_overlapped_widgets")]
+ [IntrinsicProperty]
+ public bool AvoidOverlapping {
+ get;
+ set;
+ }
+
+ [ScriptName("widget_base_dimensions")]
+ [IntrinsicProperty]
+ public int[] BaseDimensions {
+ get;
+ set;
+ }
+
+ [IntrinsicProperty]
+ public GridsterCollision Collision {
+ get;
+ set;
+ }
+
+ [IntrinsicProperty]
+ public GridsterDraggable Draggable {
+ get;
+ set;
+ }
+
+ [ScriptName("extra_cols")]
+ [IntrinsicProperty]
+ public int ExtraColumns {
+ get;
+ set;
+ }
+
+ [ScriptName("extra_rows")]
+ [IntrinsicProperty]
+ public int ExtraRows {
+ get;
+ set;
+ }
+
+ [ScriptName("widget_margins")]
+ [IntrinsicProperty]
+ public int[] Margins {
+ get;
+ set;
+ }
+
+ [ScriptName("max_size_x")]
+ [IntrinsicProperty]
+ public int MaximumColumnSpan {
+ get;
+ set;
+ }
+
+ [ScriptName("max_size_y")]
+ [IntrinsicProperty]
+ public int MaximumRowSpan {
+ get;
+ set;
+ }
+
+ [ScriptName("min_cols")]
+ [IntrinsicProperty]
+ public int MinimumColumns {
+ get;
+ set;
+ }
+
+ [ScriptName("min_rows")]
+ [IntrinsicProperty]
+ public int MinimumRows {
+ get;
+ set;
+ }
+
+ [ScriptName("widget_selector")]
+ [IntrinsicProperty]
+ public string Selector {
+ get;
+ set;
+ }
+
+ [ScriptName("serialize_params")]
+ [IntrinsicProperty]
+ public GridsterSerializationCallback SerializationCallback {
+ get;
+ set;
+ }
+ }
+
+ [Imported]
+ [IgnoreNamespace]
+ public sealed class GridsterObject {
+
+ private GridsterObject() {
+ }
+
+ // TODO: Define methods...
+
+ [ScriptName("disable")]
+ public GridsterObject DisableDragging() {
+ return null;
+ }
+
+ [ScriptName("enable")]
+ public GridsterObject EnableDragging() {
+ return null;
+ }
+ }
+
+ [Imported]
+ [IgnoreNamespace]
+ public sealed class jQueryGridsterObject : jQueryObject {
+
+ private jQueryGridsterObject() {
+ }
+
+ public jQueryObject Gridster() {
+ return null;
+ }
+
+ public jQueryObject Gridster(GridsterOptions options) {
+ return null;
+ }
+ }
+}
View
1 samples/Photos/Plugins/Plugins.csproj
@@ -32,6 +32,7 @@
</PropertyGroup>
<ItemGroup>
<ScriptInfo Include="Properties\ScriptInfo.txt" />
+ <Compile Include="Gridster.cs" />
<Compile Include="Isotope.cs" />
<Compile Include="LightBox.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
View
1 samples/Photos/packages/repositories.config
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
+ <repository path="..\PhotoTiles\packages.config" />
<repository path="..\PhotoGrid\packages.config" />
<repository path="..\PhotoList\packages.config" />
<repository path="..\PhotoListTests\packages.config" />

0 comments on commit b32f43d

Please sign in to comment.
Something went wrong with that request. Please try again.