Permalink
Browse files

Add Javascript Lib and QUnit Test Files

  • Loading branch information...
NicholasMurray committed Sep 18, 2012
1 parent add57cb commit ee1dfb2c1eb3f3a9dfab6a12bdfd51c205ce9d28
Showing with 29,690 additions and 27,052 deletions.
  1. +2 −0 CodeCamper.Model/SessionBrief.cs
  2. +58 −11 CodeCamper.Web/App_Start/RouteConfig.cs
  3. +104 −30 CodeCamper.Web/CodeCamper.Web.csproj
  4. +225 −0 CodeCamper.Web/Content/qunit.css
  5. BIN CodeCamper.Web/Scripts/_references.js
  6. +23 −0 CodeCamper.Web/Scripts/app/binder.js
  7. +21 −0 CodeCamper.Web/Scripts/app/bootstrapper.js
  8. +109 −0 CodeCamper.Web/Scripts/app/config.js
  9. +370 −0 CodeCamper.Web/Scripts/app/datacontext.js
  10. +95 −0 CodeCamper.Web/Scripts/app/datacontext.speaker-sessions.js
  11. +63 −0 CodeCamper.Web/Scripts/app/dataprimer.js
  12. +95 −0 CodeCamper.Web/Scripts/app/dataservice.attendance.js
  13. +15 −0 CodeCamper.Web/Scripts/app/dataservice.js
  14. +76 −0 CodeCamper.Web/Scripts/app/dataservice.lookup.js
  15. +80 −0 CodeCamper.Web/Scripts/app/dataservice.person.js
  16. +79 −0 CodeCamper.Web/Scripts/app/dataservice.session.js
  17. +42 −0 CodeCamper.Web/Scripts/app/event.delegates.js
  18. +83 −0 CodeCamper.Web/Scripts/app/filter.sessions.js
  19. +35 −0 CodeCamper.Web/Scripts/app/filter.speakers.js
  20. +44 −0 CodeCamper.Web/Scripts/app/group.js
  21. +143 −0 CodeCamper.Web/Scripts/app/ko.bindingHandlers.js
  22. +22 −0 CodeCamper.Web/Scripts/app/ko.debug.helpers.js
  23. +27 −0 CodeCamper.Web/Scripts/app/messenger.js
  24. +20 −0 CodeCamper.Web/Scripts/app/mock/mock.dataservice.attendance.js
  25. +33 −0 CodeCamper.Web/Scripts/app/mock/mock.dataservice.lookup.js
  26. +27 −0 CodeCamper.Web/Scripts/app/mock/mock.dataservice.person.js
  27. +27 −0 CodeCamper.Web/Scripts/app/mock/mock.dataservice.session.js
  28. +138 −0 CodeCamper.Web/Scripts/app/mock/mock.generator.js
  29. +23 −0 CodeCamper.Web/Scripts/app/mock/mock.js
  30. +70 −0 CodeCamper.Web/Scripts/app/model.attendance.js
  31. +30 −0 CodeCamper.Web/Scripts/app/model.js
  32. +91 −0 CodeCamper.Web/Scripts/app/model.mapper.js
  33. +99 −0 CodeCamper.Web/Scripts/app/model.person.js
  34. +16 −0 CodeCamper.Web/Scripts/app/model.room.js
  35. +140 −0 CodeCamper.Web/Scripts/app/model.session.js
  36. +32 −0 CodeCamper.Web/Scripts/app/model.timeslot.js
  37. +16 −0 CodeCamper.Web/Scripts/app/model.track.js
  38. +77 −0 CodeCamper.Web/Scripts/app/presenter.js
  39. +88 −0 CodeCamper.Web/Scripts/app/route-config.js
  40. +38 −0 CodeCamper.Web/Scripts/app/route-mediator.js
  41. +119 −0 CodeCamper.Web/Scripts/app/router.js
  42. +40 −0 CodeCamper.Web/Scripts/app/sort.js
  43. +24 −0 CodeCamper.Web/Scripts/app/store.js
  44. +83 −0 CodeCamper.Web/Scripts/app/utils.js
  45. +156 −0 CodeCamper.Web/Scripts/app/vm.favorites.js
  46. +19 −0 CodeCamper.Web/Scripts/app/vm.js
  47. +198 −0 CodeCamper.Web/Scripts/app/vm.session.js
  48. +161 −0 CodeCamper.Web/Scripts/app/vm.sessions.js
  49. +24 −0 CodeCamper.Web/Scripts/app/vm.shell.js
  50. +108 −0 CodeCamper.Web/Scripts/app/vm.speaker.js
  51. +78 −0 CodeCamper.Web/Scripts/app/vm.speakers.js
  52. +0 −2,494 CodeCamper.Web/Scripts/jquery-1.8.1.intellisense.js
  53. +0 −2 CodeCamper.Web/Scripts/jquery-1.8.1.min.js
  54. +0 −12,515 CodeCamper.Web/Scripts/jquery-ui-1.8.11.js
  55. +0 −1,682 CodeCamper.Web/Scripts/jquery-ui-1.8.11.min.js
  56. +0 −163 CodeCamper.Web/Scripts/jquery.unobtrusive-ajax.js
  57. +0 −5 CodeCamper.Web/Scripts/jquery.unobtrusive-ajax.min.js
  58. +0 −1,323 CodeCamper.Web/Scripts/jquery.validate-vsdoc.js
  59. +0 −1,194 CodeCamper.Web/Scripts/jquery.validate.js
  60. +0 −79 CodeCamper.Web/Scripts/jquery.validate.min.js
  61. +0 −345 CodeCamper.Web/Scripts/jquery.validate.unobtrusive.js
  62. +0 −5 CodeCamper.Web/Scripts/jquery.validate.unobtrusive.min.js
  63. +0 −3,443 CodeCamper.Web/Scripts/knockout-2.1.0.debug.js
  64. +27 −0 CodeCamper.Web/Scripts/lib/TrafficCop.js
  65. +102 −0 CodeCamper.Web/Scripts/lib/amplify.core.js
  66. +384 −0 CodeCamper.Web/Scripts/lib/amplify.request.js
  67. +304 −0 CodeCamper.Web/Scripts/lib/amplify.store.js
  68. +188 −0 CodeCamper.Web/Scripts/lib/infuser.js
  69. +7,223 −0 CodeCamper.Web/Scripts/lib/jquery-1.7.2-vsdoc.js
  70. +3,522 −3,419 CodeCamper.Web/Scripts/{jquery-1.8.1.js → lib/jquery-1.7.2.js}
  71. +4 −0 CodeCamper.Web/Scripts/lib/jquery-1.7.2.min.js
  72. +234 −0 CodeCamper.Web/Scripts/lib/jquery.mockjson.js
  73. +487 −0 CodeCamper.Web/Scripts/lib/json2.js
  74. 0 CodeCamper.Web/Scripts/{ → lib}/knockout-2.1.0.js
  75. +381 −0 CodeCamper.Web/Scripts/lib/knockout.activity.js
  76. +65 −0 CodeCamper.Web/Scripts/lib/knockout.asyncCommand.js
  77. +59 −0 CodeCamper.Web/Scripts/lib/knockout.dirtyFlag.js
  78. +1,028 −0 CodeCamper.Web/Scripts/lib/knockout.validation.js
  79. +102 −0 CodeCamper.Web/Scripts/lib/koExternalTemplateEngine.js
  80. +446 −341 CodeCamper.Web/Scripts/{modernizr-2.0.6-development-only.js → lib/modernizr-2.5.3.js}
  81. +918 −0 CodeCamper.Web/Scripts/lib/moment.js
  82. +2,030 −0 CodeCamper.Web/Scripts/lib/require.js
  83. +1,828 −0 CodeCamper.Web/Scripts/lib/sammy.js
  84. +59 −0 CodeCamper.Web/Scripts/lib/sammy.title.js
  85. 0 CodeCamper.Web/Scripts/{ → lib}/toastr.js
  86. +1,072 −0 CodeCamper.Web/Scripts/lib/underscore.js
  87. +32 −0 CodeCamper.Web/Scripts/main.js
  88. +1,106 −0 CodeCamper.Web/Scripts/moment.js
  89. +6 −0 CodeCamper.Web/Scripts/moment.min.js
  90. +13 −0 CodeCamper.Web/Test/qunit/qunit-composite.css
  91. +102 −0 CodeCamper.Web/Test/qunit/qunit-composite.js
  92. +236 −0 CodeCamper.Web/Test/qunit/qunit.css
  93. +1,452 −0 CodeCamper.Web/Test/qunit/qunit.js
  94. +38 −0 CodeCamper.Web/Test/web api/qunit-utils.js
  95. +20 −0 CodeCamper.Web/Test/web api/webapi.attendance-cud.tests.html
  96. +186 −0 CodeCamper.Web/Test/web api/webapi.attendance-cud.tests.js
  97. +20 −0 CodeCamper.Web/Test/web api/webapi.endpoint.tests.html
  98. +71 −0 CodeCamper.Web/Test/web api/webapi.endpoint.tests.js
  99. +20 −0 CodeCamper.Web/Test/web api/webapi.get-result.tests.html
  100. +27 −0 CodeCamper.Web/Test/web api/webapi.get-result.tests.js
  101. +20 −0 CodeCamper.Web/Test/web api/webapi.person-cud.tests.html
  102. +123 −0 CodeCamper.Web/Test/web api/webapi.person-cud.tests.js
  103. +20 −0 CodeCamper.Web/Test/web api/webapi.session-cud-validation.tests.html
  104. +42 −0 CodeCamper.Web/Test/web api/webapi.session-cud-validation.tests.js
  105. +20 −0 CodeCamper.Web/Test/web api/webapi.session-cud.tests.html
  106. +176 −0 CodeCamper.Web/Test/web api/webapi.session-cud.tests.js
  107. +31 −0 CodeCamper.Web/Test/web api/webapi.testsuite.html
  108. +2 −1 CodeCamper.Web/Web.config
  109. +1 −0 CodeCamper.Web/packages.config
  110. BIN packages/QUnit-MVC.1.6.2.0/QUnit-MVC.1.6.2.0.nupkg
  111. +225 −0 packages/QUnit-MVC.1.6.2.0/content/Content/qunit.css
  112. +1,452 −0 packages/QUnit-MVC.1.6.2.0/content/Scripts/qunit.js
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -9,6 +10,7 @@ namespace CodeCamper.Model
public class SessionBrief
{
public int Id { get; set; }
+ [Required(ErrorMessage = "Title is required")]
public string Title { get; set; }
public string Code { get; set; }
public int SpeakerId { get; set; }
@@ -1,30 +1,77 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
-using System.Web.Http;
+using System.Web.Http;
using System.Web.Mvc;
using System.Web.Routing;
+// ReSharper disable RedundantArgumentName
+
namespace CodeCamper.Web
{
public class RouteConfig
{
+ public static string ControllerOnly = "ApiControllerOnly";
+ public static string ControllerAndId = "ApiControllerAndIntegerId";
+ public static string ControllerAction = "ApiControllerAction";
+
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
+ // This controller-per-type route is ideal for GetAll calls.
+ // It finds the method on the controller using WebAPI conventions
+ // The template has no parameters.
+ //
+ // ex: api/sessionbriefs
+ // ex: api/sessions
+ // ex: api/persons
+ routes.MapHttpRoute(
+ name: ControllerOnly,
+ routeTemplate: "api/{controller}"
+ );
+
+ // This is the default route that a "File | New MVC 4 " project creates.
+ // (I changed the name, removed the defaults, and added the constraints)
+ //
+ // This controller-per-type route lets us fetch a single resource by numeric id
+ // It finds the appropriate method GetById method
+ // on the controller using WebAPI conventions
+ // The {id} is not optional, must be an integer, and
+ // must match a method with a parameter named "id" (case insensitive)
+ //
+ // ex: api/sessions/1
+ // ex: api/persons/1
routes.MapHttpRoute(
- name: "DefaultApi",
+ name: ControllerAndId,
routeTemplate: "api/{controller}/{id}",
- defaults: new { id = RouteParameter.Optional }
+ defaults: null, //defaults: new { id = RouteParameter.Optional } //,
+ constraints: new { id = @"^\d+$" } // id must be all digits
);
- routes.MapRoute(
- name: "Default",
- url: "{controller}/{action}/{id}",
- defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
+ /********************************************************
+ * The integer id constraint is necessary to distinguish
+ * the {id} route above from the {action} route below.
+ * For example, the route above handles
+ * "api/sessions/1"
+ * whereas the route below handles
+ * "api/lookups/all"
+ ********************************************************/
+
+ // This RPC style route is great for lookups and custom calls
+ // It matches the {action} to a method on the controller
+ //
+ // ex: api/lookups/all
+ // ex: api/lookups/rooms
+ routes.MapHttpRoute(
+ name: ControllerAction,
+ routeTemplate: "api/{controller}/{action}"
);
+
+ //PAPA: Commented this out because we wont be using MVC views
+ //routes.MapRoute(
+ // name: "Default",
+ // url: "{controller}/{action}/{id}",
+ // defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
+ //);
+
}
}
}
@@ -133,14 +133,24 @@
<Compile Include="App_Start\NinjectDependencyScope.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\ValidationActionFilter.cs" />
+ <Compile Include="Controllers\ApiBaseController.cs" />
+ <Compile Include="Controllers\AttendanceController.cs" />
+ <Compile Include="Controllers\FavoritesController.cs" />
<Compile Include="Controllers\HomeController.cs" />
+ <Compile Include="Controllers\LookupsController.cs" />
+ <Compile Include="Controllers\PersonsController.cs" />
+ <Compile Include="Controllers\SessionBriefsController.cs" />
+ <Compile Include="Controllers\SessionsController.cs" />
+ <Compile Include="Controllers\SpeakersController.cs" />
<Compile Include="Controllers\ValuesController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
+ <Content Include="App_Data\CodeCamper.sdf" />
+ <Content Include="Content\qunit.css" />
<Content Include="Content\themes\base\images\ui-bg_flat_0_aaaaaa_40x100.png" />
<Content Include="Content\themes\base\images\ui-bg_flat_75_ffffff_40x100.png" />
<Content Include="Content\themes\base\images\ui-bg_glass_55_fbf9ee_1x400.png" />
@@ -172,34 +182,101 @@
<Content Include="Content\toastr.css" />
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
- <None Include="Scripts\jquery.validate-vsdoc.js" />
- <None Include="Scripts\jquery-1.8.1.intellisense.js">
- <DependentUpon>jquery-1.8.1.js</DependentUpon>
- </None>
- <Content Include="Scripts\jquery-1.8.1.js" />
- <Content Include="Scripts\jquery-1.8.1.min.js">
- <DependentUpon>jquery-1.8.1.js</DependentUpon>
+ <Content Include="Scripts\app\binder.js" />
+ <Content Include="Scripts\app\bootstrapper.js" />
+ <Content Include="Scripts\app\config.js" />
+ <Content Include="Scripts\app\datacontext.js" />
+ <Content Include="Scripts\app\datacontext.speaker-sessions.js" />
+ <Content Include="Scripts\app\dataprimer.js" />
+ <Content Include="Scripts\app\dataservice.attendance.js" />
+ <Content Include="Scripts\app\dataservice.js" />
+ <Content Include="Scripts\app\dataservice.lookup.js" />
+ <Content Include="Scripts\app\dataservice.person.js" />
+ <Content Include="Scripts\app\dataservice.session.js" />
+ <Content Include="Scripts\app\event.delegates.js" />
+ <Content Include="Scripts\app\filter.sessions.js" />
+ <Content Include="Scripts\app\filter.speakers.js" />
+ <Content Include="Scripts\app\group.js" />
+ <Content Include="Scripts\app\ko.bindingHandlers.js" />
+ <Content Include="Scripts\app\ko.debug.helpers.js" />
+ <Content Include="Scripts\app\messenger.js" />
+ <Content Include="Scripts\app\mock\mock.dataservice.attendance.js" />
+ <Content Include="Scripts\app\mock\mock.dataservice.lookup.js" />
+ <Content Include="Scripts\app\mock\mock.dataservice.person.js" />
+ <Content Include="Scripts\app\mock\mock.dataservice.session.js" />
+ <Content Include="Scripts\app\mock\mock.generator.js" />
+ <Content Include="Scripts\app\mock\mock.js" />
+ <Content Include="Scripts\app\model.attendance.js" />
+ <Content Include="Scripts\app\model.js" />
+ <Content Include="Scripts\app\model.mapper.js" />
+ <Content Include="Scripts\app\model.person.js" />
+ <Content Include="Scripts\app\model.room.js" />
+ <Content Include="Scripts\app\model.session.js" />
+ <Content Include="Scripts\app\model.timeslot.js" />
+ <Content Include="Scripts\app\model.track.js" />
+ <Content Include="Scripts\app\presenter.js" />
+ <Content Include="Scripts\app\route-config.js" />
+ <Content Include="Scripts\app\route-mediator.js" />
+ <Content Include="Scripts\app\router.js" />
+ <Content Include="Scripts\app\sort.js" />
+ <Content Include="Scripts\app\store.js" />
+ <Content Include="Scripts\app\utils.js" />
+ <Content Include="Scripts\app\vm.favorites.js" />
+ <Content Include="Scripts\app\vm.js" />
+ <Content Include="Scripts\app\vm.session.js" />
+ <Content Include="Scripts\app\vm.sessions.js" />
+ <Content Include="Scripts\app\vm.shell.js" />
+ <Content Include="Scripts\app\vm.speaker.js" />
+ <Content Include="Scripts\app\vm.speakers.js" />
+ <Content Include="Scripts\lib\amplify.core.js" />
+ <Content Include="Scripts\lib\amplify.request.js" />
+ <Content Include="Scripts\lib\amplify.store.js" />
+ <Content Include="Scripts\lib\infuser.js" />
+ <None Include="Scripts\lib\jquery-1.7.2-vsdoc.js" />
+ <Content Include="Scripts\lib\jquery-1.7.2.js" />
+ <Content Include="Scripts\lib\jquery-1.7.2.min.js">
+ <DependentUpon>jquery-1.7.2.js</DependentUpon>
</Content>
- <Content Include="Scripts\jquery-ui-1.8.11.js" />
- <Content Include="Scripts\jquery-ui-1.8.11.min.js">
- <DependentUpon>jquery-ui-1.8.11.js</DependentUpon>
+ <Content Include="Scripts\lib\jquery.mockjson.js" />
+ <Content Include="Scripts\lib\json2.js" />
+ <Content Include="Scripts\lib\knockout-2.1.0.js" />
+ <Content Include="Scripts\lib\knockout.activity.js" />
+ <Content Include="Scripts\lib\knockout.asyncCommand.js" />
+ <Content Include="Scripts\lib\knockout.dirtyFlag.js" />
+ <Content Include="Scripts\lib\knockout.validation.js" />
+ <Content Include="Scripts\lib\koExternalTemplateEngine.js" />
+ <Content Include="Scripts\lib\modernizr-2.5.3.js" />
+ <Content Include="Scripts\lib\moment.js" />
+ <Content Include="Scripts\lib\require.js" />
+ <Content Include="Scripts\lib\sammy.js" />
+ <Content Include="Scripts\lib\sammy.title.js" />
+ <Content Include="Scripts\lib\toastr.js" />
+ <Content Include="Scripts\lib\TrafficCop.js" />
+ <Content Include="Scripts\lib\underscore.js" />
+ <Content Include="Scripts\main.js" />
+ <Content Include="Scripts\moment.js" />
+ <Content Include="Scripts\moment.min.js">
+ <DependentUpon>moment.js</DependentUpon>
</Content>
- <Content Include="Scripts\jquery.unobtrusive-ajax.js" />
- <Content Include="Scripts\jquery.unobtrusive-ajax.min.js">
- <DependentUpon>jquery.unobtrusive-ajax.js</DependentUpon>
- </Content>
- <Content Include="Scripts\jquery.validate.js" />
- <Content Include="Scripts\jquery.validate.min.js">
- <DependentUpon>jquery.validate.js</DependentUpon>
- </Content>
- <Content Include="Scripts\jquery.validate.unobtrusive.js" />
- <Content Include="Scripts\jquery.validate.unobtrusive.min.js">
- <DependentUpon>jquery.validate.unobtrusive.js</DependentUpon>
- </Content>
- <Content Include="Scripts\knockout-2.1.0.debug.js" />
- <Content Include="Scripts\knockout-2.1.0.js" />
- <Content Include="Scripts\modernizr-2.0.6-development-only.js" />
- <Content Include="Scripts\toastr.js" />
+ <Content Include="Scripts\_references.js" />
+ <Content Include="Test\qunit\qunit-composite.css" />
+ <Content Include="Test\qunit\qunit-composite.js" />
+ <Content Include="Test\qunit\qunit.css" />
+ <Content Include="Test\qunit\qunit.js" />
+ <Content Include="Test\web api\qunit-utils.js" />
+ <Content Include="Test\web api\webapi.attendance-cud.tests.html" />
+ <Content Include="Test\web api\webapi.attendance-cud.tests.js" />
+ <Content Include="Test\web api\webapi.endpoint.tests.html" />
+ <Content Include="Test\web api\webapi.endpoint.tests.js" />
+ <Content Include="Test\web api\webapi.get-result.tests.html" />
+ <Content Include="Test\web api\webapi.get-result.tests.js" />
+ <Content Include="Test\web api\webapi.person-cud.tests.html" />
+ <Content Include="Test\web api\webapi.person-cud.tests.js" />
+ <Content Include="Test\web api\webapi.session-cud-validation.tests.html" />
+ <Content Include="Test\web api\webapi.session-cud-validation.tests.js" />
+ <Content Include="Test\web api\webapi.session-cud.tests.html" />
+ <Content Include="Test\web api\webapi.session-cud.tests.js" />
+ <Content Include="Test\web api\webapi.testsuite.html" />
<Content Include="Web.config" />
<Content Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
@@ -227,16 +304,13 @@
<Content Include="Images\orderedList9.png" />
<Content Include="Images\twitter.png" />
<Content Include="Images\windowsLive.png" />
- <Content Include="Scripts\_references.js" />
<Content Include="Views\Web.config" />
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
<Content Include="Views\Shared\Error.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
</ItemGroup>
- <ItemGroup>
- <Folder Include="App_Data\" />
- </ItemGroup>
+ <ItemGroup />
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
Oops, something went wrong.

0 comments on commit ee1dfb2

Please sign in to comment.