Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
chore(build): Build v0.1.24
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlee44 committed Nov 7, 2013
1 parent f77d044 commit 110088e
Show file tree
Hide file tree
Showing 16 changed files with 192 additions and 128 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# v0.1.24 (2013/11/6)
## Bug Fixes
- **macTagAutocomplete:** Remove left padding in tag list
([389f337f](https://github.com/StartTheShift/MacGyver/commit/389f337ff50f756fb587bd7f07a03fcea8232429))
- **macTime:** Replaced the comparison of {} since you cannot compare objects to {}.
([30b68d1b](https://github.com/StartTheShift/MacGyver/commit/30b68d1b300219d59accc1f448768ef250106404))

## Features
- **macTime:** Converted date to use current instead of unix. Removed notion of end selection because it broke highlighting when you selected more than one section (hour, minute, or marker). Denested some control blocks for readability/dry-ness. Added new lines for readability. Added "A" and "P" events to modify meridian values.
([715bbe20](https://github.com/StartTheShift/MacGyver/commit/715bbe20bd41ea521611777ddf37e8fba810bfc3),
[#135](https://github.com/StartTheShift/MacGyver/issues/135))


# v0.1.23 (2013/11/4)
## Bug Fixes
- **util:** Updated the url regex to be more verbose—more inline with rfc3986. Modified the protocol attribute to return only the protocol.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MacGyver",
"version": "0.1.23",
"version": "0.1.24",
"main": [
"lib/img/ui-bg_flat_0_aaaaaa_40x100.png",
"lib/img/ui-bg_glass_75_ffffff_1x400.png",
Expand Down
2 changes: 1 addition & 1 deletion example/css/macgyver.css
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ table.mac-table-default [mac-table-selectable]{cursor:pointer}
.mac-table-container .mac-table-transclude{display:none}

.mac-tag-autocomplete{position:relative;display:inline-block;border:1px solid #aaa;background:#fff;margin:0;padding:0;}
.mac-tag-autocomplete .tag-list{margin:0;}
.mac-tag-autocomplete .tag-list{margin:0;padding-left:0;}
.mac-tag-autocomplete .tag-list .tag{padding:3px 20px 3px 5px;margin:3px;position:relative;display:inline-block;list-style:none;font-size:13px;line-height:13px;-webkit-border-radius:3px;border-radius:3px;}
.mac-tag-autocomplete .tag-list .tag.label{background:-webkit-linear-gradient(top, #eaf0ff, #dee8ff);background:-moz-linear-gradient(top, #eaf0ff, #dee8ff);background:-o-linear-gradient(top, #eaf0ff, #dee8ff);background:-ms-linear-gradient(top, #eaf0ff, #dee8ff);background:linear-gradient(to bottom, #eaf0ff, #dee8ff);border:1px solid #bfc9e1;text-shadow:none;color:#000;font-weight:normal;-webkit-box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,0.05);box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,0.05)}
.mac-tag-autocomplete .tag-list .tag .tag-close{position:absolute;right:6px;color:#9da6b7;cursor:pointer}
Expand Down
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><title>MacGyver Example</title><link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet"><link href="//fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css"><link href="css/vendor.css" rel="stylesheet"><link href="css/macgyver.css" rel="stylesheet"></head><body ng-app="Mac" mac-scroll-spy mac-scroll-spy-offset="10"><div id="top-nav"><div class="container"><a id="logo" href="index.html"><h2>MacGyver</h2></a><ul class="nav-menu"><li id="directives-nav"><a href="index.html">Directives</a></li><li id="tableview-nav"><a href="tableview.html">Table View</a></li><li id="filters-nav"><a href="filters.html">Filters</a></li><li id="events-nav"><a href="events.html">Events</a></li><li id="utils-nav"><a href="util.html">Utilities</a></li></ul></div></div><div id="header" class="macgyver-head"><h1 class="hero">MacGyver</h1><ul class="macgyver-links"><li><a href="https://github.com/StartTheShift/MacGyver">Github project</a></li><li><a href="https://github.com/StartTheShift/MacGyver/issues">Issues</a></li><li>Version 0.1.23</li></ul><div class="github-info"><ul><li><iframe src="http://ghbtns.com/github-btn.html?user=StartTheShift&amp;repo=MacGyver&amp;type=watch&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe></li><li><iframe src="http://ghbtns.com/github-btn.html?user=StartTheShift&amp;repo=MacGyver&amp;type=fork&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="95" height="20"></iframe></li></ul></div></div><div class="container"><div ng-controller="ExampleController" class="row content"><div id="nav" class="span3"><ul mac-affix mac-affix-top="188" class="nav nav-list docs-sidenav"><li mac-scroll-spy-target="modal"><a href="#modal"><i class="icon-chevron-right"></i>Modal</a></li><li mac-scroll-spy-target="scrollspy"><a href="#scrollspy"><i class="icon-chevron-right"></i>Scroll Spy</a></li><li mac-scroll-spy-target="affix"><a href="#affix"><i class="icon-chevron-right"></i>Affix</a></li><li mac-scroll-spy-target="tooltip"><a href="#tooltip"><i class="icon-chevron-right"></i>Tooltip</a></li><li mac-scroll-spy-target="menu"><a href="#menu"><i class="icon-chevron-right"></i>Menu</a></li><li mac-scroll-spy-target="autocomplete"><a href="#autocomplete"><i class="icon-chevron-right"></i>Autocomplete</a></li><li mac-scroll-spy-target="tag-autocomplete"><a href="#tag-autocomplete"><i class="icon-chevron-right"></i>Tag Autocomplete</a></li><li mac-scroll-spy-target="datepicker"><a href="#datepicker"><i class="icon-chevron-right"></i>Date Picker</a></li><li mac-scroll-spy-target="time-input"><a href="#time-input"><i class="icon-chevron-right"></i>Time Input</a></li><li mac-scroll-spy-target="tag-input"><a href="#tag-input"><i class="icon-chevron-right"></i>Tag Input</a></li><li mac-scroll-spy-target="spinner"><a href="#spinner"><i class="icon-chevron-right"></i>Spinner</a></li><li mac-scroll-spy-target="cspinner"><a href="#cspinner"><i class="icon-chevron-right"></i>Canvas Spinner</a></li><li mac-scroll-spy-target="file-upload"><a href="#file-upload"><i class="icon-chevron-right"></i>File Upload</a></li><li mac-scroll-spy-target="placeholder"><a href="#placeholder"><i class="icon-chevron-right"></i>Placeholder</a></li></ul></div><div id="example" class="span9"><section id="modal" mac-scroll-spy-anchor><h1>Modal Service</h1>
<!DOCTYPE html><html><head><meta charset="utf-8"><title>MacGyver Example</title><link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet"><link href="//fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css"><link href="css/vendor.css" rel="stylesheet"><link href="css/macgyver.css" rel="stylesheet"></head><body ng-app="Mac" mac-scroll-spy mac-scroll-spy-offset="10"><div id="top-nav"><div class="container"><a id="logo" href="index.html"><h2>MacGyver</h2></a><ul class="nav-menu"><li id="directives-nav"><a href="index.html">Directives</a></li><li id="tableview-nav"><a href="tableview.html">Table View</a></li><li id="filters-nav"><a href="filters.html">Filters</a></li><li id="events-nav"><a href="events.html">Events</a></li><li id="utils-nav"><a href="util.html">Utilities</a></li></ul></div></div><div id="header" class="macgyver-head"><h1 class="hero">MacGyver</h1><ul class="macgyver-links"><li><a href="https://github.com/StartTheShift/MacGyver">Github project</a></li><li><a href="https://github.com/StartTheShift/MacGyver/issues">Issues</a></li><li>Version 0.1.24</li></ul><div class="github-info"><ul><li><iframe src="http://ghbtns.com/github-btn.html?user=StartTheShift&amp;repo=MacGyver&amp;type=watch&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe></li><li><iframe src="http://ghbtns.com/github-btn.html?user=StartTheShift&amp;repo=MacGyver&amp;type=fork&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="95" height="20"></iframe></li></ul></div></div><div class="container"><div ng-controller="ExampleController" class="row content"><div id="nav" class="span3"><ul mac-affix mac-affix-top="188" class="nav nav-list docs-sidenav"><li mac-scroll-spy-target="modal"><a href="#modal"><i class="icon-chevron-right"></i>Modal</a></li><li mac-scroll-spy-target="scrollspy"><a href="#scrollspy"><i class="icon-chevron-right"></i>Scroll Spy</a></li><li mac-scroll-spy-target="affix"><a href="#affix"><i class="icon-chevron-right"></i>Affix</a></li><li mac-scroll-spy-target="tooltip"><a href="#tooltip"><i class="icon-chevron-right"></i>Tooltip</a></li><li mac-scroll-spy-target="menu"><a href="#menu"><i class="icon-chevron-right"></i>Menu</a></li><li mac-scroll-spy-target="autocomplete"><a href="#autocomplete"><i class="icon-chevron-right"></i>Autocomplete</a></li><li mac-scroll-spy-target="tag-autocomplete"><a href="#tag-autocomplete"><i class="icon-chevron-right"></i>Tag Autocomplete</a></li><li mac-scroll-spy-target="datepicker"><a href="#datepicker"><i class="icon-chevron-right"></i>Date Picker</a></li><li mac-scroll-spy-target="time-input"><a href="#time-input"><i class="icon-chevron-right"></i>Time Input</a></li><li mac-scroll-spy-target="tag-input"><a href="#tag-input"><i class="icon-chevron-right"></i>Tag Input</a></li><li mac-scroll-spy-target="spinner"><a href="#spinner"><i class="icon-chevron-right"></i>Spinner</a></li><li mac-scroll-spy-target="cspinner"><a href="#cspinner"><i class="icon-chevron-right"></i>Canvas Spinner</a></li><li mac-scroll-spy-target="file-upload"><a href="#file-upload"><i class="icon-chevron-right"></i>File Upload</a></li><li mac-scroll-spy-target="placeholder"><a href="#placeholder"><i class="icon-chevron-right"></i>Placeholder</a></li></ul></div><div id="example" class="span9"><section id="modal" mac-scroll-spy-anchor><h1>Modal Service</h1>
<p>There are multiple components used by modal.<br>- A modal service is used to keep state of modal opened in the applications.<br>- A modal element directive to define the modal dialog box<br>- A modal attribute directive as a modal trigger </p>
<h3>Parameters</h3>
<p><strong>show</strong><br>Type: <code>Function</code><br>Show a modal based on the modal id<br>- {String} id The id of the modal to open<br>- {Object} triggerOptions Additional options to open modal </p>
Expand Down
91 changes: 54 additions & 37 deletions example/js/MacGyver.js
Original file line number Diff line number Diff line change
Expand Up @@ -10657,6 +10657,8 @@ Clearing model by setting it to null or '' will set model back to default value
@param {String} mac-time-default If model is undefined, use this as the starting value (default 12:00 PM)
*/

var __hasProp = {}.hasOwnProperty;

angular.module("Mac").directive("macTime", [
"$filter", "$timeout", "util", "keys", function($filter, $timeout, util, keys) {
return {
Expand All @@ -10678,7 +10680,7 @@ angular.module("Mac").directive("macTime", [
var highlightActions, inputDOM, inputSelectAction, resetTime, timeRegex;
$scope.placeholder = opts.placeholder;
inputDOM = element[0].getElementsByTagName("input")[0];
timeRegex = /(\d+):(\d+) ([AP]M)/;
timeRegex = /^(0?[1-9]|1[0-2]):([0-5][0-9]) ([AP]M)$/;
highlightActions = {
hours: function() {
return inputDOM.setSelectionRange(0, 2);
Expand All @@ -10691,11 +10693,11 @@ angular.module("Mac").directive("macTime", [
}
};
resetTime = function() {
var prefix, time;
prefix = "Jan 1, 1970, ";
time = new Date(prefix + opts["default"]);
var currentDate, time;
currentDate = new Date().toDateString();
time = new Date(currentDate + " " + opts["default"]);
if (isNaN(time.getTime())) {
time = new Date(prefix + "12:00 AM");
time = new Date(currentDate + " " + defaults["default"]);
}
return $scope.time = time;
};
Expand All @@ -10707,70 +10709,67 @@ angular.module("Mac").directive("macTime", [
return resetTime();
}
});
inputSelectAction = function(index, endIndex, actions) {
if (endIndex == null) {
endIndex = index;
}
inputSelectAction = function(index, actions) {
if (actions == null) {
actions = {};
}
if (typeof endIndex === "object") {
actions = endIndex;
endIndex = index;
}
if ((0 <= index && index < 3) && (0 <= endIndex && endIndex < 3)) {
if ((0 <= index && index < 3)) {
if (typeof actions.hours === "function") {
actions.hours();
}
} else if ((3 <= index && index < 6) && (3 <= endIndex && endIndex < 6)) {
} else if ((3 <= index && index < 6)) {
if (typeof actions.minutes === "function") {
actions.minutes();
}
} else if ((6 <= index && index < 9) && (6 <= index && index < 9)) {
} else if ((6 <= index && index < 9)) {
if (typeof actions.markers === "function") {
actions.markers();
}
}
return typeof actions.all === "function" ? actions.all() : void 0;
};
$scope.updateInput = function(actions) {
var end, start;
var hasActions, key, start;
if (actions == null) {
actions = {};
}
start = inputDOM.selectionStart;
end = inputDOM.selectionEnd;
if (actions !== {}) {
inputSelectAction(start, end, actions);
hasActions = ((function() {
var _results;
_results = [];
for (key in actions) {
if (!__hasProp.call(actions, key)) continue;
_results.push(key);
}
return _results;
})()).length > 0;
if (hasActions) {
inputSelectAction(start, actions);
}
$scope.model = $filter("date")($scope.time.getTime(), "hh:mm a");
return $timeout(function() {
return inputSelectAction(start, end, highlightActions);
$timeout(function() {
return inputSelectAction(start, highlightActions);
}, 0, false);
return $scope.model = $filter("date")($scope.time.getTime(), "hh:mm a");
};
$scope.updateScopeTime = function() {
var hours, markers, minutes, timeMatch;
if (timeMatch = timeRegex.exec($scope.model)) {
hours = +timeMatch[1];
minutes = +timeMatch[2];
markers = timeMatch[3] || "AM";
if ((0 < hours && hours <= 12) && (0 <= minutes && minutes <= 60)) {
if (markers === "PM" && hours !== 12) {
hours += 12;
}
if (markers === "AM" && hours === 12) {
hours = 0;
}
return $scope.time.setHours(hours, minutes);
} else {
return $scope.updateInput();
if (markers === "PM" && hours !== 12) {
hours += 12;
}
if (markers === "AM" && hours === 12) {
hours = 0;
}
return $scope.time.setHours(hours, minutes);
} else {
return $scope.updateInput();
}
};
$scope.keydownEvent = function(event) {
var change, end, key, start;
var change, end, hours, key, start;
key = event.which;
switch (key) {
case keys.UP:
Expand All @@ -10794,7 +10793,7 @@ angular.module("Mac").directive("macTime", [
change = key === keys.LEFT ? -3 : 3;
start = inputDOM.selectionStart;
end = inputDOM.selectionEnd;
inputSelectAction(start, end, {
inputSelectAction(start, {
hours: function() {
if (key === keys.LEFT) {
return change = 0;
Expand All @@ -10812,12 +10811,30 @@ angular.module("Mac").directive("macTime", [
});
inputDOM.setSelectionRange(start, end);
return $scope.updateInput();
case keys.A:
case keys.P:
event.preventDefault();
hours = $scope.time.getHours();
if (key === keys.A) {
change = hours >= 12 ? -1 : 0;
} else if (key === keys.P) {
change = hours >= 12 ? 0 : -1;
} else {
change = 0;
}
return $scope.updateInput({
markers: function() {
return $scope.time.setHours(hours + change * 12);
}
});
}
};
return $scope.keyupEvent = function(event) {
var key;
var key, keyIsAorP, keyIsNumber;
key = event.which;
if ((keys.NUMPAD0 <= key && key <= keys.NUMPAD9) || (keys.ZERO <= key && key <= keys.NINE)) {
keyIsAorP = keys.A || keys.P;
keyIsNumber = (keys.NUMPAD0 <= key && key <= keys.NUMPAD9) || (keys.ZERO <= key && key <= keys.NINE);
if (keyIsNumber || keyIsAorP) {
return $scope.updateScopeTime();
}
};
Expand Down
Loading

0 comments on commit 110088e

Please sign in to comment.