Permalink
Browse files

Cols 1-3 and 1-5 working

  • Loading branch information...
ryanki1 committed Mar 16, 2013
1 parent d10daab commit 2da407b0041cac52cd6c15905f6df377efb7c258
Showing with 2,023 additions and 52 deletions.
  1. +11 −3 AddCon_TravellingSalesman/AddCon_TravellingSalesman.csproj
  2. +4 −0 AddCon_TravellingSalesman/App_Start/BundleConfig.cs
  3. +79 −0 AddCon_TravellingSalesman/Content/app.css
  4. BIN AddCon_TravellingSalesman/Content/images/puttPlug.png
  5. BIN AddCon_TravellingSalesman/Content/images/salesmanPlaceholder.jpg
  6. +83 −3 AddCon_TravellingSalesman/Scripts/App/app.js
  7. +1 −1 AddCon_TravellingSalesman/Scripts/App/common.js
  8. +1,457 −0 AddCon_TravellingSalesman/Scripts/jsrender.js
  9. +2 −2 AddCon_TravellingSalesman/Spec/GeoOffice_Route.html
  10. +65 −0 AddCon_TravellingSalesman/Spec/GeoOffice_xyz_android_4.html
  11. +17 −0 AddCon_TravellingSalesman/Spec/GeoOffice_xyz_iPad_iOS4.html
  12. +17 −0 AddCon_TravellingSalesman/Spec/GeoOffice_xyz_iPhone_iOS4.html
  13. +76 −0 AddCon_TravellingSalesman/Test/GeoOffice_xyz_android_4.js
  14. +49 −6 AddCon_TravellingSalesman/Test/GeoOffice_xyz_iPad_iOS4.js
  15. +73 −18 AddCon_TravellingSalesman/Test/GeoOffice_xyz_iPhone_iOS4.js
  16. +6 −2 AddCon_TravellingSalesman/Test/commonTest.js
  17. +2 −1 AddCon_TravellingSalesman/Views/SalesmanModels/Index.cshtml
  18. +36 −9 AddCon_TravellingSalesman/Views/SalesmanModels/SalesmanListControl.cshtml
  19. +37 −0 AddCon_TravellingSalesman/Views/SalesmanModels/SalesmanPagePuttControl.cshtml
  20. +8 −7 AddCon_TravellingSalesman/Views/Shared/_Layout.cshtml
  21. BIN AddCon_TravellingSalesman/bin/AddCon_TravellingSalesman.dll
  22. BIN AddCon_TravellingSalesman/bin/AddCon_TravellingSalesman.pdb
@@ -211,6 +211,9 @@
<Compile Include="Utilities\ExtensionMethods.cs" />
</ItemGroup>
<ItemGroup>
+ <Content Include="Content\app.css" />
+ <Content Include="Content\images\puttPlug.png" />
+ <Content Include="Content\images\salesmanPlaceholder.jpg" />
<Content Include="Content\jquery.mobile.acTravelSales.css" />
<Content Include="Content\jquery.mobile.acTravelSales.min.css" />
<Content Include="Content\oocss_all.css" />
@@ -245,6 +248,10 @@
<Content Include="Content\oocss_core\grid\grids_iphone.css" />
<Content Include="Content\oocss_core\grid\grid_rtl.css" />
<Content Include="Content\oocss_core\libraries.css" />
+ <Content Include="Content\oocss_core\media\assets\crystal_project\16x16\actions\1day.png" />
+ <Content Include="Content\oocss_core\media\assets\crystal_project\32x32\actions\player_play.png" />
+ <Content Include="Content\oocss_core\media\assets\crystal_project\readme.txt" />
+ <Content Include="Content\oocss_core\media\media.css" />
<Content Include="Content\oocss_core\template\template.css" />
<Content Include="Content\qunit-1.11.0.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@@ -392,6 +399,7 @@
<Content Include="Scripts\jquery.validate.unobtrusive.min.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+ <Content Include="Scripts\jsrender.js" />
<Content Include="Scripts\knockout-2.1.0.debug.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@@ -433,13 +441,15 @@
<Content Include="SignalR.Sample\SignalR.StockTicker.js" />
<Content Include="SignalR.Sample\StockTicker.css" />
<Content Include="SignalR.Sample\StockTicker.html" />
+ <Content Include="Spec\GeoOffice_xyz_android_4.html" />
<Content Include="Spec\GeoOffice_xyz_iPad_iOS4.html" />
<Content Include="Spec\GeoOffice_xyz_iPhone_iOS4.html" />
<Content Include="Spec\GeoOffice_NearestIndustrySalesman.html" />
<Content Include="Spec\GeoOffice_NearestProductSalesman.html" />
<Content Include="Spec\GeoOffice_NearestSalesman.html" />
<Content Include="Spec\GeoOffice_Route.html" />
<Content Include="Test\commonTest.js" />
+ <Content Include="Test\GeoOffice_xyz_android_4.js" />
<Content Include="Test\GeoOffice_xyz_iPad_iOS4.js" />
<Content Include="Test\GeoOffice_NearestIndustrySalesman.js" />
<Content Include="Test\GeoOffice_NearestProductSalesman.js" />
@@ -456,9 +466,6 @@
<Content Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</Content>
- <Content Include="Content\Site.css">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
<Content Include="Scripts\_references.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@@ -488,6 +495,7 @@
<Content Include="Views\SalesmanModels\dummySelector.cshtml" />
<Content Include="Views\SalesmanModels\SalesmanAdvert.cshtml" />
<Content Include="Views\Shared\_geoRanking.cshtml" />
+ <Content Include="Views\SalesmanModels\SalesmanPagePuttControl.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
@@ -12,6 +12,9 @@ public static void RegisterBundles(BundleCollection bundles)
bundles.Add(new ScriptBundle("~/bundles/geo").Include(
"~/Scripts/tutScript.js"));
+ bundles.Add(new ScriptBundle("~/bundles/jsRender").Include(
+ "~/Scripts/jsRender.js"));
+
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-1.*"));
@@ -53,6 +56,7 @@ public static void RegisterBundles(BundleCollection bundles)
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.progressbar.css",
"~/Content/themes/base/jquery.ui.theme.css"));
+ bundles.Add(new StyleBundle("~/Content/appcss").Include("~/Content/app.css"));
}
}
}
@@ -0,0 +1,79 @@
+@charset "utf-8";
+
+#puttMat {
+clear: both;
+background-color: black;
+width: auto;
+height: 16px;
+}
+
+#puttMat ul {
+list-style-type: none;
+margin: 0px auto;
+}
+
+#puttMat ul li {
+display: inline;
+}
+
+#puttMat a:link, a:visited {
+float: left;
+height: 16px;
+background: -webkit-radial-gradient(circle, grey 20%, black 40%);
+background: -moz-radial-gradient(circle, grey 20%, black 40%);
+background: radial-gradient(circle, grey 20%, black 40%);
+}
+
+#puttMat a:hover, a:active {
+background: -webkit-radial-gradient(circle, white 20%, black 40%);
+background: -moz-radial-gradient(circle, white 20%, black 40%);
+background: radial-gradient(circle, white 20%, black 40%);
+}
+
+/* Alternative to above but more costly in terms of having underlying 16 x 32 sprite
+#puttMat a:link, #puttMat a:visited {
+float: left;
+height: 16px;
+background-image: url("../bilder/puttSprite.png");
+background-position: 0px -16px;
+background-repeat: no-repeat;
+-webkit-mask-box-image: -webkit-radial-gradient(circle, black 20%, transparent 40%);
+}
+
+#puttMat a:hover, a:active {
+background-image: url("../bilder/puttSprite.png");
+background-position: 0px 0px;
+background-repeat: no-repeat;
+-webkit-mask-box-image: -webkit-radial-gradient(circle, black 20%, transparent 40%);
+}
+*/
+
+.ballInTheHole {
+ background: -webkit-radial-gradient(circle, white 20%, black 40%)!important;
+ background: -moz-radial-gradient(circle, white 20%, black 40%)!important;
+ background: radial-gradient(circle, white 20%, black 40%)!important;
+}
+.activePage {
+ /*display: block;*/
+ visibility: visible;
+ /*position: absolute;*/
+}
+.row0 {
+ /*position: static;*/ /* We wish to preserve float on 1st row for grid-size 3 */
+ /* grid-size 5? */
+}
+.inactivePage {
+ visibility: hidden;
+ /*display: none;*/
+}
+.main {
+ padding-top: 75px;
+ position: relative;
+ overflow: hidden;
+}
+.unaffectLayout {
+ display: none;
+}
+.affectLayout {
+ display: block;
+}
Binary file not shown.
@@ -21,7 +21,7 @@
log("Error - User location not locked on.");
},
showNearestFirst: function(geoTestCBSuccess, geoTestCBError){
- debugger;
+ //debugger;
if (localStorage.lat)
{
$.ajax({
@@ -45,7 +45,7 @@
}
},
geoRankingCallbackSuccess: function (position) {
- debugger;
+ //debugger;
geoAllowLocateUser(position);
},
geoRankingCallbackError: function () {
@@ -139,11 +139,91 @@
app.setSalesman(params);
},
googleMapsReady: function () {
- debugger;
+ //debugger;
var userLat = app.user.coords ? app.user.coords.latitude : null;
var userLong = app.user.coords ? app.user.coords.longitude : null;
//var ret = tut.maps.ready([userLat, userLong]);
tut.maps.origin = new google.maps.LatLng(app.selectedSalesman.coords.latitude, app.selectedSalesman.coords.longitude);
return tut.maps.drawRoute([userLat, userLong]);
+ },
+ // Salesmanlist puttControl
+ getPageFlickCount: function (leaveImpression) {
+ debugger;
+ var numPages = 0;
+ var leadingTop = -1;
+ $.each($(".unit"), function (index,ele) {
+ debugger;
+ var coordinates = $(ele).offset();
+ if (coordinates.top > leadingTop) {
+ numPages = numPages + 1;
+ leadingTop = coordinates.top;
+ }
+ if (leaveImpression) {
+ $(ele).addClass("row" + (numPages-1));
+ }
+ });
+ return numPages;
+ },
+ scorePuttMatRows: function () {
+ //debugger;
+ var leaveImpression = true;
+ app.getPageFlickCount(leaveImpression);
+ },
+ primePuttMat: function() {
+ // For every page (row) create a hole for putting
+ //debugger;
+ var numPages = app.getPageFlickCount();
+ var modelStr = "{\"List\":[";
+ for (var i = 0; i < numPages; i++) {
+ modelStr = modelStr + "{\"dummy\": \"0\"},";
+ }
+ modelStr = modelStr.substring(0, modelStr.length-1) + "]}" ; // Remove trailing comma and finish up
+ app.unwravelMat($.parseJSON(modelStr));
+ // Wireup clickability of holes
+ $.each($("#puttMat a"), function(index, ele) {
+ //debugger;
+ $(ele).click(function(evt) {
+ //debugger;
+ app.teeOff(index);
+ });
+ });
+ return numPages;
+ },
+ unwravelMat: function (model) {
+ //debugger;
+ $('#puttMatList').html($('#pagePuttTemplate').render(model));
+ },
+ resetPuttMat: function () {
+ $(".ballInTheHole").removeClass("ballInTheHole");
+ },
+ teeOff: function (index) {
+ //debugger;
+ app.resetPuttMat();
+ if (index >= 0) {
+ $("#puttMat a:eq(" + index + ")").addClass("ballInTheHole");
+ app.cuePuttMatRow(index);
+ }
+ else {
+ $("#puttMat a:first").addClass("ballInTheHole");
+ app.cuePuttMatRow(0);
+ }
+ },
+ resetPuttMatRows: function () {
+ $(".activePage").removeClass("activePage").addClass("inactivePage");
+ },
+ cuePuttMatRow: function (hole) {
+ app.resetPuttMatRows();
+ $.each($("div .unit"), function (index, ele) {
+ //debugger;
+ if ($(ele).hasClass("row" + hole)) {
+ $(ele).removeClass("unaffectLayout").addClass("affectLayout");
+ $(ele).removeClass("inactivePage").addClass("activePage");
+ }
+ else {
+ // Inactive rows should disappear so that active row positioned at the top
+ $(ele).removeClass("affectLayout").addClass("unaffectLayout");
+ $(ele).removeClass("activePage").addClass("inactivePage");
+ }
+ });
}
}
@@ -1,5 +1,5 @@
function geoAllowLocateUser(position) {
- debugger;
+ //debugger;
log("User location locked-on.");
if (position) {
localStorage.lng = position.coords.longitude;
Oops, something went wrong.

0 comments on commit 2da407b

Please sign in to comment.