Provides an easy way to toggle a checkbox input's special 'indeterminate' property. This is a visual toggle only and in no way affects the model or value outside of native browser behavior at this time.
Add a 'ui-fixed' class to elements when the page scrolls past them
10 |
11 |
12 |
They see me scrollin...
13 | Try scrolling past the red text or changing the offset
14 |
15 |
16 |
17 |
Why?
18 |
19 |
Make elements sticky, or simply appear different after scrolling past a certain point
20 |
21 |
Remember that this directive
22 | only adds a
23 | ui-scrollfix class to the element. It is up to you to add the corresponding CSS rules, however it also gives you the ability to add other rules instead if you prefer.
24 |
25 |
26 |
27 |
28 |
How?
29 |
<p ui-scrollfix>They see me scrollin...</p>
30 |
You can optionally pass a number to
31 | ui-scrollfix which would override the detected y-offset of the element. Values can be either absolute
32 | 600 or offset from the calculated value -50 or +100.
33 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/unique/unique.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Filters out all duplicate items from an array by checking the specified key
3 | * @param [key] {string} the name of the attribute of each object to compare for uniqueness
4 | if the key is empty, the entire object will be compared
5 | if the key === false then no filtering will be performed
6 | * @return {array}
7 | */
8 | angular.module('ui.unique',[]).filter('unique', ['$parse', function ($parse) {
9 |
10 | return function (items, filterOn) {
11 |
12 | if (filterOn === false) {
13 | return items;
14 | }
15 |
16 | if ((filterOn || angular.isUndefined(filterOn)) && angular.isArray(items)) {
17 | var hashCheck = {}, newItems = [],
18 | get = angular.isString(filterOn) ? $parse(filterOn) : function (item) { return item; };
19 |
20 | var extractValueToCompare = function (item) {
21 | return angular.isObject(item) ? get(item) : item;
22 | };
23 |
24 | angular.forEach(items, function (item) {
25 | var valueToCheck, isDuplicate = false;
26 |
27 | for (var i = 0; i < newItems.length; i++) {
28 | if (angular.equals(extractValueToCompare(newItems[i]), extractValueToCompare(item))) {
29 | isDuplicate = true;
30 | break;
31 | }
32 | }
33 | if (!isDuplicate) {
34 | newItems.push(item);
35 | }
36 |
37 | });
38 | items = newItems;
39 | }
40 | return items;
41 | };
42 | }]);
43 |
--------------------------------------------------------------------------------
/bower_components/bootstrap/_layouts/home.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {% include header.html %}
6 |
7 |
8 |
9 |
10 |
11 | {% include nav-main.html %}
12 |
13 |
14 | {{ content }}
15 |
16 |
17 | {% include old-bs-docs.html %}
18 |
19 |
37 |
38 |
39 | {% include footer.html %}
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | refridge
2 | ======
3 |
4 | Refridge is a simple Shopping List webapp with one huge feature: **it knows when your food is going to expire!**
5 |
6 | **Original Idea**
7 |
8 | [Click here to checkout the blog post](http://deansofer.com/posts/view/18/Shopping-List-Expiration-Reminder-App)
9 |
10 | **How?**
11 |
12 | When you add food to your shopping list, you will be able to specify the category and type of food (along with normal shopping-list notes). When you check off items in shopping mode, they are considered 'purchased' at that date (approximately). A database will be developed that contains expiration times if the food is frozen, refrigerated, left out, or cooked.
13 |
14 | **So what?**
15 |
16 | Well now you can get features such as:
17 | * Notifications for certain food types when they are going to expire
18 | * Recipe suggestions using soon-to-expire ingredients (integration with 3rd party?)
19 | * Start a new shopping list with already-expired items
20 | * Shared family shopping lists
21 | * Know what you need to pick up from the store without having to check the fridge
22 |
23 | ## Setup
24 | 1. `$ bower install`
25 | 2. Setup Firebase authentication keys for 'Github' or whatever
26 | 3. `$ python -m SimpleHTTPServer` or whatever way you wish to host
27 | 4. Visit `localhost:8000` or whatever in the browser
28 |
29 | # Roadmap
30 | * Integration with online DB of food expiration times
31 | * New custom DB of food expiration times
32 | * Password-locked lists
33 | * Shareable lists
34 | * All features in the **so what?** section
35 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/test/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration
2 | // Generated on Thu May 02 2013 23:29:14 GMT+0200 (CEST)
3 |
4 |
5 | // base path, that will be used to resolve files and exclude
6 | basePath = '..';
7 |
8 |
9 | // list of files / patterns to load in the browser
10 | files = [
11 | JASMINE,
12 | JASMINE_ADAPTER,
13 | 'components/jquery/jquery.js',
14 | 'components/angular/angular.js',
15 | 'components/angular-mocks/angular-mocks.js',
16 | 'modules/*/*.js',
17 | 'modules/*/test/*Spec.js'
18 | ];
19 |
20 |
21 | // list of files to exclude
22 | exclude = [
23 |
24 | ];
25 |
26 |
27 | // test results reporter to use
28 | // possible values: 'dots', 'progress', 'junit'
29 | reporters = ['dots'];
30 |
31 |
32 | // enable / disable colors in the output (reporters and logs)
33 | colors = true;
34 |
35 |
36 | // level of logging
37 | // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
38 | logLevel = LOG_INFO;
39 |
40 |
41 | // enable / disable watching file and executing tests whenever any file changes
42 | autoWatch = false;
43 |
44 |
45 | // Start these browsers, currently available:
46 | // - Chrome
47 | // - ChromeCanary
48 | // - Firefox
49 | // - Opera
50 | // - Safari (only Mac)
51 | // - PhantomJS
52 | // - IE (only Windows)
53 | browsers = ['Chrome', 'Firefox'];
54 |
55 |
56 | // If browser does not capture in given timeout [ms], kill it
57 | captureTimeout = 60000;
58 |
59 |
60 | // Continuous Integration mode
61 | // if true, it capture browsers, run tests and exit
62 | singleRun = false;
63 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/inflector/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
41 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/scrollfix/test/scrollfixSpec.js:
--------------------------------------------------------------------------------
1 | /*global describe, beforeEach, module, inject, it, spyOn, expect, $ */
2 | describe('uiScrollfix', function () {
3 | 'use strict';
4 |
5 | var scope, $compile, $window;
6 | beforeEach(module('ui.scrollfix'));
7 | beforeEach(inject(function (_$rootScope_, _$compile_, _$window_) {
8 | scope = _$rootScope_.$new();
9 | $compile = _$compile_;
10 | $window = _$window_;
11 | }));
12 |
13 | describe('compiling this directive', function () {
14 | it('should bind to window "scroll" event', function () {
15 | spyOn($.fn, 'bind');
16 | $compile('')(scope);
17 | expect($.fn.bind).toHaveBeenCalled();
18 | expect($.fn.bind.mostRecentCall.args[0]).toBe('scroll');
19 | });
20 | });
21 | describe('scrolling the window', function () {
22 | it('should add the ui-scrollfix class if the offset is greater than specified', function () {
23 | var element = $compile('')(scope);
24 | angular.element($window).trigger('scroll');
25 | expect(element.hasClass('ui-scrollfix')).toBe(true);
26 | });
27 | it('should remove the ui-scrollfix class if the offset is less than specified (using absolute coord)', function () {
28 | var element = $compile('')(scope);
29 | angular.element($window).trigger('scroll');
30 | expect(element.hasClass('ui-scrollfix')).toBe(false);
31 |
32 | });
33 | it('should remove the ui-scrollfix class if the offset is less than specified (using relative coord)', function () {
34 | var element = $compile('')(scope);
35 | angular.element($window).trigger('scroll');
36 | expect(element.hasClass('ui-scrollfix')).toBe(false);
37 | });
38 | });
39 | });
40 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/ie-shiv/README.md:
--------------------------------------------------------------------------------
1 | # angular-ui-ieshiv
2 |
3 | ## Important!
4 |
5 | If not installed properly, angular WILL throw an exception.
6 |
7 | "No module: ui.directives"
8 |
9 | Which means you have not included the angular-ui library in the file, or the shiv is in the wrong place.
10 |
11 | WHY? Well, angular is throwing the exception and I can't catch and stop it. If properly setup, you should be good.
12 | If not, then you should probably fix it or yank it out. Of course, then you won't have the shiv for ie.
13 |
14 | ## Description
15 |
16 | This is used in order to support IE versions that do not support custom elements. For example:
17 |
18 |
19 |
20 |
21 | IE 8 and earlier do not allow custom tag elements into the DOM. It just ignores them.
22 | In order to remedy, the trick is to tell browser by calling document.createElement('my-custom-element').
23 | Then you can use, ..., you also may need to define css styles.
24 |
25 | In current version, this will automagically define directives found in the ui.directives module and
26 | angular's ngView, ngInclude, ngPluralize directives.
27 |
28 | ## Usage
29 |
30 | The shiv needs to run after angular has compiled the application. Best to load angular-ui-ieshiv.js at
31 | bottom of section.
32 |
33 |
34 |
35 | ### Options
36 |
37 | There will be
38 |
39 | ### Notes
40 | - modules are searched for directives
41 | - only IE 8 and earlier will cause shiv to run
42 | - there will be a slight performance hit (for IE)
43 |
44 | ### Todo
45 | - provide ability to specify which directives to include/exclude
46 | - automagically locate all custom directives in current ng-app (this will involve recursion)
47 |
--------------------------------------------------------------------------------
/bower_components/bootstrap/js/tests/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Bootstrap Plugin Test Suite
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
Until RC2, the Bootstrap 3 customizer will be disabled. In the mean time, snag the compiled CSS and JavaScript. Hang tight!
28 |
29 |
30 |
31 |
33 |
46 |
47 |
48 | {% include footer.html %}
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/showhide/showhide.js:
--------------------------------------------------------------------------------
1 | /**
2 | * uiShow Directive
3 | *
4 | * Adds a 'ui-show' class to the element instead of display:block
5 | * Created to allow tighter control of CSS without bulkier directives
6 | *
7 | * @param expression {boolean} evaluated expression to determine if the class should be added
8 | */
9 | angular.module('ui.showhide',[])
10 | .directive('uiShow', [function () {
11 | return function (scope, elm, attrs) {
12 | scope.$watch(attrs.uiShow, function (newVal, oldVal) {
13 | if (newVal) {
14 | elm.addClass('ui-show');
15 | } else {
16 | elm.removeClass('ui-show');
17 | }
18 | });
19 | };
20 | }])
21 |
22 | /**
23 | * uiHide Directive
24 | *
25 | * Adds a 'ui-hide' class to the element instead of display:block
26 | * Created to allow tighter control of CSS without bulkier directives
27 | *
28 | * @param expression {boolean} evaluated expression to determine if the class should be added
29 | */
30 | .directive('uiHide', [function () {
31 | return function (scope, elm, attrs) {
32 | scope.$watch(attrs.uiHide, function (newVal, oldVal) {
33 | if (newVal) {
34 | elm.addClass('ui-hide');
35 | } else {
36 | elm.removeClass('ui-hide');
37 | }
38 | });
39 | };
40 | }])
41 |
42 | /**
43 | * uiToggle Directive
44 | *
45 | * Adds a class 'ui-show' if true, and a 'ui-hide' if false to the element instead of display:block/display:none
46 | * Created to allow tighter control of CSS without bulkier directives. This also allows you to override the
47 | * default visibility of the element using either class.
48 | *
49 | * @param expression {boolean} evaluated expression to determine if the class should be added
50 | */
51 | .directive('uiToggle', [function () {
52 | return function (scope, elm, attrs) {
53 | scope.$watch(attrs.uiToggle, function (newVal, oldVal) {
54 | if (newVal) {
55 | elm.removeClass('ui-hide').addClass('ui-show');
56 | } else {
57 | elm.removeClass('ui-show').addClass('ui-hide');
58 | }
59 | });
60 | };
61 | }]);
62 |
--------------------------------------------------------------------------------
/bower_components/bootstrap/_includes/header.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {% if page.title == "Bootstrap" %}
8 | {{ page.title }}
9 | {% else if %}
10 | {{ page.title }} · Bootstrap
11 | {% endif %}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
44 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/scrollfix/scrollfix.js:
--------------------------------------------------------------------------------
1 | /*global angular, $, document*/
2 | /**
3 | * Adds a 'ui-scrollfix' class to the element when the page scrolls past it's position.
4 | * @param [offset] {int} optional Y-offset to override the detected offset.
5 | * Takes 300 (absolute) or -300 or +300 (relative to detected)
6 | */
7 | angular.module('ui.scrollfix',[]).directive('uiScrollfix', ['$window', function ($window) {
8 | 'use strict';
9 | return {
10 | require: '^?uiScrollfixTarget',
11 | link: function (scope, elm, attrs, uiScrollfixTarget) {
12 | var top = elm[0].offsetTop,
13 | $target = uiScrollfixTarget && uiScrollfixTarget.$element || angular.element($window);
14 | if (!attrs.uiScrollfix) {
15 | attrs.uiScrollfix = top;
16 | } else {
17 | // chartAt is generally faster than indexOf: http://jsperf.com/indexof-vs-chartat
18 | if (attrs.uiScrollfix.charAt(0) === '-') {
19 | attrs.uiScrollfix = top - attrs.uiScrollfix.substr(1);
20 | } else if (attrs.uiScrollfix.charAt(0) === '+') {
21 | attrs.uiScrollfix = top + parseFloat(attrs.uiScrollfix.substr(1));
22 | }
23 | }
24 |
25 | $target.bind('scroll', function () {
26 | // if pageYOffset is defined use it, otherwise use other crap for IE
27 | var offset;
28 | if (angular.isDefined($window.pageYOffset)) {
29 | offset = $window.pageYOffset;
30 | } else {
31 | var iebody = (document.compatMode && document.compatMode !== "BackCompat") ? document.documentElement : document.body;
32 | offset = iebody.scrollTop;
33 | }
34 | if (!elm.hasClass('ui-scrollfix') && offset > attrs.uiScrollfix) {
35 | elm.addClass('ui-scrollfix');
36 | } else if (elm.hasClass('ui-scrollfix') && offset < attrs.uiScrollfix) {
37 | elm.removeClass('ui-scrollfix');
38 | }
39 | });
40 | }
41 | };
42 | }]).directive('uiScrollfixTarget', [function () {
43 | 'use strict';
44 | return {
45 | controller: function($element) {
46 | this.$element = $element;
47 | }
48 | };
49 | }]);
50 |
--------------------------------------------------------------------------------
/bower_components/bootstrap/js/transition.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: transition.js v3.0.0
3 | * http://twbs.github.com/bootstrap/javascript.html#transitions
4 | * ========================================================================
5 | * Copyright 2013 Twitter, Inc.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * ======================================================================== */
19 |
20 |
21 | +function ($) { "use strict";
22 |
23 | // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
24 | // ============================================================
25 |
26 | function transitionEnd() {
27 | var el = document.createElement('bootstrap')
28 |
29 | var transEndEventNames = {
30 | 'WebkitTransition' : 'webkitTransitionEnd'
31 | , 'MozTransition' : 'transitionend'
32 | , 'OTransition' : 'oTransitionEnd otransitionend'
33 | , 'transition' : 'transitionend'
34 | }
35 |
36 | for (var name in transEndEventNames) {
37 | if (el.style[name] !== undefined) {
38 | return { end: transEndEventNames[name] }
39 | }
40 | }
41 | }
42 |
43 | // http://blog.alexmaccaw.com/css-transitions
44 | $.fn.emulateTransitionEnd = function (duration) {
45 | var called = false, $el = this
46 | $(this).one('webkitTransitionEnd', function () { called = true })
47 | var callback = function () { if (!called) $($el).trigger('webkitTransitionEnd') }
48 | setTimeout(callback, duration)
49 | return this
50 | }
51 |
52 | $(function () {
53 | $.support.transition = transitionEnd()
54 | })
55 |
56 | }(window.jQuery);
57 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/keypress/demo/index.html:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
Keypress
12 |
13 |
14 |
15 |
What?
16 |
17 |
Bind an event to a particular keypress
18 |
19 |
22 |
23 |
26 |
27 |
28 |
31 |
32 |
33 |
Why?
34 |
35 |
Cuz you feel like it? Maybe I should stop doing the 'Why' sections, running out of explanations...
36 |
37 |
How?
38 |
39 |
The directive takes a hash (object) with the key code as the key and the callback function to fire as the value. The callback function takes an 'event' param
Holy guacamole! Best check yo self, you\'re not looking too good.
'
37 | + '
'
38 | , alert = $(alertHTML).appendTo('#qunit-fixture').alert()
39 |
40 | ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom')
41 |
42 | alert.find('.close').click()
43 |
44 | ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom')
45 | })
46 |
47 | test("should not fire closed when close is prevented", function () {
48 | $.support.transition = false
49 | stop();
50 | $('')
51 | .on('close.bs.alert', function (e) {
52 | e.preventDefault();
53 | ok(true);
54 | start();
55 | })
56 | .on('closed.bs.alert', function () {
57 | ok(false);
58 | })
59 | .alert('close')
60 | })
61 |
62 | })
63 |
--------------------------------------------------------------------------------
/bower_components/bootstrap/less/list-group.less:
--------------------------------------------------------------------------------
1 | //
2 | // List groups
3 | // --------------------------------------------------
4 |
5 | // Base class
6 | //
7 | // Easily usable on
, , or
.
8 | .list-group {
9 | // No need to set list-style: none; since .list-group-item is block level
10 | margin-bottom: 20px;
11 | padding-left: 0; // reset padding because ul and ol
12 | background-color: @list-group-bg;
13 | }
14 |
15 | // Individual list items
16 | // -------------------------
17 |
18 | .list-group-item {
19 | position: relative;
20 | display: block;
21 | padding: 10px 30px 10px 15px;
22 | // Place the border on the list items and negative margin up for better styling
23 | margin-bottom: -1px;
24 | border: 1px solid @list-group-border;
25 |
26 | // Round the first and last items
27 | &:first-child {
28 | .border-top-radius(@border-radius-base);
29 | }
30 | &:last-child {
31 | margin-bottom: 0;
32 | .border-bottom-radius(@border-radius-base);
33 | }
34 |
35 | // Align badges within list items
36 | > .badge {
37 | float: right;
38 | margin-right: -15px;
39 | }
40 | }
41 |
42 | // Custom content options
43 | // -------------------------
44 |
45 | .list-group-item-heading {
46 | margin-top: 0;
47 | margin-bottom: 5px;
48 | }
49 | .list-group-item-text {
50 | margin-bottom: 0;
51 | line-height: 1.3;
52 | }
53 |
54 | // Linked list items
55 | // -------------------------
56 |
57 | // Custom content within linked items
58 | a.list-group-item {
59 | // Colorize content accordingly
60 | .list-group-item-heading {
61 | color: @list-group-link-heading-color;
62 | }
63 | .list-group-item-text {
64 | color: @list-group-link-color;
65 | }
66 |
67 | // Hover state
68 | &:hover,
69 | &:focus {
70 | text-decoration: none;
71 | background-color: @list-group-hover-bg;
72 | }
73 |
74 | // Active class on item itself, not parent
75 | &.active {
76 | z-index: 2; // Place active items above their siblings for proper border styling
77 | color: @list-group-active-color;
78 | background-color: @list-group-active-bg;
79 | border-color: @list-group-active-border;
80 |
81 | // Force color to inherit for custom content
82 | .list-group-item-heading {
83 | color: inherit;
84 | }
85 | .list-group-item-text {
86 | color: lighten(@list-group-active-bg, 40%);
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/reset/test/resetSpec.js:
--------------------------------------------------------------------------------
1 | /*global describe, beforeEach, module, inject, it, spyOn, expect, $ */
2 | describe('uiReset', function () {
3 | 'use strict';
4 |
5 | var scope, $compile;
6 | beforeEach(module('ui.reset'));
7 | beforeEach(inject(function (_$rootScope_, _$compile_, _$window_) {
8 | scope = _$rootScope_.$new();
9 | $compile = _$compile_;
10 | }));
11 |
12 | describe('compiling this directive', function () {
13 | it('should throw an error if we have no model defined', function () {
14 | function compile() {
15 | $compile('')(scope);
16 | }
17 |
18 | expect(compile).toThrow();
19 | });
20 | it('should proper DOM structure', function () {
21 | scope.foo = 'bar';
22 | scope.$digest();
23 | var element = $compile('')(scope);
24 | expect(element.parent().is('span')).toBe(true);
25 | expect(element.next().is('a')).toBe(true);
26 | });
27 | });
28 | describe('clicking on the created anchor tag', function () {
29 | it('should prevent the default action', function () {
30 | var element = $compile('')(scope);
31 | spyOn($.Event.prototype, 'preventDefault');
32 | element.next().triggerHandler('click');
33 | expect($.Event.prototype.preventDefault).toHaveBeenCalled();
34 | });
35 | it('should set the model value to null and clear control when no options given', function () {
36 | scope.foo = 'bar';
37 | var element = $compile('')(scope);
38 | scope.$digest();
39 | expect(element.val()).toBe('bar');
40 | element.next().triggerHandler('click');
41 | expect(scope.foo).toBe(null);
42 | expect(element.val()).toBe('');
43 | });
44 | it('should set the model value to the options scope variable when a string is passed in options', function () {
45 | scope.foo = 'bar';
46 | scope.resetTo = 'i was reset';
47 | var element = $compile('')(scope);
48 | scope.$digest();
49 | expect(element.val()).toBe('bar');
50 | element.next().triggerHandler('click');
51 | expect(scope.foo).toBe('i was reset');
52 | expect(element.val()).toBe('i was reset');
53 | });
54 | });
55 | });
--------------------------------------------------------------------------------
/bower_components/bootstrap/js/tests/phantom.js:
--------------------------------------------------------------------------------
1 | // Simple phantom.js integration script
2 | // Adapted from Modernizr
3 |
4 | function waitFor(testFx, onReady, timeOutMillis) {
5 | var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 5001 //< Default Max Timout is 5s
6 | , start = new Date().getTime()
7 | , condition = false
8 | , interval = setInterval(function () {
9 | if ((new Date().getTime() - start < maxtimeOutMillis) && !condition) {
10 | // If not time-out yet and condition not yet fulfilled
11 | condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()) //< defensive code
12 | } else {
13 | if (!condition) {
14 | // If condition still not fulfilled (timeout but condition is 'false')
15 | console.log("'waitFor()' timeout")
16 | phantom.exit(1)
17 | } else {
18 | // Condition fulfilled (timeout and/or condition is 'true')
19 | typeof(onReady) === "string" ? eval(onReady) : onReady() //< Do what it's supposed to do once the condition is fulfilled
20 | clearInterval(interval) //< Stop this interval
21 | }
22 | }
23 | }, 100) //< repeat check every 100ms
24 | }
25 |
26 |
27 | if (phantom.args.length === 0 || phantom.args.length > 2) {
28 | console.log('Usage: phantom.js URL')
29 | phantom.exit()
30 | }
31 |
32 | var page = new WebPage()
33 |
34 | // Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this")
35 | page.onConsoleMessage = function(msg) {
36 | console.log(msg)
37 | };
38 |
39 | page.open(phantom.args[0], function(status){
40 | if (status !== "success") {
41 | console.log("Unable to access network")
42 | phantom.exit()
43 | } else {
44 | waitFor(function(){
45 | return page.evaluate(function(){
46 | var el = document.getElementById('qunit-testresult')
47 | if (el && el.innerText.match('completed')) {
48 | return true
49 | }
50 | return false
51 | })
52 | }, function(){
53 | var failedNum = page.evaluate(function(){
54 | var el = document.getElementById('qunit-testresult')
55 | try {
56 | return el.getElementsByClassName('failed')[0].innerHTML
57 | } catch (e) { }
58 | return 10000
59 | });
60 | phantom.exit((parseInt(failedNum, 10) > 0) ? 1 : 0)
61 | })
62 | }
63 | })
64 |
--------------------------------------------------------------------------------
/bower_components/bootstrap/js/tests/unit/phantom.js:
--------------------------------------------------------------------------------
1 | /*
2 | * grunt-contrib-qunit
3 | * http://gruntjs.com/
4 | *
5 | * Copyright (c) 2013 "Cowboy" Ben Alman, contributors
6 | * Licensed under the MIT license.
7 | */
8 |
9 | /*global QUnit:true, alert:true*/
10 | (function () {
11 | 'use strict';
12 |
13 | // Don't re-order tests.
14 | QUnit.config.reorder = false
15 | // Run tests serially, not in parallel.
16 | QUnit.config.autorun = false
17 |
18 | // Send messages to the parent PhantomJS process via alert! Good times!!
19 | function sendMessage() {
20 | var args = [].slice.call(arguments)
21 | alert(JSON.stringify(args))
22 | }
23 |
24 | // These methods connect QUnit to PhantomJS.
25 | QUnit.log = function(obj) {
26 | // What is this I don’t even
27 | if (obj.message === '[object Object], undefined:undefined') { return }
28 | // Parse some stuff before sending it.
29 | var actual = QUnit.jsDump.parse(obj.actual)
30 | var expected = QUnit.jsDump.parse(obj.expected)
31 | // Send it.
32 | sendMessage('qunit.log', obj.result, actual, expected, obj.message, obj.source)
33 | }
34 |
35 | QUnit.testStart = function(obj) {
36 | sendMessage('qunit.testStart', obj.name)
37 | }
38 |
39 | QUnit.testDone = function(obj) {
40 | sendMessage('qunit.testDone', obj.name, obj.failed, obj.passed, obj.total)
41 | }
42 |
43 | QUnit.moduleStart = function(obj) {
44 | sendMessage('qunit.moduleStart', obj.name)
45 | }
46 |
47 | QUnit.begin = function () {
48 | sendMessage('qunit.begin')
49 | console.log("Starting test suite")
50 | console.log("================================================\n")
51 | }
52 |
53 | QUnit.moduleDone = function (opts) {
54 | if (opts.failed === 0) {
55 | console.log("\r\u2714 All tests passed in '" + opts.name + "' module")
56 | } else {
57 | console.log("\u2716 " + opts.failed + " tests failed in '" + opts.name + "' module")
58 | }
59 | sendMessage('qunit.moduleDone', opts.name, opts.failed, opts.passed, opts.total)
60 | }
61 |
62 | QUnit.done = function (opts) {
63 | console.log("\n================================================")
64 | console.log("Tests completed in " + opts.runtime + " milliseconds")
65 | console.log(opts.passed + " tests of " + opts.total + " passed, " + opts.failed + " failed.")
66 | sendMessage('qunit.done', opts.failed, opts.passed, opts.total, opts.runtime)
67 | }
68 |
69 | }())
70 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/highlight/test/highlightSpec.js:
--------------------------------------------------------------------------------
1 | describe('highlight', function () {
2 | var highlightFilter, testPhrase = 'Prefix Highlight Suffix';
3 |
4 | beforeEach(module('ui.highlight'));
5 | beforeEach(inject(function ($filter) {
6 | highlightFilter = $filter('highlight');
7 | }));
8 | describe('case insensitive', function () {
9 | it('should highlight a matching phrase', function () {
10 | expect(highlightFilter(testPhrase, 'highlight')).toEqual('Prefix Highlight Suffix');
11 | });
12 | it('should highlight nothing if no match found', function () {
13 | expect(highlightFilter(testPhrase, 'no match')).toEqual(testPhrase);
14 | });
15 | it('should highlight nothing for the undefined filter', function () {
16 | expect(highlightFilter(testPhrase, undefined)).toEqual(testPhrase);
17 | });
18 | it('should work correctly for number filters', function () {
19 | expect(highlightFilter('3210123', 0)).toEqual('3210123');
20 | });
21 | it('should work correctly for number text', function () {
22 | expect(highlightFilter(3210123, '0')).toEqual('3210123');
23 | });
24 | });
25 | describe('case sensitive', function () {
26 | it('should highlight a matching phrase', function () {
27 | expect(highlightFilter(testPhrase, 'Highlight', true)).toEqual('Prefix Highlight Suffix');
28 | });
29 | it('should highlight nothing if no match found', function () {
30 | expect(highlightFilter(testPhrase, 'no match', true)).toEqual(testPhrase);
31 | });
32 | it('should highlight nothing for the undefined filter', function () {
33 | expect(highlightFilter(testPhrase, undefined, true)).toEqual(testPhrase);
34 | });
35 | it('should work correctly for number filters', function () {
36 | expect(highlightFilter('3210123', 0, true)).toEqual('3210123');
37 | });
38 | it('should work correctly for number text', function () {
39 | expect(highlightFilter(3210123, '0', true)).toEqual('3210123');
40 | });
41 | it('should not highlight a phrase with different letter-casing', function () {
42 | expect(highlightFilter(testPhrase, 'highlight', true)).toEqual(testPhrase);
43 | });
44 | });
45 | it('should highlight nothing if empty filter string passed - issue #114', function () {
46 | expect(highlightFilter(testPhrase, '')).toEqual(testPhrase);
47 | });
48 | });
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/format/demo/index.html:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
Format
18 |
19 |
20 |
21 |
What?
22 |
23 |
Replace tokens in a string in a variety of ways
24 |
25 |
26 |
27 |
32 |
39 |
45 |
46 |
{{ sentence | format : tokens[mode] }}
47 |
Tokens: {{ tokens[mode] | json }}
48 |
49 |
50 |
51 |
Why?
52 |
53 |
Most commonly, this filter is helpful for internationalization. However anywhere you need to do string replacement the format filter will come in handy.
54 |
55 |
How?
56 |
57 | {{ "Hello $0, how are you?" | format : 'Bob' }}
58 | -- or --
59 | $scope.tokens = ['first','second','third'];
60 | ...
61 | {{ "Are you on the $0, $1 or $2?" | format : tokens }}
62 | -- or --
63 | $scope.tokens = { name:'Bob', subject:'wife' };
64 | ...
65 | {{ "Hey :name, how's the :subject?" | format : tokens }}
66 |
50 |
51 |
52 | Back to top
53 |
54 |
56 |
69 |
70 |
71 | {% include footer.html %}
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/mask/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Mask
4 |
5 |
6 |
7 |
63 |
64 |
65 |
66 |
How?
67 |
68 |
TODO !!
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/route/route.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Set a $uiRoute boolean to see if the current route matches
3 | */
4 | angular.module('ui.route', []).directive('uiRoute', ['$location', '$parse', function ($location, $parse) {
5 | return {
6 | restrict: 'AC',
7 | scope: true,
8 | compile: function(tElement, tAttrs) {
9 | var useProperty;
10 | if (tAttrs.uiRoute) {
11 | useProperty = 'uiRoute';
12 | } else if (tAttrs.ngHref) {
13 | useProperty = 'ngHref';
14 | } else if (tAttrs.href) {
15 | useProperty = 'href';
16 | } else {
17 | throw new Error('uiRoute missing a route or href property on ' + tElement[0]);
18 | }
19 | return function ($scope, elm, attrs) {
20 | var modelSetter = $parse(attrs.ngModel || attrs.routeModel || '$uiRoute').assign;
21 | var watcher = angular.noop;
22 |
23 | // Used by href and ngHref
24 | function staticWatcher(newVal) {
25 | if ((hash = newVal.indexOf('#')) > -1){
26 | newVal = newVal.substr(hash + 1);
27 | }
28 | watcher = function watchHref() {
29 | modelSetter($scope, ($location.path().indexOf(newVal) > -1));
30 | };
31 | watcher();
32 | }
33 | // Used by uiRoute
34 | function regexWatcher(newVal) {
35 | if ((hash = newVal.indexOf('#')) > -1){
36 | newVal = newVal.substr(hash + 1);
37 | }
38 | watcher = function watchRegex() {
39 | var regexp = new RegExp('^' + newVal + '$', ['i']);
40 | modelSetter($scope, regexp.test($location.path()));
41 | };
42 | watcher();
43 | }
44 |
45 | switch (useProperty) {
46 | case 'uiRoute':
47 | // if uiRoute={{}} this will be undefined, otherwise it will have a value and $observe() never gets triggered
48 | if (attrs.uiRoute){
49 | regexWatcher(attrs.uiRoute);
50 | }else{
51 | attrs.$observe('uiRoute', regexWatcher);
52 | }
53 | break;
54 | case 'ngHref':
55 | // Setup watcher() every time ngHref changes
56 | if (attrs.ngHref){
57 | staticWatcher(attrs.ngHref);
58 | }else{
59 | attrs.$observe('ngHref', staticWatcher);
60 | }
61 | break;
62 | case 'href':
63 | // Setup watcher()
64 | staticWatcher(attrs.href);
65 | }
66 |
67 | $scope.$on('$routeChangeSuccess', function(){
68 | watcher();
69 | });
70 |
71 | //Added for compatibility with ui-router
72 | $scope.$on('$stateChangeSuccess', function(){
73 | watcher();
74 | });
75 | };
76 | }
77 | };
78 | }]);
79 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/jq/jq.js:
--------------------------------------------------------------------------------
1 | /**
2 | * General-purpose jQuery wrapper. Simply pass the plugin name as the expression.
3 | *
4 | * It is possible to specify a default set of parameters for each jQuery plugin.
5 | * Under the jq key, namespace each plugin by that which will be passed to ui-jq.
6 | * Unfortunately, at this time you can only pre-define the first parameter.
7 | * @example { jq : { datepicker : { showOn:'click' } } }
8 | *
9 | * @param ui-jq {string} The $elm.[pluginName]() to call.
10 | * @param [ui-options] {mixed} Expression to be evaluated and passed as options to the function
11 | * Multiple parameters can be separated by commas
12 | * @param [ui-refresh] {expression} Watch expression and refire plugin on changes
13 | *
14 | * @example
15 | */
16 | angular.module('ui.jq',[]).
17 | value('uiJqConfig',{}).
18 | directive('uiJq', ['uiJqConfig', '$timeout', function uiJqInjectingFunction(uiJqConfig, $timeout) {
19 |
20 | return {
21 | restrict: 'A',
22 | compile: function uiJqCompilingFunction(tElm, tAttrs) {
23 |
24 | if (!angular.isFunction(tElm[tAttrs.uiJq])) {
25 | throw new Error('ui-jq: The "' + tAttrs.uiJq + '" function does not exist');
26 | }
27 | var options = uiJqConfig && uiJqConfig[tAttrs.uiJq];
28 |
29 | return function uiJqLinkingFunction(scope, elm, attrs) {
30 |
31 | var linkOptions = [];
32 |
33 | // If ui-options are passed, merge (or override) them onto global defaults and pass to the jQuery method
34 | if (attrs.uiOptions) {
35 | linkOptions = scope.$eval('[' + attrs.uiOptions + ']');
36 | if (angular.isObject(options) && angular.isObject(linkOptions[0])) {
37 | linkOptions[0] = angular.extend({}, options, linkOptions[0]);
38 | }
39 | } else if (options) {
40 | linkOptions = [options];
41 | }
42 | // If change compatibility is enabled, the form input's "change" event will trigger an "input" event
43 | if (attrs.ngModel && elm.is('select,input,textarea')) {
44 | elm.bind('change', function() {
45 | elm.trigger('input');
46 | });
47 | }
48 |
49 | // Call jQuery method and pass relevant options
50 | function callPlugin() {
51 | $timeout(function() {
52 | elm[attrs.uiJq].apply(elm, linkOptions);
53 | }, 0, false);
54 | }
55 |
56 | // If ui-refresh is used, re-fire the the method upon every change
57 | if (attrs.uiRefresh) {
58 | scope.$watch(attrs.uiRefresh, function(newVal) {
59 | callPlugin();
60 | });
61 | }
62 | callPlugin();
63 | };
64 | }
65 | };
66 | }]);
67 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/showhide/demo/index.html:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
Show, Hide and Toggle Alternatives
15 |
16 |
17 |
18 |
What?
19 |
20 |
Instead of doing ng-show and ng-hide which simply sets
21 | display:block/none a ui-show and
22 | ui-hide class will be added which can give you tighter control over how things appear or disappear.
23 |
CSS3 transitions of course! Applying a class means you can specify exactly how these two states behave. In addition, the show/hide variants do not enforce css rules when they are false (unless you use toggle), so the default CSS can still apply.
39 |
But can't you just do ng-class="{ ui-show : someExpression }"?
40 |
... shutup.
41 |
42 |
In all seriousness, this is just a convenience wrapper for using
43 | ng-class. This way you can simply swap out instances of ng for
44 | ui to immediately get your customized approach.
45 |
46 |
47 |
48 |
How?
49 |
50 | <p><a ng-click="showHide=!showHide">Toggle State: {{!!showHide}}</a></p>
51 | <div ui-show="showHide">Show</div>
52 | <div ui-hide="showHide">Hide</div>
53 | <div ui-toggle="showHide">Toggle</div>
54 |
55 | <style>
56 | .ui-show {
57 | color: blue;
58 | transition: all 0.5s ease; /* You should probably browser-prefix this */
59 | }
60 | .ui-hide {
61 | opacity: 0;
62 | transition: all 0.5s ease; /* You should probably browser-prefix this */
63 | }
64 | </style>
65 |
66 |
Using ui-show or ui-hide will add a class of the same name when the expression is true.
67 |
68 |
69 |
Use ui-toggle if you want to leverage both classes, as
70 | ui-show will be added when true and ui-hide when false.
78 |
--------------------------------------------------------------------------------
/bower_components/bootstrap/js/alert.js:
--------------------------------------------------------------------------------
1 | /* ========================================================================
2 | * Bootstrap: alert.js v3.0.0
3 | * http://twbs.github.com/bootstrap/javascript.html#alerts
4 | * ========================================================================
5 | * Copyright 2013 Twitter, Inc.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * ======================================================================== */
19 |
20 |
21 | +function ($) { "use strict";
22 |
23 | // ALERT CLASS DEFINITION
24 | // ======================
25 |
26 | var dismiss = '[data-dismiss="alert"]'
27 | var Alert = function (el) {
28 | $(el).on('click', dismiss, this.close)
29 | }
30 |
31 | Alert.prototype.close = function (e) {
32 | var $this = $(this)
33 | var selector = $this.attr('data-target')
34 |
35 | if (!selector) {
36 | selector = $this.attr('href')
37 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
38 | }
39 |
40 | var $parent = $(selector)
41 |
42 | if (e) e.preventDefault()
43 |
44 | if (!$parent.length) {
45 | $parent = $this.hasClass('alert') ? $this : $this.parent()
46 | }
47 |
48 | $parent.trigger(e = $.Event('close.bs.alert'))
49 |
50 | if (e.isDefaultPrevented()) return
51 |
52 | $parent.removeClass('in')
53 |
54 | function removeElement() {
55 | $parent.trigger('closed.bs.alert').remove()
56 | }
57 |
58 | $.support.transition && $parent.hasClass('fade') ?
59 | $parent
60 | .one($.support.transition.end, removeElement)
61 | .emulateTransitionEnd(150) :
62 | removeElement()
63 | }
64 |
65 |
66 | // ALERT PLUGIN DEFINITION
67 | // =======================
68 |
69 | var old = $.fn.alert
70 |
71 | $.fn.alert = function (option) {
72 | return this.each(function () {
73 | var $this = $(this)
74 | var data = $this.data('bs.alert')
75 |
76 | if (!data) $this.data('bs.alert', (data = new Alert(this)))
77 | if (typeof option == 'string') data[option].call($this)
78 | })
79 | }
80 |
81 | $.fn.alert.Constructor = Alert
82 |
83 |
84 | // ALERT NO CONFLICT
85 | // =================
86 |
87 | $.fn.alert.noConflict = function () {
88 | $.fn.alert = old
89 | return this
90 | }
91 |
92 |
93 | // ALERT DATA-API
94 | // ==============
95 |
96 | $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
97 |
98 | }(window.jQuery);
99 |
--------------------------------------------------------------------------------
/bower_components/bootstrap/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Bootstrap
2 |
3 | Looking to contribute something to Bootstrap? **Here's how you can help.**
4 |
5 |
6 |
7 | ## Reporting issues
8 |
9 | We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within the Bootstrap core. Please read the following guidelines before opening any issue.
10 |
11 | 1. **Search for existing issues.** We get a lot of duplicate issues, and you'd help us out a lot by first checking if someone else has reported the same issue. Moreover, the issue may have already been resolved with a fix available.
12 | 2. **Create an isolated and reproducible test case.** Be sure the problem exists in Bootstrap's code with a [reduced test case](http://css-tricks.com/reduced-test-cases/) that should be included in each bug report.
13 | 3. **Include a live example.** Make use of jsFiddle or jsBin to share your isolated test cases.
14 | 4. **Share as much information as possible.** Include operating system and version, browser and version, version of Bootstrap, customized or vanilla build, etc. where appropriate. Also include steps to reproduce the bug.
15 |
16 |
17 |
18 | ## Key branches
19 |
20 | - `master` is the latest, deployed version.
21 | - `gh-pages` is the hosted docs (not to be used for pull requests).
22 | - `*-wip` is the official work in progress branch for the next release.
23 |
24 |
25 |
26 | ## Pull requests
27 |
28 | - Try to submit pull requests against the latest `*-wip` branch for easier merging
29 | - CSS changes must be done in .less files first, never just the compiled files
30 | - If modifying the .less files, always recompile and commit the compiled files bootstrap.css and bootstrap.min.css
31 | - Try not to pollute your pull request with unintended changes--keep them simple and small
32 | - Try to share which browsers your code has been tested in before submitting a pull request
33 |
34 |
35 |
36 | ## Coding standards
37 |
38 | ### HTML
39 |
40 | - Two spaces for indentation, never tabs
41 | - Double quotes only, never single quotes
42 | - Always use proper indentation
43 | - Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags)
44 |
45 | ### CSS
46 |
47 | - Adhere to the [Recess CSS property order](http://markdotto.com/2011/11/29/css-property-order/)
48 | - Multiple-line approach (one property and value per line)
49 | - Always a space after a property's colon (.e.g, `display: block;` and not `display:block;`)
50 | - End all lines with a semi-colon
51 | - For multiple, comma-separated selectors, place each selector on it's own line
52 | - Attribute selectors, like `input[type="text"]` should always wrap the attribute's value in double quotes, for consistency and safety (see this [blog post on unquoted attribute values](http://mathiasbynens.be/notes/unquoted-attribute-values) that can lead to XSS attacks).
53 |
54 | ### JS
55 |
56 | - No semicolons
57 | - Comma first
58 | - 2 spaces (no tabs)
59 | - strict mode
60 | - "Attractive"
61 |
62 |
63 |
64 | ## License
65 |
66 | By contributing your code, you agree to license your contribution under the terms of the APLv2: https://github.com/twbs/bootstrap/blob/master/LICENSE
67 |
--------------------------------------------------------------------------------
/bower_components/angular-ui-utils/modules/jq/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
jQuery Passthrough
4 |
5 |
6 |
7 |
What?
8 |
9 |
Call the jQuery function or plugin specified on the element.
Not every jQuery plugin requires creating a new directive just to use it. Instead, use the pass-through directive to rapidly port functionality. It is probably the best solution for 75% of the cases you will encounter.
30 |
31 |
If a plugin requires more robust integration with AngularJS then you may need to look into creating a custom directive instead, or
32 | contact us with a request.
33 |
34 |
35 |
36 |
37 |
How?
38 |
39 |
To call something like $.fn.tooltip() simply do
40 | ui-jq="tooltip". Note that the name of the function must be identical. This also works for normal jQuery commands such as
41 | $.fn.slideUp().
42 |
43 |
To pass parameters use the ui-options attribute. The value will be evaluated in the
44 | $scope context and passed to the function. If defaults are set, the passed options will extend them. If a string is passed, the default options will be ignored.
45 |
46 |
47 |
Use the directive name jq for namespacing inside
48 | uiJqConfig. Then sub-namespace options for each function by the name of that function (exactly as it is passed to
49 | ui-jq) so that you don't have to pass options every time you call the directive.
50 |
51 | <a title="Easiest. Binding. Ever!" ui-jq="tooltip">Hover over me for static Tooltip</a>
52 |
53 | <a data-original-title="{{tooltip}}" ui-jq="tooltip">Fill the input for a dynamic Tooltip:</a>
54 | <input type="text" ng-model="tooltip" placeholder="Tooltip Content">
55 |
56 | <script>
57 | myModule.value('uiJqConfig', {
58 | // The Tooltip namespace
59 | tooltip: {
60 | // Tooltip options. This object will be used as the defaults
61 | placement: 'right'
62 | }
63 | });
64 | </script>
65 |
66 |
67 |
--------------------------------------------------------------------------------
/bower_components/bootstrap/js/tests/unit/tab.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | module("tabs")
4 |
5 | test("should provide no conflict", function () {
6 | var tab = $.fn.tab.noConflict()
7 | ok(!$.fn.tab, 'tab was set back to undefined (org value)')
8 | $.fn.tab = tab
9 | })
10 |
11 | test("should be defined on jquery object", function () {
12 | ok($(document.body).tab, 'tabs method is defined')
13 | })
14 |
15 | test("should return element", function () {
16 | ok($(document.body).tab()[0] == document.body, 'document.body returned')
17 | })
18 |
19 | test("should activate element by tab id", function () {
20 | var tabsHTML =
21 | '
The ui-validate directive makes it very easy to create custom validator expressions.
18 |
19 |
20 |
34 |
35 |
Why?
36 |
37 |
AngularJS comes with several built-in validation mechanism for input fields (ngRequired, ngPattern etc.) but using an arbitrary validation function requires creation of custom formatters and / or parsers. The ui-validate directive makes it easy to use any function(s) defined in scope as a validator function(s).