Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Nancy, messed around with the shift UI. Modified config for r…
…azor --HG-- rename : CodeProse.Shifter/partials/controls/LabeledCheckBoxModel.cs => CodeProse.Shifter/partials/controls/WeekDayCheckBoxModel.cs rename : CodeProse.Shifter/partials/controls/labeled-checkbox.cshtml => CodeProse.Shifter/partials/controls/weekday-checkbox.cshtml
- Loading branch information
Ryan@Ryan-HP
authored and
Ryan@Ryan-HP
committed
Mar 18, 2012
1 parent
0bb7643
commit c3d8048
Showing
39 changed files
with
330 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
(function ($) { | ||
$(document).ready(function () { | ||
$('.number-picker').each(function () { | ||
var picker = $(this); | ||
var max = picker.data('maximum'); | ||
var min = picker.data('minimum'); | ||
|
||
var number = picker.children(':input').first(); | ||
var incrementor = number.next(); | ||
var decrementor = incrementor.next(); | ||
|
||
if (number.val() === '') { | ||
number.val(min); | ||
} | ||
|
||
incrementor.click(function () { | ||
var current = parseInt(number.val()); | ||
|
||
if (current === max) { | ||
current = min; | ||
} else { | ||
current++; | ||
} | ||
|
||
number.val(current); | ||
}); | ||
|
||
decrementor.click(function () { | ||
var current = parseInt(number.val()); | ||
|
||
if (current === min) { | ||
current = max; | ||
} else { | ||
current--; | ||
} | ||
|
||
number.val(current); | ||
}); | ||
}); | ||
}); | ||
|
||
$.fn.number = function () { | ||
return this.children(':input').first().val(); | ||
}; | ||
|
||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(function () { | ||
String.prototype.padLeft = function (padString, length) { | ||
var str = this; | ||
while (str.length < length) | ||
str = padString + str; | ||
return str; | ||
}; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(function ($) { | ||
$(document).ready(function () { | ||
|
||
}); | ||
|
||
$.fn.time = function () { | ||
var numbers = this.children('.number-picker'); | ||
|
||
var hour = numbers.first().number(); | ||
var minute = numbers.first().next().number(); | ||
var ampm = this.children('select').children('option:selected').val(); | ||
|
||
var formatted = function () { | ||
var minutePart = ''; | ||
if (minute > 0) { | ||
minutePart = ':' + minute.toString().padLeft('0', 2); | ||
}; | ||
|
||
return hour.toString() + minutePart + ' ' + ampm; | ||
}; | ||
|
||
return { | ||
hour: hour, | ||
minute: minute, | ||
ampm: ampm, | ||
formatted: formatted | ||
}; | ||
}; | ||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace CodeProse.Shifter.partials.controls | ||
{ | ||
public class NumberPickerModel | ||
{ | ||
public NumberPickerModel(int minValue, int maxValue) | ||
{ | ||
MaxValue = maxValue; | ||
MinValue = minValue; | ||
} | ||
|
||
public int MaxValue { get; private set; } | ||
public int MinValue { get; private set; } | ||
} | ||
} |
6 changes: 4 additions & 2 deletions
6
...partials/controls/LabeledCheckBoxModel.cs → ...partials/controls/WeekDayCheckBoxModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
namespace CodeProse.Shifter.partials.controls | ||
{ | ||
public class LabeledCheckBoxModel | ||
public class WeekDayCheckBoxModel | ||
{ | ||
public LabeledCheckBoxModel(string name, bool @checked) | ||
public WeekDayCheckBoxModel(string name, string abbreviation, bool @checked) | ||
{ | ||
Name = name; | ||
Checked = @checked; | ||
Abbreviation = abbreviation; | ||
} | ||
|
||
public string Name { get; private set; } | ||
public bool Checked { get; private set; } | ||
public string Abbreviation { get; private set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="number-picker" data-minimum="@Model.MinValue" data-maximum="@Model.MaxValue"> | ||
<input type="text" readonly="readonly" /> | ||
<input type="button" value="+" /> | ||
<input type="button" value="-" /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.