rails-angular-strap 2.1.6 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -10
- data/lib/rails-angular-strap/version.rb +1 -1
- data/vendor/assets/javascripts/angular-strap.js +1 -1
- data/vendor/assets/javascripts/angular-strap.min.js +1 -1
- data/vendor/assets/javascripts/angular-strap/angular-strap.js +1405 -1104
- data/vendor/assets/javascripts/angular-strap/angular-strap.min.js +4 -5
- data/vendor/assets/javascripts/angular-strap/angular-strap.tpl.js +15 -15
- data/vendor/assets/javascripts/angular-strap/angular-strap.tpl.min.js +2 -2
- metadata +2 -192
- data/vendor/assets/javascripts/angular-strap-unstable.js +0 -2
- data/vendor/assets/javascripts/angular-strap-unstable.min.js +0 -2
- data/vendor/assets/javascripts/angular-strap/angular-strap.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/affix.js +0 -249
- data/vendor/assets/javascripts/angular-strap/modules/affix.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/affix.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/alert.js +0 -120
- data/vendor/assets/javascripts/angular-strap/modules/alert.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/alert.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/alert.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/alert.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/aside.js +0 -96
- data/vendor/assets/javascripts/angular-strap/modules/aside.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/aside.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/aside.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/aside.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/button.js +0 -177
- data/vendor/assets/javascripts/angular-strap/modules/button.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/button.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/collapse.js +0 -273
- data/vendor/assets/javascripts/angular-strap/modules/collapse.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/collapse.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/date-formatter.js +0 -61
- data/vendor/assets/javascripts/angular-strap/modules/date-formatter.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/date-formatter.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/date-parser.js +0 -273
- data/vendor/assets/javascripts/angular-strap/modules/date-parser.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/date-parser.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.js +0 -640
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/datepicker.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/debounce.js +0 -62
- data/vendor/assets/javascripts/angular-strap/modules/debounce.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/debounce.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/dimensions.js +0 -156
- data/vendor/assets/javascripts/angular-strap/modules/dimensions.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/dimensions.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.js +0 -149
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/dropdown.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/modal.js +0 -349
- data/vendor/assets/javascripts/angular-strap/modules/modal.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/modal.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/modal.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/modal.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/navbar.js +0 -72
- data/vendor/assets/javascripts/angular-strap/modules/navbar.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/navbar.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/parse-options.js +0 -76
- data/vendor/assets/javascripts/angular-strap/modules/parse-options.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/parse-options.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/popover.js +0 -112
- data/vendor/assets/javascripts/angular-strap/modules/popover.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/popover.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/popover.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/popover.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/raf.js +0 -61
- data/vendor/assets/javascripts/angular-strap/modules/raf.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/raf.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/scrollspy.js +0 -261
- data/vendor/assets/javascripts/angular-strap/modules/scrollspy.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/scrollspy.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/select.js +0 -325
- data/vendor/assets/javascripts/angular-strap/modules/select.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/select.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/select.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/select.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/tab.js +0 -186
- data/vendor/assets/javascripts/angular-strap/modules/tab.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/tab.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/tab.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/tab.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.js +0 -485
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/timepicker.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.js +0 -690
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/tooltip.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.js +0 -266
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/modules/typeahead.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.js +0 -5040
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.min.js +0 -11
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.tpl.js +0 -89
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/affix.js +0 -249
- data/vendor/assets/javascripts/angular-strap/unstable/modules/affix.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/affix.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.js +0 -120
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.js +0 -96
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/button.js +0 -177
- data/vendor/assets/javascripts/angular-strap/unstable/modules/button.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/button.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/collapse.js +0 -273
- data/vendor/assets/javascripts/angular-strap/unstable/modules/collapse.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/collapse.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-formatter.js +0 -61
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-formatter.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-formatter.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-parser.js +0 -273
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-parser.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-parser.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.js +0 -640
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/debounce.js +0 -62
- data/vendor/assets/javascripts/angular-strap/unstable/modules/debounce.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/debounce.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dimensions.js +0 -156
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dimensions.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dimensions.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.js +0 -149
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.js +0 -357
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/navbar.js +0 -72
- data/vendor/assets/javascripts/angular-strap/unstable/modules/navbar.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/navbar.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/parse-options.js +0 -76
- data/vendor/assets/javascripts/angular-strap/unstable/modules/parse-options.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/parse-options.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.js +0 -112
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/raf.js +0 -61
- data/vendor/assets/javascripts/angular-strap/unstable/modules/raf.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/raf.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/scrollspy.js +0 -261
- data/vendor/assets/javascripts/angular-strap/unstable/modules/scrollspy.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/scrollspy.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.js +0 -328
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.js +0 -186
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.js +0 -485
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.js +0 -705
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.tpl.min.js +0 -8
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.js +0 -266
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.min.js +0 -9
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.min.js.map +0 -1
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.tpl.js +0 -14
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.tpl.min.js +0 -8
@@ -1,14 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
'use strict';
|
9
|
-
|
10
|
-
angular.module('mgcrea.ngStrap.dropdown').run(['$templateCache', function($templateCache) {
|
11
|
-
|
12
|
-
$templateCache.put('dropdown/dropdown.tpl.html', '<ul tabindex="-1" class="dropdown-menu" role="menu"><li role="presentation" ng-class="{divider: item.divider}" ng-repeat="item in content"><a role="menuitem" tabindex="-1" ng-href="{{item.href}}" ng-if="!item.divider && item.href" target="{{item.target || \'\'}}" ng-bind="item.text"></a> <a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-if="!item.divider && item.click" ng-click="$eval(item.click);$hide()" ng-bind="item.text"></a></li></ul>');
|
13
|
-
|
14
|
-
}]);
|
@@ -1,8 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
"use strict";angular.module("mgcrea.ngStrap.dropdown").run(["$templateCache",function(e){e.put("dropdown/dropdown.tpl.html",'<ul tabindex="-1" class="dropdown-menu" role="menu"><li role="presentation" ng-class="{divider: item.divider}" ng-repeat="item in content"><a role="menuitem" tabindex="-1" ng-href="{{item.href}}" ng-if="!item.divider && item.href" target="{{item.target || \'\'}}" ng-bind="item.text"></a> <a role="menuitem" tabindex="-1" href="javascript:void(0)" ng-if="!item.divider && item.click" ng-click="$eval(item.click);$hide()" ng-bind="item.text"></a></li></ul>')}]);
|
@@ -1,349 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
'use strict';
|
9
|
-
|
10
|
-
angular.module('mgcrea.ngStrap.modal', ['mgcrea.ngStrap.helpers.dimensions'])
|
11
|
-
|
12
|
-
.provider('$modal', function() {
|
13
|
-
|
14
|
-
var defaults = this.defaults = {
|
15
|
-
animation: 'am-fade',
|
16
|
-
backdropAnimation: 'am-fade',
|
17
|
-
prefixClass: 'modal',
|
18
|
-
prefixEvent: 'modal',
|
19
|
-
placement: 'top',
|
20
|
-
template: 'modal/modal.tpl.html',
|
21
|
-
contentTemplate: false,
|
22
|
-
container: false,
|
23
|
-
element: null,
|
24
|
-
backdrop: true,
|
25
|
-
keyboard: true,
|
26
|
-
html: false,
|
27
|
-
show: true
|
28
|
-
};
|
29
|
-
|
30
|
-
this.$get = ["$window", "$rootScope", "$compile", "$q", "$templateCache", "$http", "$animate", "$timeout", "$sce", "dimensions", function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $timeout, $sce, dimensions) {
|
31
|
-
|
32
|
-
var forEach = angular.forEach;
|
33
|
-
var trim = String.prototype.trim;
|
34
|
-
var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;
|
35
|
-
var bodyElement = angular.element($window.document.body);
|
36
|
-
var htmlReplaceRegExp = /ng-bind="/ig;
|
37
|
-
|
38
|
-
function ModalFactory(config) {
|
39
|
-
|
40
|
-
var $modal = {};
|
41
|
-
|
42
|
-
// Common vars
|
43
|
-
var options = $modal.$options = angular.extend({}, defaults, config);
|
44
|
-
$modal.$promise = fetchTemplate(options.template);
|
45
|
-
var scope = $modal.$scope = options.scope && options.scope.$new() || $rootScope.$new();
|
46
|
-
if(!options.element && !options.container) {
|
47
|
-
options.container = 'body';
|
48
|
-
}
|
49
|
-
|
50
|
-
// store $id to identify the triggering element in events
|
51
|
-
// give priority to options.id, otherwise, try to use
|
52
|
-
// element id if defined
|
53
|
-
$modal.$id = options.id || options.element && options.element.attr('id') || '';
|
54
|
-
|
55
|
-
// Support scope as string options
|
56
|
-
forEach(['title', 'content'], function(key) {
|
57
|
-
if(options[key]) scope[key] = $sce.trustAsHtml(options[key]);
|
58
|
-
});
|
59
|
-
|
60
|
-
// Provide scope helpers
|
61
|
-
scope.$hide = function() {
|
62
|
-
scope.$$postDigest(function() {
|
63
|
-
$modal.hide();
|
64
|
-
});
|
65
|
-
};
|
66
|
-
scope.$show = function() {
|
67
|
-
scope.$$postDigest(function() {
|
68
|
-
$modal.show();
|
69
|
-
});
|
70
|
-
};
|
71
|
-
scope.$toggle = function() {
|
72
|
-
scope.$$postDigest(function() {
|
73
|
-
$modal.toggle();
|
74
|
-
});
|
75
|
-
};
|
76
|
-
// Publish isShown as a protected var on scope
|
77
|
-
$modal.$isShown = scope.$isShown = false;
|
78
|
-
|
79
|
-
// Support contentTemplate option
|
80
|
-
if(options.contentTemplate) {
|
81
|
-
$modal.$promise = $modal.$promise.then(function(template) {
|
82
|
-
var templateEl = angular.element(template);
|
83
|
-
return fetchTemplate(options.contentTemplate)
|
84
|
-
.then(function(contentTemplate) {
|
85
|
-
var contentEl = findElement('[ng-bind="content"]', templateEl[0]).removeAttr('ng-bind').html(contentTemplate);
|
86
|
-
// Drop the default footer as you probably don't want it if you use a custom contentTemplate
|
87
|
-
if(!config.template) contentEl.next().remove();
|
88
|
-
return templateEl[0].outerHTML;
|
89
|
-
});
|
90
|
-
});
|
91
|
-
}
|
92
|
-
|
93
|
-
// Fetch, compile then initialize modal
|
94
|
-
var modalLinker, modalElement;
|
95
|
-
var backdropElement = angular.element('<div class="' + options.prefixClass + '-backdrop"/>');
|
96
|
-
$modal.$promise.then(function(template) {
|
97
|
-
if(angular.isObject(template)) template = template.data;
|
98
|
-
if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html="');
|
99
|
-
template = trim.apply(template);
|
100
|
-
modalLinker = $compile(template);
|
101
|
-
$modal.init();
|
102
|
-
});
|
103
|
-
|
104
|
-
$modal.init = function() {
|
105
|
-
|
106
|
-
// Options: show
|
107
|
-
if(options.show) {
|
108
|
-
scope.$$postDigest(function() {
|
109
|
-
$modal.show();
|
110
|
-
});
|
111
|
-
}
|
112
|
-
|
113
|
-
};
|
114
|
-
|
115
|
-
$modal.destroy = function() {
|
116
|
-
|
117
|
-
// Remove element
|
118
|
-
if(modalElement) {
|
119
|
-
modalElement.remove();
|
120
|
-
modalElement = null;
|
121
|
-
}
|
122
|
-
if(backdropElement) {
|
123
|
-
backdropElement.remove();
|
124
|
-
backdropElement = null;
|
125
|
-
}
|
126
|
-
|
127
|
-
// Destroy scope
|
128
|
-
scope.$destroy();
|
129
|
-
|
130
|
-
};
|
131
|
-
|
132
|
-
$modal.show = function() {
|
133
|
-
if($modal.$isShown) return;
|
134
|
-
|
135
|
-
if(scope.$emit(options.prefixEvent + '.show.before', $modal).defaultPrevented) {
|
136
|
-
return;
|
137
|
-
}
|
138
|
-
var parent, after;
|
139
|
-
if(angular.isElement(options.container)) {
|
140
|
-
parent = options.container;
|
141
|
-
after = options.container[0].lastChild ? angular.element(options.container[0].lastChild) : null;
|
142
|
-
} else {
|
143
|
-
if (options.container) {
|
144
|
-
parent = findElement(options.container);
|
145
|
-
after = parent[0].lastChild ? angular.element(parent[0].lastChild) : null;
|
146
|
-
} else {
|
147
|
-
parent = null;
|
148
|
-
after = options.element;
|
149
|
-
}
|
150
|
-
}
|
151
|
-
|
152
|
-
// Fetch a cloned element linked from template
|
153
|
-
modalElement = $modal.$element = modalLinker(scope, function(clonedElement, scope) {});
|
154
|
-
|
155
|
-
// Set the initial positioning.
|
156
|
-
modalElement.css({display: 'block'}).addClass(options.placement);
|
157
|
-
|
158
|
-
// Options: animation
|
159
|
-
if(options.animation) {
|
160
|
-
if(options.backdrop) {
|
161
|
-
backdropElement.addClass(options.backdropAnimation);
|
162
|
-
}
|
163
|
-
modalElement.addClass(options.animation);
|
164
|
-
}
|
165
|
-
|
166
|
-
if(options.backdrop) {
|
167
|
-
$animate.enter(backdropElement, bodyElement, null);
|
168
|
-
}
|
169
|
-
// Support v1.3+ $animate
|
170
|
-
// https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9
|
171
|
-
var promise = $animate.enter(modalElement, parent, after, enterAnimateCallback);
|
172
|
-
if(promise && promise.then) promise.then(enterAnimateCallback);
|
173
|
-
|
174
|
-
$modal.$isShown = scope.$isShown = true;
|
175
|
-
safeDigest(scope);
|
176
|
-
// Focus once the enter-animation has started
|
177
|
-
// Weird PhantomJS bug hack
|
178
|
-
var el = modalElement[0];
|
179
|
-
requestAnimationFrame(function() {
|
180
|
-
el.focus();
|
181
|
-
});
|
182
|
-
|
183
|
-
bodyElement.addClass(options.prefixClass + '-open');
|
184
|
-
if(options.animation) {
|
185
|
-
bodyElement.addClass(options.prefixClass + '-with-' + options.animation);
|
186
|
-
}
|
187
|
-
|
188
|
-
// Bind events
|
189
|
-
if(options.backdrop) {
|
190
|
-
modalElement.on('click', hideOnBackdropClick);
|
191
|
-
backdropElement.on('click', hideOnBackdropClick);
|
192
|
-
backdropElement.on('wheel', preventEventDefault);
|
193
|
-
}
|
194
|
-
if(options.keyboard) {
|
195
|
-
modalElement.on('keyup', $modal.$onKeyUp);
|
196
|
-
}
|
197
|
-
};
|
198
|
-
|
199
|
-
function enterAnimateCallback() {
|
200
|
-
scope.$emit(options.prefixEvent + '.show', $modal);
|
201
|
-
}
|
202
|
-
|
203
|
-
$modal.hide = function() {
|
204
|
-
if(!$modal.$isShown) return;
|
205
|
-
|
206
|
-
if(scope.$emit(options.prefixEvent + '.hide.before', $modal).defaultPrevented) {
|
207
|
-
return;
|
208
|
-
}
|
209
|
-
var promise = $animate.leave(modalElement, leaveAnimateCallback);
|
210
|
-
// Support v1.3+ $animate
|
211
|
-
// https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9
|
212
|
-
if(promise && promise.then) promise.then(leaveAnimateCallback);
|
213
|
-
|
214
|
-
if(options.backdrop) {
|
215
|
-
$animate.leave(backdropElement);
|
216
|
-
}
|
217
|
-
$modal.$isShown = scope.$isShown = false;
|
218
|
-
safeDigest(scope);
|
219
|
-
|
220
|
-
// Unbind events
|
221
|
-
if(options.backdrop) {
|
222
|
-
modalElement.off('click', hideOnBackdropClick);
|
223
|
-
backdropElement.off('click', hideOnBackdropClick);
|
224
|
-
backdropElement.off('wheel', preventEventDefault);
|
225
|
-
}
|
226
|
-
if(options.keyboard) {
|
227
|
-
modalElement.off('keyup', $modal.$onKeyUp);
|
228
|
-
}
|
229
|
-
};
|
230
|
-
|
231
|
-
function leaveAnimateCallback() {
|
232
|
-
scope.$emit(options.prefixEvent + '.hide', $modal);
|
233
|
-
bodyElement.removeClass(options.prefixClass + '-open');
|
234
|
-
if(options.animation) {
|
235
|
-
bodyElement.removeClass(options.prefixClass + '-with-' + options.animation);
|
236
|
-
}
|
237
|
-
}
|
238
|
-
|
239
|
-
$modal.toggle = function() {
|
240
|
-
|
241
|
-
$modal.$isShown ? $modal.hide() : $modal.show();
|
242
|
-
|
243
|
-
};
|
244
|
-
|
245
|
-
$modal.focus = function() {
|
246
|
-
modalElement[0].focus();
|
247
|
-
};
|
248
|
-
|
249
|
-
// Protected methods
|
250
|
-
|
251
|
-
$modal.$onKeyUp = function(evt) {
|
252
|
-
|
253
|
-
if (evt.which === 27 && $modal.$isShown) {
|
254
|
-
$modal.hide();
|
255
|
-
evt.stopPropagation();
|
256
|
-
}
|
257
|
-
|
258
|
-
};
|
259
|
-
|
260
|
-
// Private methods
|
261
|
-
|
262
|
-
function hideOnBackdropClick(evt) {
|
263
|
-
if(evt.target !== evt.currentTarget) return;
|
264
|
-
options.backdrop === 'static' ? $modal.focus() : $modal.hide();
|
265
|
-
}
|
266
|
-
|
267
|
-
function preventEventDefault(evt) {
|
268
|
-
evt.preventDefault();
|
269
|
-
}
|
270
|
-
|
271
|
-
return $modal;
|
272
|
-
|
273
|
-
}
|
274
|
-
|
275
|
-
// Helper functions
|
276
|
-
|
277
|
-
function safeDigest(scope) {
|
278
|
-
scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();
|
279
|
-
}
|
280
|
-
|
281
|
-
function findElement(query, element) {
|
282
|
-
return angular.element((element || document).querySelectorAll(query));
|
283
|
-
}
|
284
|
-
|
285
|
-
var fetchPromises = {};
|
286
|
-
function fetchTemplate(template) {
|
287
|
-
if(fetchPromises[template]) return fetchPromises[template];
|
288
|
-
return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))
|
289
|
-
.then(function(res) {
|
290
|
-
if(angular.isObject(res)) {
|
291
|
-
$templateCache.put(template, res.data);
|
292
|
-
return res.data;
|
293
|
-
}
|
294
|
-
return res;
|
295
|
-
}));
|
296
|
-
}
|
297
|
-
|
298
|
-
return ModalFactory;
|
299
|
-
|
300
|
-
}];
|
301
|
-
|
302
|
-
})
|
303
|
-
|
304
|
-
.directive('bsModal', ["$window", "$sce", "$modal", function($window, $sce, $modal) {
|
305
|
-
|
306
|
-
return {
|
307
|
-
restrict: 'EAC',
|
308
|
-
scope: true,
|
309
|
-
link: function postLink(scope, element, attr, transclusion) {
|
310
|
-
|
311
|
-
// Directive options
|
312
|
-
var options = {scope: scope, element: element, show: false};
|
313
|
-
angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation', 'id'], function(key) {
|
314
|
-
if(angular.isDefined(attr[key])) options[key] = attr[key];
|
315
|
-
});
|
316
|
-
|
317
|
-
// Support scope as data-attrs
|
318
|
-
angular.forEach(['title', 'content'], function(key) {
|
319
|
-
attr[key] && attr.$observe(key, function(newValue, oldValue) {
|
320
|
-
scope[key] = $sce.trustAsHtml(newValue);
|
321
|
-
});
|
322
|
-
});
|
323
|
-
|
324
|
-
// Support scope as an object
|
325
|
-
attr.bsModal && scope.$watch(attr.bsModal, function(newValue, oldValue) {
|
326
|
-
if(angular.isObject(newValue)) {
|
327
|
-
angular.extend(scope, newValue);
|
328
|
-
} else {
|
329
|
-
scope.content = newValue;
|
330
|
-
}
|
331
|
-
}, true);
|
332
|
-
|
333
|
-
// Initialize modal
|
334
|
-
var modal = $modal(options);
|
335
|
-
|
336
|
-
// Trigger
|
337
|
-
element.on(attr.trigger || 'click', modal.toggle);
|
338
|
-
|
339
|
-
// Garbage collection
|
340
|
-
scope.$on('$destroy', function() {
|
341
|
-
if (modal) modal.destroy();
|
342
|
-
options = null;
|
343
|
-
modal = null;
|
344
|
-
});
|
345
|
-
|
346
|
-
}
|
347
|
-
};
|
348
|
-
|
349
|
-
}]);
|
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
"use strict";angular.module("mgcrea.ngStrap.modal",["mgcrea.ngStrap.helpers.dimensions"]).provider("$modal",function(){var e=this.defaults={animation:"am-fade",backdropAnimation:"am-fade",prefixClass:"modal",prefixEvent:"modal",placement:"top",template:"modal/modal.tpl.html",contentTemplate:!1,container:!1,element:null,backdrop:!0,keyboard:!0,html:!1,show:!0};this.$get=["$window","$rootScope","$compile","$q","$templateCache","$http","$animate","$timeout","$sce","dimensions",function(n,t,o,a,i,r,l,c,s){function u(n){function a(){b.$emit(w.prefixEvent+".show",u)}function i(){b.$emit(w.prefixEvent+".hide",u),g.removeClass(w.prefixClass+"-open"),w.animation&&g.removeClass(w.prefixClass+"-with-"+w.animation)}function r(e){e.target===e.currentTarget&&("static"===w.backdrop?u.focus():u.hide())}function c(e){e.preventDefault()}var u={},w=u.$options=angular.extend({},e,n);u.$promise=p(w.template);var b=u.$scope=w.scope&&w.scope.$new()||t.$new();w.element||w.container||(w.container="body"),u.$id=w.id||w.element&&w.element.attr("id")||"",f(["title","content"],function(e){w[e]&&(b[e]=s.trustAsHtml(w[e]))}),b.$hide=function(){b.$$postDigest(function(){u.hide()})},b.$show=function(){b.$$postDigest(function(){u.show()})},b.$toggle=function(){b.$$postDigest(function(){u.toggle()})},u.$isShown=b.$isShown=!1,w.contentTemplate&&(u.$promise=u.$promise.then(function(e){var t=angular.element(e);return p(w.contentTemplate).then(function(e){var o=m('[ng-bind="content"]',t[0]).removeAttr("ng-bind").html(e);return n.template||o.next().remove(),t[0].outerHTML})}));var k,y,C=angular.element('<div class="'+w.prefixClass+'-backdrop"/>');return u.$promise.then(function(e){angular.isObject(e)&&(e=e.data),w.html&&(e=e.replace(v,'ng-bind-html="')),e=h.apply(e),k=o(e),u.init()}),u.init=function(){w.show&&b.$$postDigest(function(){u.show()})},u.destroy=function(){y&&(y.remove(),y=null),C&&(C.remove(),C=null),b.$destroy()},u.show=function(){if(!u.$isShown&&!b.$emit(w.prefixEvent+".show.before",u).defaultPrevented){var e,n;angular.isElement(w.container)?(e=w.container,n=w.container[0].lastChild?angular.element(w.container[0].lastChild):null):w.container?(e=m(w.container),n=e[0].lastChild?angular.element(e[0].lastChild):null):(e=null,n=w.element),y=u.$element=k(b,function(){}),y.css({display:"block"}).addClass(w.placement),w.animation&&(w.backdrop&&C.addClass(w.backdropAnimation),y.addClass(w.animation)),w.backdrop&&l.enter(C,g,null);var t=l.enter(y,e,n,a);t&&t.then&&t.then(a),u.$isShown=b.$isShown=!0,d(b);var o=y[0];$(function(){o.focus()}),g.addClass(w.prefixClass+"-open"),w.animation&&g.addClass(w.prefixClass+"-with-"+w.animation),w.backdrop&&(y.on("click",r),C.on("click",r),C.on("wheel",c)),w.keyboard&&y.on("keyup",u.$onKeyUp)}},u.hide=function(){if(u.$isShown&&!b.$emit(w.prefixEvent+".hide.before",u).defaultPrevented){var e=l.leave(y,i);e&&e.then&&e.then(i),w.backdrop&&l.leave(C),u.$isShown=b.$isShown=!1,d(b),w.backdrop&&(y.off("click",r),C.off("click",r),C.off("wheel",c)),w.keyboard&&y.off("keyup",u.$onKeyUp)}},u.toggle=function(){u.$isShown?u.hide():u.show()},u.focus=function(){y[0].focus()},u.$onKeyUp=function(e){27===e.which&&u.$isShown&&(u.hide(),e.stopPropagation())},u}function d(e){e.$$phase||e.$root&&e.$root.$$phase||e.$digest()}function m(e,n){return angular.element((n||document).querySelectorAll(e))}function p(e){return w[e]?w[e]:w[e]=a.when(i.get(e)||r.get(e)).then(function(n){return angular.isObject(n)?(i.put(e,n.data),n.data):n})}var f=angular.forEach,h=String.prototype.trim,$=n.requestAnimationFrame||n.setTimeout,g=angular.element(n.document.body),v=/ng-bind="/gi,w={};return u}]}).directive("bsModal",["$window","$sce","$modal",function(e,n,t){return{restrict:"EAC",scope:!0,link:function(e,o,a){var i={scope:e,element:o,show:!1};angular.forEach(["template","contentTemplate","placement","backdrop","keyboard","html","container","animation","id"],function(e){angular.isDefined(a[e])&&(i[e]=a[e])}),angular.forEach(["title","content"],function(t){a[t]&&a.$observe(t,function(o){e[t]=n.trustAsHtml(o)})}),a.bsModal&&e.$watch(a.bsModal,function(n){angular.isObject(n)?angular.extend(e,n):e.content=n},!0);var r=t(i);o.on(a.trigger||"click",r.toggle),e.$on("$destroy",function(){r&&r.destroy(),i=null,r=null})}}}]);
|
9
|
-
//# sourceMappingURL=modal.min.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["modal/modal.js"],"names":[],"mappings":"qBASM,OAAA,wBAAa,+CAEb,SAAW,cAEX,GAAA,KAAiB,UACjB,UAAW,UACX,kBAAS,UACT,YAAU,QACV,YAAU,QACV,UAAM,MACN,SAAM,uDAGR,QAAK,iBAEH,UAAI,EACJ,MAAI,EACJ,MAAI,4JAWE,GAAe,WAiKd,OACD,MAAA,EAAA,YAAA,QAAA,gBAgCJ,EAAO,MAAA,EAAS,YAAW,QAAA,wCAEzB,EAAO,wGA8BF,WAAP,EAAO,SAAA,EAAA,QAAA,EAAA,4CAhOL,mHAMF,GAAO,SAAc,EAAM,mFAUvB,QAAO,WAAA,SAAA,wCAKP,MAAO,mDAKP,MAAO,gGAOR,EAAQ,cAIN,SAAK,EAAS,UAAA,IAGT,oBACJ,SAAO,EAAc,SAAA,KAAA,SAAA,0IAOvB,OADA,GAAa,UAAA,EAAA,OAAA,SACb,EAAkB,GAAA,kBAMpB,GAAO,gEAiLT,oCA9KA,QAAO,SAAO,KAAW,EAAA,EAAA,6DAGvB,EAAW,EAAM,KACf,mCAOJ,EAAO,aAAU,yBAOZ,QAAA,yDAaH,EAAG,cAIA,KAAQ,eACT,EAAA,aAEK,MAAA,EAAA,YAAA,eAAA,GAAA,qBAGH,GAAQ,UACH,UAAA,EAAA,cACL,EAAS,YACT,EAAQ,UAAQ,GAAA,UAAA,QAAA,QAAA,EAAA,UAAA,GAAA,WAAA,kHAYP,EAAA,SAAU,EAAA,EAAA,gBAGrB,KAAa,QAAS,UAAQ,SAAA,EAAA,WAG7B,EAAQ,YACT,EAAS,+EAOX,EAAO,MAAA,EAAiB,EAAW,KAInC,IAAI,GAAK,EAAa,MAAA,EAAA,EAAA,EAAA,EACtB,IAAA,EAAsB,MAAA,EAAW,KAAA,oCAM/B,GAAA,EAAY,8BAKZ,SAAgB,EAAS,YAAA,SACzB,EAAA,WACA,EAAA,SAAmB,EAAS,YAAA,SAAA,EAAA,wDAOhC,EAAS,GAAA,QAAuB,+KAsB3B,EAAQ,UACT,EAAA,MAAa,KAEb,SAAgB,EAAI,UAAS,sDAOjC,EAAS,IAAA,QAAuB,IAE9B,EAAA,UACA,EAAW,IAAA,QAAW,EAAA,cAYtB,OAAa,4DAOb,EAAQ,GAAA,oEASV,EAAA,oBAgBM,gBAOR,EAAI,SAAgB,EAAA,OAAA,EAAA,MAAA,SAAA,EAAA,kBAGlB,GAAQ,EAAc,SAChB,SAAS,SAAK,GAAA,UAAA,iBAAA,wBAKlB,GAAO,GAAA,EAAA,gFAIX,EAAO,IAAA,EAAA,EAAA,wCAlQL,EAAI,OAAS,UAAA,gFAGb,EAAqB,+GA+QhB,uCAKH,IAAa,MAAK,EAAS,QAAK,EAAS,MAAU,WACjD,SAAa,WAAK,kBAAY,YAAA,WAAA,WAAA,OAAA,YAAA,YAAA,MAAA,SAAA,0CAKlC,QAAK,SAAW,QAAM,WAAY,SAAS,GACzC,EAAG,IAAQ,EAAA,SAAS,EAAW,SAAA,GAC7B,EAAA,GAAQ,EAAO,YAAO,qEAOtB,QAAQ,OAAO,EAAA,uBAOjB,GAAI,EAAa,gFAQtB,EAAA","file":"modal.min.js","sourcesContent":["'use strict';\n\nangular.module('mgcrea.ngStrap.modal', ['mgcrea.ngStrap.helpers.dimensions'])\n\n .provider('$modal', function() {\n\n var defaults = this.defaults = {\n animation: 'am-fade',\n backdropAnimation: 'am-fade',\n prefixClass: 'modal',\n prefixEvent: 'modal',\n placement: 'top',\n template: 'modal/modal.tpl.html',\n contentTemplate: false,\n container: false,\n element: null,\n backdrop: true,\n keyboard: true,\n html: false,\n show: true\n };\n\n this.$get = function($window, $rootScope, $compile, $q, $templateCache, $http, $animate, $timeout, $sce, dimensions) {\n\n var forEach = angular.forEach;\n var trim = String.prototype.trim;\n var requestAnimationFrame = $window.requestAnimationFrame || $window.setTimeout;\n var bodyElement = angular.element($window.document.body);\n var htmlReplaceRegExp = /ng-bind=\"/ig;\n\n function ModalFactory(config) {\n\n var $modal = {};\n\n // Common vars\n var options = $modal.$options = angular.extend({}, defaults, config);\n $modal.$promise = fetchTemplate(options.template);\n var scope = $modal.$scope = options.scope && options.scope.$new() || $rootScope.$new();\n if(!options.element && !options.container) {\n options.container = 'body';\n }\n\n // store $id to identify the triggering element in events\n // give priority to options.id, otherwise, try to use\n // element id if defined\n $modal.$id = options.id || options.element && options.element.attr('id') || '';\n\n // Support scope as string options\n forEach(['title', 'content'], function(key) {\n if(options[key]) scope[key] = $sce.trustAsHtml(options[key]);\n });\n\n // Provide scope helpers\n scope.$hide = function() {\n scope.$$postDigest(function() {\n $modal.hide();\n });\n };\n scope.$show = function() {\n scope.$$postDigest(function() {\n $modal.show();\n });\n };\n scope.$toggle = function() {\n scope.$$postDigest(function() {\n $modal.toggle();\n });\n };\n // Publish isShown as a protected var on scope\n $modal.$isShown = scope.$isShown = false;\n\n // Support contentTemplate option\n if(options.contentTemplate) {\n $modal.$promise = $modal.$promise.then(function(template) {\n var templateEl = angular.element(template);\n return fetchTemplate(options.contentTemplate)\n .then(function(contentTemplate) {\n var contentEl = findElement('[ng-bind=\"content\"]', templateEl[0]).removeAttr('ng-bind').html(contentTemplate);\n // Drop the default footer as you probably don't want it if you use a custom contentTemplate\n if(!config.template) contentEl.next().remove();\n return templateEl[0].outerHTML;\n });\n });\n }\n\n // Fetch, compile then initialize modal\n var modalLinker, modalElement;\n var backdropElement = angular.element('<div class=\"' + options.prefixClass + '-backdrop\"/>');\n $modal.$promise.then(function(template) {\n if(angular.isObject(template)) template = template.data;\n if(options.html) template = template.replace(htmlReplaceRegExp, 'ng-bind-html=\"');\n template = trim.apply(template);\n modalLinker = $compile(template);\n $modal.init();\n });\n\n $modal.init = function() {\n\n // Options: show\n if(options.show) {\n scope.$$postDigest(function() {\n $modal.show();\n });\n }\n\n };\n\n $modal.destroy = function() {\n\n // Remove element\n if(modalElement) {\n modalElement.remove();\n modalElement = null;\n }\n if(backdropElement) {\n backdropElement.remove();\n backdropElement = null;\n }\n\n // Destroy scope\n scope.$destroy();\n\n };\n\n $modal.show = function() {\n if($modal.$isShown) return;\n\n if(scope.$emit(options.prefixEvent + '.show.before', $modal).defaultPrevented) {\n return;\n }\n var parent, after;\n if(angular.isElement(options.container)) {\n parent = options.container;\n after = options.container[0].lastChild ? angular.element(options.container[0].lastChild) : null;\n } else {\n if (options.container) {\n parent = findElement(options.container);\n after = parent[0].lastChild ? angular.element(parent[0].lastChild) : null;\n } else {\n parent = null;\n after = options.element;\n }\n }\n\n // Fetch a cloned element linked from template\n modalElement = $modal.$element = modalLinker(scope, function(clonedElement, scope) {});\n\n // Set the initial positioning.\n modalElement.css({display: 'block'}).addClass(options.placement);\n\n // Options: animation\n if(options.animation) {\n if(options.backdrop) {\n backdropElement.addClass(options.backdropAnimation);\n }\n modalElement.addClass(options.animation);\n }\n\n if(options.backdrop) {\n $animate.enter(backdropElement, bodyElement, null);\n }\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n var promise = $animate.enter(modalElement, parent, after, enterAnimateCallback);\n if(promise && promise.then) promise.then(enterAnimateCallback);\n\n $modal.$isShown = scope.$isShown = true;\n safeDigest(scope);\n // Focus once the enter-animation has started\n // Weird PhantomJS bug hack\n var el = modalElement[0];\n requestAnimationFrame(function() {\n el.focus();\n });\n\n bodyElement.addClass(options.prefixClass + '-open');\n if(options.animation) {\n bodyElement.addClass(options.prefixClass + '-with-' + options.animation);\n }\n\n // Bind events\n if(options.backdrop) {\n modalElement.on('click', hideOnBackdropClick);\n backdropElement.on('click', hideOnBackdropClick);\n backdropElement.on('wheel', preventEventDefault);\n }\n if(options.keyboard) {\n modalElement.on('keyup', $modal.$onKeyUp);\n }\n };\n\n function enterAnimateCallback() {\n scope.$emit(options.prefixEvent + '.show', $modal);\n }\n\n $modal.hide = function() {\n if(!$modal.$isShown) return;\n\n if(scope.$emit(options.prefixEvent + '.hide.before', $modal).defaultPrevented) {\n return;\n }\n var promise = $animate.leave(modalElement, leaveAnimateCallback);\n // Support v1.3+ $animate\n // https://github.com/angular/angular.js/commit/bf0f5502b1bbfddc5cdd2f138efd9188b8c652a9\n if(promise && promise.then) promise.then(leaveAnimateCallback);\n\n if(options.backdrop) {\n $animate.leave(backdropElement);\n }\n $modal.$isShown = scope.$isShown = false;\n safeDigest(scope);\n\n // Unbind events\n if(options.backdrop) {\n modalElement.off('click', hideOnBackdropClick);\n backdropElement.off('click', hideOnBackdropClick);\n backdropElement.off('wheel', preventEventDefault);\n }\n if(options.keyboard) {\n modalElement.off('keyup', $modal.$onKeyUp);\n }\n };\n\n function leaveAnimateCallback() {\n scope.$emit(options.prefixEvent + '.hide', $modal);\n bodyElement.removeClass(options.prefixClass + '-open');\n if(options.animation) {\n bodyElement.removeClass(options.prefixClass + '-with-' + options.animation);\n }\n }\n\n $modal.toggle = function() {\n\n $modal.$isShown ? $modal.hide() : $modal.show();\n\n };\n\n $modal.focus = function() {\n modalElement[0].focus();\n };\n\n // Protected methods\n\n $modal.$onKeyUp = function(evt) {\n\n if (evt.which === 27 && $modal.$isShown) {\n $modal.hide();\n evt.stopPropagation();\n }\n\n };\n\n // Private methods\n\n function hideOnBackdropClick(evt) {\n if(evt.target !== evt.currentTarget) return;\n options.backdrop === 'static' ? $modal.focus() : $modal.hide();\n }\n\n function preventEventDefault(evt) {\n evt.preventDefault();\n }\n\n return $modal;\n\n }\n\n // Helper functions\n\n function safeDigest(scope) {\n scope.$$phase || (scope.$root && scope.$root.$$phase) || scope.$digest();\n }\n\n function findElement(query, element) {\n return angular.element((element || document).querySelectorAll(query));\n }\n\n var fetchPromises = {};\n function fetchTemplate(template) {\n if(fetchPromises[template]) return fetchPromises[template];\n return (fetchPromises[template] = $q.when($templateCache.get(template) || $http.get(template))\n .then(function(res) {\n if(angular.isObject(res)) {\n $templateCache.put(template, res.data);\n return res.data;\n }\n return res;\n }));\n }\n\n return ModalFactory;\n\n };\n\n })\n\n .directive('bsModal', function($window, $sce, $modal) {\n\n return {\n restrict: 'EAC',\n scope: true,\n link: function postLink(scope, element, attr, transclusion) {\n\n // Directive options\n var options = {scope: scope, element: element, show: false};\n angular.forEach(['template', 'contentTemplate', 'placement', 'backdrop', 'keyboard', 'html', 'container', 'animation', 'id'], function(key) {\n if(angular.isDefined(attr[key])) options[key] = attr[key];\n });\n\n // Support scope as data-attrs\n angular.forEach(['title', 'content'], function(key) {\n attr[key] && attr.$observe(key, function(newValue, oldValue) {\n scope[key] = $sce.trustAsHtml(newValue);\n });\n });\n\n // Support scope as an object\n attr.bsModal && scope.$watch(attr.bsModal, function(newValue, oldValue) {\n if(angular.isObject(newValue)) {\n angular.extend(scope, newValue);\n } else {\n scope.content = newValue;\n }\n }, true);\n\n // Initialize modal\n var modal = $modal(options);\n\n // Trigger\n element.on(attr.trigger || 'click', modal.toggle);\n\n // Garbage collection\n scope.$on('$destroy', function() {\n if (modal) modal.destroy();\n options = null;\n modal = null;\n });\n\n }\n };\n\n });\n"],"sourceRoot":"/source/"}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
'use strict';
|
9
|
-
|
10
|
-
angular.module('mgcrea.ngStrap.modal').run(['$templateCache', function($templateCache) {
|
11
|
-
|
12
|
-
$templateCache.put('modal/modal.tpl.html', '<div class="modal" tabindex="-1" role="dialog"><div class="modal-dialog"><div class="modal-content"><div class="modal-header" ng-show="title"><button type="button" class="close" ng-click="$hide()">×</button><h4 class="modal-title" ng-bind="title"></h4></div><div class="modal-body" ng-bind="content"></div><div class="modal-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>');
|
13
|
-
|
14
|
-
}]);
|
@@ -1,8 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
"use strict";angular.module("mgcrea.ngStrap.modal").run(["$templateCache",function(t){t.put("modal/modal.tpl.html",'<div class="modal" tabindex="-1" role="dialog"><div class="modal-dialog"><div class="modal-content"><div class="modal-header" ng-show="title"><button type="button" class="close" ng-click="$hide()">×</button><h4 class="modal-title" ng-bind="title"></h4></div><div class="modal-body" ng-bind="content"></div><div class="modal-footer"><button type="button" class="btn btn-default" ng-click="$hide()">Close</button></div></div></div></div>')}]);
|
@@ -1,72 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* angular-strap
|
3
|
-
* @version v2.1.6 - 2015-01-11
|
4
|
-
* @link http://mgcrea.github.io/angular-strap
|
5
|
-
* @author Olivier Louvignes (olivier@mg-crea.com)
|
6
|
-
* @license MIT License, http://www.opensource.org/licenses/MIT
|
7
|
-
*/
|
8
|
-
'use strict';
|
9
|
-
|
10
|
-
angular.module('mgcrea.ngStrap.navbar', [])
|
11
|
-
|
12
|
-
.provider('$navbar', function() {
|
13
|
-
|
14
|
-
var defaults = this.defaults = {
|
15
|
-
activeClass: 'active',
|
16
|
-
routeAttr: 'data-match-route',
|
17
|
-
strict: false
|
18
|
-
};
|
19
|
-
|
20
|
-
this.$get = function() {
|
21
|
-
return {defaults: defaults};
|
22
|
-
};
|
23
|
-
|
24
|
-
})
|
25
|
-
|
26
|
-
.directive('bsNavbar', ["$window", "$location", "$navbar", function($window, $location, $navbar) {
|
27
|
-
|
28
|
-
var defaults = $navbar.defaults;
|
29
|
-
|
30
|
-
return {
|
31
|
-
restrict: 'A',
|
32
|
-
link: function postLink(scope, element, attr, controller) {
|
33
|
-
|
34
|
-
// Directive options
|
35
|
-
var options = angular.copy(defaults);
|
36
|
-
angular.forEach(Object.keys(defaults), function(key) {
|
37
|
-
if(angular.isDefined(attr[key])) options[key] = attr[key];
|
38
|
-
});
|
39
|
-
|
40
|
-
// Watch for the $location
|
41
|
-
scope.$watch(function() {
|
42
|
-
|
43
|
-
return $location.path();
|
44
|
-
|
45
|
-
}, function(newValue, oldValue) {
|
46
|
-
|
47
|
-
var liElements = element[0].querySelectorAll('li[' + options.routeAttr + ']');
|
48
|
-
|
49
|
-
angular.forEach(liElements, function(li) {
|
50
|
-
|
51
|
-
var liElement = angular.element(li);
|
52
|
-
var pattern = liElement.attr(options.routeAttr).replace('/', '\\/');
|
53
|
-
if(options.strict) {
|
54
|
-
pattern = '^' + pattern + '$';
|
55
|
-
}
|
56
|
-
var regexp = new RegExp(pattern, ['i']);
|
57
|
-
|
58
|
-
if(regexp.test(newValue)) {
|
59
|
-
liElement.addClass(options.activeClass);
|
60
|
-
} else {
|
61
|
-
liElement.removeClass(options.activeClass);
|
62
|
-
}
|
63
|
-
|
64
|
-
});
|
65
|
-
|
66
|
-
});
|
67
|
-
|
68
|
-
}
|
69
|
-
|
70
|
-
};
|
71
|
-
|
72
|
-
}]);
|