rails-angular-strap 0.0.1 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +2 -0
- data/README.md +10 -2
- data/lib/rails-angular-strap.rb +4 -6
- data/lib/rails-angular-strap/version.rb +1 -2
- data/vendor/assets/javascripts/angular-strap-unstable.js +2 -0
- data/vendor/assets/javascripts/angular-strap-unstable.min.js +2 -0
- data/vendor/assets/javascripts/angular-strap/angular-strap.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.js +5040 -0
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.min.js +11 -0
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.tpl.js +89 -0
- data/vendor/assets/javascripts/angular-strap/unstable/angular-strap.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/affix.js +249 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/affix.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/affix.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.js +120 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/alert.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.js +96 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/aside.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/button.js +177 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/button.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/button.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/collapse.js +273 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/collapse.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/collapse.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-formatter.js +61 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-formatter.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-formatter.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-parser.js +273 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-parser.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/date-parser.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.js +640 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/datepicker.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/debounce.js +62 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/debounce.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/debounce.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dimensions.js +156 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dimensions.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dimensions.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.js +149 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/dropdown.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.js +357 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/modal.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/navbar.js +72 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/navbar.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/navbar.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/parse-options.js +76 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/parse-options.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/parse-options.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.js +112 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/popover.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/raf.js +61 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/raf.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/raf.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/scrollspy.js +261 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/scrollspy.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/scrollspy.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.js +328 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/select.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.js +186 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tab.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.js +485 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/timepicker.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.js +705 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/tooltip.tpl.min.js +8 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.js +266 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.min.js +9 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.min.js.map +1 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.tpl.js +14 -0
- data/vendor/assets/javascripts/angular-strap/unstable/modules/typeahead.tpl.min.js +8 -0
- metadata +119 -3
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["dropdown.min.js"],"names":["angular","module","provider","defaults","this","animation","prefixClass","placement","template","trigger","container","keyboard","html","delay","$get","$window","$rootScope","$tooltip","$timeout","DropdownFactory","element","config","onBodyClick","evt","target","$dropdown","hide","options","extend","$scope","scope","$new","parentEl","parent","$onKeyDown","test","keyCode","preventDefault","stopPropagation","items","$element","querySelectorAll","length","index","forEach","el","i","matchesSelector","call","isUndefined","eq","focus","show","on","bodyEl","hasClass","addClass","$isShown","off","removeClass","destroy","document","body","Element","prototype","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","directive","$sce","restrict","link","attr","key","isDefined","bsDropdown","$watch","newValue","content","bsShow","dropdown","isString","match","$on"],"mappings":"AAOA,YAEAA,SAAQC,OAAO,2BAA4B,2BAExCC,SAAS,YAAa,WAErB,GAAIC,GAAWC,KAAKD,UAClBE,UAAW,UACXC,YAAa,WACbC,UAAW,cACXC,SAAU,6BACVC,QAAS,QACTC,WAAW,EACXC,UAAU,EACVC,MAAM,EACNC,MAAO,EAGTT,MAAKU,MAAQ,UAAW,aAAc,WAAY,WAAY,SAASC,EAASC,EAAYC,EAAUC,GAKpG,QAASC,GAAgBC,EAASC,GAiEhC,QAASC,GAAYC,GACnB,MAAGA,GAAIC,SAAWJ,EAAQ,GACnBG,EAAIC,SAAWJ,EAAQ,IAAMK,EAAUC,OAD9C,OAhEF,CAAA,GAAID,MAGAE,EAAU3B,QAAQ4B,UAAWzB,EAAUkB,EAC/BI,GAAUI,OAASF,EAAQG,OAASH,EAAQG,MAAMC,QAAUf,EAAWe,OAEnFN,EAAYR,EAASG,EAASO,EAC9B,IAAIK,GAAWZ,EAAQa,QAIvBR,GAAUS,WAAa,SAASX,GAC9B,GAAK,UAAUY,KAAKZ,EAAIa,SAAxB,CACAb,EAAIc,iBACJd,EAAIe,iBAGJ,IAAIC,GAAQvC,QAA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AAI9C,IAAWG,MAAOA,EACtB9B,SAAQ4C,SAAS,YAAa,YAAa,QAAS,UAAW,WAAY,OAAQ,YAAa,WAAY,MAAO,SAAS8B,GACvH1E,QAAQ2E,UAAUF,EAAKC,MAAO/C,EAAQ+C,GAAOD,EAAKC,MAIvDD,EAAKG,YAAc9C,EAAM+C,OAAOJ,EAAKG,WAAY,SAASE,GACxDhD,EAAMiD,QAAUD,IACf,GAGHL,EAAKO,QAAUlD,EAAM+C,OAAOJ,EAAKO,OAAQ,SAASF,GAC5CG,GAAajF,QAAQ2E,UAAUG,KAChC9E,QAAQkF,SAASJ,KAAWA,IAAaA,EAASK,MAAM,yBAC3DL,KAAa,EAAOG,EAAS7B,OAAS6B,EAASvD,SAIjD,IAAIuD,GAAWxD,EAAUL,EAASO,EAGlCG,GAAMsD,IAAI,WAAY,WAChBH,GAAUA,EAASrB,UACvBjC,EAAU,KACVsD,EAAW","file":"dropdown.min.js","sourcesContent":[null],"sourceRoot":"/source/"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-02-08
|
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
|
+
}]);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-02-08
|
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>')}]);
|
@@ -0,0 +1,357 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-02-08
|
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', 'container', 'animation', 'id'], function(key) {
|
314
|
+
if(angular.isDefined(attr[key])) options[key] = attr[key];
|
315
|
+
});
|
316
|
+
|
317
|
+
// use string regex match for boolean values
|
318
|
+
var falseValueRegExp = /^(false|0|)$/;
|
319
|
+
angular.forEach(['keyboard', 'html'], function(key) {
|
320
|
+
if(angular.isDefined(attr[key])) options[key] = !falseValueRegExp.test(attr[key]);
|
321
|
+
});
|
322
|
+
|
323
|
+
if(angular.isDefined(attr['backdrop'])) options['backdrop'] = falseValueRegExp.test(attr['backdrop']) ? false : attr['backdrop'];
|
324
|
+
|
325
|
+
// Support scope as data-attrs
|
326
|
+
angular.forEach(['title', 'content'], function(key) {
|
327
|
+
attr[key] && attr.$observe(key, function(newValue, oldValue) {
|
328
|
+
scope[key] = $sce.trustAsHtml(newValue);
|
329
|
+
});
|
330
|
+
});
|
331
|
+
|
332
|
+
// Support scope as an object
|
333
|
+
attr.bsModal && scope.$watch(attr.bsModal, function(newValue, oldValue) {
|
334
|
+
if(angular.isObject(newValue)) {
|
335
|
+
angular.extend(scope, newValue);
|
336
|
+
} else {
|
337
|
+
scope.content = newValue;
|
338
|
+
}
|
339
|
+
}, true);
|
340
|
+
|
341
|
+
// Initialize modal
|
342
|
+
var modal = $modal(options);
|
343
|
+
|
344
|
+
// Trigger
|
345
|
+
element.on(attr.trigger || 'click', modal.toggle);
|
346
|
+
|
347
|
+
// Garbage collection
|
348
|
+
scope.$on('$destroy', function() {
|
349
|
+
if (modal) modal.destroy();
|
350
|
+
options = null;
|
351
|
+
modal = null;
|
352
|
+
});
|
353
|
+
|
354
|
+
}
|
355
|
+
};
|
356
|
+
|
357
|
+
}]);
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-02-08
|
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(){w.$emit(v.prefixEvent+".show",u)}function i(){w.$emit(v.prefixEvent+".hide",u),g.removeClass(v.prefixClass+"-open"),v.animation&&g.removeClass(v.prefixClass+"-with-"+v.animation)}function r(e){e.target===e.currentTarget&&("static"===v.backdrop?u.focus():u.hide())}function c(e){e.preventDefault()}var u={},v=u.$options=angular.extend({},e,n);u.$promise=f(v.template);var w=u.$scope=v.scope&&v.scope.$new()||t.$new();v.element||v.container||(v.container="body"),u.$id=v.id||v.element&&v.element.attr("id")||"",p(["title","content"],function(e){v[e]&&(w[e]=s.trustAsHtml(v[e]))}),w.$hide=function(){w.$$postDigest(function(){u.hide()})},w.$show=function(){w.$$postDigest(function(){u.show()})},w.$toggle=function(){w.$$postDigest(function(){u.toggle()})},u.$isShown=w.$isShown=!1,v.contentTemplate&&(u.$promise=u.$promise.then(function(e){var t=angular.element(e);return f(v.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="'+v.prefixClass+'-backdrop"/>');return u.$promise.then(function(e){angular.isObject(e)&&(e=e.data),v.html&&(e=e.replace(b,'ng-bind-html="')),e=h.apply(e),k=o(e),u.init()}),u.init=function(){v.show&&w.$$postDigest(function(){u.show()})},u.destroy=function(){y&&(y.remove(),y=null),C&&(C.remove(),C=null),w.$destroy()},u.show=function(){if(!u.$isShown&&!w.$emit(v.prefixEvent+".show.before",u).defaultPrevented){var e,n;angular.isElement(v.container)?(e=v.container,n=v.container[0].lastChild?angular.element(v.container[0].lastChild):null):v.container?(e=m(v.container),n=e[0].lastChild?angular.element(e[0].lastChild):null):(e=null,n=v.element),y=u.$element=k(w,function(){}),y.css({display:"block"}).addClass(v.placement),v.animation&&(v.backdrop&&C.addClass(v.backdropAnimation),y.addClass(v.animation)),v.backdrop&&l.enter(C,g,null);var t=l.enter(y,e,n,a);t&&t.then&&t.then(a),u.$isShown=w.$isShown=!0,d(w);var o=y[0];$(function(){o.focus()}),g.addClass(v.prefixClass+"-open"),v.animation&&g.addClass(v.prefixClass+"-with-"+v.animation),v.backdrop&&(y.on("click",r),C.on("click",r),C.on("wheel",c)),v.keyboard&&y.on("keyup",u.$onKeyUp)}},u.hide=function(){if(u.$isShown&&!w.$emit(v.prefixEvent+".hide.before",u).defaultPrevented){var e=l.leave(y,i);e&&e.then&&e.then(i),v.backdrop&&l.leave(C),u.$isShown=w.$isShown=!1,d(w),v.backdrop&&(y.off("click",r),C.off("click",r),C.off("wheel",c)),v.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 f(e){return v[e]?v[e]:v[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 p=angular.forEach,h=String.prototype.trim,$=n.requestAnimationFrame||n.setTimeout,g=angular.element(n.document.body),b=/ng-bind="/gi,v={};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","container","animation","id"],function(e){angular.isDefined(a[e])&&(i[e]=a[e])});var r=/^(false|0|)$/;angular.forEach(["keyboard","html"],function(e){angular.isDefined(a[e])&&(i[e]=!r.test(a[e]))}),angular.isDefined(a.backdrop)&&(i.backdrop=r.test(a.backdrop)?!1:a.backdrop),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 l=t(i);o.on(a.trigger||"click",l.toggle),e.$on("$destroy",function(){l&&l.destroy(),i=null,l=null})}}}]);
|
9
|
+
//# sourceMappingURL=modal.min.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["modal.min.js"],"names":["angular","module","provider","defaults","this","animation","backdropAnimation","prefixClass","prefixEvent","placement","template","contentTemplate","container","element","backdrop","keyboard","html","show","$get","$window","$rootScope","$compile","$q","$templateCache","$http","$animate","$timeout","$sce","ModalFactory","config","enterAnimateCallback","scope","$emit","options","$modal","leaveAnimateCallback","bodyElement","removeClass","hideOnBackdropClick","evt","target","currentTarget","focus","hide","preventEventDefault","preventDefault","$options","extend","$promise","fetchTemplate","$scope","$new","$id","id","attr","forEach","key","trustAsHtml","$hide","$$postDigest","$show","$toggle","toggle","$isShown","then","templateEl","contentEl","findElement","removeAttr","next","remove","outerHTML","modalLinker","modalElement","backdropElement","isObject","data","replace","htmlReplaceRegExp","trim","apply","init","destroy","$destroy","defaultPrevented","parent","after","isElement","lastChild","$element","css","display","addClass","enter","promise","safeDigest","el","requestAnimationFrame","on","$onKeyUp","leave","off","which","stopPropagation","$$phase","$root","$digest","query","document","querySelectorAll","fetchPromises","when","get","res","put","String","prototype","setTimeout","body","directive","restrict","link","isDefined","falseValueRegExp","test","$observe","newValue","bsModal","$watch","content","modal","trigger","$on"],"mappings":"AAOA,YAEAA,SAAQC,OAAO,wBAAyB,sCAErCC,SAAS,SAAU,WAElB,GAAIC,GAAWC,KAAKD,UAClBE,UAAW,UACXC,kBAAmB,UACnBC,YAAa,QACbC,YAAa,QACbC,UAAW,MACXC,SAAU,uBACVC,iBAAiB,EACjBC,WAAW,EACXC,QAAS,KACTC,UAAU,EACVC,UAAU,EACVC,MAAM,EACNC,MAAM,EAGRb,MAAKc,MAAQ,UAAW,aAAc,WAAY,KAAM,iBAAkB,QAAS,WAAY,WAAY,OAAQ,aAAc,SAASC,EAASC,EAAYC,EAAUC,EAAIC,EAAgBC,EAAOC,EAAUC,EAAUC,GAQtN,QAASC,GAAaC,GAiKpB,QAASC,KACPC,EAAMC,MAAMC,EAAQzB,YAAc,QAAS0B,GA+B7C,QAASC,KACPJ,EAAMC,MAAMC,EAAQzB,YAAc,QAAS0B,GAC3CE,EAAYC,YAAYJ,EAAQ1B,YAAc,SAC3C0B,EAAQ5B,WACT+B,EAAYC,YAAYJ,EAAQ1B,YAAc,SAAW0B,EAAQ5B,WA2BrE,QAASiC,GAAoBC,GACxBA,EAAIC,SAAWD,EAAIE,gBACD,WAArBR,EAAQnB,SAAwBoB,EAAOQ,QAAUR,EAAOS,QAG1D,QAASC,GAAoBL,GAC3BA,EAAIM,iBApON,GAAIX,MAGAD,EAAUC,EAAOY,SAAW9C,QAAQ+C,UAAW5C,EAAU0B,EAC7DK,GAAOc,SAAWC,EAAchB,EAAQvB,SACxC,IAAIqB,GAAQG,EAAOgB,OAASjB,EAAQF,OAASE,EAAQF,MAAMoB,QAAU/B,EAAW+B,MAC5ElB,GAAQpB,SAAYoB,EAAQrB,YAC9BqB,EAAQrB,UAAY,QAMtBsB,EAAOkB,IAAMnB,EAAQoB,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yPpBgC,IAaJ,OAAOlF,OAMV2F,UAAU,WAAY,UAAW,OAAQ,SAAU,SAASpG,EAASQ,EAAMO,GAE1E,OACEsF,SAAU,MACVzF,OAAO,EACP0F,KAAM,SAAkB1F,EAAOlB,EAASyC,GAGtC,GAAIrB,IAAWF,MAAOA,EAAOlB,QAASA,EAASI,MAAM,EACrDjB,SAAQuD,SAAS,WAAY,kBAAmB,YAAa,YAAa,YAAa,MAAO,SAASC,GAClGxD,QAAQ0H,UAAUpE,EAAKE,MAAOvB,EAAQuB,GAAOF,EAAKE,KAIvD,IAAImE,GAAmB,cACvB3H,SAAQuD,SAAS,WAAY,QAAS,SAASC,GAC1CxD,QAAQ0H,UAAUpE,EAAKE,MAAOvB,EAAQuB,IAAQmE,EAAiBC,KAAKtE,EAAKE,OAG3ExD,QAAQ0H,UAAUpE,EAAe,YAAIrB,EAAkB,SAAI0F,EAAiBC,KAAKtE,EAAe,WAAK,EAAQA,EAAe,UAG/HtD,QAAQuD,SAAS,QAAS,WAAY,SAASC,GAC7CF,EAAKE,IAAQF,EAAKuE,SAASrE,EAAK,SAASsE,GACvC/F,EAAMyB,GAAO7B,EAAK8B,YAAYqE,OAKlCxE,EAAKyE,SAAWhG,EAAMiG,OAAO1E,EAAKyE,QAAS,SAASD,GAC/C9H,QAAQ2E,SAASmD,GAClB9H,QAAQ+C,OAAOhB,EAAO+F,GAEtB/F,EAAMkG,QAAUH,IAEjB,EAGH,IAAII,GAAQhG,EAAOD,EAGnBpB,GAAQqF,GAAG5C,EAAK6E,SAAW,QAASD,EAAMpE,QAG1C/B,EAAMqG,IAAI,WAAY,WAChBF,GAAOA,EAAMhD,UACjBjD,EAAU,KACViG,EAAQ","file":"modal.min.js","sourcesContent":[null],"sourceRoot":"/source/"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-02-08
|
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
|
+
}]);
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-02-08
|
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>')}]);
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/**
|
2
|
+
* angular-strap
|
3
|
+
* @version v2.1.6 - 2015-02-08
|
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
|
+
}]);
|