__webpack_require__(20);
__webpack_require__(21);
__webpack_require__(22);
++<<<<<<< HEAD
+ __webpack_require__(23);
+ __webpack_require__(24);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ },
/**
* State-based routing for AngularJS
++<<<<<<< HEAD
+ * @version v0.2.18
++=======
+ * @version v0.2.15
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* @link http://angular-ui.github.com/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
isArray = angular.isArray,
forEach = angular.forEach,
extend = angular.extend,
++<<<<<<< HEAD
+ copy = angular.copy,
+ toJson = angular.toJson;
++=======
+ copy = angular.copy;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
function inherit(parent, extra) {
return extend(new (extend(function() {}, { prototype: parent }))(), extra);
var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];
for (var i in parents) {
++<<<<<<< HEAD
+ if (!parents[i] || !parents[i].params) continue;
++=======
+ if (!parents[i].params) continue;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
parentParams = objectKeys(parents[i].params);
if (!parentParams.length) continue;
* propagated immediately. Once the `$resolve` promise has been rejected, no
* further invocables will be called.
*
++<<<<<<< HEAD
+ * Cyclic dependencies between invocables are not permitted and will cause `$resolve`
++=======
+ * Cyclic dependencies between invocables are not permitted and will caues `$resolve`
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* to throw an error. As a special case, an injectable can depend on a parameter
* with the same name as the injectable, which will be fulfilled from the `parent`
* injectable of the same name. This allows inherited values to be decorated.
// The regular expression is somewhat complicated due to the need to allow curly braces
// inside the regular expression. The placeholder regexp breaks down as follows:
// ([:*])([\w\[\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case)
++<<<<<<< HEAD
+ // \{([\w\[\]]+)(?:\:\s*( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case
++=======
+ // \{([\w\[\]]+)(?:\:( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
// (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either
// [^{}\\]+ - anything other than curly braces or backslash
// \\. - a backslash escape
// \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms
++<<<<<<< HEAD
+ var placeholder = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
+ searchPlaceholder = /([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
++=======
+ var placeholder = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
+ searchPlaceholder = /([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
compiled = '^', last = 0, m,
segments = this.segments = [],
parentParams = parentMatcher ? parentMatcher.params : {},
function addParameter(id, type, config, location) {
paramNames.push(id);
if (parentParams[id]) return parentParams[id];
++<<<<<<< HEAD
+ if (!/^\w+([-.]+\w+)*(?:\[\])?$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'");
++=======
+ if (!/^\w+(-+\w+)*(?:\[\])?$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'");
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (params[id]) throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'");
params[id] = new $$UMFP.Param(id, type, config, location);
return params[id];
if (!pattern) return result;
switch(squash) {
case false: surroundPattern = ['(', ')' + (optional ? "?" : "")]; break;
++<<<<<<< HEAD
+ case true:
+ result = result.replace(/\/$/, '');
+ surroundPattern = ['(?:\/(', ')|\/)?'];
+ break;
++=======
+ case true: surroundPattern = ['?(', ')?']; break;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
default: surroundPattern = ['(' + squash + "|", ')?']; break;
}
return result + surroundPattern[0] + pattern + surroundPattern[1];
cfg = config.params[id];
segment = pattern.substring(last, m.index);
regexp = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);
++<<<<<<< HEAD
+
+ if (regexp) {
+ type = $$UMFP.type(regexp) || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) });
+ }
+
++=======
+ type = $$UMFP.type(regexp || "string") || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return {
id: id, regexp: regexp, segment: segment, type: type, cfg: cfg
};
return map(allReversed, unquoteDashes).reverse();
}
++<<<<<<< HEAD
+ var param, paramVal;
+ for (i = 0; i < nPath; i++) {
+ paramName = paramNames[i];
+ param = this.params[paramName];
+ paramVal = m[i+1];
+ // if the param value matches a pre-replace pair, replace the value before decoding.
+ for (j = 0; j < param.replace.length; j++) {
+ if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;
+ }
+ if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);
+ if (isDefined(paramVal)) paramVal = param.type.decode(paramVal);
++=======
+ for (i = 0; i < nPath; i++) {
+ paramName = paramNames[i];
+ var param = this.params[paramName];
+ var paramVal = m[i+1];
+ // if the param value matches a pre-replace pair, replace the value before decoding.
+ for (j = 0; j < param.replace; j++) {
+ if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;
+ }
+ if (paramVal && param.array === true) paramVal = decodePathArray(paramVal);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
values[paramName] = param.value(paramVal);
}
for (/**/; i < nTotal; i++) {
paramName = paramNames[i];
values[paramName] = this.params[paramName].value(searchParams[paramName]);
++<<<<<<< HEAD
+ param = this.params[paramName];
+ paramVal = searchParams[paramName];
+ for (j = 0; j < param.replace.length; j++) {
+ if (param.replace[j].from === paramVal) paramVal = param.replace[j].to;
+ }
+ if (isDefined(paramVal)) paramVal = param.type.decode(paramVal);
+ values[paramName] = param.value(paramVal);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
return values;
/**
* @ngdoc function
++<<<<<<< HEAD
+ * @name ui.router.util.type:UrlMatcher#validates
++=======
+ * @name ui.router.util.type:UrlMatcher#validate
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* @methodOf ui.router.util.type:UrlMatcher
*
* @description
if (isPathParam) {
var nextSegment = segments[i + 1];
++<<<<<<< HEAD
+ var isFinalPathParam = i + 1 === nPath;
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (squash === false) {
if (encoded != null) {
if (isArray(encoded)) {
} else if (isString(squash)) {
result += squash + nextSegment;
}
++<<<<<<< HEAD
+
+ if (isFinalPathParam && param.squash === true && result.slice(-1) === '/') result = result.slice(0, -1);
+ } else {
+ if (encoded == null || (isDefaultValue && squash !== false)) continue;
+ if (!isArray(encoded)) encoded = [ encoded ];
+ if (encoded.length === 0) continue;
++=======
+ } else {
+ if (encoded == null || (isDefaultValue && squash !== false)) continue;
+ if (!isArray(encoded)) encoded = [ encoded ];
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
encoded = map(encoded, encodeURIComponent).join('&' + name + '=');
result += (search ? '&' : '?') + (name + '=' + encoded);
search = true;
// Wraps type (.is/.encode/.decode) functions to operate on each value of an array
function arrayHandler(callback, allTruthyMode) {
return function handleArray(val) {
++<<<<<<< HEAD
+ if (isArray(val) && val.length === 0) return val;
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
val = arrayWrap(val);
var result = map(val, callback);
if (allTruthyMode === true)
var isCaseInsensitive = false, isStrictMode = true, defaultSquashPolicy = false;
++<<<<<<< HEAD
+ // Use tildes to pre-encode slashes.
+ // If the slashes are simply URLEncoded, the browser can choose to pre-decode them,
+ // and bidirectional encoding/decoding fails.
+ // Tilde was chosen because it's not a RFC 3986 section 2.2 Reserved Character
+ function valToString(val) { return val != null ? val.toString().replace(/~/g, "~~").replace(/\//g, "~2F") : val; }
+ function valFromString(val) { return val != null ? val.toString().replace(/~2F/g, "/").replace(/~~/g, "~") : val; }
+
+ var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {
+ "string": {
++=======
+ function valToString(val) { return val != null ? val.toString().replace(/\//g, "%2F") : val; }
+ function valFromString(val) { return val != null ? val.toString().replace(/%2F/g, "/") : val; }
+
+ var $types = {}, enqueue = true, typeQueue = [], injector, defaultTypes = {
+ string: {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
encode: valToString,
decode: valFromString,
// TODO: in 1.0, make string .is() return false if value is undefined/null by default.
is: function(val) { return val == null || !isDefined(val) || typeof val === "string"; },
pattern: /[^/]*/
},
++<<<<<<< HEAD
+ "int": {
++=======
+ int: {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
encode: valToString,
decode: function(val) { return parseInt(val, 10); },
is: function(val) { return isDefined(val) && this.decode(val.toString()) === val; },
pattern: /\d+/
},
++<<<<<<< HEAD
+ "bool": {
++=======
+ bool: {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
encode: function(val) { return val ? 1 : 0; },
decode: function(val) { return parseInt(val, 10) !== 0; },
is: function(val) { return val === true || val === false; },
pattern: /0|1/
},
++<<<<<<< HEAD
+ "date": {
++=======
+ date: {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
encode: function (val) {
if (!this.is(val))
return undefined;
pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,
capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/
},
++<<<<<<< HEAD
+ "json": {
++=======
+ json: {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
encode: angular.toJson,
decode: angular.fromJson,
is: angular.isObject,
equals: angular.equals,
pattern: /[^/]*/
},
++<<<<<<< HEAD
+ "any": { // does not encode/decode
++=======
+ any: { // does not encode/decode
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
encode: angular.identity,
decode: angular.identity,
equals: angular.equals,
if (config.type && urlType) throw new Error("Param '"+id+"' has two type configurations.");
if (urlType) return urlType;
if (!config.type) return (location === "config" ? $types.any : $types.string);
++<<<<<<< HEAD
+
+ if (angular.isString(config.type))
+ return $types[config.type];
+ if (config.type instanceof Type)
+ return config.type;
+ return new Type(config.type);
++=======
+ return config.type instanceof Type ? config.type : new Type(config.type);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
// array config: param name (param[]) overrides default settings. explicit config overrides param name.
* });
* </pre>
*
++<<<<<<< HEAD
+ * @param {function} rule Handler function that takes `$injector` and `$location`
++=======
+ * @param {object} rule Handler function that takes `$injector` and `$location`
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* services as arguments. You can use them to return a valid path as a string.
*
* @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
* });
* </pre>
*
++<<<<<<< HEAD
+ * @param {string|function} rule The url path you want to redirect to or a function
++=======
+ * @param {string|object} rule The url path you want to redirect to or a function
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* rule that returns the url path. The function version is passed two params:
* `$injector` and `$location` services, and must return a url string.
*
* @methodOf ui.router.router.$urlRouterProvider
*
* @description
++<<<<<<< HEAD
+ * Registers a handler for a given url matching.
+ *
+ * If the handler is a string, it is
++=======
+ * Registers a handler for a given url matching. if handle is a string, it is
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* treated as a redirect, and is interpolated according to the syntax of match
* (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
*
* </pre>
*
* @param {string|object} what The incoming path that you want to redirect.
++<<<<<<< HEAD
+ * @param {string|function} handler The path you want to redirect your user to.
++=======
+ * @param {string|object} handler The path you want to redirect your user to.
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*/
this.when = function (what, handler) {
var redirect, handlerIsString = isString(handler);
*
*/
this.$get = $get;
++<<<<<<< HEAD
+ $get.$inject = ['$location', '$rootScope', '$injector', '$browser', '$sniffer'];
+ function $get( $location, $rootScope, $injector, $browser, $sniffer) {
++=======
+ $get.$inject = ['$location', '$rootScope', '$injector', '$browser'];
+ function $get( $location, $rootScope, $injector, $browser) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;
if (angular.isObject(isHtml5)) {
isHtml5 = isHtml5.enabled;
}
++<<<<<<< HEAD
+
+ isHtml5 = isHtml5 && $sniffer.history;
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var url = urlMatcher.format(params);
options = options || {};
// inherit 'data' from parent and override by own values (if any)
data: function(state) {
if (state.parent && state.parent.data) {
++<<<<<<< HEAD
+ state.data = state.self.data = inherit(state.parent.data, state.data);
++=======
+ state.data = state.self.data = extend({}, state.parent.data, state.data);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
return state.data;
},
// Derive parameters for this state and ensure they're a super-set of parent's parameters
params: function(state) {
++<<<<<<< HEAD
+ var ownParams = pick(state.ownParams, state.ownParams.$$keys());
+ return state.parent && state.parent.params ? extend(state.parent.params.$$new(), ownParams) : new $$UMFP.ParamSet();
++=======
+ return state.parent && state.parent.params ? extend(state.parent.params.$$new(), state.ownParams) : new $$UMFP.ParamSet();
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
// If there is no explicit multi-view configuration, make one up so we don't have
var name = state.name;
if (!isString(name) || name.indexOf('@') >= 0) throw new Error("State must have a valid name");
++<<<<<<< HEAD
+ if (states.hasOwnProperty(name)) throw new Error("State '" + name + "' is already defined");
++=======
+ if (states.hasOwnProperty(name)) throw new Error("State '" + name + "'' is already defined");
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
// Get parent name
var parentName = (name.indexOf('.') !== -1) ? name.substring(0, name.lastIndexOf('.'))
*
* Callback function for when a state is entered. Good way
* to trigger an action or dispatch an event, such as opening a dialog.
++<<<<<<< HEAD
+ * If minifying your scripts, make sure to explicitly annotate this function,
++=======
+ * If minifying your scripts, make sure to explictly annotate this function,
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* because it won't be automatically annotated by your build tools.
*
* <pre>onEnter: function(MyService, $stateParams) {
*
* Callback function for when a state is exited. Good way to
* trigger an action or dispatch an event, such as opening a dialog.
++<<<<<<< HEAD
+ * If minifying your scripts, make sure to explicitly annotate this function,
++=======
+ * If minifying your scripts, make sure to explictly annotate this function,
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* because it won't be automatically annotated by your build tools.
*
* <pre>onExit: function(MyService, $stateParams) {
*
* @param {object=} params A map of the parameters that will be sent to the state,
* will populate $stateParams. Any parameters that are not specified will be inherited from currently
++<<<<<<< HEAD
+ * defined parameters. Only parameters specified in the state definition can be overridden, new
+ * parameters will be ignored. This allows, for example, going to a sibling state that shares parameters
++=======
+ * defined parameters. This allows, for example, going to a sibling state that shares parameters
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* specified in a parent state. Parameter inheritance only works between common ancestor states, I.e.
* transitioning to a sibling will get you the parameters for all parents, transitioning to a child
* will get you all current parameters, etc.
* - **`relative`** - {object=$state.$current}, When transitioning with relative path (e.g '^'),
* defines which state to be relative from.
* - **`notify`** - {boolean=true}, If `true` will broadcast $stateChangeStart and $stateChangeSuccess events.
++<<<<<<< HEAD
+ * - **`reload`** (v0.2.5) - {boolean=false|string|object}, If `true` will force transition even if no state or params
+ * have changed. It will reload the resolves and views of the current state and parent states.
+ * If `reload` is a string (or state object), the state object is fetched (by name, or object reference); and \
+ * the transition reloads the resolves and views for that matched state, and all its children states.
++=======
+ * - **`reload`** (v0.2.5) - {boolean=false}, If `true` will force transition even if the state or params
+ * have not changed, aka a reload of the same state. It differs from reloadOnSearch because you'd
+ * use this when you want to force a reload when *everything* is the same, including search params.
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*
* @returns {promise} A promise representing the state of the new transition.
*
if (hash) toParams['#'] = hash;
$state.params = toParams;
copy($state.params, $stateParams);
++<<<<<<< HEAD
+ copy(filterByKeys(to.params.$$keys(), $stateParams), to.locals.globals.$stateParams);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (options.location && to.navigable && to.navigable.url) {
$urlRouter.push(to.navigable.url, toParams, {
$$avoidResync: true, replace: options.location === 'replace'
// Filter parameters before we pass them to event handlers etc.
toParams = filterByKeys(to.params.$$keys(), toParams || {});
++<<<<<<< HEAD
+
+ // Re-add the saved hash before we start returning things or broadcasting $stateChangeStart
+ if (hash) toParams['#'] = hash;
+
++=======
+
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
// Broadcast start event and cancel the transition if requested
if (options.notify) {
/**
* })
* </pre>
*/
++<<<<<<< HEAD
+ if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams, options).defaultPrevented) {
+ $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams);
+ //Don't update and resync url if there's been a new transition started. see issue #2238, #600
+ if ($state.transition == null) $urlRouter.update();
++=======
+ if ($rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams).defaultPrevented) {
+ $rootScope.$broadcast('$stateChangeCancel', to.self, toParams, from.self, fromParams);
+ $urlRouter.update();
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return TransitionPrevented;
}
}
}
}
++<<<<<<< HEAD
++=======
+ // Re-add the saved hash before we start returning things
+ if (hash) toParams['#'] = hash;
+
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
// Run it again, to catch any transitions in callbacks
if ($state.transition !== transition) return TransitionSuperseded;
}
angular.module('ui.router.state')
++<<<<<<< HEAD
+ .factory('$stateParams', function () { return {}; })
++=======
+ .value('$stateParams', {})
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
.provider('$state', $StateProvider);
if (options.view) {
result = $templateFactory.fromConfig(options.view, options.params, options.locals);
}
++<<<<<<< HEAD
++=======
+ if (result && options.notify) {
+ /**
+ * @ngdoc event
+ * @name ui.router.state.$state#$viewContentLoading
+ * @eventOf ui.router.state.$view
+ * @eventType broadcast on root scope
+ * @description
+ *
+ * Fired once the view **begins loading**, *before* the DOM is rendered.
+ *
+ * @param {Object} event Event object.
+ * @param {Object} viewConfig The view config properties (template, controller, etc).
+ *
+ * @example
+ *
+ * <pre>
+ * $scope.$on('$viewContentLoading',
+ * function(event, viewConfig){
+ * // Access to all the view config properties.
+ * // and one special property 'targetView'
+ * // viewConfig.targetView
+ * });
+ * </pre>
+ */
+ $rootScope.$broadcast('$viewContentLoading', options);
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return result;
}
};
angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);
++<<<<<<< HEAD
+ var ngMajorVer = angular.version.major;
+ var ngMinorVer = angular.version.minor;
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/**
* @ngdoc directive
* @name ui.router.state.directive:ui-view
* service, {@link ui.router.state.$uiViewScroll}. This custom service let's you
* scroll ui-view elements into view when they are populated during a state activation.
*
++<<<<<<< HEAD
+ * @param {string=} noanimation If truthy, the non-animated renderer will be selected (no animations
+ * will be applied to the ui-view)
+ *
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* *Note: To revert back to old [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
* functionality, call `$uiViewScrollProvider.useAnchorScroll()`.*
*
// Returns a set of DOM manipulation functions based on which Angular version
// it should use
function getRenderer(attrs, scope) {
++<<<<<<< HEAD
+ var statics = {
+ enter: function (element, target, cb) { target.after(element); cb(); },
+ leave: function (element, cb) { element.remove(); cb(); }
+ };
+
+ if (!!attrs.noanimation) return statics;
+
+ function animEnabled(element) {
+ if (ngMajorVer === 1 && ngMinorVer >= 4) return !!$animate.enabled(element);
+ if (ngMajorVer === 1 && ngMinorVer >= 2) return !!$animate.enabled();
+ return (!!$animator);
+ }
+
+ // ng 1.2+
+ if ($animate) {
+ return {
+ enter: function(element, target, cb) {
+ if (!animEnabled(element)) {
+ statics.enter(element, target, cb);
+ } else if (angular.version.minor > 2) {
+ $animate.enter(element, null, target).then(cb);
+ } else {
+ $animate.enter(element, null, target, cb);
+ }
+ },
+ leave: function(element, cb) {
+ if (!animEnabled(element)) {
+ statics.leave(element, cb);
+ } else if (angular.version.minor > 2) {
+ $animate.leave(element).then(cb);
+ } else {
+ $animate.leave(element, cb);
+ }
++=======
+ var statics = function() {
+ return {
+ enter: function (element, target, cb) { target.after(element); cb(); },
+ leave: function (element, cb) { element.remove(); cb(); }
+ };
+ };
+
+ if ($animate) {
+ return {
+ enter: function(element, target, cb) {
+ var promise = $animate.enter(element, null, target, cb);
+ if (promise && promise.then) promise.then(cb);
+ },
+ leave: function(element, cb) {
+ var promise = $animate.leave(element, cb);
+ if (promise && promise.then) promise.then(cb);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
}
++<<<<<<< HEAD
+ // ng 1.1.5
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if ($animator) {
var animate = $animator && $animator(scope, attrs);
};
}
++<<<<<<< HEAD
+ return statics;
++=======
+ return statics();
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
var directive = {
scope.$on('$stateChangeSuccess', function() {
updateView(false);
});
++<<<<<<< HEAD
++=======
+ scope.$on('$viewContentLoading', function() {
+ updateView(false);
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
updateView(true);
function cleanupLastView() {
++<<<<<<< HEAD
+ var _previousEl = previousEl;
+ var _currentScope = currentScope;
+
+ if (_currentScope) {
+ _currentScope._willBeDestroyed = true;
+ }
+
+ function cleanOld() {
+ if (_previousEl) {
+ _previousEl.remove();
+ }
+
+ if (_currentScope) {
+ _currentScope.$destroy();
+ }
++=======
+ if (previousEl) {
+ previousEl.remove();
+ previousEl = null;
+ }
+
+ if (currentScope) {
+ currentScope.$destroy();
+ currentScope = null;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
if (currentEl) {
renderer.leave(currentEl, function() {
++<<<<<<< HEAD
+ cleanOld();
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
previousEl = null;
});
previousEl = currentEl;
++<<<<<<< HEAD
+ } else {
+ cleanOld();
+ previousEl = null;
+ }
+
+ currentEl = null;
+ currentScope = null;
++=======
+ currentEl = null;
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
function updateView(firstTime) {
name = getUiViewName(scope, attrs, $element, $interpolate),
previousLocals = name && $state.$current && $state.$current.locals[name];
++<<<<<<< HEAD
+ if (!firstTime && previousLocals === latestLocals || scope._willBeDestroyed) return; // nothing to do
+ newScope = scope.$new();
+ latestLocals = $state.$current.locals[name];
+
+ /**
+ * @ngdoc event
+ * @name ui.router.state.directive:ui-view#$viewContentLoading
+ * @eventOf ui.router.state.directive:ui-view
+ * @eventType emits on ui-view directive scope
+ * @description
+ *
+ * Fired once the view **begins loading**, *before* the DOM is rendered.
+ *
+ * @param {Object} event Event object.
+ * @param {string} viewName Name of the view.
+ */
+ newScope.$emit('$viewContentLoading', name);
+
++=======
+ if (!firstTime && previousLocals === latestLocals) return; // nothing to do
+ newScope = scope.$new();
+ latestLocals = $state.$current.locals[name];
+
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var clone = $transclude(newScope, function(clone) {
renderer.enter(clone, $element, function onUiViewEnter() {
if(currentScope) {
* @name ui.router.state.directive:ui-view#$viewContentLoaded
* @eventOf ui.router.state.directive:ui-view
* @eventType emits on ui-view directive scope
++<<<<<<< HEAD
+ * @description
+ * Fired once the view is **loaded**, *after* the DOM is rendered.
+ *
+ * @param {Object} event Event object.
+ * @param {string} viewName Name of the view.
+ */
+ currentScope.$emit('$viewContentLoaded', name);
++=======
+ * @description *
+ * Fired once the view is **loaded**, *after* the DOM is rendered.
+ *
+ * @param {Object} event Event object.
+ */
+ currentScope.$emit('$viewContentLoaded');
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
currentScope.$eval(onloadExp);
}
};
}
}
++<<<<<<< HEAD
+ function getTypeInfo(el) {
+ // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
+ var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';
+ var isForm = el[0].nodeName === "FORM";
+
+ return {
+ attr: isForm ? "action" : (isSvg ? 'xlink:href' : 'href'),
+ isAnchor: el.prop("tagName").toUpperCase() === "A",
+ clickable: !isForm
+ };
+ }
+
+ function clickHook(el, $state, $timeout, type, current) {
+ return function(e) {
+ var button = e.which || e.button, target = current();
+
+ if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) {
+ // HACK: This is to allow ng-clicks to be processed before the transition is initiated:
+ var transition = $timeout(function() {
+ $state.go(target.state, target.params, target.options);
+ });
+ e.preventDefault();
+
+ // if the state has no URL, ignore one preventDefault from the <a> directive.
+ var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1: 0;
+
+ e.preventDefault = function() {
+ if (ignorePreventDefaultCount-- <= 0) $timeout.cancel(transition);
+ };
+ }
+ };
+ }
+
+ function defaultOpts(el, $state) {
+ return { relative: stateContext(el) || $state.$current, inherit: true };
+ }
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/**
* @ngdoc directive
* @name ui.router.state.directive:ui-sref
* @restrict A
*
* @description
++<<<<<<< HEAD
+ * A directive that binds a link (`<a>` tag) to a state. If the state has an associated
+ * URL, the directive will automatically generate & update the `href` attribute via
+ * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking
+ * the link will trigger a state transition with optional parameters.
+ *
+ * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be
+ * handled natively by the browser.
+ *
+ * You can also use relative state paths within ui-sref, just like the relative
+ * paths passed to `$state.go()`. You just need to be aware that the path is relative
+ * to the state that the link lives in, in other words the state that loaded the
++=======
+ * A directive that binds a link (`<a>` tag) to a state. If the state has an associated
+ * URL, the directive will automatically generate & update the `href` attribute via
+ * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking
+ * the link will trigger a state transition with optional parameters.
+ *
+ * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be
+ * handled natively by the browser.
+ *
+ * You can also use relative state paths within ui-sref, just like the relative
+ * paths passed to `$state.go()`. You just need to be aware that the path is relative
+ * to the state that the link lives in, in other words the state that loaded the
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* template containing the link.
*
* You can specify options to pass to {@link ui.router.state.$state#go $state.go()}
* and `reload`.
*
* @example
++<<<<<<< HEAD
+ * Here's an example of how you'd use ui-sref and how it would compile. If you have the
+ * following template:
+ * <pre>
+ * <a ui-sref="home">Home</a> | <a ui-sref="about">About</a> | <a ui-sref="{page: 2}">Next page</a>
+ *
++=======
+ * Here's an example of how you'd use ui-sref and how it would compile. If you have the
+ * following template:
+ * <pre>
+ * <a ui-sref="home">Home</a> | <a ui-sref="about">About</a> | <a ui-sref="{page: 2}">Next page</a>
+ *
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* <ul>
* <li ng-repeat="contact in contacts">
* <a ui-sref="contacts.detail({ id: contact.id })">{{ contact.name }}</a>
* </li>
* </ul>
* </pre>
++<<<<<<< HEAD
+ *
+ * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):
+ * <pre>
+ * <a href="#/home" ui-sref="home">Home</a> | <a href="#/about" ui-sref="about">About</a> | <a href="#/contacts?page=2" ui-sref="{page: 2}">Next page</a>
+ *
++=======
+ *
+ * Then the compiled html would be (assuming Html5Mode is off and current state is contacts):
+ * <pre>
+ * <a href="#/home" ui-sref="home">Home</a> | <a href="#/about" ui-sref="about">About</a> | <a href="#/contacts?page=2" ui-sref="{page: 2}">Next page</a>
+ *
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* <ul>
* <li ng-repeat="contact in contacts">
* <a href="#/contacts/1" ui-sref="contacts.detail({ id: contact.id })">Joe</a>
*/
$StateRefDirective.$inject = ['$state', '$timeout'];
function $StateRefDirective($state, $timeout) {
++<<<<<<< HEAD
++=======
+ var allowedOptions = ['location', 'inherit', 'reload', 'absolute'];
+
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ return {
+ restrict: 'A',
+ require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
+ link: function(scope, element, attrs, uiSrefActive) {
++<<<<<<< HEAD
+ var ref = parseStateRef(attrs.uiSref, $state.current.name);
+ var def = { state: ref.state, href: null, params: null };
+ var type = getTypeInfo(element);
+ var active = uiSrefActive[1] || uiSrefActive[0];
+
+ def.options = extend(defaultOpts(element, $state), attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {});
+
+ var update = function(val) {
+ if (val) def.params = angular.copy(val);
+ def.href = $state.href(ref.state, def.params, def.options);
+
+ if (active) active.$$addStateInfo(ref.state, def.params);
+ if (def.href !== null) attrs.$set(type.attr, def.href);
+ };
+
+ if (ref.paramExpr) {
+ scope.$watch(ref.paramExpr, function(val) { if (val !== def.params) update(val); }, true);
+ def.params = angular.copy(scope.$eval(ref.paramExpr));
+ }
+ update();
+
+ if (!type.clickable) return;
+ element.bind("click", clickHook(element, $state, $timeout, type, function() { return def; }));
+ }
+ };
+ }
+
+ /**
+ * @ngdoc directive
+ * @name ui.router.state.directive:ui-state
+ *
+ * @requires ui.router.state.uiSref
+ *
+ * @restrict A
+ *
+ * @description
+ * Much like ui-sref, but will accept named $scope properties to evaluate for a state definition,
+ * params and override options.
+ *
+ * @param {string} ui-state 'stateName' can be any valid absolute or relative state
+ * @param {Object} ui-state-params params to pass to {@link ui.router.state.$state#href $state.href()}
+ * @param {Object} ui-state-opts options to pass to {@link ui.router.state.$state#go $state.go()}
+ */
+ $StateRefDynamicDirective.$inject = ['$state', '$timeout'];
+ function $StateRefDynamicDirective($state, $timeout) {
return {
restrict: 'A',
require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
link: function(scope, element, attrs, uiSrefActive) {
+ var type = getTypeInfo(element);
+ var active = uiSrefActive[1] || uiSrefActive[0];
+ var group = [attrs.uiState, attrs.uiStateParams || null, attrs.uiStateOpts || null];
+ var watch = '[' + group.map(function(val) { return val || 'null'; }).join(', ') + ']';
+ var def = { state: null, params: null, options: null, href: null };
+
+ function runStateRefLink (group) {
+ def.state = group[0]; def.params = group[1]; def.options = group[2];
+ def.href = $state.href(def.state, def.params, def.options);
+
+ if (active) active.$$addStateInfo(def.state, def.params);
+ if (def.href) attrs.$set(type.attr, def.href);
+ }
+
+ scope.$watch(watch, runStateRefLink, true);
+ runStateRefLink(scope.$eval(watch));
+
+ if (!type.clickable) return;
+ element.bind("click", clickHook(element, $state, $timeout, type, function() { return def; }));
++=======
+ var ref = parseStateRef(attrs.uiSref, $state.current.name);
+ var params = null, url = null, base = stateContext(element) || $state.$current;
+ // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
+ var hrefKind = Object.prototype.toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?
+ 'xlink:href' : 'href';
+ var newHref = null, isAnchor = element.prop("tagName").toUpperCase() === "A";
+ var isForm = element[0].nodeName === "FORM";
+ var attr = isForm ? "action" : hrefKind, nav = true;
+
+ var options = { relative: base, inherit: true };
+ var optionsOverride = scope.$eval(attrs.uiSrefOpts) || {};
+
+ angular.forEach(allowedOptions, function(option) {
+ if (option in optionsOverride) {
+ options[option] = optionsOverride[option];
+ }
+ });
+
+ var update = function(newVal) {
+ if (newVal) params = angular.copy(newVal);
+ if (!nav) return;
+
+ newHref = $state.href(ref.state, params, options);
+
+ var activeDirective = uiSrefActive[1] || uiSrefActive[0];
+ if (activeDirective) {
+ activeDirective.$$addStateInfo(ref.state, params);
+ }
+ if (newHref === null) {
+ nav = false;
+ return false;
+ }
+ attrs.$set(attr, newHref);
+ };
+
+ if (ref.paramExpr) {
+ scope.$watch(ref.paramExpr, function(newVal, oldVal) {
+ if (newVal !== params) update(newVal);
+ }, true);
+ params = angular.copy(scope.$eval(ref.paramExpr));
+ }
+ update();
+
+ if (isForm) return;
+
+ element.bind("click", function(e) {
+ var button = e.which || e.button;
+ if ( !(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || element.attr('target')) ) {
+ // HACK: This is to allow ng-clicks to be processed before the transition is initiated:
+ var transition = $timeout(function() {
+ $state.go(ref.state, params, options);
+ });
+ e.preventDefault();
+
+ // if the state has no URL, ignore one preventDefault from the <a> directive.
+ var ignorePreventDefaultCount = isAnchor && !newHref ? 1: 0;
+ e.preventDefault = function() {
+ if (ignorePreventDefaultCount-- <= 0)
+ $timeout.cancel(transition);
+ };
+ }
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
}
++<<<<<<< HEAD
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/**
* @ngdoc directive
* @name ui.router.state.directive:ui-sref-active
* </li>
* </ul>
* </pre>
++<<<<<<< HEAD
+ *
+ * It is also possible to pass ui-sref-active an expression that evaluates
+ * to an object hash, whose keys represent active class names and whose
+ * values represent the respective state names/globs.
+ * ui-sref-active will match if the current active state **includes** any of
+ * the specified state names/globs, even the abstract ones.
+ *
+ * @Example
+ * Given the following template, with "admin" being an abstract state:
+ * <pre>
+ * <div ui-sref-active="{'active': 'admin.*'}">
+ * <a ui-sref-active="active" ui-sref="admin.roles">Roles</a>
+ * </div>
+ * </pre>
+ *
+ * When the current state is "admin.roles" the "active" class will be applied
+ * to both the <div> and <a> elements. It is important to note that the state
+ * names/globs passed to ui-sref-active shadow the state provided by ui-sref.
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*/
/**
function $StateRefActiveDirective($state, $stateParams, $interpolate) {
return {
restrict: "A",
++<<<<<<< HEAD
+ controller: ['$scope', '$element', '$attrs', '$timeout', function ($scope, $element, $attrs, $timeout) {
+ var states = [], activeClasses = {}, activeEqClass, uiSrefActive;
++=======
+ controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
+ var states = [], activeClass;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
// There probably isn't much point in $observing this
// uiSrefActive and uiSrefActiveEq share the same directive object with some
// slight difference in logic routing
++<<<<<<< HEAD
+ activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope);
+
+ try {
+ uiSrefActive = $scope.$eval($attrs.uiSrefActive);
+ } catch (e) {
+ // Do nothing. uiSrefActive is not a valid expression.
+ // Fall back to using $interpolate below
+ }
+ uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope);
+ if (isObject(uiSrefActive)) {
+ forEach(uiSrefActive, function(stateOrName, activeClass) {
+ if (isString(stateOrName)) {
+ var ref = parseStateRef(stateOrName, $state.current.name);
+ addState(ref.state, $scope.$eval(ref.paramExpr), activeClass);
+ }
+ });
+ }
+
+ // Allow uiSref to communicate with uiSrefActive[Equals]
+ this.$$addStateInfo = function (newState, newParams) {
+ // we already got an explicit state provided by ui-sref-active, so we
+ // shadow the one that comes from ui-sref
+ if (isObject(uiSrefActive) && states.length > 0) {
+ return;
+ }
+ addState(newState, newParams, uiSrefActive);
+ update();
+ };
+
+ $scope.$on('$stateChangeSuccess', update);
+
+ function addState(stateName, stateParams, activeClass) {
+ var state = $state.get(stateName, stateContext($element));
+ var stateHash = createStateHash(stateName, stateParams);
+
+ states.push({
+ state: state || { name: stateName },
+ params: stateParams,
+ hash: stateHash
+ });
+
+ activeClasses[stateHash] = activeClass;
+ }
+
+ /**
+ * @param {string} state
+ * @param {Object|string} [params]
+ * @return {string}
+ */
+ function createStateHash(state, params) {
+ if (!isString(state)) {
+ throw new Error('state should be a string');
+ }
+ if (isObject(params)) {
+ return state + toJson(params);
+ }
+ params = $scope.$eval(params);
+ if (isObject(params)) {
+ return state + toJson(params);
+ }
+ return state;
+ }
+
+ // Update route state
+ function update() {
+ for (var i = 0; i < states.length; i++) {
+ if (anyMatch(states[i].state, states[i].params)) {
+ addClass($element, activeClasses[states[i].hash]);
+ } else {
+ removeClass($element, activeClasses[states[i].hash]);
+ }
+
+ if (exactMatch(states[i].state, states[i].params)) {
+ addClass($element, activeEqClass);
+ } else {
+ removeClass($element, activeEqClass);
+ }
+ }
+ }
+
+ function addClass(el, className) { $timeout(function () { el.addClass(className); }); }
+ function removeClass(el, className) { el.removeClass(className); }
+ function anyMatch(state, params) { return $state.includes(state.name, params); }
+ function exactMatch(state, params) { return $state.is(state.name, params); }
+
+ update();
++=======
+ activeClass = $interpolate($attrs.uiSrefActiveEq || $attrs.uiSrefActive || '', false)($scope);
+
+ // Allow uiSref to communicate with uiSrefActive[Equals]
+ this.$$addStateInfo = function (newState, newParams) {
+ var state = $state.get(newState, stateContext($element));
+
+ states.push({
+ state: state || { name: newState },
+ params: newParams
+ });
+
+ update();
+ };
+
+ $scope.$on('$stateChangeSuccess', update);
+
+ // Update route state
+ function update() {
+ if (anyMatch()) {
+ $element.addClass(activeClass);
+ } else {
+ $element.removeClass(activeClass);
+ }
+ }
+
+ function anyMatch() {
+ for (var i = 0; i < states.length; i++) {
+ if (isMatch(states[i].state, states[i].params)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ function isMatch(state, params) {
+ if (typeof $attrs.uiSrefActiveEq !== 'undefined') {
+ return $state.is(state.name, params);
+ } else {
+ return $state.includes(state.name, params);
+ }
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}]
};
}
angular.module('ui.router.state')
.directive('uiSref', $StateRefDirective)
.directive('uiSrefActive', $StateRefActiveDirective)
++<<<<<<< HEAD
+ .directive('uiSrefActiveEq', $StateRefActiveDirective)
+ .directive('uiState', $StateRefDynamicDirective);
++=======
+ .directive('uiSrefActiveEq', $StateRefActiveDirective);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/**
* @ngdoc filter
*/
$IsStateFilter.$inject = ['$state'];
function $IsStateFilter($state) {
++<<<<<<< HEAD
+ var isFilter = function (state, params) {
+ return $state.is(state, params);
++=======
+ var isFilter = function (state) {
+ return $state.is(state);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
};
isFilter.$stateful = true;
return isFilter;
*/
$IncludedByStateFilter.$inject = ['$state'];
function $IncludedByStateFilter($state) {
++<<<<<<< HEAD
+ var includesFilter = function (state, params, options) {
+ return $state.includes(state, params, options);
++=======
+ var includesFilter = function (state) {
+ return $state.includes(state);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
};
includesFilter.$stateful = true;
return includesFilter;
/***/ function(module, exports) {
/**
++<<<<<<< HEAD
+ * @license AngularJS v1.6.2
+ * (c) 2010-2017 Google, Inc. http://angularjs.org
+ * License: MIT
+ */
+ (function(window, angular) {'use strict';
++=======
+ * @license AngularJS v1.4.8
+ * (c) 2010-2015 Google, Inc. http://angularjs.org
+ * License: MIT
+ */
+ (function(window, angular, undefined) {'use strict';
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var $resourceMinErr = angular.$$minErr('$resource');
*
* <div doc-module-components="ngResource"></div>
*
++<<<<<<< HEAD
+ * See {@link ngResource.$resourceProvider} and {@link ngResource.$resource} for usage.
+ */
+
+ /**
+ * @ngdoc provider
+ * @name $resourceProvider
+ *
+ * @description
+ *
+ * Use `$resourceProvider` to change the default behavior of the {@link ngResource.$resource}
+ * service.
+ *
+ * ## Dependencies
+ * Requires the {@link ngResource } module to be installed.
+ *
++=======
+ * See {@link ngResource.$resource `$resource`} for usage.
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*/
/**
* @ngdoc service
* @name $resource
* @requires $http
++<<<<<<< HEAD
+ * @requires ng.$log
+ * @requires $q
+ * @requires ng.$timeout
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*
* @description
* A factory which creates a resource object that lets you interact with
* can escape it with `/\.`.
*
* @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
++<<<<<<< HEAD
+ * `actions` methods. If a parameter value is a function, it will be called every time
+ * a param value needs to be obtained for a request (unless the param was overridden). The function
+ * will be passed the current data value as an argument.
++=======
+ * `actions` methods. If any of the parameter value is a function, it will be executed every time
+ * when a param value needs to be obtained for a request (unless the param was overridden).
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*
* Each key value in the parameter object is first bound to url template if present and then any
* excess keys are appended to the url search query after the `?`.
* Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in
* URL `/path/greet?salutation=Hello`.
*
++<<<<<<< HEAD
+ * If the parameter value is prefixed with `@`, then the value for that parameter will be
+ * extracted from the corresponding property on the `data` object (provided when calling a
+ * "non-GET" action method).
+ * For example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of
+ * `someParam` will be `data.someProp`.
+ * Note that the parameter will be ignored, when calling a "GET" action method (i.e. an action
+ * method that does not accept a request body)
+ *
+ * @param {Object.<Object>=} actions Hash with declaration of custom actions that will be available
+ * in addition to the default set of resource actions (see below). If a custom action has the same
+ * key as a default action (e.g. `save`), then the default action will be *overwritten*, and not
+ * extended.
+ *
+ * The declaration should be created in the format of {@link ng.$http#usage $http.config}:
++=======
+ * If the parameter value is prefixed with `@` then the value for that parameter will be extracted
+ * from the corresponding property on the `data` object (provided when calling an action method). For
+ * example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of `someParam`
+ * will be `data.someProp`.
+ *
+ * @param {Object.<Object>=} actions Hash with declaration of custom actions that should extend
+ * the default set of resource actions. The declaration should be created in the format of {@link
+ * ng.$http#usage $http.config}:
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*
* {action1: {method:?, params:?, isArray:?, headers:?, ...},
* action2: {method:?, params:?, isArray:?, headers:?, ...},
* - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`,
* `DELETE`, `JSONP`, etc).
* - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of
++<<<<<<< HEAD
+ * the parameter value is a function, it will be called every time when a param value needs to
+ * be obtained for a request (unless the param was overridden). The function will be passed the
+ * current data value as an argument.
++=======
+ * the parameter value is a function, it will be executed every time when a param value needs to
+ * be obtained for a request (unless the param was overridden).
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* - **`url`** – {string} – action specific `url` override. The url templating is supported just
* like for the resource-level urls.
* - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,
* transform function or an array of such functions. The transform function takes the http
* request body and headers and returns its transformed (typically serialized) version.
* By default, transformRequest will contain one function that checks if the request data is
++<<<<<<< HEAD
+ * an object and serializes it using `angular.toJson`. To prevent this behavior, set
+ * `transformRequest` to an empty array: `transformRequest: []`
+ * - **`transformResponse`** –
+ * `{function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>}` –
+ * transform function or an array of such functions. The transform function takes the http
+ * response body, headers and status and returns its transformed (typically deserialized)
+ * version.
+ * By default, transformResponse will contain one function that checks if the response looks
+ * like a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior,
+ * set `transformResponse` to an empty array: `transformResponse: []`
++=======
+ * an object and serializes to using `angular.toJson`. To prevent this behavior, set
+ * `transformRequest` to an empty array: `transformRequest: []`
+ * - **`transformResponse`** –
+ * `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
+ * transform function or an array of such functions. The transform function takes the http
+ * response body and headers and returns its transformed (typically deserialized) version.
+ * By default, transformResponse will contain one function that checks if the response looks like
+ * a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, set
+ * `transformResponse` to an empty array: `transformResponse: []`
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
* GET request, otherwise if a cache instance built with
* {@link ng.$cacheFactory $cacheFactory}, this cache will be used for
* caching.
++<<<<<<< HEAD
+ * - **`timeout`** – `{number}` – timeout in milliseconds.<br />
+ * **Note:** In contrast to {@link ng.$http#usage $http.config}, {@link ng.$q promises} are
+ * **not** supported in $resource, because the same value would be used for multiple requests.
+ * If you are looking for a way to cancel requests, you should use the `cancellable` option.
+ * - **`cancellable`** – `{boolean}` – if set to true, the request made by a "non-instance" call
+ * will be cancelled (if not already completed) by calling `$cancelRequest()` on the call's
+ * return value. Calling `$cancelRequest()` for a non-cancellable or an already
+ * completed/cancelled request will have no effect.<br />
++=======
+ * - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that
+ * should abort the request when resolved.
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the
* XHR object. See
* [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5)
* with `http response` object. See {@link ng.$http $http interceptors}.
*
* @param {Object} options Hash with custom settings that should extend the
++<<<<<<< HEAD
+ * default `$resourceProvider` behavior. The supported options are:
+ *
+ * - **`stripTrailingSlashes`** – {boolean} – If true then the trailing
+ * slashes from any calculated URL will be stripped. (Defaults to true.)
+ * - **`cancellable`** – {boolean} – If true, the request made by a "non-instance" call will be
+ * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return value.
+ * This can be overwritten per action. (Defaults to false.)
++=======
+ * default `$resourceProvider` behavior. The only supported option is
+ *
+ * Where:
+ *
+ * - **`stripTrailingSlashes`** – {boolean} – If true then the trailing
+ * slashes from any calculated URL will be stripped. (Defaults to true.)
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*
* @returns {Object} A resource "class" object with methods for the default set of resource actions
* optionally extended with custom `actions`. The default set contains these actions:
* - non-GET instance actions: `instance.$action([parameters], [success], [error])`
*
*
++<<<<<<< HEAD
+ * Success callback is called with (value (Object|Array), responseHeaders (Function),
+ * status (number), statusText (string)) arguments, where the value is the populated resource
+ * instance or collection object. The error callback is called with (httpResponse) argument.
++=======
+ * Success callback is called with (value, responseHeaders) arguments, where the value is
+ * the populated resource instance or collection object. The error callback is called
+ * with (httpResponse) argument.
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*
* Class actions return empty instance (with additional properties below).
* Instance actions return promise of the action.
*
++<<<<<<< HEAD
+ * The Resource instances and collections have these additional properties:
++=======
+ * The Resource instances and collection have these additional properties:
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*
* - `$promise`: the {@link ng.$q promise} of the original server interaction that created this
* instance or collection.
* {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view
* rendering until the resource(s) are loaded.
*
++<<<<<<< HEAD
+ * On failure, the promise is rejected with the {@link ng.$http http response} object, without
++=======
+ * On failure, the promise is resolved with the {@link ng.$http http response} object, without
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* the `resource` property.
*
* If an interceptor object was provided, the promise will instead be resolved with the value
* rejection), `false` before that. Knowing if the Resource has been resolved is useful in
* data-binding.
*
++<<<<<<< HEAD
+ * The Resource instances and collections have these additional methods:
+ *
+ * - `$cancelRequest`: If there is a cancellable, pending request related to the instance or
+ * collection, calling this method will abort the request.
+ *
+ * The Resource instances have these additional methods:
+ *
+ * - `toJSON`: It returns a simple object without any of the extra properties added as part of
+ * the Resource API. This object can be serialized through {@link angular.toJson} safely
+ * without attaching Angular-specific fields. Notice that `JSON.stringify` (and
+ * `angular.toJson`) automatically use this method when serializing a Resource instance
+ * (see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON()_behavior)).
+ *
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* @example
*
* # Credit card resource
*
* Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and
* `headers`.
++<<<<<<< HEAD
+ *
+ * @example
+ *
+ * # User resource
+ *
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* When the data is returned from the server then the object is an instance of the resource type and
* all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD
* operations (create, read, update, delete) on server-side data.
*
```js
var User = $resource('/user/:userId', {userId:'@id'});
++<<<<<<< HEAD
+ User.get({userId:123}, function(user, getResponseHeaders){
+ user.abc = true;
+ user.$save(function(user, putResponseHeaders) {
+ //user => saved user object
++=======
+ User.get({userId:123}, function(u, getResponseHeaders){
+ u.abc = true;
+ u.$save(function(u, putResponseHeaders) {
+ //u => saved user object
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
//putResponseHeaders => $http header getter
});
});
$scope.user = user;
});
```
++<<<<<<< HEAD
+ *
+ * @example
+ *
+ * # Creating a custom 'PUT' request
+ *
++=======
+
+ * # Creating a custom 'PUT' request
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
* In this example we create a custom method on our resource to make a PUT request
* ```js
* var app = angular.module('app', ['ngResource', 'ngRoute']);
* // This will PUT /notes/ID with the note object in the request payload
* }]);
* ```
++<<<<<<< HEAD
+ *
+ * @example
+ *
+ * # Cancelling requests
+ *
+ * If an action's configuration specifies that it is cancellable, you can cancel the request related
+ * to an instance or collection (as long as it is a result of a "non-instance" call):
+ *
+ ```js
+ // ...defining the `Hotel` resource...
+ var Hotel = $resource('/api/hotel/:id', {id: '@id'}, {
+ // Let's make the `query()` method cancellable
+ query: {method: 'get', isArray: true, cancellable: true}
+ });
+
+ // ...somewhere in the PlanVacationController...
+ ...
+ this.onDestinationChanged = function onDestinationChanged(destination) {
+ // We don't care about any pending request for hotels
+ // in a different destination any more
+ this.availableHotels.$cancelRequest();
+
+ // Let's query for hotels in '<destination>'
+ // (calls: /api/hotel?location=<destination>)
+ this.availableHotels = Hotel.query({location: destination});
+ };
+ ```
+ *
+ */
+ angular.module('ngResource', ['ng']).
+ provider('$resource', function ResourceProvider() {
+ var PROTOCOL_AND_IPV6_REGEX = /^https?:\/\/\[[^\]]*][^/]*/;
+
+ var provider = this;
+
+ /**
+ * @ngdoc property
+ * @name $resourceProvider#defaults
+ * @description
+ * Object containing default options used when creating `$resource` instances.
+ *
+ * The default values satisfy a wide range of usecases, but you may choose to overwrite any of
+ * them to further customize your instances. The available properties are:
+ *
+ * - **stripTrailingSlashes** – `{boolean}` – If true, then the trailing slashes from any
+ * calculated URL will be stripped.<br />
+ * (Defaults to true.)
+ * - **cancellable** – `{boolean}` – If true, the request made by a "non-instance" call will be
+ * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return
+ * value. For more details, see {@link ngResource.$resource}. This can be overwritten per
+ * resource class or action.<br />
+ * (Defaults to false.)
+ * - **actions** - `{Object.<Object>}` - A hash with default actions declarations. Actions are
+ * high-level methods corresponding to RESTful actions/methods on resources. An action may
+ * specify what HTTP method to use, what URL to hit, if the return value will be a single
+ * object or a collection (array) of objects etc. For more details, see
+ * {@link ngResource.$resource}. The actions can also be enhanced or overwritten per resource
+ * class.<br />
+ * The default actions are:
+ * ```js
+ * {
+ * get: {method: 'GET'},
+ * save: {method: 'POST'},
+ * query: {method: 'GET', isArray: true},
+ * remove: {method: 'DELETE'},
+ * delete: {method: 'DELETE'}
+ * }
+ * ```
+ *
+ * #### Example
+ *
+ * For example, you can specify a new `update` action that uses the `PUT` HTTP verb:
+ *
+ * ```js
+ * angular.
+ * module('myApp').
+ * config(['$resourceProvider', function ($resourceProvider) {
+ * $resourceProvider.defaults.actions.update = {
+ * method: 'PUT'
+ * };
+ * });
+ * ```
+ *
+ * Or you can even overwrite the whole `actions` list and specify your own:
+ *
+ * ```js
+ * angular.
+ * module('myApp').
+ * config(['$resourceProvider', function ($resourceProvider) {
+ * $resourceProvider.defaults.actions = {
+ * create: {method: 'POST'},
+ * get: {method: 'GET'},
+ * getAll: {method: 'GET', isArray:true},
+ * update: {method: 'PUT'},
+ * delete: {method: 'DELETE'}
+ * };
+ * });
+ * ```
+ *
+ */
++=======
+ */
+ angular.module('ngResource', ['ng']).
+ provider('$resource', function() {
+ var PROTOCOL_AND_DOMAIN_REGEX = /^https?:\/\/[^\/]*/;
+ var provider = this;
+
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
this.defaults = {
// Strip slashes by default
stripTrailingSlashes: true,
++<<<<<<< HEAD
+ // Make non-instance requests cancellable (via `$cancelRequest()`)
+ cancellable: false,
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
// Default actions configuration
actions: {
'get': {method: 'GET'},
}
};
++<<<<<<< HEAD
+ this.$get = ['$http', '$log', '$q', '$timeout', function($http, $log, $q, $timeout) {
+
+ var noop = angular.noop,
+ forEach = angular.forEach,
+ extend = angular.extend,
+ copy = angular.copy,
+ isArray = angular.isArray,
+ isDefined = angular.isDefined,
+ isFunction = angular.isFunction,
+ isNumber = angular.isNumber,
+ encodeUriQuery = angular.$$encodeUriQuery,
+ encodeUriSegment = angular.$$encodeUriSegment;
++=======
+ this.$get = ['$http', '$q', function($http, $q) {
+
+ var noop = angular.noop,
+ forEach = angular.forEach,
+ extend = angular.extend,
+ copy = angular.copy,
+ isFunction = angular.isFunction;
+
+ /**
+ * We need our custom method because encodeURIComponent is too aggressive and doesn't follow
+ * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set
+ * (pchar) allowed in path segments:
+ * segment = *pchar
+ * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
+ * pct-encoded = "%" HEXDIG HEXDIG
+ * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
+ * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
+ * / "*" / "+" / "," / ";" / "="
+ */
+ function encodeUriSegment(val) {
+ return encodeUriQuery(val, true).
+ replace(/%26/gi, '&').
+ replace(/%3D/gi, '=').
+ replace(/%2B/gi, '+');
+ }
+
+
+ /**
+ * This method is intended for encoding *key* or *value* parts of query component. We need a
+ * custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't
+ * have to be encoded per http://tools.ietf.org/html/rfc3986:
+ * query = *( pchar / "/" / "?" )
+ * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
+ * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
+ * pct-encoded = "%" HEXDIG HEXDIG
+ * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
+ * / "*" / "+" / "," / ";" / "="
+ */
+ function encodeUriQuery(val, pctEncodeSpaces) {
+ return encodeURIComponent(val).
+ replace(/%40/gi, '@').
+ replace(/%3A/gi, ':').
+ replace(/%24/g, '$').
+ replace(/%2C/gi, ',').
+ replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
function Route(template, defaults) {
this.template = template;
url = actionUrl || self.template,
val,
encodedVal,
++<<<<<<< HEAD
+ protocolAndIpv6 = '';
+
+ var urlParams = self.urlParams = Object.create(null);
+ forEach(url.split(/\W/), function(param) {
+ if (param === 'hasOwnProperty') {
+ throw $resourceMinErr('badname', 'hasOwnProperty is not a valid parameter name.');
+ }
+ if (!(new RegExp('^\\d+$').test(param)) && param &&
+ (new RegExp('(^|[^\\\\]):' + param + '(\\W|$)').test(url))) {
+ urlParams[param] = {
+ isQueryParamValue: (new RegExp('\\?.*=:' + param + '(?:\\W|$)')).test(url)
+ };
+ }
+ });
+ url = url.replace(/\\:/g, ':');
+ url = url.replace(PROTOCOL_AND_IPV6_REGEX, function(match) {
+ protocolAndIpv6 = match;
++=======
+ protocolAndDomain = '';
+
+ var urlParams = self.urlParams = {};
+ forEach(url.split(/\W/), function(param) {
+ if (param === 'hasOwnProperty') {
+ throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");
+ }
+ if (!(new RegExp("^\\d+$").test(param)) && param &&
+ (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) {
+ urlParams[param] = true;
+ }
+ });
+ url = url.replace(/\\:/g, ':');
+ url = url.replace(PROTOCOL_AND_DOMAIN_REGEX, function(match) {
+ protocolAndDomain = match;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return '';
});
params = params || {};
++<<<<<<< HEAD
+ forEach(self.urlParams, function(paramInfo, urlParam) {
+ val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
+ if (isDefined(val) && val !== null) {
+ if (paramInfo.isQueryParamValue) {
+ encodedVal = encodeUriQuery(val, true);
+ } else {
+ encodedVal = encodeUriSegment(val);
+ }
+ url = url.replace(new RegExp(':' + urlParam + '(\\W|$)', 'g'), function(match, p1) {
+ return encodedVal + p1;
+ });
+ } else {
+ url = url.replace(new RegExp('(/?):' + urlParam + '(\\W|$)', 'g'), function(match,
+ leadingSlashes, tail) {
+ if (tail.charAt(0) === '/') {
++=======
+ forEach(self.urlParams, function(_, urlParam) {
+ val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
+ if (angular.isDefined(val) && val !== null) {
+ encodedVal = encodeUriSegment(val);
+ url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) {
+ return encodedVal + p1;
+ });
+ } else {
+ url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
+ leadingSlashes, tail) {
+ if (tail.charAt(0) == '/') {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return tail;
} else {
return leadingSlashes + tail;
url = url.replace(/\/+$/, '') || '/';
}
++<<<<<<< HEAD
+ // Collapse `/.` if found in the last URL path segment before the query.
+ // E.g. `http://url.com/id/.format?q=x` becomes `http://url.com/id.format?q=x`.
+ url = url.replace(/\/\.(?=\w+($|\?))/, '.');
+ // Replace escaped `/\.` with `/.`.
+ // (If `\.` comes from a param value, it will be encoded as `%5C.`.)
+ config.url = protocolAndIpv6 + url.replace(/\/(\\|%5C)\./, '/.');
++=======
+ // then replace collapse `/.` if found in the last URL path segment before the query
+ // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
+ url = url.replace(/\/\.(?=\w+($|\?))/, '.');
+ // replace escaped `/\.` with `/.`
+ config.url = protocolAndDomain + url.replace(/\/\\\./, '/.');
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
// set params - delegate param encoding to $http
var ids = {};
actionParams = extend({}, paramDefaults, actionParams);
forEach(actionParams, function(value, key) {
++<<<<<<< HEAD
+ if (isFunction(value)) { value = value(data); }
+ ids[key] = value && value.charAt && value.charAt(0) === '@' ?
++=======
+ if (isFunction(value)) { value = value(); }
+ ids[key] = value && value.charAt && value.charAt(0) == '@' ?
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
lookupDottedPath(data, value.substr(1)) : value;
});
return ids;
var data = extend({}, this);
delete data.$promise;
delete data.$resolved;
++<<<<<<< HEAD
+ delete data.$cancelRequest;
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return data;
};
forEach(actions, function(action, name) {
var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);
++<<<<<<< HEAD
+ var numericTimeout = action.timeout;
+ var cancellable = isDefined(action.cancellable) ?
+ action.cancellable : route.defaults.cancellable;
+
+ if (numericTimeout && !isNumber(numericTimeout)) {
+ $log.debug('ngResource:\n' +
+ ' Only numeric values are allowed as `timeout`.\n' +
+ ' Promises are not supported in $resource, because the same value would ' +
+ 'be used for multiple requests. If you are looking for a way to cancel ' +
+ 'requests, you should use the `cancellable` option.');
+ delete action.timeout;
+ numericTimeout = null;
+ }
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Resource[name] = function(a1, a2, a3, a4) {
var params = {}, data, success, error;
++<<<<<<< HEAD
++=======
+ /* jshint -W086 */ /* (purposefully fall through case statements) */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
switch (arguments.length) {
case 4:
error = a4;
success = a3;
++<<<<<<< HEAD
+ // falls through
++=======
+ //fallthrough
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
case 3:
case 2:
if (isFunction(a2)) {
success = a2;
error = a3;
++<<<<<<< HEAD
+ // falls through
++=======
+ //fallthrough
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
} else {
params = a1;
data = a2;
success = a3;
break;
}
++<<<<<<< HEAD
+ // falls through
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
case 1:
if (isFunction(a1)) success = a1;
else if (hasBody) data = a1;
case 0: break;
default:
throw $resourceMinErr('badargs',
++<<<<<<< HEAD
+ 'Expected up to 4 arguments [params, data, success, error], got {0} arguments',
+ arguments.length);
+ }
++=======
+ "Expected up to 4 arguments [params, data, success, error], got {0} arguments",
+ arguments.length);
+ }
+ /* jshint +W086 */ /* (purposefully fall through case statements) */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var isInstanceCall = this instanceof Resource;
var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));
defaultResponseInterceptor;
var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||
undefined;
++<<<<<<< HEAD
+ var hasError = !!error;
+ var hasResponseErrorInterceptor = !!responseErrorInterceptor;
+ var timeoutDeferred;
+ var numericTimeoutPromise;
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
forEach(action, function(value, key) {
switch (key) {
case 'params':
case 'isArray':
case 'interceptor':
++<<<<<<< HEAD
+ case 'cancellable':
++=======
+ break;
+ case 'timeout':
+ httpConfig[key] = value;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
break;
}
});
++<<<<<<< HEAD
+ if (!isInstanceCall && cancellable) {
+ timeoutDeferred = $q.defer();
+ httpConfig.timeout = timeoutDeferred.promise;
+
+ if (numericTimeout) {
+ numericTimeoutPromise = $timeout(timeoutDeferred.resolve, numericTimeout);
+ }
+ }
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (hasBody) httpConfig.data = data;
route.setUrlParams(httpConfig,
extend({}, extractParams(data, action.params || {}), params),
action.url);
var promise = $http(httpConfig).then(function(response) {
++<<<<<<< HEAD
+ var data = response.data;
+
+ if (data) {
+ // Need to convert action.isArray to boolean in case it is undefined
+ if (isArray(data) !== (!!action.isArray)) {
+ throw $resourceMinErr('badcfg',
+ 'Error in resource configuration for action `{0}`. Expected response to ' +
+ 'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object',
+ isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url);
+ }
+ if (action.isArray) {
+ value.length = 0;
+ forEach(data, function(item) {
+ if (typeof item === 'object') {
++=======
+ var data = response.data,
+ promise = value.$promise;
+
+ if (data) {
+ // Need to convert action.isArray to boolean in case it is undefined
+ // jshint -W018
+ if (angular.isArray(data) !== (!!action.isArray)) {
+ throw $resourceMinErr('badcfg',
+ 'Error in resource configuration for action `{0}`. Expected response to ' +
+ 'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object',
+ angular.isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url);
+ }
+ // jshint +W018
+ if (action.isArray) {
+ value.length = 0;
+ forEach(data, function(item) {
+ if (typeof item === "object") {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
value.push(new Resource(item));
} else {
// Valid JSON values may be string literals, and these should not be converted
}
});
} else {
++<<<<<<< HEAD
+ var promise = value.$promise; // Save the promise
+ shallowClearAndCopy(data, value);
+ value.$promise = promise; // Restore the promise
+ }
+ }
+ response.resource = value;
+
+ return response;
+ });
+
+ promise = promise['finally'](function() {
+ value.$resolved = true;
+ if (!isInstanceCall && cancellable) {
+ value.$cancelRequest = noop;
+ $timeout.cancel(numericTimeoutPromise);
+ timeoutDeferred = numericTimeoutPromise = httpConfig.timeout = null;
+ }
++=======
+ shallowClearAndCopy(data, value);
+ value.$promise = promise;
+ }
+ }
+
+ value.$resolved = true;
+
+ response.resource = value;
+
+ return response;
+ }, function(response) {
+ value.$resolved = true;
+
+ (error || noop)(response);
+
+ return $q.reject(response);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
});
promise = promise.then(
function(response) {
var value = responseInterceptor(response);
++<<<<<<< HEAD
+ (success || noop)(value, response.headers, response.status, response.statusText);
+ return value;
+ },
+ (hasError || hasResponseErrorInterceptor) ?
+ function(response) {
+ if (hasError && !hasResponseErrorInterceptor) {
+ // Avoid `Possibly Unhandled Rejection` error,
+ // but still fulfill the returned promise with a rejection
+ promise.catch(noop);
+ }
+ if (hasError) error(response);
+ return hasResponseErrorInterceptor ?
+ responseErrorInterceptor(response) :
+ $q.reject(response);
+ } :
+ undefined);
++=======
+ (success || noop)(value, response.headers);
+ return value;
+ },
+ responseErrorInterceptor);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (!isInstanceCall) {
// we are creating instance / collection
// - return the instance / collection
value.$promise = promise;
value.$resolved = false;
++<<<<<<< HEAD
+ if (cancellable) value.$cancelRequest = cancelRequest;
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return value;
}
// instance call
return promise;
++<<<<<<< HEAD
+
+ function cancelRequest(value) {
+ promise.catch(noop);
+ timeoutDeferred.resolve(value);
+ }
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
};
});
Resource.bind = function(additionalParamDefaults) {
++<<<<<<< HEAD
+ var extendedParamDefaults = extend({}, paramDefaults, additionalParamDefaults);
+ return resourceFactory(url, extendedParamDefaults, actions, options);
++=======
+ return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
};
return Resource;
* angular-ui-bootstrap
* http://angular-ui.github.io/bootstrap/
++<<<<<<< HEAD
+ * Version: 1.3.3 - 2016-05-22
+ * License: MIT
+ */angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]);
+ angular.module("ui.bootstrap.tpls", ["uib/template/accordion/accordion-group.html","uib/template/accordion/accordion.html","uib/template/alert/alert.html","uib/template/carousel/carousel.html","uib/template/carousel/slide.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/year.html","uib/template/datepickerPopup/popup.html","uib/template/modal/backdrop.html","uib/template/modal/window.html","uib/template/pager/pager.html","uib/template/pagination/pagination.html","uib/template/tooltip/tooltip-html-popup.html","uib/template/tooltip/tooltip-popup.html","uib/template/tooltip/tooltip-template-popup.html","uib/template/popover/popover-html.html","uib/template/popover/popover-template.html","uib/template/popover/popover.html","uib/template/progressbar/bar.html","uib/template/progressbar/progress.html","uib/template/progressbar/progressbar.html","uib/template/rating/rating.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html","uib/template/timepicker/timepicker.html","uib/template/typeahead/typeahead-match.html","uib/template/typeahead/typeahead-popup.html"]);
+ angular.module('ui.bootstrap.collapse', [])
+
+ .directive('uibCollapse', ['$animate', '$q', '$parse', '$injector', function($animate, $q, $parse, $injector) {
+ var $animateCss = $injector.has('$animateCss') ? $injector.get('$animateCss') : null;
+ return {
+ link: function(scope, element, attrs) {
+ var expandingExpr = $parse(attrs.expanding),
+ expandedExpr = $parse(attrs.expanded),
+ collapsingExpr = $parse(attrs.collapsing),
+ collapsedExpr = $parse(attrs.collapsed);
+
+ if (!scope.$eval(attrs.uibCollapse)) {
+ element.addClass('in')
+ .addClass('collapse')
+ .attr('aria-expanded', true)
+ .attr('aria-hidden', false)
++=======
+ * Version: 1.0.0 - 2016-01-08
+ * License: MIT
+ */
+ angular.module("ui.bootstrap", ["ui.bootstrap.tpls", "ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]);
+ angular.module("ui.bootstrap.tpls", ["uib/template/accordion/accordion-group.html","uib/template/accordion/accordion.html","uib/template/alert/alert.html","uib/template/carousel/carousel.html","uib/template/carousel/slide.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/popup.html","uib/template/datepicker/year.html","uib/template/modal/backdrop.html","uib/template/modal/window.html","uib/template/pager/pager.html","uib/template/pagination/pagination.html","uib/template/tooltip/tooltip-html-popup.html","uib/template/tooltip/tooltip-popup.html","uib/template/tooltip/tooltip-template-popup.html","uib/template/popover/popover-html.html","uib/template/popover/popover-template.html","uib/template/popover/popover.html","uib/template/progressbar/bar.html","uib/template/progressbar/progress.html","uib/template/progressbar/progressbar.html","uib/template/rating/rating.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html","uib/template/timepicker/timepicker.html","uib/template/typeahead/typeahead-match.html","uib/template/typeahead/typeahead-popup.html"]);
+ angular.module('ui.bootstrap.collapse', [])
+
+ .directive('uibCollapse', ['$animate', '$injector', function($animate, $injector) {
+ var $animateCss = $injector.has('$animateCss') ? $injector.get('$animateCss') : null;
+ return {
+ link: function(scope, element, attrs) {
+ if (!scope.$eval(attrs.uibCollapse)) {
+ element.addClass('in')
+ .addClass('collapse')
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
.css({height: 'auto'});
}
function expand() {
++<<<<<<< HEAD
+ if (element.hasClass('collapse') && element.hasClass('in')) {
+ return;
+ }
+
+ $q.resolve(expandingExpr(scope))
+ .then(function() {
+ element.removeClass('collapse')
+ .addClass('collapsing')
+ .attr('aria-expanded', true)
+ .attr('aria-hidden', false);
+
+ if ($animateCss) {
+ $animateCss(element, {
+ addClass: 'in',
+ easing: 'ease',
+ to: { height: element[0].scrollHeight + 'px' }
+ }).start()['finally'](expandDone);
+ } else {
+ $animate.addClass(element, 'in', {
+ to: { height: element[0].scrollHeight + 'px' }
+ }).then(expandDone);
+ }
+ });
++=======
+ element.removeClass('collapse')
+ .addClass('collapsing')
+ .attr('aria-expanded', true)
+ .attr('aria-hidden', false);
+
+ if ($animateCss) {
+ $animateCss(element, {
+ addClass: 'in',
+ easing: 'ease',
+ to: { height: element[0].scrollHeight + 'px' }
+ }).start()['finally'](expandDone);
+ } else {
+ $animate.addClass(element, 'in', {
+ to: { height: element[0].scrollHeight + 'px' }
+ }).then(expandDone);
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
function expandDone() {
element.removeClass('collapsing')
.addClass('collapse')
.css({height: 'auto'});
++<<<<<<< HEAD
+ expandedExpr(scope);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
function collapse() {
return collapseDone();
}
++<<<<<<< HEAD
+ $q.resolve(collapsingExpr(scope))
+ .then(function() {
+ element
+ // IMPORTANT: The height must be set before adding "collapsing" class.
+ // Otherwise, the browser attempts to animate from height 0 (in
+ // collapsing class) to the given height here.
+ .css({height: element[0].scrollHeight + 'px'})
+ // initially all panel collapse have the collapse class, this removal
+ // prevents the animation from jumping to collapsed state
+ .removeClass('collapse')
+ .addClass('collapsing')
+ .attr('aria-expanded', false)
+ .attr('aria-hidden', true);
+
+ if ($animateCss) {
+ $animateCss(element, {
+ removeClass: 'in',
+ to: {height: '0'}
+ }).start()['finally'](collapseDone);
+ } else {
+ $animate.removeClass(element, 'in', {
+ to: {height: '0'}
+ }).then(collapseDone);
+ }
+ });
++=======
+ element
+ // IMPORTANT: The height must be set before adding "collapsing" class.
+ // Otherwise, the browser attempts to animate from height 0 (in
+ // collapsing class) to the given height here.
+ .css({height: element[0].scrollHeight + 'px'})
+ // initially all panel collapse have the collapse class, this removal
+ // prevents the animation from jumping to collapsed state
+ .removeClass('collapse')
+ .addClass('collapsing')
+ .attr('aria-expanded', false)
+ .attr('aria-hidden', true);
+
+ if ($animateCss) {
+ $animateCss(element, {
+ removeClass: 'in',
+ to: {height: '0'}
+ }).start()['finally'](collapseDone);
+ } else {
+ $animate.removeClass(element, 'in', {
+ to: {height: '0'}
+ }).then(collapseDone);
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
function collapseDone() {
element.css({height: '0'}); // Required so that collapse works when animation is disabled
element.removeClass('collapsing')
.addClass('collapse');
++<<<<<<< HEAD
+ collapsedExpr(scope);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
scope.$watch(attrs.uibCollapse, function(shouldCollapse) {
},
scope: {
heading: '@', // Interpolate the heading attribute onto this scope
++<<<<<<< HEAD
+ panelClass: '@?', // Ditto with panelClass
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
isOpen: '=?',
isDisabled: '=?'
},
}
}
};
++<<<<<<< HEAD
+
+ var id = 'accordiongroup-' + scope.$id + '-' + Math.floor(Math.random() * 10000);
+ scope.headingId = id + '-tab';
+ scope.panelId = id + '-panel';
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
})
link: function(scope, element, attrs, controller) {
scope.$watch(function() { return controller[attrs.uibAccordionTransclude]; }, function(heading) {
if (heading) {
++<<<<<<< HEAD
+ var elem = angular.element(element[0].querySelector(getHeaderSelectors()));
+ elem.html('');
+ elem.append(heading);
++=======
+ element.find('span').html('');
+ element.find('span').append(heading);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
});
}
};
++<<<<<<< HEAD
+
+ function getHeaderSelectors() {
+ return 'uib-accordion-header,' +
+ 'data-uib-accordion-header,' +
+ 'x-uib-accordion-header,' +
+ 'uib\\:accordion-header,' +
+ '[uib-accordion-header],' +
+ '[data-uib-accordion-header],' +
+ '[x-uib-accordion-header]';
+ }
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
});
angular.module('ui.bootstrap.alert', [])
if (attrs.uibUncheckable) {
scope.$watch(uncheckableExpr, function(uncheckable) {
++<<<<<<< HEAD
+ attrs.$set('uncheckable', uncheckable ? '' : undefined);
++=======
+ attrs.$set('uncheckable', uncheckable ? '' : null);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
});
}
}
var self = this,
slides = self.slides = $scope.slides = [],
SLIDE_DIRECTION = 'uib-slideDirection',
++<<<<<<< HEAD
+ currentIndex = $scope.active,
+ currentInterval, isPlaying, bufferedTransitions = [];
++=======
+ currentIndex = -1,
+ currentInterval, isPlaying, bufferedTransitions = [];
+ self.currentSlide = null;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var destroyed = false;
self.addSlide = function(slide, element) {
++<<<<<<< HEAD
+ slides.push({
+ slide: slide,
+ element: element
+ });
+ slides.sort(function(a, b) {
+ return +a.slide.index - +b.slide.index;
+ });
+ //if this is the first slide or the slide is set to active, select it
+ if (slide.index === $scope.active || slides.length === 1 && !angular.isNumber($scope.active)) {
++=======
+ slide.$element = element;
+ slides.push(slide);
+ //if this is the first slide or the slide is set to active, select it
+ if (slides.length === 1 || slide.active) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if ($scope.$currentTransition) {
$scope.$currentTransition = null;
}
++<<<<<<< HEAD
+ currentIndex = slide.index;
+ $scope.active = slide.index;
+ setActive(currentIndex);
+ self.select(slides[findSlideIndex(slide)]);
+ if (slides.length === 1) {
+ $scope.play();
+ }
++=======
+ self.select(slides[slides.length - 1]);
+ if (slides.length === 1) {
+ $scope.play();
+ }
+ } else {
+ slide.active = false;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
self.getCurrentIndex = function() {
++<<<<<<< HEAD
+ for (var i = 0; i < slides.length; i++) {
+ if (slides[i].slide.index === currentIndex) {
+ return i;
+ }
+ }
++=======
+ if (self.currentSlide && angular.isDefined(self.currentSlide.index)) {
+ return +self.currentSlide.index;
+ }
+ return currentIndex;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
};
self.next = $scope.next = function() {
return;
}
++<<<<<<< HEAD
+ return self.select(slides[newIndex], 'next');
++=======
+ return self.select(getSlideByIndex(newIndex), 'next');
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
};
self.prev = $scope.prev = function() {
return;
}
++<<<<<<< HEAD
+ return self.select(slides[newIndex], 'prev');
+ };
+
+ self.removeSlide = function(slide) {
+ var index = findSlideIndex(slide);
+
+ var bufferedIndex = bufferedTransitions.indexOf(slides[index]);
+ if (bufferedIndex !== -1) {
+ bufferedTransitions.splice(bufferedIndex, 1);
+ }
+
+ //get the index of the slide inside the carousel
+ slides.splice(index, 1);
+ if (slides.length > 0 && currentIndex === index) {
+ if (index >= slides.length) {
+ currentIndex = slides.length - 1;
+ $scope.active = currentIndex;
+ setActive(currentIndex);
+ self.select(slides[slides.length - 1]);
+ } else {
+ currentIndex = index;
+ $scope.active = currentIndex;
+ setActive(currentIndex);
+ self.select(slides[index]);
+ }
+ } else if (currentIndex > index) {
+ currentIndex--;
+ $scope.active = currentIndex;
+ }
+
+ //clean the active value when no more slide
+ if (slides.length === 0) {
+ currentIndex = null;
+ $scope.active = null;
++=======
+ return self.select(getSlideByIndex(newIndex), 'prev');
+ };
+
+ self.removeSlide = function(slide) {
+ if (angular.isDefined(slide.index)) {
+ slides.sort(function(a, b) {
+ return +a.index > +b.index;
+ });
+ }
+
+ var bufferedIndex = bufferedTransitions.indexOf(slide);
+ if (bufferedIndex !== -1) {
+ bufferedTransitions.splice(bufferedIndex, 1);
+ }
+ //get the index of the slide inside the carousel
+ var index = slides.indexOf(slide);
+ slides.splice(index, 1);
+ $timeout(function() {
+ if (slides.length > 0 && slide.active) {
+ if (index >= slides.length) {
+ self.select(slides[index - 1]);
+ } else {
+ self.select(slides[index]);
+ }
+ } else if (currentIndex > index) {
+ currentIndex--;
+ }
+ });
+
+ //clean the currentSlide when no more slide
+ if (slides.length === 0) {
+ self.currentSlide = null;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
clearBufferedTransitions();
}
};
/* direction: "prev" or "next" */
self.select = $scope.select = function(nextSlide, direction) {
++<<<<<<< HEAD
+ var nextIndex = findSlideIndex(nextSlide.slide);
++=======
+ var nextIndex = $scope.indexOfSlide(nextSlide);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
//Decide direction if it's not given
if (direction === undefined) {
direction = nextIndex > self.getCurrentIndex() ? 'next' : 'prev';
}
//Prevent this user-triggered transition from occurring if there is already one in progress
++<<<<<<< HEAD
+ if (nextSlide.slide.index !== currentIndex &&
+ !$scope.$currentTransition) {
+ goNext(nextSlide.slide, nextIndex, direction);
+ } else if (nextSlide && nextSlide.slide.index !== currentIndex && $scope.$currentTransition) {
+ bufferedTransitions.push(slides[nextIndex]);
++=======
+ if (nextSlide && nextSlide !== self.currentSlide && !$scope.$currentTransition) {
+ goNext(nextSlide, nextIndex, direction);
+ } else if (nextSlide && nextSlide !== self.currentSlide && $scope.$currentTransition) {
+ bufferedTransitions.push(nextSlide);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
/* Allow outside people to call indexOf on slides array */
$scope.indexOfSlide = function(slide) {
++<<<<<<< HEAD
+ return +slide.slide.index;
+ };
+
+ $scope.isActive = function(slide) {
+ return $scope.active === slide.slide.index;
+ };
+
+ $scope.isPrevDisabled = function() {
+ return $scope.active === 0 && $scope.noWrap();
+ };
+
+ $scope.isNextDisabled = function() {
+ return $scope.active === slides.length - 1 && $scope.noWrap();
++=======
+ return angular.isDefined(slide.index) ? +slide.index : slides.indexOf(slide);
+ };
+
+ $scope.isActive = function(slide) {
+ return self.currentSlide === slide;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
};
$scope.pause = function() {
$scope.$watchCollection('slides', resetTransition);
++<<<<<<< HEAD
+ $scope.$watch('active', function(index) {
+ if (angular.isNumber(index) && currentIndex !== index) {
+ for (var i = 0; i < slides.length; i++) {
+ if (slides[i].slide.index === index) {
+ index = i;
+ break;
+ }
+ }
+
+ var slide = slides[index];
+ if (slide) {
+ setActive(index);
+ self.select(slides[index]);
+ currentIndex = index;
+ }
+ }
+ });
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
function clearBufferedTransitions() {
while (bufferedTransitions.length) {
bufferedTransitions.shift();
}
function getSlideByIndex(index) {
++<<<<<<< HEAD
++=======
+ if (angular.isUndefined(slides[index].index)) {
+ return slides[index];
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
for (var i = 0, l = slides.length; i < l; ++i) {
if (slides[i].index === index) {
return slides[i];
}
}
++<<<<<<< HEAD
+ function setActive(index) {
+ for (var i = 0; i < slides.length; i++) {
+ slides[i].slide.active = i === index;
+ }
+ }
+
+ function goNext(slide, index, direction) {
+ if (destroyed) {
+ return;
+ }
+
+ angular.extend(slide, {direction: direction});
+ angular.extend(slides[currentIndex].slide || {}, {direction: direction});
+ if ($animate.enabled($element) && !$scope.$currentTransition &&
+ slides[index].element && self.slides.length > 1) {
+ slides[index].element.data(SLIDE_DIRECTION, slide.direction);
+ var currentIdx = self.getCurrentIndex();
+
+ if (angular.isNumber(currentIdx) && slides[currentIdx].element) {
+ slides[currentIdx].element.data(SLIDE_DIRECTION, slide.direction);
+ }
+
+ $scope.$currentTransition = true;
+ $animate.on('addClass', slides[index].element, function(element, phase) {
++=======
+ function goNext(slide, index, direction) {
+ if (destroyed) { return; }
+
+ angular.extend(slide, {direction: direction, active: true});
+ angular.extend(self.currentSlide || {}, {direction: direction, active: false});
+ if ($animate.enabled($element) && !$scope.$currentTransition &&
+ slide.$element && self.slides.length > 1) {
+ slide.$element.data(SLIDE_DIRECTION, slide.direction);
+ if (self.currentSlide && self.currentSlide.$element) {
+ self.currentSlide.$element.data(SLIDE_DIRECTION, slide.direction);
+ }
+
+ $scope.$currentTransition = true;
+ $animate.on('addClass', slide.$element, function(element, phase) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (phase === 'close') {
$scope.$currentTransition = null;
$animate.off('addClass', element);
if (bufferedTransitions.length) {
++<<<<<<< HEAD
+ var nextSlide = bufferedTransitions.pop().slide;
+ var nextIndex = nextSlide.index;
++=======
+ var nextSlide = bufferedTransitions.pop();
+ var nextIndex = $scope.indexOfSlide(nextSlide);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var nextDirection = nextIndex > self.getCurrentIndex() ? 'next' : 'prev';
clearBufferedTransitions();
});
}
++<<<<<<< HEAD
+ $scope.active = slide.index;
+ currentIndex = slide.index;
+ setActive(index);
++=======
+ self.currentSlide = slide;
+ currentIndex = index;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
//every time you change slides, reset the timer
restartTimer();
}
++<<<<<<< HEAD
+ function findSlideIndex(slide) {
+ for (var i = 0; i < slides.length; i++) {
+ if (slides[i].slide === slide) {
+ return i;
+ }
+ }
+ }
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
function resetTimer() {
if (currentInterval) {
$interval.cancel(currentInterval);
return attrs.templateUrl || 'uib/template/carousel/carousel.html';
},
scope: {
++<<<<<<< HEAD
+ active: '=',
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
interval: '=',
noTransition: '=',
noPause: '=',
return attrs.templateUrl || 'uib/template/carousel/slide.html';
},
scope: {
++<<<<<<< HEAD
++=======
+ active: '=?',
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
actual: '=?',
index: '=?'
},
scope.$on('$destroy', function() {
carouselCtrl.removeSlide(scope);
});
++<<<<<<< HEAD
++=======
+
+ scope.$watch('active', function(active) {
+ if (active) {
+ carouselCtrl.select(scope);
+ }
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
})
angular.module('ui.bootstrap.dateparser', [])
++<<<<<<< HEAD
+ .service('uibDateParser', ['$log', '$locale', 'dateFilter', 'orderByFilter', function($log, $locale, dateFilter, orderByFilter) {
++=======
+ .service('uibDateParser', ['$log', '$locale', 'orderByFilter', function($log, $locale, orderByFilter) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
// Pulled from https://github.com/mbostock/d3/blob/master/src/format/requote.js
var SPECIAL_CHARACTERS_REGEXP = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
localeId = $locale.id;
this.parsers = {};
++<<<<<<< HEAD
+ this.formatters = {};
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
formatCodeToRegex = [
{
key: 'yyyy',
regex: '\\d{4}',
++<<<<<<< HEAD
+ apply: function(value) { this.year = +value; },
+ formatter: function(date) {
+ var _date = new Date();
+ _date.setFullYear(Math.abs(date.getFullYear()));
+ return dateFilter(_date, 'yyyy');
+ }
++=======
+ apply: function(value) { this.year = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'yy',
regex: '\\d{2}',
++<<<<<<< HEAD
+ apply: function(value) { value = +value; this.year = value < 69 ? value + 2000 : value + 1900; },
+ formatter: function(date) {
+ var _date = new Date();
+ _date.setFullYear(Math.abs(date.getFullYear()));
+ return dateFilter(_date, 'yy');
+ }
++=======
+ apply: function(value) { this.year = +value + 2000; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'y',
regex: '\\d{1,4}',
++<<<<<<< HEAD
+ apply: function(value) { this.year = +value; },
+ formatter: function(date) {
+ var _date = new Date();
+ _date.setFullYear(Math.abs(date.getFullYear()));
+ return dateFilter(_date, 'y');
+ }
++=======
+ apply: function(value) { this.year = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'M!',
regex: '0?[1-9]|1[0-2]',
++<<<<<<< HEAD
+ apply: function(value) { this.month = value - 1; },
+ formatter: function(date) {
+ var value = date.getMonth();
+ if (/^[0-9]$/.test(value)) {
+ return dateFilter(date, 'MM');
+ }
+
+ return dateFilter(date, 'M');
+ }
++=======
+ apply: function(value) { this.month = value - 1; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'MMMM',
regex: $locale.DATETIME_FORMATS.MONTH.join('|'),
++<<<<<<< HEAD
+ apply: function(value) { this.month = $locale.DATETIME_FORMATS.MONTH.indexOf(value); },
+ formatter: function(date) { return dateFilter(date, 'MMMM'); }
++=======
+ apply: function(value) { this.month = $locale.DATETIME_FORMATS.MONTH.indexOf(value); }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'MMM',
regex: $locale.DATETIME_FORMATS.SHORTMONTH.join('|'),
++<<<<<<< HEAD
+ apply: function(value) { this.month = $locale.DATETIME_FORMATS.SHORTMONTH.indexOf(value); },
+ formatter: function(date) { return dateFilter(date, 'MMM'); }
++=======
+ apply: function(value) { this.month = $locale.DATETIME_FORMATS.SHORTMONTH.indexOf(value); }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'MM',
regex: '0[1-9]|1[0-2]',
++<<<<<<< HEAD
+ apply: function(value) { this.month = value - 1; },
+ formatter: function(date) { return dateFilter(date, 'MM'); }
++=======
+ apply: function(value) { this.month = value - 1; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'M',
regex: '[1-9]|1[0-2]',
++<<<<<<< HEAD
+ apply: function(value) { this.month = value - 1; },
+ formatter: function(date) { return dateFilter(date, 'M'); }
++=======
+ apply: function(value) { this.month = value - 1; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'd!',
regex: '[0-2]?[0-9]{1}|3[0-1]{1}',
++<<<<<<< HEAD
+ apply: function(value) { this.date = +value; },
+ formatter: function(date) {
+ var value = date.getDate();
+ if (/^[1-9]$/.test(value)) {
+ return dateFilter(date, 'dd');
+ }
+
+ return dateFilter(date, 'd');
+ }
++=======
+ apply: function(value) { this.date = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'dd',
regex: '[0-2][0-9]{1}|3[0-1]{1}',
++<<<<<<< HEAD
+ apply: function(value) { this.date = +value; },
+ formatter: function(date) { return dateFilter(date, 'dd'); }
++=======
+ apply: function(value) { this.date = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'd',
regex: '[1-2]?[0-9]{1}|3[0-1]{1}',
++<<<<<<< HEAD
+ apply: function(value) { this.date = +value; },
+ formatter: function(date) { return dateFilter(date, 'd'); }
+ },
+ {
+ key: 'EEEE',
+ regex: $locale.DATETIME_FORMATS.DAY.join('|'),
+ formatter: function(date) { return dateFilter(date, 'EEEE'); }
+ },
+ {
+ key: 'EEE',
+ regex: $locale.DATETIME_FORMATS.SHORTDAY.join('|'),
+ formatter: function(date) { return dateFilter(date, 'EEE'); }
++=======
+ apply: function(value) { this.date = +value; }
+ },
+ {
+ key: 'EEEE',
+ regex: $locale.DATETIME_FORMATS.DAY.join('|')
+ },
+ {
+ key: 'EEE',
+ regex: $locale.DATETIME_FORMATS.SHORTDAY.join('|')
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'HH',
regex: '(?:0|1)[0-9]|2[0-3]',
++<<<<<<< HEAD
+ apply: function(value) { this.hours = +value; },
+ formatter: function(date) { return dateFilter(date, 'HH'); }
++=======
+ apply: function(value) { this.hours = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'hh',
regex: '0[0-9]|1[0-2]',
++<<<<<<< HEAD
+ apply: function(value) { this.hours = +value; },
+ formatter: function(date) { return dateFilter(date, 'hh'); }
++=======
+ apply: function(value) { this.hours = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'H',
regex: '1?[0-9]|2[0-3]',
++<<<<<<< HEAD
+ apply: function(value) { this.hours = +value; },
+ formatter: function(date) { return dateFilter(date, 'H'); }
++=======
+ apply: function(value) { this.hours = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'h',
regex: '[0-9]|1[0-2]',
++<<<<<<< HEAD
+ apply: function(value) { this.hours = +value; },
+ formatter: function(date) { return dateFilter(date, 'h'); }
++=======
+ apply: function(value) { this.hours = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'mm',
regex: '[0-5][0-9]',
++<<<<<<< HEAD
+ apply: function(value) { this.minutes = +value; },
+ formatter: function(date) { return dateFilter(date, 'mm'); }
++=======
+ apply: function(value) { this.minutes = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'm',
regex: '[0-9]|[1-5][0-9]',
++<<<<<<< HEAD
+ apply: function(value) { this.minutes = +value; },
+ formatter: function(date) { return dateFilter(date, 'm'); }
++=======
+ apply: function(value) { this.minutes = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'sss',
regex: '[0-9][0-9][0-9]',
++<<<<<<< HEAD
+ apply: function(value) { this.milliseconds = +value; },
+ formatter: function(date) { return dateFilter(date, 'sss'); }
++=======
+ apply: function(value) { this.milliseconds = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'ss',
regex: '[0-5][0-9]',
++<<<<<<< HEAD
+ apply: function(value) { this.seconds = +value; },
+ formatter: function(date) { return dateFilter(date, 'ss'); }
++=======
+ apply: function(value) { this.seconds = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 's',
regex: '[0-9]|[1-5][0-9]',
++<<<<<<< HEAD
+ apply: function(value) { this.seconds = +value; },
+ formatter: function(date) { return dateFilter(date, 's'); }
++=======
+ apply: function(value) { this.seconds = +value; }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'a',
if (value === 'PM') {
this.hours += 12;
}
++<<<<<<< HEAD
+ },
+ formatter: function(date) { return dateFilter(date, 'a'); }
++=======
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
{
key: 'Z',
minutes = matches[3];
this.hours += toInt(sign + hours);
this.minutes += toInt(sign + minutes);
++<<<<<<< HEAD
+ },
+ formatter: function(date) {
+ return dateFilter(date, 'Z');
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
},
{
key: 'ww',
++<<<<<<< HEAD
+ regex: '[0-4][0-9]|5[0-3]',
+ formatter: function(date) { return dateFilter(date, 'ww'); }
+ },
+ {
+ key: 'w',
+ regex: '[0-9]|[1-4][0-9]|5[0-3]',
+ formatter: function(date) { return dateFilter(date, 'w'); }
+ },
+ {
+ key: 'GGGG',
+ regex: $locale.DATETIME_FORMATS.ERANAMES.join('|').replace(/\s/g, '\\s'),
+ formatter: function(date) { return dateFilter(date, 'GGGG'); }
+ },
+ {
+ key: 'GGG',
+ regex: $locale.DATETIME_FORMATS.ERAS.join('|'),
+ formatter: function(date) { return dateFilter(date, 'GGG'); }
+ },
+ {
+ key: 'GG',
+ regex: $locale.DATETIME_FORMATS.ERAS.join('|'),
+ formatter: function(date) { return dateFilter(date, 'GG'); }
+ },
+ {
+ key: 'G',
+ regex: $locale.DATETIME_FORMATS.ERAS.join('|'),
+ formatter: function(date) { return dateFilter(date, 'G'); }
++=======
+ regex: '[0-4][0-9]|5[0-3]'
+ },
+ {
+ key: 'w',
+ regex: '[0-9]|[1-4][0-9]|5[0-3]'
+ },
+ {
+ key: 'GGGG',
+ regex: $locale.DATETIME_FORMATS.ERANAMES.join('|').replace(/\s/g, '\\s')
+ },
+ {
+ key: 'GGG',
+ regex: $locale.DATETIME_FORMATS.ERAS.join('|')
+ },
+ {
+ key: 'GG',
+ regex: $locale.DATETIME_FORMATS.ERAS.join('|')
+ },
+ {
+ key: 'G',
+ regex: $locale.DATETIME_FORMATS.ERAS.join('|')
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
];
};
this.init();
++<<<<<<< HEAD
+ function createParser(format, func) {
++=======
+ function createParser(format) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var map = [], regex = format.split('');
// check for literal values
map.push({
index: index,
++<<<<<<< HEAD
+ key: data.key,
+ apply: data[func],
++=======
+ apply: data.apply,
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
matcher: data.regex
});
}
};
}
++<<<<<<< HEAD
+ this.filter = function(date, format) {
+ if (!angular.isDate(date) || isNaN(date) || !format) {
+ return '';
+ }
+
+ format = $locale.DATETIME_FORMATS[format] || format;
+
+ if ($locale.id !== localeId) {
+ this.init();
+ }
+
+ if (!this.formatters[format]) {
+ this.formatters[format] = createParser(format, 'formatter');
+ }
+
+ var parser = this.formatters[format],
+ map = parser.map;
+
+ var _format = format;
+
+ return map.reduce(function(str, mapper, i) {
+ var match = _format.match(new RegExp('(.*)' + mapper.key));
+ if (match && angular.isString(match[1])) {
+ str += match[1];
+ _format = _format.replace(match[1] + mapper.key, '');
+ }
+
+ var endStr = i === map.length - 1 ? _format : '';
+
+ if (mapper.apply) {
+ return str + mapper.apply.call(null, date) + endStr;
+ }
+
+ return str + endStr;
+ }, '');
+ };
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
this.parse = function(input, format, baseDate) {
if (!angular.isString(input) || !format) {
return input;
}
if (!this.parsers[format]) {
++<<<<<<< HEAD
+ this.parsers[format] = createParser(format, 'apply');
++=======
+ this.parsers[format] = createParser(format);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
var parser = this.parsers[format],
this.timezoneToOffset = timezoneToOffset;
this.addDateMinutes = addDateMinutes;
this.convertTimezoneToLocal = convertTimezoneToLocal;
++<<<<<<< HEAD
+
++=======
+
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
function toTimezone(date, timezone) {
return date && timezone ? convertTimezoneToLocal(date, timezone) : date;
}
return date && timezone ? convertTimezoneToLocal(date, timezone, true) : date;
}
++<<<<<<< HEAD
+ //https://github.com/angular/angular.js/blob/622c42169699ec07fc6daaa19fe6d224e5d2f70e/src/Angular.js#L1207
+ function timezoneToOffset(timezone, fallback) {
+ timezone = timezone.replace(/:/g, '');
++=======
+ //https://github.com/angular/angular.js/blob/4daafd3dbe6a80d578f5a31df1bb99c77559543e/src/Angular.js#L1207
+ function timezoneToOffset(timezone, fallback) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
}
function convertTimezoneToLocal(date, timezone, reverse) {
reverse = reverse ? -1 : 1;
++<<<<<<< HEAD
+ var dateTimezoneOffset = date.getTimezoneOffset();
+ var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
+ return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));
++=======
+ var timezoneOffset = timezoneToOffset(timezone, date.getTimezoneOffset());
+ return addDateMinutes(date, reverse * (timezoneOffset - date.getTimezoneOffset()));
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
}]);
return {
restrict: 'A',
++<<<<<<< HEAD
+ compile: function(tElement, tAttrs) {
++=======
+ compile: function (tElement, tAttrs) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var linkedScopes = [];
var instances = [];
var expToData = {};
element: element
});
++<<<<<<< HEAD
+ exps.forEach(function(exp, k) {
++=======
+ exps.forEach(function (exp, k) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
addForExp(exp, scope);
});
var compareWithExp = matches[2];
var data = expToData[exp];
if (!data) {
++<<<<<<< HEAD
+ var watchFn = function(compareWithVal) {
+ var newActivated = null;
+ instances.some(function(instance) {
++=======
+ var watchFn = function (compareWithVal) {
+ var newActivated = null;
+ instances.some(function (instance) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var thisVal = instance.scope.$eval(onExp);
if (thisVal === compareWithVal) {
newActivated = instance;
instances.splice(index, 1);
if (linkedScopes.length) {
var newWatchScope = linkedScopes[0];
++<<<<<<< HEAD
+ angular.forEach(expToData, function(data) {
++=======
+ angular.forEach(expToData, function (data) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (data.scope === removedScope) {
data.watcher = newWatchScope.$watch(data.compareWithExp, data.watchFn);
data.scope = newWatchScope;
}
});
++<<<<<<< HEAD
+ } else {
++=======
+ }
+ else {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
expToData = {};
}
}
}
};
}]);
- };
-
- // Key event mapper
- $scope.keys = { 13: 'enter', 32: 'space', 33: 'pageup', 34: 'pagedown', 35: 'end', 36: 'home', 37: 'left', 38: 'up', 39: 'right', 40: 'down' };
-
- var focusElement = function() {
- self.element[0].focus();
- };
-
- // Listen for focus requests from popup directive
- $scope.$on('uib:datepicker.focus', focusElement);
-
- $scope.keydown = function(evt) {
- var key = $scope.keys[evt.which];
-
- if (!key || evt.shiftKey || evt.altKey || $scope.disabled) {
- return;
- }
-
- evt.preventDefault();
- if (!self.shortcutPropagation) {
- evt.stopPropagation();
- }
-
- if (key === 'enter' || key === 'space') {
- if (self.isDisabled(self.activeDate)) {
- return; // do nothing
- }
- $scope.select(self.activeDate);
- } else if (evt.ctrlKey && (key === 'up' || key === 'down')) {
- $scope.toggleMode(key === 'up' ? 1 : -1);
- } else {
- self.handleKeyDown(key, evt);
- self.refreshView();
- }
- };
-
- $scope.$on('$destroy', function() {
- //Clear all watch listeners on destroy
- while (watchListeners.length) {
- watchListeners.shift()();
- }
- });
-
- function setMode(mode) {
- $scope.datepickerMode = mode;
- $scope.datepickerOptions.datepickerMode = mode;
- }
- }])
-
- .controller('UibDaypickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {
- var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
-
- this.step = { months: 1 };
- this.element = $element;
- function getDaysInMonth(year, month) {
- return month === 1 && year % 4 === 0 &&
- (year % 100 !== 0 || year % 400 === 0) ? 29 : DAYS_IN_MONTH[month];
- }
-
- this.init = function(ctrl) {
- angular.extend(ctrl, this);
- scope.showWeeks = ctrl.showWeeks;
- ctrl.refreshView();
- };
-
- this.getDates = function(startDate, n) {
- var dates = new Array(n), current = new Date(startDate), i = 0, date;
- while (i < n) {
- date = new Date(current);
- dates[i++] = date;
- current.setDate(current.getDate() + 1);
- }
- return dates;
- };
-
- this._refreshView = function() {
- var year = this.activeDate.getFullYear(),
- month = this.activeDate.getMonth(),
- firstDayOfMonth = new Date(this.activeDate);
-
- firstDayOfMonth.setFullYear(year, month, 1);
-
- var difference = this.startingDay - firstDayOfMonth.getDay(),
- numDisplayedFromPreviousMonth = difference > 0 ?
- 7 - difference : - difference,
- firstDate = new Date(firstDayOfMonth);
-
- if (numDisplayedFromPreviousMonth > 0) {
- firstDate.setDate(-numDisplayedFromPreviousMonth + 1);
- }
-
- // 42 is the number of days on a six-week calendar
- var days = this.getDates(firstDate, 42);
- for (var i = 0; i < 42; i ++) {
- days[i] = angular.extend(this.createDateObject(days[i], this.formatDay), {
- secondary: days[i].getMonth() !== month,
- uid: scope.uniqueId + '-' + i
- });
- }
-
- scope.labels = new Array(7);
- for (var j = 0; j < 7; j++) {
- scope.labels[j] = {
- abbr: dateFilter(days[j].date, this.formatDayHeader),
- full: dateFilter(days[j].date, 'EEEE')
- };
- }
-
- scope.title = dateFilter(this.activeDate, this.formatDayTitle);
- scope.rows = this.split(days, 7);
-
- if (scope.showWeeks) {
- scope.weekNumbers = [];
- var thursdayIndex = (4 + 7 - this.startingDay) % 7,
- numWeeks = scope.rows.length;
- for (var curWeek = 0; curWeek < numWeeks; curWeek++) {
- scope.weekNumbers.push(
- getISO8601WeekNumber(scope.rows[curWeek][thursdayIndex].date));
- }
- }
- };
-
- this.compare = function(date1, date2) {
- var _date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());
- var _date2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
- _date1.setFullYear(date1.getFullYear());
- _date2.setFullYear(date2.getFullYear());
- return _date1 - _date2;
- };
-
- function getISO8601WeekNumber(date) {
- var checkDate = new Date(date);
- checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); // Thursday
- var time = checkDate.getTime();
- checkDate.setMonth(0); // Compare with Jan 1
- checkDate.setDate(1);
- return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
- }
-
- this.handleKeyDown = function(key, evt) {
- var date = this.activeDate.getDate();
-
- if (key === 'left') {
- date = date - 1;
- } else if (key === 'up') {
- date = date - 7;
- } else if (key === 'right') {
- date = date + 1;
- } else if (key === 'down') {
- date = date + 7;
- } else if (key === 'pageup' || key === 'pagedown') {
- var month = this.activeDate.getMonth() + (key === 'pageup' ? - 1 : 1);
- this.activeDate.setMonth(month, 1);
- date = Math.min(getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth()), date);
- } else if (key === 'home') {
- date = 1;
- } else if (key === 'end') {
- date = getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth());
- }
- this.activeDate.setDate(date);
- };
- }])
-
- .controller('UibMonthpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {
- this.step = { years: 1 };
- this.element = $element;
-
- this.init = function(ctrl) {
- angular.extend(ctrl, this);
- ctrl.refreshView();
- };
-
- this._refreshView = function() {
- var months = new Array(12),
- year = this.activeDate.getFullYear(),
- date;
-
- for (var i = 0; i < 12; i++) {
- date = new Date(this.activeDate);
- date.setFullYear(year, i, 1);
- months[i] = angular.extend(this.createDateObject(date, this.formatMonth), {
- uid: scope.uniqueId + '-' + i
- });
- }
-
- scope.title = dateFilter(this.activeDate, this.formatMonthTitle);
- scope.rows = this.split(months, 3);
- };
-
- this.compare = function(date1, date2) {
- var _date1 = new Date(date1.getFullYear(), date1.getMonth());
- var _date2 = new Date(date2.getFullYear(), date2.getMonth());
- _date1.setFullYear(date1.getFullYear());
- _date2.setFullYear(date2.getFullYear());
- return _date1 - _date2;
- };
-
- this.handleKeyDown = function(key, evt) {
- var date = this.activeDate.getMonth();
-
- if (key === 'left') {
- date = date - 1;
- } else if (key === 'up') {
- date = date - 3;
- } else if (key === 'right') {
- date = date + 1;
- } else if (key === 'down') {
- date = date + 3;
- } else if (key === 'pageup' || key === 'pagedown') {
- var year = this.activeDate.getFullYear() + (key === 'pageup' ? - 1 : 1);
- this.activeDate.setFullYear(year);
- } else if (key === 'home') {
- date = 0;
- } else if (key === 'end') {
- date = 11;
- }
- this.activeDate.setMonth(date);
- };
- }])
-
- .controller('UibYearpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {
- var columns, range;
- this.element = $element;
-
- function getStartingYear(year) {
- return parseInt((year - 1) / range, 10) * range + 1;
- }
-
- this.yearpickerInit = function() {
- columns = this.yearColumns;
- range = this.yearRows * columns;
- this.step = { years: range };
- };
-
- this._refreshView = function() {
- var years = new Array(range), date;
-
- for (var i = 0, start = getStartingYear(this.activeDate.getFullYear()); i < range; i++) {
- date = new Date(this.activeDate);
- date.setFullYear(start + i, 0, 1);
- years[i] = angular.extend(this.createDateObject(date, this.formatYear), {
- uid: scope.uniqueId + '-' + i
- });
- }
-
- scope.title = [years[0].label, years[range - 1].label].join(' - ');
- scope.rows = this.split(years, columns);
- scope.columns = columns;
- };
-
- this.compare = function(date1, date2) {
- return date1.getFullYear() - date2.getFullYear();
- };
-
- this.handleKeyDown = function(key, evt) {
- var date = this.activeDate.getFullYear();
-
- if (key === 'left') {
- date = date - 1;
- } else if (key === 'up') {
- date = date - columns;
- } else if (key === 'right') {
- date = date + 1;
- } else if (key === 'down') {
- date = date + columns;
- } else if (key === 'pageup' || key === 'pagedown') {
- date += (key === 'pageup' ? - 1 : 1) * range;
- } else if (key === 'home') {
- date = getStartingYear(this.activeDate.getFullYear());
- } else if (key === 'end') {
- date = getStartingYear(this.activeDate.getFullYear()) + range - 1;
- }
- this.activeDate.setFullYear(date);
- };
- }])
-
- .directive('uibDatepicker', function() {
- return {
- replace: true,
- templateUrl: function(element, attrs) {
- return attrs.templateUrl || 'uib/template/datepicker/datepicker.html';
- },
- scope: {
- datepickerOptions: '=?'
- },
- require: ['uibDatepicker', '^ngModel'],
- controller: 'UibDatepickerController',
- controllerAs: 'datepicker',
- link: function(scope, element, attrs, ctrls) {
- var datepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1];
-
- datepickerCtrl.init(ngModelCtrl);
- }
- };
- })
-
- .directive('uibDaypicker', function() {
- return {
- replace: true,
- templateUrl: function(element, attrs) {
- return attrs.templateUrl || 'uib/template/datepicker/day.html';
- },
- require: ['^uibDatepicker', 'uibDaypicker'],
- controller: 'UibDaypickerController',
- link: function(scope, element, attrs, ctrls) {
- var datepickerCtrl = ctrls[0],
- daypickerCtrl = ctrls[1];
-
- daypickerCtrl.init(datepickerCtrl);
- }
- };
- })
-
- .directive('uibMonthpicker', function() {
- return {
- replace: true,
- templateUrl: function(element, attrs) {
- return attrs.templateUrl || 'uib/template/datepicker/month.html';
- },
- require: ['^uibDatepicker', 'uibMonthpicker'],
- controller: 'UibMonthpickerController',
- link: function(scope, element, attrs, ctrls) {
- var datepickerCtrl = ctrls[0],
- monthpickerCtrl = ctrls[1];
-
- monthpickerCtrl.init(datepickerCtrl);
- }
- };
- })
-
- .directive('uibYearpicker', function() {
- return {
- replace: true,
- templateUrl: function(element, attrs) {
- return attrs.templateUrl || 'uib/template/datepicker/year.html';
- },
- require: ['^uibDatepicker', 'uibYearpicker'],
- controller: 'UibYearpickerController',
- link: function(scope, element, attrs, ctrls) {
- var ctrl = ctrls[0];
- angular.extend(ctrl, ctrls[1]);
- ctrl.yearpickerInit();
-
- ctrl.refreshView();
- }
- };
- });
-
++<<<<<<< HEAD
+ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.isClass'])
+
+ .value('$datepickerSuppressError', false)
+
+ .value('$datepickerLiteralWarning', true)
+
+ .constant('uibDatepickerConfig', {
+ datepickerMode: 'day',
+ formatDay: 'dd',
+ formatMonth: 'MMMM',
+ formatYear: 'yyyy',
+ formatDayHeader: 'EEE',
+ formatDayTitle: 'MMMM yyyy',
+ formatMonthTitle: 'yyyy',
+ maxDate: null,
+ maxMode: 'year',
+ minDate: null,
+ minMode: 'day',
+ ngModelOptions: {},
+ shortcutPropagation: false,
+ showWeeks: true,
+ yearColumns: 5,
+ yearRows: 4
+ })
+
+ .controller('UibDatepickerController', ['$scope', '$attrs', '$parse', '$interpolate', '$locale', '$log', 'dateFilter', 'uibDatepickerConfig', '$datepickerLiteralWarning', '$datepickerSuppressError', 'uibDateParser',
+ function($scope, $attrs, $parse, $interpolate, $locale, $log, dateFilter, datepickerConfig, $datepickerLiteralWarning, $datepickerSuppressError, dateParser) {
+ var self = this,
+ ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl;
+ ngModelOptions = {},
+ watchListeners = [],
+ optionsUsed = !!$attrs.datepickerOptions;
+
+ if (!$scope.datepickerOptions) {
+ $scope.datepickerOptions = {};
+ }
+
+ // Modes chain
+ this.modes = ['day', 'month', 'year'];
+
+ [
+ 'customClass',
+ 'dateDisabled',
+ 'datepickerMode',
+ 'formatDay',
+ 'formatDayHeader',
+ 'formatDayTitle',
+ 'formatMonth',
+ 'formatMonthTitle',
+ 'formatYear',
+ 'maxDate',
+ 'maxMode',
+ 'minDate',
+ 'minMode',
+ 'showWeeks',
+ 'shortcutPropagation',
+ 'startingDay',
+ 'yearColumns',
+ 'yearRows'
+ ].forEach(function(key) {
+ switch (key) {
+ case 'customClass':
+ case 'dateDisabled':
+ $scope[key] = $scope.datepickerOptions[key] || angular.noop;
+ break;
+ case 'datepickerMode':
+ $scope.datepickerMode = angular.isDefined($scope.datepickerOptions.datepickerMode) ?
+ $scope.datepickerOptions.datepickerMode : datepickerConfig.datepickerMode;
+ break;
+ case 'formatDay':
+ case 'formatDayHeader':
+ case 'formatDayTitle':
+ case 'formatMonth':
+ case 'formatMonthTitle':
+ case 'formatYear':
+ self[key] = angular.isDefined($scope.datepickerOptions[key]) ?
+ $interpolate($scope.datepickerOptions[key])($scope.$parent) :
+ datepickerConfig[key];
+ break;
+ case 'showWeeks':
+ case 'shortcutPropagation':
+ case 'yearColumns':
+ case 'yearRows':
+ self[key] = angular.isDefined($scope.datepickerOptions[key]) ?
+ $scope.datepickerOptions[key] : datepickerConfig[key];
+ break;
+ case 'startingDay':
+ if (angular.isDefined($scope.datepickerOptions.startingDay)) {
+ self.startingDay = $scope.datepickerOptions.startingDay;
+ } else if (angular.isNumber(datepickerConfig.startingDay)) {
+ self.startingDay = datepickerConfig.startingDay;
+ } else {
+ self.startingDay = ($locale.DATETIME_FORMATS.FIRSTDAYOFWEEK + 8) % 7;
+ }
+
+ break;
+ case 'maxDate':
+ case 'minDate':
+ $scope.$watch('datepickerOptions.' + key, function(value) {
+ if (value) {
+ if (angular.isDate(value)) {
+ self[key] = dateParser.fromTimezone(new Date(value), ngModelOptions.timezone);
+ } else {
+ if ($datepickerLiteralWarning) {
+ $log.warn('Literal date support has been deprecated, please switch to date object usage');
+ }
+
+ self[key] = new Date(dateFilter(value, 'medium'));
+ }
+ } else {
+ self[key] = datepickerConfig[key] ?
+ dateParser.fromTimezone(new Date(datepickerConfig[key]), ngModelOptions.timezone) :
+ null;
+ }
+
+ self.refreshView();
+ });
+
+ break;
+ case 'maxMode':
+ case 'minMode':
+ if ($scope.datepickerOptions[key]) {
+ $scope.$watch(function() { return $scope.datepickerOptions[key]; }, function(value) {
+ self[key] = $scope[key] = angular.isDefined(value) ? value : datepickerOptions[key];
+ if (key === 'minMode' && self.modes.indexOf($scope.datepickerOptions.datepickerMode) < self.modes.indexOf(self[key]) ||
+ key === 'maxMode' && self.modes.indexOf($scope.datepickerOptions.datepickerMode) > self.modes.indexOf(self[key])) {
+ $scope.datepickerMode = self[key];
+ $scope.datepickerOptions.datepickerMode = self[key];
+ }
+ });
+ } else {
+ self[key] = $scope[key] = datepickerConfig[key] || null;
+ }
+
+ break;
+ }
+ });
+
+ $scope.uniqueId = 'datepicker-' + $scope.$id + '-' + Math.floor(Math.random() * 10000);
+
+ $scope.disabled = angular.isDefined($attrs.disabled) || false;
+ if (angular.isDefined($attrs.ngDisabled)) {
+ watchListeners.push($scope.$parent.$watch($attrs.ngDisabled, function(disabled) {
+ $scope.disabled = disabled;
+ self.refreshView();
+ }));
+ }
+
+ $scope.isActive = function(dateObject) {
+ if (self.compare(dateObject.date, self.activeDate) === 0) {
+ $scope.activeDateId = dateObject.uid;
+ return true;
+ }
+ return false;
+ };
+
+ this.init = function(ngModelCtrl_) {
+ ngModelCtrl = ngModelCtrl_;
+ ngModelOptions = ngModelCtrl_.$options || datepickerConfig.ngModelOptions;
+ if ($scope.datepickerOptions.initDate) {
+ self.activeDate = dateParser.fromTimezone($scope.datepickerOptions.initDate, ngModelOptions.timezone) || new Date();
+ $scope.$watch('datepickerOptions.initDate', function(initDate) {
+ if (initDate && (ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue) || ngModelCtrl.$invalid)) {
+ self.activeDate = dateParser.fromTimezone(initDate, ngModelOptions.timezone);
+ self.refreshView();
+ }
+ });
+ } else {
+ self.activeDate = new Date();
+ }
+
+ var date = ngModelCtrl.$modelValue ? new Date(ngModelCtrl.$modelValue) : new Date();
+ this.activeDate = !isNaN(date) ?
+ dateParser.fromTimezone(date, ngModelOptions.timezone) :
+ dateParser.fromTimezone(new Date(), ngModelOptions.timezone);
+
+ ngModelCtrl.$render = function() {
+ self.render();
+ };
+ };
+
+ this.render = function() {
+ if (ngModelCtrl.$viewValue) {
+ var date = new Date(ngModelCtrl.$viewValue),
+ isValid = !isNaN(date);
+
+ if (isValid) {
+ this.activeDate = dateParser.fromTimezone(date, ngModelOptions.timezone);
+ } else if (!$datepickerSuppressError) {
+ $log.error('Datepicker directive: "ng-model" value must be a Date object');
+ }
+ }
+ this.refreshView();
+ };
+
+ this.refreshView = function() {
+ if (this.element) {
+ $scope.selectedDt = null;
+ this._refreshView();
+ if ($scope.activeDt) {
+ $scope.activeDateId = $scope.activeDt.uid;
+ }
+
+ var date = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;
+ date = dateParser.fromTimezone(date, ngModelOptions.timezone);
+ ngModelCtrl.$setValidity('dateDisabled', !date ||
+ this.element && !this.isDisabled(date));
+ }
+ };
+
+ this.createDateObject = function(date, format) {
+ var model = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;
+ model = dateParser.fromTimezone(model, ngModelOptions.timezone);
+ var today = new Date();
+ today = dateParser.fromTimezone(today, ngModelOptions.timezone);
+ var time = this.compare(date, today);
+ var dt = {
+ date: date,
+ label: dateParser.filter(date, format),
+ selected: model && this.compare(date, model) === 0,
+ disabled: this.isDisabled(date),
+ past: time < 0,
+ current: time === 0,
+ future: time > 0,
+ customClass: this.customClass(date) || null
+ };
+
+ if (model && this.compare(date, model) === 0) {
+ $scope.selectedDt = dt;
+ }
+
+ if (self.activeDate && this.compare(dt.date, self.activeDate) === 0) {
+ $scope.activeDt = dt;
+ }
+
+ return dt;
+ };
+
+ this.isDisabled = function(date) {
+ return $scope.disabled ||
+ this.minDate && this.compare(date, this.minDate) < 0 ||
+ this.maxDate && this.compare(date, this.maxDate) > 0 ||
+ $scope.dateDisabled && $scope.dateDisabled({date: date, mode: $scope.datepickerMode});
+ };
+
+ this.customClass = function(date) {
+ return $scope.customClass({date: date, mode: $scope.datepickerMode});
+ };
+
+ // Split array into smaller arrays
+ this.split = function(arr, size) {
+ var arrays = [];
+ while (arr.length > 0) {
+ arrays.push(arr.splice(0, size));
+ }
+ return arrays;
+ };
+
+ $scope.select = function(date) {
+ if ($scope.datepickerMode === self.minMode) {
+ var dt = ngModelCtrl.$viewValue ? dateParser.fromTimezone(new Date(ngModelCtrl.$viewValue), ngModelOptions.timezone) : new Date(0, 0, 0, 0, 0, 0, 0);
+ dt.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
+ dt = dateParser.toTimezone(dt, ngModelOptions.timezone);
+ ngModelCtrl.$setViewValue(dt);
+ ngModelCtrl.$render();
+ } else {
+ self.activeDate = date;
+ setMode(self.modes[self.modes.indexOf($scope.datepickerMode) - 1]);
+
+ $scope.$emit('uib:datepicker.mode');
+ }
+
+ $scope.$broadcast('uib:datepicker.focus');
+ };
+
+ $scope.move = function(direction) {
+ var year = self.activeDate.getFullYear() + direction * (self.step.years || 0),
+ month = self.activeDate.getMonth() + direction * (self.step.months || 0);
+ self.activeDate.setFullYear(year, month, 1);
+ self.refreshView();
+ };
+
+ $scope.toggleMode = function(direction) {
+ direction = direction || 1;
+
+ if ($scope.datepickerMode === self.maxMode && direction === 1 ||
+ $scope.datepickerMode === self.minMode && direction === -1) {
+ return;
+ }
+
+ setMode(self.modes[self.modes.indexOf($scope.datepickerMode) + direction]);
+
+ $scope.$emit('uib:datepicker.mode');
++=======
angular.module('ui.bootstrap.position', [])
/**
var targetElemPos = {top: 0, left: 0, placement: ''};
if (placement[2]) {
- var viewportOffset = this.viewportOffset(hostElem, appendToBody);
+ var viewportOffset = this.viewportOffset(hostElem);
+
+ var targetElemStyle = $window.getComputedStyle(targetElem);
+ var adjustedSize = {
+ width: targetWidth + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginLeft) + this.parseStyle(targetElemStyle.marginRight))),
+ height: targetHeight + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginTop) + this.parseStyle(targetElemStyle.marginBottom)))
+ };
+
+ placement[0] = placement[0] === 'top' && adjustedSize.height > viewportOffset.top && adjustedSize.height <= viewportOffset.bottom ? 'bottom' :
+ placement[0] === 'bottom' && adjustedSize.height > viewportOffset.bottom && adjustedSize.height <= viewportOffset.top ? 'top' :
+ placement[0] === 'left' && adjustedSize.width > viewportOffset.left && adjustedSize.width <= viewportOffset.right ? 'right' :
+ placement[0] === 'right' && adjustedSize.width > viewportOffset.right && adjustedSize.width <= viewportOffset.left ? 'left' :
+ placement[0];
+
+ placement[1] = placement[1] === 'top' && adjustedSize.height - hostElemPos.height > viewportOffset.bottom && adjustedSize.height - hostElemPos.height <= viewportOffset.top ? 'bottom' :
+ placement[1] === 'bottom' && adjustedSize.height - hostElemPos.height > viewportOffset.top && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom ? 'top' :
+ placement[1] === 'left' && adjustedSize.width - hostElemPos.width > viewportOffset.right && adjustedSize.width - hostElemPos.width <= viewportOffset.left ? 'right' :
+ placement[1] === 'right' && adjustedSize.width - hostElemPos.width > viewportOffset.left && adjustedSize.width - hostElemPos.width <= viewportOffset.right ? 'left' :
+ placement[1];
+
+ if (placement[1] === 'center') {
+ if (PLACEMENT_REGEX.vertical.test(placement[0])) {
+ var xOverflow = hostElemPos.width / 2 - targetWidth / 2;
+ if (viewportOffset.left + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.right) {
+ placement[1] = 'left';
+ } else if (viewportOffset.right + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.left) {
+ placement[1] = 'right';
+ }
+ } else {
+ var yOverflow = hostElemPos.height / 2 - adjustedSize.height / 2;
+ if (viewportOffset.top + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom) {
+ placement[1] = 'top';
+ } else if (viewportOffset.bottom + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.top) {
+ placement[1] = 'bottom';
+ }
+ }
+ }
+ }
+
+ switch (placement[0]) {
+ case 'top':
+ targetElemPos.top = hostElemPos.top - targetHeight;
+ break;
+ case 'bottom':
+ targetElemPos.top = hostElemPos.top + hostElemPos.height;
+ break;
+ case 'left':
+ targetElemPos.left = hostElemPos.left - targetWidth;
+ break;
+ case 'right':
+ targetElemPos.left = hostElemPos.left + hostElemPos.width;
+ break;
+ }
+
+ switch (placement[1]) {
+ case 'top':
+ targetElemPos.top = hostElemPos.top;
+ break;
+ case 'bottom':
+ targetElemPos.top = hostElemPos.top + hostElemPos.height - targetHeight;
+ break;
+ case 'left':
+ targetElemPos.left = hostElemPos.left;
+ break;
+ case 'right':
+ targetElemPos.left = hostElemPos.left + hostElemPos.width - targetWidth;
+ break;
+ case 'center':
+ if (PLACEMENT_REGEX.vertical.test(placement[0])) {
+ targetElemPos.left = hostElemPos.left + hostElemPos.width / 2 - targetWidth / 2;
+ } else {
+ targetElemPos.top = hostElemPos.top + hostElemPos.height / 2 - targetHeight / 2;
+ }
+ break;
+ }
+
+ targetElemPos.top = Math.round(targetElemPos.top);
+ targetElemPos.left = Math.round(targetElemPos.left);
+ targetElemPos.placement = placement[1] === 'center' ? placement[0] : placement[0] + '-' + placement[1];
+
+ return targetElemPos;
+ },
+
+ /**
+ * Provides a way for positioning tooltip & dropdown
+ * arrows when using placement options beyond the standard
+ * left, right, top, or bottom.
+ *
+ * @param {element} elem - The tooltip/dropdown element.
+ * @param {string} placement - The placement for the elem.
+ */
+ positionArrow: function(elem, placement) {
+ elem = this.getRawNode(elem);
+
+ var isTooltip = true;
+
+ var innerElem = elem.querySelector('.tooltip-inner');
+ if (!innerElem) {
+ isTooltip = false;
+ innerElem = elem.querySelector('.popover-inner');
+ }
+ if (!innerElem) {
+ return;
+ }
+
+ var arrowElem = isTooltip ? elem.querySelector('.tooltip-arrow') : elem.querySelector('.arrow');
+ if (!arrowElem) {
+ return;
+ }
+
+ placement = this.parsePlacement(placement);
+ if (placement[1] === 'center') {
+ // no adjustment necessary - just reset styles
+ angular.element(arrowElem).css({top: '', bottom: '', right: '', left: '', margin: ''});
+ return;
+ }
+
+ var borderProp = 'border-' + placement[0] + '-width';
+ var borderWidth = $window.getComputedStyle(arrowElem)[borderProp];
+
+ var borderRadiusProp = 'border-';
+ if (PLACEMENT_REGEX.vertical.test(placement[0])) {
+ borderRadiusProp += placement[0] + '-' + placement[1];
+ } else {
+ borderRadiusProp += placement[1] + '-' + placement[0];
+ }
+ borderRadiusProp += '-radius';
+ var borderRadius = $window.getComputedStyle(isTooltip ? innerElem : elem)[borderRadiusProp];
+
+ var arrowCss = {
+ top: 'auto',
+ bottom: 'auto',
+ left: 'auto',
+ right: 'auto',
+ margin: 0
+ };
+
+ switch (placement[0]) {
+ case 'top':
+ arrowCss.bottom = isTooltip ? '0' : '-' + borderWidth;
+ break;
+ case 'bottom':
+ arrowCss.top = isTooltip ? '0' : '-' + borderWidth;
+ break;
+ case 'left':
+ arrowCss.right = isTooltip ? '0' : '-' + borderWidth;
+ break;
+ case 'right':
+ arrowCss.left = isTooltip ? '0' : '-' + borderWidth;
+ break;
+ }
+
+ arrowCss[placement[1]] = borderRadius;
+
+ angular.element(arrowElem).css(arrowCss);
+ }
+ };
+ }]);
+
+ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.isClass', 'ui.bootstrap.position'])
+
+ .value('$datepickerSuppressError', false)
+
+ .constant('uibDatepickerConfig', {
+ formatDay: 'dd',
+ formatMonth: 'MMMM',
+ formatYear: 'yyyy',
+ formatDayHeader: 'EEE',
+ formatDayTitle: 'MMMM yyyy',
+ formatMonthTitle: 'yyyy',
+ datepickerMode: 'day',
+ minMode: 'day',
+ maxMode: 'year',
+ showWeeks: true,
+ startingDay: 0,
+ yearRows: 4,
+ yearColumns: 5,
+ minDate: null,
+ maxDate: null,
+ shortcutPropagation: false,
+ ngModelOptions: {}
+ })
+
+ .controller('UibDatepickerController', ['$scope', '$attrs', '$parse', '$interpolate', '$log', 'dateFilter', 'uibDatepickerConfig', '$datepickerSuppressError', 'uibDateParser',
+ function($scope, $attrs, $parse, $interpolate, $log, dateFilter, datepickerConfig, $datepickerSuppressError, dateParser) {
+ var self = this,
+ ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl;
+ ngModelOptions = {};
+
+ // Modes chain
+ this.modes = ['day', 'month', 'year'];
+
+ // Interpolated configuration attributes
+ angular.forEach(['formatDay', 'formatMonth', 'formatYear', 'formatDayHeader', 'formatDayTitle', 'formatMonthTitle'], function(key) {
+ self[key] = angular.isDefined($attrs[key]) ? $interpolate($attrs[key])($scope.$parent) : datepickerConfig[key];
+ });
+
+ // Evaled configuration attributes
+ angular.forEach(['showWeeks', 'startingDay', 'yearRows', 'yearColumns', 'shortcutPropagation'], function(key) {
+ self[key] = angular.isDefined($attrs[key]) ? $scope.$parent.$eval($attrs[key]) : datepickerConfig[key];
+ });
+
+ // Watchable date attributes
+ angular.forEach(['minDate', 'maxDate'], function(key) {
+ if ($attrs[key]) {
+ $scope.$parent.$watch($attrs[key], function(value) {
+ self[key] = value ? angular.isDate(value) ? dateParser.fromTimezone(new Date(value), ngModelOptions.timezone) : new Date(dateFilter(value, 'medium')) : null;
+ self.refreshView();
+ });
+ } else {
+ self[key] = datepickerConfig[key] ? dateParser.fromTimezone(new Date(datepickerConfig[key]), ngModelOptions.timezone) : null;
+ }
+ });
+
+ angular.forEach(['minMode', 'maxMode'], function(key) {
+ if ($attrs[key]) {
+ $scope.$parent.$watch($attrs[key], function(value) {
+ self[key] = $scope[key] = angular.isDefined(value) ? value : $attrs[key];
+ if (key === 'minMode' && self.modes.indexOf($scope.datepickerMode) < self.modes.indexOf(self[key]) ||
+ key === 'maxMode' && self.modes.indexOf($scope.datepickerMode) > self.modes.indexOf(self[key])) {
+ $scope.datepickerMode = self[key];
+ }
+ });
+ } else {
+ self[key] = $scope[key] = datepickerConfig[key] || null;
+ }
+ });
+
+ $scope.datepickerMode = $scope.datepickerMode || datepickerConfig.datepickerMode;
+ $scope.uniqueId = 'datepicker-' + $scope.$id + '-' + Math.floor(Math.random() * 10000);
+
+ if (angular.isDefined($attrs.initDate)) {
+ this.activeDate = dateParser.fromTimezone($scope.$parent.$eval($attrs.initDate), ngModelOptions.timezone) || new Date();
+ $scope.$parent.$watch($attrs.initDate, function(initDate) {
+ if (initDate && (ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue) || ngModelCtrl.$invalid)) {
+ self.activeDate = dateParser.fromTimezone(initDate, ngModelOptions.timezone);
+ self.refreshView();
+ }
+ });
+ } else {
+ this.activeDate = new Date();
+ }
+
+ $scope.disabled = angular.isDefined($attrs.disabled) || false;
+ if (angular.isDefined($attrs.ngDisabled)) {
+ $scope.$parent.$watch($attrs.ngDisabled, function(disabled) {
+ $scope.disabled = disabled;
+ self.refreshView();
+ });
+ }
+
+ $scope.isActive = function(dateObject) {
+ if (self.compare(dateObject.date, self.activeDate) === 0) {
+ $scope.activeDateId = dateObject.uid;
+ return true;
+ }
+ return false;
+ };
+
+ this.init = function(ngModelCtrl_) {
+ ngModelCtrl = ngModelCtrl_;
+ ngModelOptions = ngModelCtrl_.$options || datepickerConfig.ngModelOptions;
+
+ if (ngModelCtrl.$modelValue) {
+ this.activeDate = ngModelCtrl.$modelValue;
+ }
+
+ ngModelCtrl.$render = function() {
+ self.render();
+ };
+ };
+
+ this.render = function() {
+ if (ngModelCtrl.$viewValue) {
+ var date = new Date(ngModelCtrl.$viewValue),
+ isValid = !isNaN(date);
+
+ if (isValid) {
+ this.activeDate = dateParser.fromTimezone(date, ngModelOptions.timezone);
+ } else if (!$datepickerSuppressError) {
+ $log.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.');
+ }
+ }
+ this.refreshView();
+ };
+
+ this.refreshView = function() {
+ if (this.element) {
+ $scope.selectedDt = null;
+ this._refreshView();
+ if ($scope.activeDt) {
+ $scope.activeDateId = $scope.activeDt.uid;
+ }
+
+ var date = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;
+ date = dateParser.fromTimezone(date, ngModelOptions.timezone);
+ ngModelCtrl.$setValidity('dateDisabled', !date ||
+ this.element && !this.isDisabled(date));
+ }
+ };
+
+ this.createDateObject = function(date, format) {
+ var model = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;
+ model = dateParser.fromTimezone(model, ngModelOptions.timezone);
+ var dt = {
+ date: date,
+ label: dateFilter(date, format),
+ selected: model && this.compare(date, model) === 0,
+ disabled: this.isDisabled(date),
+ current: this.compare(date, new Date()) === 0,
+ customClass: this.customClass(date) || null
+ };
+
+ if (model && this.compare(date, model) === 0) {
+ $scope.selectedDt = dt;
+ }
+
+ if (self.activeDate && this.compare(dt.date, self.activeDate) === 0) {
+ $scope.activeDt = dt;
+ }
+
+ return dt;
+ };
+
+ this.isDisabled = function(date) {
+ return $scope.disabled ||
+ this.minDate && this.compare(date, this.minDate) < 0 ||
+ this.maxDate && this.compare(date, this.maxDate) > 0 ||
+ $attrs.dateDisabled && $scope.dateDisabled({date: date, mode: $scope.datepickerMode});
+ };
+
+ this.customClass = function(date) {
+ return $scope.customClass({date: date, mode: $scope.datepickerMode});
+ };
+
+ // Split array into smaller arrays
+ this.split = function(arr, size) {
+ var arrays = [];
+ while (arr.length > 0) {
+ arrays.push(arr.splice(0, size));
+ }
+ return arrays;
+ };
+
+ $scope.select = function(date) {
+ if ($scope.datepickerMode === self.minMode) {
+ var dt = ngModelCtrl.$viewValue ? dateParser.fromTimezone(new Date(ngModelCtrl.$viewValue), ngModelOptions.timezone) : new Date(0, 0, 0, 0, 0, 0, 0);
+ dt.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
+ dt = dateParser.toTimezone(dt, ngModelOptions.timezone);
+ ngModelCtrl.$setViewValue(dt);
+ ngModelCtrl.$render();
+ } else {
+ self.activeDate = date;
+ $scope.datepickerMode = self.modes[self.modes.indexOf($scope.datepickerMode) - 1];
+ }
+ };
+
+ $scope.move = function(direction) {
+ var year = self.activeDate.getFullYear() + direction * (self.step.years || 0),
+ month = self.activeDate.getMonth() + direction * (self.step.months || 0);
+ self.activeDate.setFullYear(year, month, 1);
+ self.refreshView();
+ };
+
+ $scope.toggleMode = function(direction) {
+ direction = direction || 1;
+
+ if ($scope.datepickerMode === self.maxMode && direction === 1 ||
+ $scope.datepickerMode === self.minMode && direction === -1) {
+ return;
+ }
+
+ $scope.datepickerMode = self.modes[self.modes.indexOf($scope.datepickerMode) + direction];
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ };
+
+ // Key event mapper
+ $scope.keys = { 13: 'enter', 32: 'space', 33: 'pageup', 34: 'pagedown', 35: 'end', 36: 'home', 37: 'left', 38: 'up', 39: 'right', 40: 'down' };
+
+ var focusElement = function() {
+ self.element[0].focus();
+ };
+
+ // Listen for focus requests from popup directive
+ $scope.$on('uib:datepicker.focus', focusElement);
+
+ $scope.keydown = function(evt) {
+ var key = $scope.keys[evt.which];
+
+ if (!key || evt.shiftKey || evt.altKey || $scope.disabled) {
+ return;
+ }
+
+ evt.preventDefault();
+ if (!self.shortcutPropagation) {
+ evt.stopPropagation();
+ }
+
+ if (key === 'enter' || key === 'space') {
+ if (self.isDisabled(self.activeDate)) {
+ return; // do nothing
+ }
+ $scope.select(self.activeDate);
+ } else if (evt.ctrlKey && (key === 'up' || key === 'down')) {
+ $scope.toggleMode(key === 'up' ? 1 : -1);
+ } else {
+ self.handleKeyDown(key, evt);
+ self.refreshView();
+ }
+ };
++<<<<<<< HEAD
++
++ $scope.$on('$destroy', function() {
++ //Clear all watch listeners on destroy
++ while (watchListeners.length) {
++ watchListeners.shift()();
++ }
++ });
++
++ function setMode(mode) {
++ $scope.datepickerMode = mode;
++ $scope.datepickerOptions.datepickerMode = mode;
++ }
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ }])
+
+ .controller('UibDaypickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {
+ var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+
+ this.step = { months: 1 };
+ this.element = $element;
+ function getDaysInMonth(year, month) {
+ return month === 1 && year % 4 === 0 &&
+ (year % 100 !== 0 || year % 400 === 0) ? 29 : DAYS_IN_MONTH[month];
+ }
+
+ this.init = function(ctrl) {
+ angular.extend(ctrl, this);
+ scope.showWeeks = ctrl.showWeeks;
+ ctrl.refreshView();
+ };
+
+ this.getDates = function(startDate, n) {
+ var dates = new Array(n), current = new Date(startDate), i = 0, date;
+ while (i < n) {
+ date = new Date(current);
+ dates[i++] = date;
+ current.setDate(current.getDate() + 1);
+ }
+ return dates;
+ };
+
+ this._refreshView = function() {
+ var year = this.activeDate.getFullYear(),
+ month = this.activeDate.getMonth(),
+ firstDayOfMonth = new Date(this.activeDate);
+
+ firstDayOfMonth.setFullYear(year, month, 1);
+
+ var difference = this.startingDay - firstDayOfMonth.getDay(),
+ numDisplayedFromPreviousMonth = difference > 0 ?
+ 7 - difference : - difference,
+ firstDate = new Date(firstDayOfMonth);
+
+ if (numDisplayedFromPreviousMonth > 0) {
+ firstDate.setDate(-numDisplayedFromPreviousMonth + 1);
+ }
+
+ // 42 is the number of days on a six-week calendar
+ var days = this.getDates(firstDate, 42);
+ for (var i = 0; i < 42; i ++) {
+ days[i] = angular.extend(this.createDateObject(days[i], this.formatDay), {
+ secondary: days[i].getMonth() !== month,
+ uid: scope.uniqueId + '-' + i
+ });
+ }
+
+ scope.labels = new Array(7);
+ for (var j = 0; j < 7; j++) {
+ scope.labels[j] = {
+ abbr: dateFilter(days[j].date, this.formatDayHeader),
+ full: dateFilter(days[j].date, 'EEEE')
+ };
+ }
+
+ scope.title = dateFilter(this.activeDate, this.formatDayTitle);
+ scope.rows = this.split(days, 7);
+
+ if (scope.showWeeks) {
+ scope.weekNumbers = [];
+ var thursdayIndex = (4 + 7 - this.startingDay) % 7,
+ numWeeks = scope.rows.length;
+ for (var curWeek = 0; curWeek < numWeeks; curWeek++) {
+ scope.weekNumbers.push(
+ getISO8601WeekNumber(scope.rows[curWeek][thursdayIndex].date));
+ }
+ }
+ };
+
+ this.compare = function(date1, date2) {
+ var _date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());
+ var _date2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
+ _date1.setFullYear(date1.getFullYear());
+ _date2.setFullYear(date2.getFullYear());
+ return _date1 - _date2;
+ };
+
+ function getISO8601WeekNumber(date) {
+ var checkDate = new Date(date);
+ checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); // Thursday
+ var time = checkDate.getTime();
+ checkDate.setMonth(0); // Compare with Jan 1
+ checkDate.setDate(1);
+ return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
+ }
+
+ this.handleKeyDown = function(key, evt) {
+ var date = this.activeDate.getDate();
+
+ if (key === 'left') {
+ date = date - 1;
+ } else if (key === 'up') {
+ date = date - 7;
+ } else if (key === 'right') {
+ date = date + 1;
+ } else if (key === 'down') {
+ date = date + 7;
+ } else if (key === 'pageup' || key === 'pagedown') {
+ var month = this.activeDate.getMonth() + (key === 'pageup' ? - 1 : 1);
+ this.activeDate.setMonth(month, 1);
+ date = Math.min(getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth()), date);
+ } else if (key === 'home') {
+ date = 1;
+ } else if (key === 'end') {
+ date = getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth());
+ }
+ this.activeDate.setDate(date);
+ };
+ }])
+
+ .controller('UibMonthpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {
+ this.step = { years: 1 };
+ this.element = $element;
+
+ this.init = function(ctrl) {
+ angular.extend(ctrl, this);
+ ctrl.refreshView();
+ };
+
+ this._refreshView = function() {
+ var months = new Array(12),
+ year = this.activeDate.getFullYear(),
+ date;
+
+ for (var i = 0; i < 12; i++) {
+ date = new Date(this.activeDate);
+ date.setFullYear(year, i, 1);
+ months[i] = angular.extend(this.createDateObject(date, this.formatMonth), {
+ uid: scope.uniqueId + '-' + i
+ });
+ }
+
+ scope.title = dateFilter(this.activeDate, this.formatMonthTitle);
+ scope.rows = this.split(months, 3);
+ };
+
+ this.compare = function(date1, date2) {
+ var _date1 = new Date(date1.getFullYear(), date1.getMonth());
+ var _date2 = new Date(date2.getFullYear(), date2.getMonth());
+ _date1.setFullYear(date1.getFullYear());
+ _date2.setFullYear(date2.getFullYear());
+ return _date1 - _date2;
+ };
+
+ this.handleKeyDown = function(key, evt) {
+ var date = this.activeDate.getMonth();
+
+ if (key === 'left') {
+ date = date - 1;
+ } else if (key === 'up') {
+ date = date - 3;
+ } else if (key === 'right') {
+ date = date + 1;
+ } else if (key === 'down') {
+ date = date + 3;
+ } else if (key === 'pageup' || key === 'pagedown') {
+ var year = this.activeDate.getFullYear() + (key === 'pageup' ? - 1 : 1);
+ this.activeDate.setFullYear(year);
+ } else if (key === 'home') {
+ date = 0;
+ } else if (key === 'end') {
+ date = 11;
+ }
+ this.activeDate.setMonth(date);
+ };
+ }])
+
+ .controller('UibYearpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {
+ var columns, range;
+ this.element = $element;
+
+ function getStartingYear(year) {
+ return parseInt((year - 1) / range, 10) * range + 1;
+ }
+
+ this.yearpickerInit = function() {
+ columns = this.yearColumns;
+ range = this.yearRows * columns;
+ this.step = { years: range };
+ };
+
+ this._refreshView = function() {
+ var years = new Array(range), date;
+
+ for (var i = 0, start = getStartingYear(this.activeDate.getFullYear()); i < range; i++) {
+ date = new Date(this.activeDate);
+ date.setFullYear(start + i, 0, 1);
+ years[i] = angular.extend(this.createDateObject(date, this.formatYear), {
+ uid: scope.uniqueId + '-' + i
+ });
+ }
+
+ scope.title = [years[0].label, years[range - 1].label].join(' - ');
+ scope.rows = this.split(years, columns);
+ scope.columns = columns;
+ };
+
+ this.compare = function(date1, date2) {
+ return date1.getFullYear() - date2.getFullYear();
+ };
+
+ this.handleKeyDown = function(key, evt) {
+ var date = this.activeDate.getFullYear();
+
+ if (key === 'left') {
+ date = date - 1;
+ } else if (key === 'up') {
+ date = date - columns;
+ } else if (key === 'right') {
+ date = date + 1;
+ } else if (key === 'down') {
+ date = date + columns;
+ } else if (key === 'pageup' || key === 'pagedown') {
+ date += (key === 'pageup' ? - 1 : 1) * range;
+ } else if (key === 'home') {
+ date = getStartingYear(this.activeDate.getFullYear());
+ } else if (key === 'end') {
+ date = getStartingYear(this.activeDate.getFullYear()) + range - 1;
+ }
+ this.activeDate.setFullYear(date);
+ };
+ }])
+
+ .directive('uibDatepicker', function() {
+ return {
+ replace: true,
+ templateUrl: function(element, attrs) {
+ return attrs.templateUrl || 'uib/template/datepicker/datepicker.html';
+ },
+ scope: {
++<<<<<<< HEAD
++ datepickerOptions: '=?'
++=======
+ datepickerMode: '=?',
+ dateDisabled: '&',
+ customClass: '&',
+ shortcutPropagation: '&?'
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ },
+ require: ['uibDatepicker', '^ngModel'],
+ controller: 'UibDatepickerController',
+ controllerAs: 'datepicker',
+ link: function(scope, element, attrs, ctrls) {
+ var datepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1];
+
+ datepickerCtrl.init(ngModelCtrl);
+ }
+ };
+ })
+
+ .directive('uibDaypicker', function() {
+ return {
+ replace: true,
+ templateUrl: function(element, attrs) {
+ return attrs.templateUrl || 'uib/template/datepicker/day.html';
+ },
+ require: ['^uibDatepicker', 'uibDaypicker'],
+ controller: 'UibDaypickerController',
+ link: function(scope, element, attrs, ctrls) {
+ var datepickerCtrl = ctrls[0],
+ daypickerCtrl = ctrls[1];
+
+ daypickerCtrl.init(datepickerCtrl);
+ }
+ };
+ })
+
+ .directive('uibMonthpicker', function() {
+ return {
+ replace: true,
+ templateUrl: function(element, attrs) {
+ return attrs.templateUrl || 'uib/template/datepicker/month.html';
+ },
+ require: ['^uibDatepicker', 'uibMonthpicker'],
+ controller: 'UibMonthpickerController',
+ link: function(scope, element, attrs, ctrls) {
+ var datepickerCtrl = ctrls[0],
+ monthpickerCtrl = ctrls[1];
+
+ monthpickerCtrl.init(datepickerCtrl);
+ }
+ };
+ })
+
+ .directive('uibYearpicker', function() {
+ return {
+ replace: true,
+ templateUrl: function(element, attrs) {
+ return attrs.templateUrl || 'uib/template/datepicker/year.html';
+ },
+ require: ['^uibDatepicker', 'uibYearpicker'],
+ controller: 'UibYearpickerController',
+ link: function(scope, element, attrs, ctrls) {
+ var ctrl = ctrls[0];
+ angular.extend(ctrl, ctrls[1]);
+ ctrl.yearpickerInit();
+
+ ctrl.refreshView();
+ }
+ };
- })
-
- .constant('uibDatepickerPopupConfig', {
- datepickerPopup: 'yyyy-MM-dd',
- datepickerPopupTemplateUrl: 'uib/template/datepicker/popup.html',
- datepickerTemplateUrl: 'uib/template/datepicker/datepicker.html',
- html5Types: {
- date: 'yyyy-MM-dd',
- 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss',
- 'month': 'yyyy-MM'
- },
- currentText: 'Today',
- clearText: 'Clear',
- closeText: 'Done',
- closeOnDateSelection: true,
- appendToBody: false,
- showButtonBar: true,
- onOpenFocus: true,
- altInputFormats: []
- })
-
- .controller('UibDatepickerPopupController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$document', '$rootScope', '$uibPosition', 'dateFilter', 'uibDateParser', 'uibDatepickerPopupConfig', '$timeout', 'uibDatepickerConfig',
- function(scope, element, attrs, $compile, $parse, $document, $rootScope, $position, dateFilter, dateParser, datepickerPopupConfig, $timeout, datepickerConfig) {
- var self = this;
- var cache = {},
- isHtml5DateInput = false;
- var dateFormat, closeOnDateSelection, appendToBody, onOpenFocus,
- datepickerPopupTemplateUrl, datepickerTemplateUrl, popupEl, datepickerEl,
- ngModel, ngModelOptions, $popup, altInputFormats;
-
- scope.watchData = {};
-
- this.init = function(_ngModel_) {
- ngModel = _ngModel_;
- ngModelOptions = _ngModel_.$options || datepickerConfig.ngModelOptions;
- closeOnDateSelection = angular.isDefined(attrs.closeOnDateSelection) ? scope.$parent.$eval(attrs.closeOnDateSelection) : datepickerPopupConfig.closeOnDateSelection;
- appendToBody = angular.isDefined(attrs.datepickerAppendToBody) ? scope.$parent.$eval(attrs.datepickerAppendToBody) : datepickerPopupConfig.appendToBody;
- onOpenFocus = angular.isDefined(attrs.onOpenFocus) ? scope.$parent.$eval(attrs.onOpenFocus) : datepickerPopupConfig.onOpenFocus;
- datepickerPopupTemplateUrl = angular.isDefined(attrs.datepickerPopupTemplateUrl) ? attrs.datepickerPopupTemplateUrl : datepickerPopupConfig.datepickerPopupTemplateUrl;
- datepickerTemplateUrl = angular.isDefined(attrs.datepickerTemplateUrl) ? attrs.datepickerTemplateUrl : datepickerPopupConfig.datepickerTemplateUrl;
- altInputFormats = angular.isDefined(attrs.altInputFormats) ? scope.$parent.$eval(attrs.altInputFormats) : datepickerPopupConfig.altInputFormats;
++<<<<<<< HEAD
++ });
+
- scope.showButtonBar = angular.isDefined(attrs.showButtonBar) ? scope.$parent.$eval(attrs.showButtonBar) : datepickerPopupConfig.showButtonBar;
++ angular.module('ui.bootstrap.position', [])
+
- if (datepickerPopupConfig.html5Types[attrs.type]) {
- dateFormat = datepickerPopupConfig.html5Types[attrs.type];
- isHtml5DateInput = true;
- } else {
- dateFormat = attrs.uibDatepickerPopup || datepickerPopupConfig.datepickerPopup;
- attrs.$observe('uibDatepickerPopup', function(value, oldValue) {
- var newDateFormat = value || datepickerPopupConfig.datepickerPopup;
- // Invalidate the $modelValue to ensure that formatters re-run
- // FIXME: Refactor when PR is merged: https://github.com/angular/angular.js/pull/10764
- if (newDateFormat !== dateFormat) {
- dateFormat = newDateFormat;
- ngModel.$modelValue = null;
++ /**
++ * A set of utility methods for working with the DOM.
++ * It is meant to be used where we need to absolute-position elements in
++ * relation to another element (this is the case for tooltips, popovers,
++ * typeahead suggestions etc.).
++ */
++ .factory('$uibPosition', ['$document', '$window', function($document, $window) {
++ /**
++ * Used by scrollbarWidth() function to cache scrollbar's width.
++ * Do not access this variable directly, use scrollbarWidth() instead.
++ */
++ var SCROLLBAR_WIDTH;
++ /**
++ * scrollbar on body and html element in IE and Edge overlay
++ * content and should be considered 0 width.
++ */
++ var BODY_SCROLLBAR_WIDTH;
++ var OVERFLOW_REGEX = {
++ normal: /(auto|scroll)/,
++ hidden: /(auto|scroll|hidden)/
++ };
++ var PLACEMENT_REGEX = {
++ auto: /\s?auto?\s?/i,
++ primary: /^(top|bottom|left|right)$/,
++ secondary: /^(top|bottom|left|right|center)$/,
++ vertical: /^(top|bottom)$/
++ };
++ var BODY_REGEX = /(HTML|BODY)/;
+
- if (!dateFormat) {
- throw new Error('uibDatepickerPopup must have a date format specified.');
- }
- }
- });
- }
++ return {
+
- if (!dateFormat) {
- throw new Error('uibDatepickerPopup must have a date format specified.');
- }
++ /**
++ * Provides a raw DOM element from a jQuery/jQLite element.
++ *
++ * @param {element} elem - The element to convert.
++ *
++ * @returns {element} A HTML element.
++ */
++ getRawNode: function(elem) {
++ return elem.nodeName ? elem : elem[0] || elem;
++ },
+
- if (isHtml5DateInput && attrs.uibDatepickerPopup) {
- throw new Error('HTML5 date input types do not support custom formats.');
- }
++ /**
++ * Provides a parsed number for a style property. Strips
++ * units and casts invalid numbers to 0.
++ *
++ * @param {string} value - The style value to parse.
++ *
++ * @returns {number} A valid number.
++ */
++ parseStyle: function(value) {
++ value = parseFloat(value);
++ return isFinite(value) ? value : 0;
++ },
+
- // popup element used to display calendar
- popupEl = angular.element('<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>');
- scope.ngModelOptions = angular.copy(ngModelOptions);
- scope.ngModelOptions.timezone = null;
- popupEl.attr({
- 'ng-model': 'date',
- 'ng-model-options': 'ngModelOptions',
- 'ng-change': 'dateSelection(date)',
- 'template-url': datepickerPopupTemplateUrl
- });
++ /**
++ * Provides the closest positioned ancestor.
++ *
++ * @param {element} element - The element to get the offest parent for.
++ *
++ * @returns {element} The closest positioned ancestor.
++ */
++ offsetParent: function(elem) {
++ elem = this.getRawNode(elem);
+
- // datepicker element
- datepickerEl = angular.element(popupEl.children()[0]);
- datepickerEl.attr('template-url', datepickerTemplateUrl);
++ var offsetParent = elem.offsetParent || $document[0].documentElement;
+
- if (isHtml5DateInput) {
- if (attrs.type === 'month') {
- datepickerEl.attr('datepicker-mode', '"month"');
- datepickerEl.attr('min-mode', 'month');
- }
- }
++ function isStaticPositioned(el) {
++ return ($window.getComputedStyle(el).position || 'static') === 'static';
++ }
+
- if (attrs.datepickerOptions) {
- var options = scope.$parent.$eval(attrs.datepickerOptions);
- if (options && options.initDate) {
- scope.initDate = dateParser.fromTimezone(options.initDate, ngModelOptions.timezone);
- datepickerEl.attr('init-date', 'initDate');
- delete options.initDate;
- }
- angular.forEach(options, function(value, option) {
- datepickerEl.attr(cameltoDash(option), value);
- });
- }
++ while (offsetParent && offsetParent !== $document[0].documentElement && isStaticPositioned(offsetParent)) {
++ offsetParent = offsetParent.offsetParent;
++ }
+
- angular.forEach(['minMode', 'maxMode'], function(key) {
- if (attrs[key]) {
- scope.$parent.$watch(function() { return attrs[key]; }, function(value) {
- scope.watchData[key] = value;
- });
- datepickerEl.attr(cameltoDash(key), 'watchData.' + key);
- }
- });
++ return offsetParent || $document[0].documentElement;
++ },
+
- angular.forEach(['datepickerMode', 'shortcutPropagation'], function(key) {
- if (attrs[key]) {
- var getAttribute = $parse(attrs[key]);
- var propConfig = {
- get: function() {
- return getAttribute(scope.$parent);
++ /**
++ * Provides the scrollbar width, concept from TWBS measureScrollbar()
++ * function in https://github.com/twbs/bootstrap/blob/master/js/modal.js
++ * In IE and Edge, scollbar on body and html element overlay and should
++ * return a width of 0.
++ *
++ * @returns {number} The width of the browser scollbar.
++ */
++ scrollbarWidth: function(isBody) {
++ if (isBody) {
++ if (angular.isUndefined(BODY_SCROLLBAR_WIDTH)) {
++ var bodyElem = $document.find('body');
++ bodyElem.addClass('uib-position-body-scrollbar-measure');
++ BODY_SCROLLBAR_WIDTH = $window.innerWidth - bodyElem[0].clientWidth;
++ BODY_SCROLLBAR_WIDTH = isFinite(BODY_SCROLLBAR_WIDTH) ? BODY_SCROLLBAR_WIDTH : 0;
++ bodyElem.removeClass('uib-position-body-scrollbar-measure');
+ }
- };
-
- datepickerEl.attr(cameltoDash(key), 'watchData.' + key);
++ return BODY_SCROLLBAR_WIDTH;
++ }
+
- // Propagate changes from datepicker to outside
- if (key === 'datepickerMode') {
- var setAttribute = getAttribute.assign;
- propConfig.set = function(v) {
- setAttribute(scope.$parent, v);
- };
++ if (angular.isUndefined(SCROLLBAR_WIDTH)) {
++ var scrollElem = angular.element('<div class="uib-position-scrollbar-measure"></div>');
++ $document.find('body').append(scrollElem);
++ SCROLLBAR_WIDTH = scrollElem[0].offsetWidth - scrollElem[0].clientWidth;
++ SCROLLBAR_WIDTH = isFinite(SCROLLBAR_WIDTH) ? SCROLLBAR_WIDTH : 0;
++ scrollElem.remove();
+ }
+
- Object.defineProperty(scope.watchData, key, propConfig);
- }
- });
++ return SCROLLBAR_WIDTH;
++ },
+
- angular.forEach(['minDate', 'maxDate', 'initDate'], function(key) {
- if (attrs[key]) {
- var getAttribute = $parse(attrs[key]);
++ /**
++ * Provides the padding required on an element to replace the scrollbar.
++ *
++ * @returns {object} An object with the following properties:
++ * <ul>
++ * <li>**scrollbarWidth**: the width of the scrollbar</li>
++ * <li>**widthOverflow**: whether the the width is overflowing</li>
++ * <li>**right**: the amount of right padding on the element needed to replace the scrollbar</li>
++ * <li>**rightOriginal**: the amount of right padding currently on the element</li>
++ * <li>**heightOverflow**: whether the the height is overflowing</li>
++ * <li>**bottom**: the amount of bottom padding on the element needed to replace the scrollbar</li>
++ * <li>**bottomOriginal**: the amount of bottom padding currently on the element</li>
++ * </ul>
++ */
++ scrollbarPadding: function(elem) {
++ elem = this.getRawNode(elem);
+
- scope.$parent.$watch(getAttribute, function(value) {
- if (key === 'minDate' || key === 'maxDate') {
- cache[key] = angular.isDate(value) ? dateParser.fromTimezone(new Date(value), ngModelOptions.timezone) : new Date(dateFilter(value, 'medium'));
- }
++ var elemStyle = $window.getComputedStyle(elem);
++ var paddingRight = this.parseStyle(elemStyle.paddingRight);
++ var paddingBottom = this.parseStyle(elemStyle.paddingBottom);
++ var scrollParent = this.scrollParent(elem, false, true);
++ var scrollbarWidth = this.scrollbarWidth(scrollParent, BODY_REGEX.test(scrollParent.tagName));
+
- scope.watchData[key] = cache[key] || dateParser.fromTimezone(new Date(value), ngModelOptions.timezone);
- });
++ return {
++ scrollbarWidth: scrollbarWidth,
++ widthOverflow: scrollParent.scrollWidth > scrollParent.clientWidth,
++ right: paddingRight + scrollbarWidth,
++ originalRight: paddingRight,
++ heightOverflow: scrollParent.scrollHeight > scrollParent.clientHeight,
++ bottom: paddingBottom + scrollbarWidth,
++ originalBottom: paddingBottom
++ };
++ },
+
- datepickerEl.attr(cameltoDash(key), 'watchData.' + key);
- }
- });
++ /**
++ * Checks to see if the element is scrollable.
++ *
++ * @param {element} elem - The element to check.
++ * @param {boolean=} [includeHidden=false] - Should scroll style of 'hidden' be considered,
++ * default is false.
++ *
++ * @returns {boolean} Whether the element is scrollable.
++ */
++ isScrollable: function(elem, includeHidden) {
++ elem = this.getRawNode(elem);
+
- if (attrs.dateDisabled) {
- datepickerEl.attr('date-disabled', 'dateDisabled({ date: date, mode: mode })');
- }
++ var overflowRegex = includeHidden ? OVERFLOW_REGEX.hidden : OVERFLOW_REGEX.normal;
++ var elemStyle = $window.getComputedStyle(elem);
++ return overflowRegex.test(elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX);
++ },
+
- angular.forEach(['formatDay', 'formatMonth', 'formatYear', 'formatDayHeader', 'formatDayTitle', 'formatMonthTitle', 'showWeeks', 'startingDay', 'yearRows', 'yearColumns'], function(key) {
- if (angular.isDefined(attrs[key])) {
- datepickerEl.attr(cameltoDash(key), attrs[key]);
- }
- });
++ /**
++ * Provides the closest scrollable ancestor.
++ * A port of the jQuery UI scrollParent method:
++ * https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js
++ *
++ * @param {element} elem - The element to find the scroll parent of.
++ * @param {boolean=} [includeHidden=false] - Should scroll style of 'hidden' be considered,
++ * default is false.
++ * @param {boolean=} [includeSelf=false] - Should the element being passed be
++ * included in the scrollable llokup.
++ *
++ * @returns {element} A HTML element.
++ */
++ scrollParent: function(elem, includeHidden, includeSelf) {
++ elem = this.getRawNode(elem);
+
- if (attrs.customClass) {
- datepickerEl.attr('custom-class', 'customClass({ date: date, mode: mode })');
- }
++ var overflowRegex = includeHidden ? OVERFLOW_REGEX.hidden : OVERFLOW_REGEX.normal;
++ var documentEl = $document[0].documentElement;
++ var elemStyle = $window.getComputedStyle(elem);
++ if (includeSelf && overflowRegex.test(elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX)) {
++ return elem;
++ }
++ var excludeStatic = elemStyle.position === 'absolute';
++ var scrollParent = elem.parentElement || documentEl;
+
- if (!isHtml5DateInput) {
- // Internal API to maintain the correct ng-invalid-[key] class
- ngModel.$$parserName = 'date';
- ngModel.$validators.date = validator;
- ngModel.$parsers.unshift(parseDate);
- ngModel.$formatters.push(function(value) {
- if (ngModel.$isEmpty(value)) {
- scope.date = value;
- return value;
++ if (scrollParent === documentEl || elemStyle.position === 'fixed') {
++ return documentEl;
+ }
- scope.date = dateParser.fromTimezone(value, ngModelOptions.timezone);
- return dateFilter(scope.date, dateFormat);
- });
- } else {
- ngModel.$formatters.push(function(value) {
- scope.date = dateParser.fromTimezone(value, ngModelOptions.timezone);
- return value;
- });
- }
+
- // Detect changes in the view from the text box
- ngModel.$viewChangeListeners.push(function() {
- scope.date = parseDateString(ngModel.$viewValue);
- });
++ while (scrollParent.parentElement && scrollParent !== documentEl) {
++ var spStyle = $window.getComputedStyle(scrollParent);
++ if (excludeStatic && spStyle.position !== 'static') {
++ excludeStatic = false;
++ }
+
- element.bind('keydown', inputKeydownBind);
++ if (!excludeStatic && overflowRegex.test(spStyle.overflow + spStyle.overflowY + spStyle.overflowX)) {
++ break;
++ }
++ scrollParent = scrollParent.parentElement;
++ }
+
- $popup = $compile(popupEl)(scope);
- // Prevent jQuery cache memory leak (template is now redundant after linking)
- popupEl.remove();
++ return scrollParent;
++ },
+
- if (appendToBody) {
- $document.find('body').append($popup);
- } else {
- element.after($popup);
- }
++ /**
++ * Provides read-only equivalent of jQuery's position function:
++ * http://api.jquery.com/position/ - distance to closest positioned
++ * ancestor. Does not account for margins by default like jQuery position.
++ *
++ * @param {element} elem - The element to caclulate the position on.
++ * @param {boolean=} [includeMargins=false] - Should margins be accounted
++ * for, default is false.
++ *
++ * @returns {object} An object with the following properties:
++ * <ul>
++ * <li>**width**: the width of the element</li>
++ * <li>**height**: the height of the element</li>
++ * <li>**top**: distance to top edge of offset parent</li>
++ * <li>**left**: distance to left edge of offset parent</li>
++ * </ul>
++ */
++ position: function(elem, includeMagins) {
++ elem = this.getRawNode(elem);
+
- scope.$on('$destroy', function() {
- if (scope.isOpen === true) {
- if (!$rootScope.$$phase) {
- scope.$apply(function() {
- scope.isOpen = false;
- });
++ var elemOffset = this.offset(elem);
++ if (includeMagins) {
++ var elemStyle = $window.getComputedStyle(elem);
++ elemOffset.top -= this.parseStyle(elemStyle.marginTop);
++ elemOffset.left -= this.parseStyle(elemStyle.marginLeft);
+ }
- }
-
- $popup.remove();
- element.unbind('keydown', inputKeydownBind);
- $document.unbind('click', documentClickBind);
- });
- };
-
- scope.getText = function(key) {
- return scope[key + 'Text'] || datepickerPopupConfig[key + 'Text'];
- };
++ var parent = this.offsetParent(elem);
++ var parentOffset = {top: 0, left: 0};
+
- scope.isDisabled = function(date) {
- if (date === 'today') {
- date = new Date();
- }
++ if (parent !== $document[0].documentElement) {
++ parentOffset = this.offset(parent);
++ parentOffset.top += parent.clientTop - parent.scrollTop;
++ parentOffset.left += parent.clientLeft - parent.scrollLeft;
++ }
+
- return scope.watchData.minDate && scope.compare(date, cache.minDate) < 0 ||
- scope.watchData.maxDate && scope.compare(date, cache.maxDate) > 0;
- };
++ return {
++ width: Math.round(angular.isNumber(elemOffset.width) ? elemOffset.width : elem.offsetWidth),
++ height: Math.round(angular.isNumber(elemOffset.height) ? elemOffset.height : elem.offsetHeight),
++ top: Math.round(elemOffset.top - parentOffset.top),
++ left: Math.round(elemOffset.left - parentOffset.left)
++ };
++ },
+
- scope.compare = function(date1, date2) {
- return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
- };
++ /**
++ * Provides read-only equivalent of jQuery's offset function:
++ * http://api.jquery.com/offset/ - distance to viewport. Does
++ * not account for borders, margins, or padding on the body
++ * element.
++ *
++ * @param {element} elem - The element to calculate the offset on.
++ *
++ * @returns {object} An object with the following properties:
++ * <ul>
++ * <li>**width**: the width of the element</li>
++ * <li>**height**: the height of the element</li>
++ * <li>**top**: distance to top edge of viewport</li>
++ * <li>**right**: distance to bottom edge of viewport</li>
++ * </ul>
++ */
++ offset: function(elem) {
++ elem = this.getRawNode(elem);
+
- // Inner change
- scope.dateSelection = function(dt) {
- if (angular.isDefined(dt)) {
- scope.date = dt;
- }
- var date = scope.date ? dateFilter(scope.date, dateFormat) : null; // Setting to NULL is necessary for form validators to function
- element.val(date);
- ngModel.$setViewValue(date);
++ var elemBCR = elem.getBoundingClientRect();
++ return {
++ width: Math.round(angular.isNumber(elemBCR.width) ? elemBCR.width : elem.offsetWidth),
++ height: Math.round(angular.isNumber(elemBCR.height) ? elemBCR.height : elem.offsetHeight),
++ top: Math.round(elemBCR.top + ($window.pageYOffset || $document[0].documentElement.scrollTop)),
++ left: Math.round(elemBCR.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft))
++ };
++ },
+
- if (closeOnDateSelection) {
- scope.isOpen = false;
- element[0].focus();
- }
- };
++ /**
++ * Provides offset distance to the closest scrollable ancestor
++ * or viewport. Accounts for border and scrollbar width.
++ *
++ * Right and bottom dimensions represent the distance to the
++ * respective edge of the viewport element. If the element
++ * edge extends beyond the viewport, a negative value will be
++ * reported.
++ *
++ * @param {element} elem - The element to get the viewport offset for.
++ * @param {boolean=} [useDocument=false] - Should the viewport be the document element instead
++ * of the first scrollable element, default is false.
++ * @param {boolean=} [includePadding=true] - Should the padding on the offset parent element
++ * be accounted for, default is true.
++ *
++ * @returns {object} An object with the following properties:
++ * <ul>
++ * <li>**top**: distance to the top content edge of viewport element</li>
++ * <li>**bottom**: distance to the bottom content edge of viewport element</li>
++ * <li>**left**: distance to the left content edge of viewport element</li>
++ * <li>**right**: distance to the right content edge of viewport element</li>
++ * </ul>
++ */
++ viewportOffset: function(elem, useDocument, includePadding) {
++ elem = this.getRawNode(elem);
++ includePadding = includePadding !== false ? true : false;
+
- scope.keydown = function(evt) {
- if (evt.which === 27) {
- evt.stopPropagation();
- scope.isOpen = false;
- element[0].focus();
- }
- };
++ var elemBCR = elem.getBoundingClientRect();
++ var offsetBCR = {top: 0, left: 0, bottom: 0, right: 0};
+
- scope.select = function(date) {
- if (date === 'today') {
- var today = new Date();
- if (angular.isDate(scope.date)) {
- date = new Date(scope.date);
- date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate());
- } else {
- date = new Date(today.setHours(0, 0, 0, 0));
- }
- }
- scope.dateSelection(date);
- };
++ var offsetParent = useDocument ? $document[0].documentElement : this.scrollParent(elem);
++ var offsetParentBCR = offsetParent.getBoundingClientRect();
+
- scope.close = function() {
- scope.isOpen = false;
- element[0].focus();
- };
++ offsetBCR.top = offsetParentBCR.top + offsetParent.clientTop;
++ offsetBCR.left = offsetParentBCR.left + offsetParent.clientLeft;
++ if (offsetParent === $document[0].documentElement) {
++ offsetBCR.top += $window.pageYOffset;
++ offsetBCR.left += $window.pageXOffset;
++ }
++ offsetBCR.bottom = offsetBCR.top + offsetParent.clientHeight;
++ offsetBCR.right = offsetBCR.left + offsetParent.clientWidth;
+
- scope.disabled = angular.isDefined(attrs.disabled) || false;
- if (attrs.ngDisabled) {
- scope.$parent.$watch($parse(attrs.ngDisabled), function(disabled) {
- scope.disabled = disabled;
- });
- }
++ if (includePadding) {
++ var offsetParentStyle = $window.getComputedStyle(offsetParent);
++ offsetBCR.top += this.parseStyle(offsetParentStyle.paddingTop);
++ offsetBCR.bottom -= this.parseStyle(offsetParentStyle.paddingBottom);
++ offsetBCR.left += this.parseStyle(offsetParentStyle.paddingLeft);
++ offsetBCR.right -= this.parseStyle(offsetParentStyle.paddingRight);
++ }
+
- scope.$watch('isOpen', function(value) {
- if (value) {
- if (!scope.disabled) {
- scope.position = appendToBody ? $position.offset(element) : $position.position(element);
- scope.position.top = scope.position.top + element.prop('offsetHeight');
++ return {
++ top: Math.round(elemBCR.top - offsetBCR.top),
++ bottom: Math.round(offsetBCR.bottom - elemBCR.bottom),
++ left: Math.round(elemBCR.left - offsetBCR.left),
++ right: Math.round(offsetBCR.right - elemBCR.right)
++ };
++ },
+
- $timeout(function() {
- if (onOpenFocus) {
- scope.$broadcast('uib:datepicker.focus');
- }
- $document.bind('click', documentClickBind);
- }, 0, false);
- } else {
- scope.isOpen = false;
++ /**
++ * Provides an array of placement values parsed from a placement string.
++ * Along with the 'auto' indicator, supported placement strings are:
++ * <ul>
++ * <li>top: element on top, horizontally centered on host element.</li>
++ * <li>top-left: element on top, left edge aligned with host element left edge.</li>
++ * <li>top-right: element on top, lerightft edge aligned with host element right edge.</li>
++ * <li>bottom: element on bottom, horizontally centered on host element.</li>
++ * <li>bottom-left: element on bottom, left edge aligned with host element left edge.</li>
++ * <li>bottom-right: element on bottom, right edge aligned with host element right edge.</li>
++ * <li>left: element on left, vertically centered on host element.</li>
++ * <li>left-top: element on left, top edge aligned with host element top edge.</li>
++ * <li>left-bottom: element on left, bottom edge aligned with host element bottom edge.</li>
++ * <li>right: element on right, vertically centered on host element.</li>
++ * <li>right-top: element on right, top edge aligned with host element top edge.</li>
++ * <li>right-bottom: element on right, bottom edge aligned with host element bottom edge.</li>
++ * </ul>
++ * A placement string with an 'auto' indicator is expected to be
++ * space separated from the placement, i.e: 'auto bottom-left' If
++ * the primary and secondary placement values do not match 'top,
++ * bottom, left, right' then 'top' will be the primary placement and
++ * 'center' will be the secondary placement. If 'auto' is passed, true
++ * will be returned as the 3rd value of the array.
++ *
++ * @param {string} placement - The placement string to parse.
++ *
++ * @returns {array} An array with the following values
++ * <ul>
++ * <li>**[0]**: The primary placement.</li>
++ * <li>**[1]**: The secondary placement.</li>
++ * <li>**[2]**: If auto is passed: true, else undefined.</li>
++ * </ul>
++ */
++ parsePlacement: function(placement) {
++ var autoPlace = PLACEMENT_REGEX.auto.test(placement);
++ if (autoPlace) {
++ placement = placement.replace(PLACEMENT_REGEX.auto, '');
++ }
++
++ placement = placement.split('-');
++
++ placement[0] = placement[0] || 'top';
++ if (!PLACEMENT_REGEX.primary.test(placement[0])) {
++ placement[0] = 'top';
++ }
++
++ placement[1] = placement[1] || 'center';
++ if (!PLACEMENT_REGEX.secondary.test(placement[1])) {
++ placement[1] = 'center';
++ }
++
++ if (autoPlace) {
++ placement[2] = true;
++ } else {
++ placement[2] = false;
++ }
++
++ return placement;
++ },
++
++ /**
++ * Provides coordinates for an element to be positioned relative to
++ * another element. Passing 'auto' as part of the placement parameter
++ * will enable smart placement - where the element fits. i.e:
++ * 'auto left-top' will check to see if there is enough space to the left
++ * of the hostElem to fit the targetElem, if not place right (same for secondary
++ * top placement). Available space is calculated using the viewportOffset
++ * function.
++ *
++ * @param {element} hostElem - The element to position against.
++ * @param {element} targetElem - The element to position.
++ * @param {string=} [placement=top] - The placement for the targetElem,
++ * default is 'top'. 'center' is assumed as secondary placement for
++ * 'top', 'left', 'right', and 'bottom' placements. Available placements are:
++ * <ul>
++ * <li>top</li>
++ * <li>top-right</li>
++ * <li>top-left</li>
++ * <li>bottom</li>
++ * <li>bottom-left</li>
++ * <li>bottom-right</li>
++ * <li>left</li>
++ * <li>left-top</li>
++ * <li>left-bottom</li>
++ * <li>right</li>
++ * <li>right-top</li>
++ * <li>right-bottom</li>
++ * </ul>
++ * @param {boolean=} [appendToBody=false] - Should the top and left values returned
++ * be calculated from the body element, default is false.
++ *
++ * @returns {object} An object with the following properties:
++ * <ul>
++ * <li>**top**: Value for targetElem top.</li>
++ * <li>**left**: Value for targetElem left.</li>
++ * <li>**placement**: The resolved placement.</li>
++ * </ul>
++ */
++ positionElements: function(hostElem, targetElem, placement, appendToBody) {
++ hostElem = this.getRawNode(hostElem);
++ targetElem = this.getRawNode(targetElem);
++
++ // need to read from prop to support tests.
++ var targetWidth = angular.isDefined(targetElem.offsetWidth) ? targetElem.offsetWidth : targetElem.prop('offsetWidth');
++ var targetHeight = angular.isDefined(targetElem.offsetHeight) ? targetElem.offsetHeight : targetElem.prop('offsetHeight');
++
++ placement = this.parsePlacement(placement);
++
++ var hostElemPos = appendToBody ? this.offset(hostElem) : this.position(hostElem);
++ var targetElemPos = {top: 0, left: 0, placement: ''};
++
++ if (placement[2]) {
++ var viewportOffset = this.viewportOffset(hostElem, appendToBody);
+
+ var targetElemStyle = $window.getComputedStyle(targetElem);
+ var adjustedSize = {
+ width: targetWidth + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginLeft) + this.parseStyle(targetElemStyle.marginRight))),
+ height: targetHeight + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginTop) + this.parseStyle(targetElemStyle.marginBottom)))
+ };
+
+ placement[0] = placement[0] === 'top' && adjustedSize.height > viewportOffset.top && adjustedSize.height <= viewportOffset.bottom ? 'bottom' :
+ placement[0] === 'bottom' && adjustedSize.height > viewportOffset.bottom && adjustedSize.height <= viewportOffset.top ? 'top' :
+ placement[0] === 'left' && adjustedSize.width > viewportOffset.left && adjustedSize.width <= viewportOffset.right ? 'right' :
+ placement[0] === 'right' && adjustedSize.width > viewportOffset.right && adjustedSize.width <= viewportOffset.left ? 'left' :
+ placement[0];
+
+ placement[1] = placement[1] === 'top' && adjustedSize.height - hostElemPos.height > viewportOffset.bottom && adjustedSize.height - hostElemPos.height <= viewportOffset.top ? 'bottom' :
+ placement[1] === 'bottom' && adjustedSize.height - hostElemPos.height > viewportOffset.top && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom ? 'top' :
+ placement[1] === 'left' && adjustedSize.width - hostElemPos.width > viewportOffset.right && adjustedSize.width - hostElemPos.width <= viewportOffset.left ? 'right' :
+ placement[1] === 'right' && adjustedSize.width - hostElemPos.width > viewportOffset.left && adjustedSize.width - hostElemPos.width <= viewportOffset.right ? 'left' :
+ placement[1];
+
+ if (placement[1] === 'center') {
+ if (PLACEMENT_REGEX.vertical.test(placement[0])) {
+ var xOverflow = hostElemPos.width / 2 - targetWidth / 2;
+ if (viewportOffset.left + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.right) {
+ placement[1] = 'left';
+ } else if (viewportOffset.right + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.left) {
+ placement[1] = 'right';
+ }
+ } else {
+ var yOverflow = hostElemPos.height / 2 - adjustedSize.height / 2;
+ if (viewportOffset.top + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom) {
+ placement[1] = 'top';
+ } else if (viewportOffset.bottom + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.top) {
+ placement[1] = 'bottom';
+ }
+ }
+ }
+ }
+
+ switch (placement[0]) {
+ case 'top':
+ targetElemPos.top = hostElemPos.top - targetHeight;
+ break;
+ case 'bottom':
+ targetElemPos.top = hostElemPos.top + hostElemPos.height;
+ break;
+ case 'left':
+ targetElemPos.left = hostElemPos.left - targetWidth;
+ break;
+ case 'right':
+ targetElemPos.left = hostElemPos.left + hostElemPos.width;
+ break;
+ }
+
+ switch (placement[1]) {
+ case 'top':
+ targetElemPos.top = hostElemPos.top;
+ break;
+ case 'bottom':
+ targetElemPos.top = hostElemPos.top + hostElemPos.height - targetHeight;
+ break;
+ case 'left':
+ targetElemPos.left = hostElemPos.left;
+ break;
+ case 'right':
+ targetElemPos.left = hostElemPos.left + hostElemPos.width - targetWidth;
+ break;
+ case 'center':
+ if (PLACEMENT_REGEX.vertical.test(placement[0])) {
+ targetElemPos.left = hostElemPos.left + hostElemPos.width / 2 - targetWidth / 2;
+ } else {
+ targetElemPos.top = hostElemPos.top + hostElemPos.height / 2 - targetHeight / 2;
+ }
+ break;
+ }
+
+ targetElemPos.top = Math.round(targetElemPos.top);
+ targetElemPos.left = Math.round(targetElemPos.left);
+ targetElemPos.placement = placement[1] === 'center' ? placement[0] : placement[0] + '-' + placement[1];
+
+ return targetElemPos;
+ },
+
+ /**
+ * Provides a way for positioning tooltip & dropdown
+ * arrows when using placement options beyond the standard
+ * left, right, top, or bottom.
+ *
+ * @param {element} elem - The tooltip/dropdown element.
+ * @param {string} placement - The placement for the elem.
+ */
+ positionArrow: function(elem, placement) {
+ elem = this.getRawNode(elem);
+
+ var innerElem = elem.querySelector('.tooltip-inner, .popover-inner');
+ if (!innerElem) {
+ return;
+ }
+
+ var isTooltip = angular.element(innerElem).hasClass('tooltip-inner');
+
+ var arrowElem = isTooltip ? elem.querySelector('.tooltip-arrow') : elem.querySelector('.arrow');
+ if (!arrowElem) {
+ return;
+ }
+
+ var arrowCss = {
+ top: '',
+ bottom: '',
+ left: '',
+ right: ''
+ };
+
+ placement = this.parsePlacement(placement);
+ if (placement[1] === 'center') {
+ // no adjustment necessary - just reset styles
+ angular.element(arrowElem).css(arrowCss);
+ return;
+ }
+
+ var borderProp = 'border-' + placement[0] + '-width';
+ var borderWidth = $window.getComputedStyle(arrowElem)[borderProp];
+
+ var borderRadiusProp = 'border-';
+ if (PLACEMENT_REGEX.vertical.test(placement[0])) {
+ borderRadiusProp += placement[0] + '-' + placement[1];
+ } else {
+ borderRadiusProp += placement[1] + '-' + placement[0];
+ }
+ borderRadiusProp += '-radius';
+ var borderRadius = $window.getComputedStyle(isTooltip ? innerElem : elem)[borderRadiusProp];
+
+ switch (placement[0]) {
+ case 'top':
+ arrowCss.bottom = isTooltip ? '0' : '-' + borderWidth;
+ break;
+ case 'bottom':
+ arrowCss.top = isTooltip ? '0' : '-' + borderWidth;
+ break;
+ case 'left':
+ arrowCss.right = isTooltip ? '0' : '-' + borderWidth;
+ break;
+ case 'right':
+ arrowCss.left = isTooltip ? '0' : '-' + borderWidth;
+ break;
+ }
+
+ arrowCss[placement[1]] = borderRadius;
+
+ angular.element(arrowElem).css(arrowCss);
+ }
+ };
+ }]);
+
+ angular.module('ui.bootstrap.datepickerPopup', ['ui.bootstrap.datepicker', 'ui.bootstrap.position'])
+
+ .value('$datepickerPopupLiteralWarning', true)
+
+ .constant('uibDatepickerPopupConfig', {
+ altInputFormats: [],
+ appendToBody: false,
+ clearText: 'Clear',
+ closeOnDateSelection: true,
+ closeText: 'Done',
+ currentText: 'Today',
+ datepickerPopup: 'yyyy-MM-dd',
+ datepickerPopupTemplateUrl: 'uib/template/datepickerPopup/popup.html',
+ datepickerTemplateUrl: 'uib/template/datepicker/datepicker.html',
+ html5Types: {
+ date: 'yyyy-MM-dd',
+ 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss',
+ 'month': 'yyyy-MM'
+ },
+ onOpenFocus: true,
+ showButtonBar: true,
+ placement: 'auto bottom-left'
+ })
+
+ .controller('UibDatepickerPopupController', ['$scope', '$element', '$attrs', '$compile', '$log', '$parse', '$window', '$document', '$rootScope', '$uibPosition', 'dateFilter', 'uibDateParser', 'uibDatepickerPopupConfig', '$timeout', 'uibDatepickerConfig', '$datepickerPopupLiteralWarning',
+ function($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $rootScope, $position, dateFilter, dateParser, datepickerPopupConfig, $timeout, datepickerConfig, $datepickerPopupLiteralWarning) {
+ var cache = {},
+ isHtml5DateInput = false;
+ var dateFormat, closeOnDateSelection, appendToBody, onOpenFocus,
+ datepickerPopupTemplateUrl, datepickerTemplateUrl, popupEl, datepickerEl, scrollParentEl,
+ ngModel, ngModelOptions, $popup, altInputFormats, watchListeners = [],
+ timezone;
+
+ this.init = function(_ngModel_) {
+ ngModel = _ngModel_;
+ ngModelOptions = _ngModel_.$options;
+ closeOnDateSelection = angular.isDefined($attrs.closeOnDateSelection) ?
+ $scope.$parent.$eval($attrs.closeOnDateSelection) :
+ datepickerPopupConfig.closeOnDateSelection;
+ appendToBody = angular.isDefined($attrs.datepickerAppendToBody) ?
+ $scope.$parent.$eval($attrs.datepickerAppendToBody) :
+ datepickerPopupConfig.appendToBody;
+ onOpenFocus = angular.isDefined($attrs.onOpenFocus) ?
+ $scope.$parent.$eval($attrs.onOpenFocus) : datepickerPopupConfig.onOpenFocus;
+ datepickerPopupTemplateUrl = angular.isDefined($attrs.datepickerPopupTemplateUrl) ?
+ $attrs.datepickerPopupTemplateUrl :
+ datepickerPopupConfig.datepickerPopupTemplateUrl;
+ datepickerTemplateUrl = angular.isDefined($attrs.datepickerTemplateUrl) ?
+ $attrs.datepickerTemplateUrl : datepickerPopupConfig.datepickerTemplateUrl;
+ altInputFormats = angular.isDefined($attrs.altInputFormats) ?
+ $scope.$parent.$eval($attrs.altInputFormats) :
+ datepickerPopupConfig.altInputFormats;
+
+ $scope.showButtonBar = angular.isDefined($attrs.showButtonBar) ?
+ $scope.$parent.$eval($attrs.showButtonBar) :
+ datepickerPopupConfig.showButtonBar;
+
+ if (datepickerPopupConfig.html5Types[$attrs.type]) {
+ dateFormat = datepickerPopupConfig.html5Types[$attrs.type];
+ isHtml5DateInput = true;
+ } else {
+ dateFormat = $attrs.uibDatepickerPopup || datepickerPopupConfig.datepickerPopup;
+ $attrs.$observe('uibDatepickerPopup', function(value, oldValue) {
+ var newDateFormat = value || datepickerPopupConfig.datepickerPopup;
+ // Invalidate the $modelValue to ensure that formatters re-run
+ // FIXME: Refactor when PR is merged: https://github.com/angular/angular.js/pull/10764
+ if (newDateFormat !== dateFormat) {
+ dateFormat = newDateFormat;
+ ngModel.$modelValue = null;
+
+ if (!dateFormat) {
+ throw new Error('uibDatepickerPopup must have a date format specified.');
+ }
+ }
+ });
+ }
+
+ if (!dateFormat) {
+ throw new Error('uibDatepickerPopup must have a date format specified.');
+ }
+
+ if (isHtml5DateInput && $attrs.uibDatepickerPopup) {
+ throw new Error('HTML5 date input types do not support custom formats.');
+ }
+
+ // popup element used to display calendar
+ popupEl = angular.element('<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>');
+ if (ngModelOptions) {
+ timezone = ngModelOptions.timezone;
+ $scope.ngModelOptions = angular.copy(ngModelOptions);
+ $scope.ngModelOptions.timezone = null;
+ if ($scope.ngModelOptions.updateOnDefault === true) {
+ $scope.ngModelOptions.updateOn = $scope.ngModelOptions.updateOn ?
+ $scope.ngModelOptions.updateOn + ' default' : 'default';
}
+
+ popupEl.attr('ng-model-options', 'ngModelOptions');
} else {
- $document.unbind('click', documentClickBind);
+ timezone = null;
+ }
+
+ popupEl.attr({
+ 'ng-model': 'date',
+ 'ng-change': 'dateSelection(date)',
+ 'template-url': datepickerPopupTemplateUrl
+ });
+
+ // datepicker element
+ datepickerEl = angular.element(popupEl.children()[0]);
+ datepickerEl.attr('template-url', datepickerTemplateUrl);
+
+ if (!$scope.datepickerOptions) {
+ $scope.datepickerOptions = {};
+ }
+
+ if (isHtml5DateInput) {
+ if ($attrs.type === 'month') {
+ $scope.datepickerOptions.datepickerMode = 'month';
+ $scope.datepickerOptions.minMode = 'month';
+ }
+ }
+
+ datepickerEl.attr('datepicker-options', 'datepickerOptions');
+
+ if (!isHtml5DateInput) {
+ // Internal API to maintain the correct ng-invalid-[key] class
+ ngModel.$$parserName = 'date';
+ ngModel.$validators.date = validator;
+ ngModel.$parsers.unshift(parseDate);
+ ngModel.$formatters.push(function(value) {
+ if (ngModel.$isEmpty(value)) {
+ $scope.date = value;
+ return value;
+ }
+
+ if (angular.isNumber(value)) {
+ value = new Date(value);
+ }
+
+ $scope.date = dateParser.fromTimezone(value, timezone);
+
+ return dateParser.filter($scope.date, dateFormat);
+ });
+ } else {
+ ngModel.$formatters.push(function(value) {
+ $scope.date = dateParser.fromTimezone(value, timezone);
+ return value;
+ });
+ }
+
+ // Detect changes in the view from the text box
+ ngModel.$viewChangeListeners.push(function() {
+ $scope.date = parseDateString(ngModel.$viewValue);
+ });
+
+ $element.on('keydown', inputKeydownBind);
+
+ $popup = $compile(popupEl)($scope);
+ // Prevent jQuery cache memory leak (template is now redundant after linking)
+ popupEl.remove();
+
+ if (appendToBody) {
+ $document.find('body').append($popup);
+ } else {
+ $element.after($popup);
+ }
+
+ $scope.$on('$destroy', function() {
+ if ($scope.isOpen === true) {
+ if (!$rootScope.$$phase) {
+ $scope.$apply(function() {
+ $scope.isOpen = false;
+ });
+ }
+ }
+
+ $popup.remove();
+ $element.off('keydown', inputKeydownBind);
+ $document.off('click', documentClickBind);
+ if (scrollParentEl) {
+ scrollParentEl.off('scroll', positionPopup);
+ }
+ angular.element($window).off('resize', positionPopup);
+
+ //Clear all watch listeners on destroy
+ while (watchListeners.length) {
+ watchListeners.shift()();
+ }
+ });
+ };
+
+ $scope.getText = function(key) {
+ return $scope[key + 'Text'] || datepickerPopupConfig[key + 'Text'];
+ };
+
+ $scope.isDisabled = function(date) {
+ if (date === 'today') {
+ date = dateParser.fromTimezone(new Date(), timezone);
+ }
+
+ var dates = {};
+ angular.forEach(['minDate', 'maxDate'], function(key) {
+ if (!$scope.datepickerOptions[key]) {
+ dates[key] = null;
+ } else if (angular.isDate($scope.datepickerOptions[key])) {
+ dates[key] = dateParser.fromTimezone(new Date($scope.datepickerOptions[key]), timezone);
+ } else {
+ if ($datepickerPopupLiteralWarning) {
+ $log.warn('Literal date support has been deprecated, please switch to date object usage');
+ }
+
+ dates[key] = new Date(dateFilter($scope.datepickerOptions[key], 'medium'));
+ }
+ });
+
+ return $scope.datepickerOptions &&
+ dates.minDate && $scope.compare(date, dates.minDate) < 0 ||
+ dates.maxDate && $scope.compare(date, dates.maxDate) > 0;
+ };
+
+ $scope.compare = function(date1, date2) {
+ return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
+ };
+
+ // Inner change
+ $scope.dateSelection = function(dt) {
+ if (angular.isDefined(dt)) {
+ $scope.date = dt;
+ }
+ var date = $scope.date ? dateParser.filter($scope.date, dateFormat) : null; // Setting to NULL is necessary for form validators to function
+ $element.val(date);
+ ngModel.$setViewValue(date);
+
+ if (closeOnDateSelection) {
+ $scope.isOpen = false;
+ $element[0].focus();
+ }
+ };
+
+ $scope.keydown = function(evt) {
+ if (evt.which === 27) {
+ evt.stopPropagation();
+ $scope.isOpen = false;
+ $element[0].focus();
+ }
+ };
+
+ $scope.select = function(date, evt) {
+ evt.stopPropagation();
+
+ if (date === 'today') {
+ var today = new Date();
+ if (angular.isDate($scope.date)) {
+ date = new Date($scope.date);
+ date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate());
+ } else {
+ date = new Date(today.setHours(0, 0, 0, 0));
+ }
+ }
+ $scope.dateSelection(date);
+ };
+
+ $scope.close = function(evt) {
+ evt.stopPropagation();
+
+ $scope.isOpen = false;
+ $element[0].focus();
+ };
+
+ $scope.disabled = angular.isDefined($attrs.disabled) || false;
+ if ($attrs.ngDisabled) {
+ watchListeners.push($scope.$parent.$watch($parse($attrs.ngDisabled), function(disabled) {
+ $scope.disabled = disabled;
+ }));
+ }
+
+ $scope.$watch('isOpen', function(value) {
+ if (value) {
+ if (!$scope.disabled) {
+ $timeout(function() {
+ positionPopup();
+
+ if (onOpenFocus) {
+ $scope.$broadcast('uib:datepicker.focus');
+ }
+
+ $document.on('click', documentClickBind);
+
+ var placement = $attrs.popupPlacement ? $attrs.popupPlacement : datepickerPopupConfig.placement;
+ if (appendToBody || $position.parsePlacement(placement)[2]) {
+ scrollParentEl = scrollParentEl || angular.element($position.scrollParent($element));
+ if (scrollParentEl) {
+ scrollParentEl.on('scroll', positionPopup);
+ }
+ } else {
+ scrollParentEl = null;
+ }
+
+ angular.element($window).on('resize', positionPopup);
+ }, 0, false);
+ } else {
+ $scope.isOpen = false;
+ }
+ } else {
+ $document.off('click', documentClickBind);
+ if (scrollParentEl) {
+ scrollParentEl.off('scroll', positionPopup);
+ }
+ angular.element($window).off('resize', positionPopup);
}
});
});
}
}
- }])
-
- .directive('uibDatepickerPopup', function() {
- return {
- require: ['ngModel', 'uibDatepickerPopup'],
- controller: 'UibDatepickerPopupController',
- scope: {
- isOpen: '=?',
- currentText: '@',
- clearText: '@',
- closeText: '@',
- dateDisabled: '&',
- customClass: '&'
- },
- link: function(scope, element, attrs, ctrls) {
- var ngModel = ctrls[0],
- ctrl = ctrls[1];
-
- ctrl.init(ngModel);
- }
- };
- })
- .directive('uibDatepickerPopupWrap', function() {
- return {
- replace: true,
- transclude: true,
- templateUrl: function(element, attrs) {
- return attrs.templateUrl || 'uib/template/datepicker/popup.html';
+ function positionPopup() {
+ if ($scope.isOpen) {
+ var dpElement = angular.element($popup[0].querySelector('.uib-datepicker-popup'));
+ var placement = $attrs.popupPlacement ? $attrs.popupPlacement : datepickerPopupConfig.placement;
+ var position = $position.positionElements($element, dpElement, placement, appendToBody);
+ dpElement.css({top: position.top + 'px', left: position.left + 'px'});
+ if (dpElement.hasClass('uib-position-measure')) {
+ dpElement.removeClass('uib-position-measure');
+ }
}
- };
- });
-
- angular.module('ui.bootstrap.debounce', [])
- /**
- * A helper, internal service that debounces a function
- */
- .factory('$$debounce', ['$timeout', function($timeout) {
- return function(callback, debounceTime) {
- var timeoutPromise;
-
- return function() {
- var self = this;
- var args = Array.prototype.slice.call(arguments);
- if (timeoutPromise) {
- $timeout.cancel(timeoutPromise);
- }
-
- timeoutPromise = $timeout(function() {
- callback.apply(self, args);
- }, debounceTime);
- };
- };
- }]);
-
- angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
+ }
- .constant('uibDropdownConfig', {
- appendToOpenClass: 'uib-dropdown-open',
- openClass: 'open'
+ $scope.$on('uib:datepicker.mode', function() {
+ $timeout(positionPopup, 0, false);
+ });
+ }])
++=======
+ })
+
- .service('uibDropdownService', ['$document', '$rootScope', function($document, $rootScope) {
- var openScope = null;
++ .constant('uibDatepickerPopupConfig', {
++ datepickerPopup: 'yyyy-MM-dd',
++ datepickerPopupTemplateUrl: 'uib/template/datepicker/popup.html',
++ datepickerTemplateUrl: 'uib/template/datepicker/datepicker.html',
++ html5Types: {
++ date: 'yyyy-MM-dd',
++ 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss',
++ 'month': 'yyyy-MM'
++ },
++ currentText: 'Today',
++ clearText: 'Clear',
++ closeText: 'Done',
++ closeOnDateSelection: true,
++ appendToBody: false,
++ showButtonBar: true,
++ onOpenFocus: true,
++ altInputFormats: []
++ })
++
++ .controller('UibDatepickerPopupController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$document', '$rootScope', '$uibPosition', 'dateFilter', 'uibDateParser', 'uibDatepickerPopupConfig', '$timeout', 'uibDatepickerConfig',
++ function(scope, element, attrs, $compile, $parse, $document, $rootScope, $position, dateFilter, dateParser, datepickerPopupConfig, $timeout, datepickerConfig) {
++ var self = this;
++ var cache = {},
++ isHtml5DateInput = false;
++ var dateFormat, closeOnDateSelection, appendToBody, onOpenFocus,
++ datepickerPopupTemplateUrl, datepickerTemplateUrl, popupEl, datepickerEl,
++ ngModel, ngModelOptions, $popup, altInputFormats;
++
++ scope.watchData = {};
++
++ this.init = function(_ngModel_) {
++ ngModel = _ngModel_;
++ ngModelOptions = _ngModel_.$options || datepickerConfig.ngModelOptions;
++ closeOnDateSelection = angular.isDefined(attrs.closeOnDateSelection) ? scope.$parent.$eval(attrs.closeOnDateSelection) : datepickerPopupConfig.closeOnDateSelection;
++ appendToBody = angular.isDefined(attrs.datepickerAppendToBody) ? scope.$parent.$eval(attrs.datepickerAppendToBody) : datepickerPopupConfig.appendToBody;
++ onOpenFocus = angular.isDefined(attrs.onOpenFocus) ? scope.$parent.$eval(attrs.onOpenFocus) : datepickerPopupConfig.onOpenFocus;
++ datepickerPopupTemplateUrl = angular.isDefined(attrs.datepickerPopupTemplateUrl) ? attrs.datepickerPopupTemplateUrl : datepickerPopupConfig.datepickerPopupTemplateUrl;
++ datepickerTemplateUrl = angular.isDefined(attrs.datepickerTemplateUrl) ? attrs.datepickerTemplateUrl : datepickerPopupConfig.datepickerTemplateUrl;
++ altInputFormats = angular.isDefined(attrs.altInputFormats) ? scope.$parent.$eval(attrs.altInputFormats) : datepickerPopupConfig.altInputFormats;
++
++ scope.showButtonBar = angular.isDefined(attrs.showButtonBar) ? scope.$parent.$eval(attrs.showButtonBar) : datepickerPopupConfig.showButtonBar;
++
++ if (datepickerPopupConfig.html5Types[attrs.type]) {
++ dateFormat = datepickerPopupConfig.html5Types[attrs.type];
++ isHtml5DateInput = true;
++ } else {
++ dateFormat = attrs.uibDatepickerPopup || datepickerPopupConfig.datepickerPopup;
++ attrs.$observe('uibDatepickerPopup', function(value, oldValue) {
++ var newDateFormat = value || datepickerPopupConfig.datepickerPopup;
++ // Invalidate the $modelValue to ensure that formatters re-run
++ // FIXME: Refactor when PR is merged: https://github.com/angular/angular.js/pull/10764
++ if (newDateFormat !== dateFormat) {
++ dateFormat = newDateFormat;
++ ngModel.$modelValue = null;
++
++ if (!dateFormat) {
++ throw new Error('uibDatepickerPopup must have a date format specified.');
++ }
++ }
++ });
++ }
++
++ if (!dateFormat) {
++ throw new Error('uibDatepickerPopup must have a date format specified.');
++ }
++
++ if (isHtml5DateInput && attrs.uibDatepickerPopup) {
++ throw new Error('HTML5 date input types do not support custom formats.');
++ }
++
++ // popup element used to display calendar
++ popupEl = angular.element('<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>');
++ scope.ngModelOptions = angular.copy(ngModelOptions);
++ scope.ngModelOptions.timezone = null;
++ popupEl.attr({
++ 'ng-model': 'date',
++ 'ng-model-options': 'ngModelOptions',
++ 'ng-change': 'dateSelection(date)',
++ 'template-url': datepickerPopupTemplateUrl
++ });
++
++ // datepicker element
++ datepickerEl = angular.element(popupEl.children()[0]);
++ datepickerEl.attr('template-url', datepickerTemplateUrl);
++
++ if (isHtml5DateInput) {
++ if (attrs.type === 'month') {
++ datepickerEl.attr('datepicker-mode', '"month"');
++ datepickerEl.attr('min-mode', 'month');
++ }
++ }
++
++ if (attrs.datepickerOptions) {
++ var options = scope.$parent.$eval(attrs.datepickerOptions);
++ if (options && options.initDate) {
++ scope.initDate = dateParser.fromTimezone(options.initDate, ngModelOptions.timezone);
++ datepickerEl.attr('init-date', 'initDate');
++ delete options.initDate;
++ }
++ angular.forEach(options, function(value, option) {
++ datepickerEl.attr(cameltoDash(option), value);
++ });
++ }
++
++ angular.forEach(['minMode', 'maxMode'], function(key) {
++ if (attrs[key]) {
++ scope.$parent.$watch(function() { return attrs[key]; }, function(value) {
++ scope.watchData[key] = value;
++ });
++ datepickerEl.attr(cameltoDash(key), 'watchData.' + key);
++ }
++ });
++
++ angular.forEach(['datepickerMode', 'shortcutPropagation'], function(key) {
++ if (attrs[key]) {
++ var getAttribute = $parse(attrs[key]);
++ var propConfig = {
++ get: function() {
++ return getAttribute(scope.$parent);
++ }
++ };
++
++ datepickerEl.attr(cameltoDash(key), 'watchData.' + key);
++
++ // Propagate changes from datepicker to outside
++ if (key === 'datepickerMode') {
++ var setAttribute = getAttribute.assign;
++ propConfig.set = function(v) {
++ setAttribute(scope.$parent, v);
++ };
++ }
++
++ Object.defineProperty(scope.watchData, key, propConfig);
++ }
++ });
++
++ angular.forEach(['minDate', 'maxDate', 'initDate'], function(key) {
++ if (attrs[key]) {
++ var getAttribute = $parse(attrs[key]);
++
++ scope.$parent.$watch(getAttribute, function(value) {
++ if (key === 'minDate' || key === 'maxDate') {
++ cache[key] = angular.isDate(value) ? dateParser.fromTimezone(new Date(value), ngModelOptions.timezone) : new Date(dateFilter(value, 'medium'));
++ }
++
++ scope.watchData[key] = cache[key] || dateParser.fromTimezone(new Date(value), ngModelOptions.timezone);
++ });
++
++ datepickerEl.attr(cameltoDash(key), 'watchData.' + key);
++ }
++ });
++
++ if (attrs.dateDisabled) {
++ datepickerEl.attr('date-disabled', 'dateDisabled({ date: date, mode: mode })');
++ }
++
++ angular.forEach(['formatDay', 'formatMonth', 'formatYear', 'formatDayHeader', 'formatDayTitle', 'formatMonthTitle', 'showWeeks', 'startingDay', 'yearRows', 'yearColumns'], function(key) {
++ if (angular.isDefined(attrs[key])) {
++ datepickerEl.attr(cameltoDash(key), attrs[key]);
++ }
++ });
++
++ if (attrs.customClass) {
++ datepickerEl.attr('custom-class', 'customClass({ date: date, mode: mode })');
++ }
++
++ if (!isHtml5DateInput) {
++ // Internal API to maintain the correct ng-invalid-[key] class
++ ngModel.$$parserName = 'date';
++ ngModel.$validators.date = validator;
++ ngModel.$parsers.unshift(parseDate);
++ ngModel.$formatters.push(function(value) {
++ if (ngModel.$isEmpty(value)) {
++ scope.date = value;
++ return value;
++ }
++ scope.date = dateParser.fromTimezone(value, ngModelOptions.timezone);
++ return dateFilter(scope.date, dateFormat);
++ });
++ } else {
++ ngModel.$formatters.push(function(value) {
++ scope.date = dateParser.fromTimezone(value, ngModelOptions.timezone);
++ return value;
++ });
++ }
++
++ // Detect changes in the view from the text box
++ ngModel.$viewChangeListeners.push(function() {
++ scope.date = parseDateString(ngModel.$viewValue);
++ });
++
++ element.bind('keydown', inputKeydownBind);
++
++ $popup = $compile(popupEl)(scope);
++ // Prevent jQuery cache memory leak (template is now redundant after linking)
++ popupEl.remove();
++
++ if (appendToBody) {
++ $document.find('body').append($popup);
++ } else {
++ element.after($popup);
++ }
++
++ scope.$on('$destroy', function() {
++ if (scope.isOpen === true) {
++ if (!$rootScope.$$phase) {
++ scope.$apply(function() {
++ scope.isOpen = false;
++ });
++ }
++ }
++
++ $popup.remove();
++ element.unbind('keydown', inputKeydownBind);
++ $document.unbind('click', documentClickBind);
++ });
++ };
++
++ scope.getText = function(key) {
++ return scope[key + 'Text'] || datepickerPopupConfig[key + 'Text'];
++ };
++
++ scope.isDisabled = function(date) {
++ if (date === 'today') {
++ date = new Date();
++ }
++
++ return scope.watchData.minDate && scope.compare(date, cache.minDate) < 0 ||
++ scope.watchData.maxDate && scope.compare(date, cache.maxDate) > 0;
++ };
++
++ scope.compare = function(date1, date2) {
++ return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
++ };
++
++ // Inner change
++ scope.dateSelection = function(dt) {
++ if (angular.isDefined(dt)) {
++ scope.date = dt;
++ }
++ var date = scope.date ? dateFilter(scope.date, dateFormat) : null; // Setting to NULL is necessary for form validators to function
++ element.val(date);
++ ngModel.$setViewValue(date);
++
++ if (closeOnDateSelection) {
++ scope.isOpen = false;
++ element[0].focus();
++ }
++ };
++
++ scope.keydown = function(evt) {
++ if (evt.which === 27) {
++ evt.stopPropagation();
++ scope.isOpen = false;
++ element[0].focus();
++ }
++ };
++
++ scope.select = function(date) {
++ if (date === 'today') {
++ var today = new Date();
++ if (angular.isDate(scope.date)) {
++ date = new Date(scope.date);
++ date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate());
++ } else {
++ date = new Date(today.setHours(0, 0, 0, 0));
++ }
++ }
++ scope.dateSelection(date);
++ };
++
++ scope.close = function() {
++ scope.isOpen = false;
++ element[0].focus();
++ };
++
++ scope.disabled = angular.isDefined(attrs.disabled) || false;
++ if (attrs.ngDisabled) {
++ scope.$parent.$watch($parse(attrs.ngDisabled), function(disabled) {
++ scope.disabled = disabled;
++ });
++ }
++
++ scope.$watch('isOpen', function(value) {
++ if (value) {
++ if (!scope.disabled) {
++ scope.position = appendToBody ? $position.offset(element) : $position.position(element);
++ scope.position.top = scope.position.top + element.prop('offsetHeight');
++
++ $timeout(function() {
++ if (onOpenFocus) {
++ scope.$broadcast('uib:datepicker.focus');
++ }
++ $document.bind('click', documentClickBind);
++ }, 0, false);
++ } else {
++ scope.isOpen = false;
++ }
++ } else {
++ $document.unbind('click', documentClickBind);
++ }
++ });
++
++ function cameltoDash(string) {
++ return string.replace(/([A-Z])/g, function($1) { return '-' + $1.toLowerCase(); });
++ }
++
++ function parseDateString(viewValue) {
++ var date = dateParser.parse(viewValue, dateFormat, scope.date);
++ if (isNaN(date)) {
++ for (var i = 0; i < altInputFormats.length; i++) {
++ date = dateParser.parse(viewValue, altInputFormats[i], scope.date);
++ if (!isNaN(date)) {
++ return date;
++ }
++ }
++ }
++ return date;
++ }
++
++ function parseDate(viewValue) {
++ if (angular.isNumber(viewValue)) {
++ // presumably timestamp to date object
++ viewValue = new Date(viewValue);
++ }
++
++ if (!viewValue) {
++ return null;
++ }
++
++ if (angular.isDate(viewValue) && !isNaN(viewValue)) {
++ return viewValue;
++ }
++
++ if (angular.isString(viewValue)) {
++ var date = parseDateString(viewValue);
++ if (!isNaN(date)) {
++ return dateParser.toTimezone(date, ngModelOptions.timezone);
++ }
++ }
++
++ return ngModel.$options && ngModel.$options.allowInvalid ? viewValue : undefined;
++ }
++
++ function validator(modelValue, viewValue) {
++ var value = modelValue || viewValue;
++
++ if (!attrs.ngRequired && !value) {
++ return true;
++ }
++
++ if (angular.isNumber(value)) {
++ value = new Date(value);
++ }
++
++ if (!value) {
++ return true;
++ }
++
++ if (angular.isDate(value) && !isNaN(value)) {
++ return true;
++ }
++
++ if (angular.isString(value)) {
++ return !isNaN(parseDateString(viewValue));
++ }
++
++ return false;
++ }
++
++ function documentClickBind(event) {
++ if (!scope.isOpen && scope.disabled) {
++ return;
++ }
++
++ var popup = $popup[0];
++ var dpContainsTarget = element[0].contains(event.target);
++ // The popup node may not be an element node
++ // In some browsers (IE) only element nodes have the 'contains' function
++ var popupContainsTarget = popup.contains !== undefined && popup.contains(event.target);
++ if (scope.isOpen && !(dpContainsTarget || popupContainsTarget)) {
++ scope.$apply(function() {
++ scope.isOpen = false;
++ });
++ }
++ }
++
++ function inputKeydownBind(evt) {
++ if (evt.which === 27 && scope.isOpen) {
++ evt.preventDefault();
++ evt.stopPropagation();
++ scope.$apply(function() {
++ scope.isOpen = false;
++ });
++ element[0].focus();
++ } else if (evt.which === 40 && !scope.isOpen) {
++ evt.preventDefault();
++ evt.stopPropagation();
++ scope.$apply(function() {
++ scope.isOpen = true;
++ });
++ }
++ }
++ }])
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+
+ .directive('uibDatepickerPopup', function() {
+ return {
+ require: ['ngModel', 'uibDatepickerPopup'],
+ controller: 'UibDatepickerPopupController',
+ scope: {
++<<<<<<< HEAD
+ datepickerOptions: '=?',
+ isOpen: '=?',
+ currentText: '@',
+ clearText: '@',
+ closeText: '@'
++=======
++ isOpen: '=?',
++ currentText: '@',
++ clearText: '@',
++ closeText: '@',
++ dateDisabled: '&',
++ customClass: '&'
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ },
+ link: function(scope, element, attrs, ctrls) {
+ var ngModel = ctrls[0],
+ ctrl = ctrls[1];
+
+ ctrl.init(ngModel);
+ }
+ };
+ })
+
+ .directive('uibDatepickerPopupWrap', function() {
+ return {
+ replace: true,
+ transclude: true,
+ templateUrl: function(element, attrs) {
++<<<<<<< HEAD
+ return attrs.templateUrl || 'uib/template/datepickerPopup/popup.html';
++=======
++ return attrs.templateUrl || 'uib/template/datepicker/popup.html';
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ }
+ };
+ });
+
+ angular.module('ui.bootstrap.debounce', [])
+ /**
+ * A helper, internal service that debounces a function
+ */
+ .factory('$$debounce', ['$timeout', function($timeout) {
+ return function(callback, debounceTime) {
+ var timeoutPromise;
+
+ return function() {
+ var self = this;
+ var args = Array.prototype.slice.call(arguments);
+ if (timeoutPromise) {
+ $timeout.cancel(timeoutPromise);
+ }
+
+ timeoutPromise = $timeout(function() {
+ callback.apply(self, args);
+ }, debounceTime);
+ };
+ };
+ }]);
+
+ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position'])
+
+ .constant('uibDropdownConfig', {
+ appendToOpenClass: 'uib-dropdown-open',
+ openClass: 'open'
+ })
+
+ .service('uibDropdownService', ['$document', '$rootScope', function($document, $rootScope) {
+ var openScope = null;
++<<<<<<< HEAD
+ this.open = function(dropdownScope, element) {
+ if (!openScope) {
+ $document.on('click', closeDropdown);
+ element.on('keydown', keybindFilter);
++=======
+ this.open = function(dropdownScope) {
+ if (!openScope) {
+ $document.on('click', closeDropdown);
+ $document.on('keydown', keybindFilter);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
if (openScope && openScope !== dropdownScope) {
openScope = dropdownScope;
};
++<<<<<<< HEAD
+ this.close = function(dropdownScope, element) {
+ if (openScope === dropdownScope) {
+ openScope = null;
+ $document.off('click', closeDropdown);
+ element.off('keydown', keybindFilter);
++=======
+ this.close = function(dropdownScope) {
+ if (openScope === dropdownScope) {
+ openScope = null;
+ $document.off('click', closeDropdown);
+ $document.off('keydown', keybindFilter);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
var keybindFilter = function(evt) {
if (evt.which === 27) {
++<<<<<<< HEAD
+ evt.stopPropagation();
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
openScope.focusToggleElement();
closeDropdown();
} else if (openScope.isKeynavEnabled() && [38, 40].indexOf(evt.which) !== -1 && openScope.isOpen) {
};
this.toggle = function(open) {
++<<<<<<< HEAD
+ scope.isOpen = arguments.length ? !!open : !scope.isOpen;
+ if (angular.isFunction(setIsOpen)) {
+ setIsOpen(scope, scope.isOpen);
+ }
+
+ return scope.isOpen;
++=======
+ return scope.isOpen = arguments.length ? !!open : !scope.isOpen;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
};
// Allow other directives to watch status
if (appendTo && self.dropdownMenu) {
var pos = $position.positionElements($element, self.dropdownMenu, 'bottom-left', true),
css,
++<<<<<<< HEAD
+ rightalign,
+ scrollbarWidth;
++=======
+ rightalign;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
css = {
top: pos.top + 'px',
css.right = 'auto';
} else {
css.left = 'auto';
++<<<<<<< HEAD
+ scrollbarWidth = $position.scrollbarWidth(true);
+ css.right = window.innerWidth - scrollbarWidth -
++=======
+ css.right = window.innerWidth -
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
(pos.left + $element.prop('offsetWidth')) + 'px';
}
}
var openContainer = appendTo ? appendTo : $element;
++<<<<<<< HEAD
+ var hasOpenClass = openContainer.hasClass(appendTo ? appendToOpenClass : openClass);
+
+ if (hasOpenClass === !isOpen) {
+ $animate[isOpen ? 'addClass' : 'removeClass'](openContainer, appendTo ? appendToOpenClass : openClass).then(function() {
+ if (angular.isDefined(isOpen) && isOpen !== wasOpen) {
+ toggleInvoker($scope, { open: !!isOpen });
+ }
+ });
+ }
++=======
+
+ $animate[isOpen ? 'addClass' : 'removeClass'](openContainer, appendTo ? appendToOpenClass : openClass).then(function() {
+ if (angular.isDefined(isOpen) && isOpen !== wasOpen) {
+ toggleInvoker($scope, { open: !!isOpen });
+ }
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (isOpen) {
if (self.dropdownMenuTemplateUrl) {
}
scope.focusToggleElement();
++<<<<<<< HEAD
+ uibDropdownService.open(scope, $element);
++=======
+ uibDropdownService.open(scope);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
} else {
if (self.dropdownMenuTemplateUrl) {
if (templateScope) {
self.dropdownMenu = newEl;
}
++<<<<<<< HEAD
+ uibDropdownService.close(scope, $element);
++=======
+ uibDropdownService.close(scope);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
self.selectedOption = null;
}
setIsOpen($scope, isOpen);
}
});
++<<<<<<< HEAD
++=======
+
+ $scope.$on('$locationChangeSuccess', function() {
+ if (scope.getAutoClose() !== 'disabled') {
+ scope.isOpen = false;
+ }
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}])
.directive('uibDropdown', function() {
}
};
});
++<<<<<<< HEAD
+ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap', 'ui.bootstrap.position'])
++=======
+ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/**
* A helper, internal data structure that stores all references attached to key
*/
/**
* A helper directive for the $modal service. It creates a backdrop element.
*/
++<<<<<<< HEAD
+ .directive('uibModalBackdrop', ['$animate', '$injector', '$uibModalStack',
+ function($animate, $injector, $modalStack) {
++=======
+ .directive('uibModalBackdrop', ['$animateCss', '$injector', '$uibModalStack',
+ function($animateCss, $injector, $modalStack) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return {
replace: true,
templateUrl: 'uib/template/modal/backdrop.html',
function linkFn(scope, element, attrs) {
if (attrs.modalInClass) {
++<<<<<<< HEAD
+ $animate.addClass(element, attrs.modalInClass);
++=======
+ $animateCss(element, {
+ addClass: attrs.modalInClass
+ }).start();
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {
var done = setIsAsync();
if (scope.modalOptions.animation) {
++<<<<<<< HEAD
+ $animate.removeClass(element, attrs.modalInClass).then(done);
++=======
+ $animateCss(element, {
+ removeClass: attrs.modalInClass
+ }).start().then(done);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
} else {
done();
}
}
}])
++<<<<<<< HEAD
+ .directive('uibModalWindow', ['$uibModalStack', '$q', '$animateCss', '$document',
+ function($modalStack, $q, $animateCss, $document) {
++=======
+ .directive('uibModalWindow', ['$uibModalStack', '$q', '$animate', '$animateCss', '$document',
+ function($modalStack, $q, $animate, $animateCss, $document) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return {
scope: {
index: '@'
scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {
var done = setIsAsync();
++<<<<<<< HEAD
+ $animateCss(element, {
+ removeClass: attrs.modalInClass
+ }).start().then(done);
++=======
+ if ($animateCss) {
+ $animateCss(element, {
+ removeClass: attrs.modalInClass
+ }).start().then(done);
+ } else {
+ $animate.removeClass(element, attrs.modalInClass).then(done);
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
});
}
$q.when(animationPromise).then(function() {
++<<<<<<< HEAD
+ // Notify {@link $modalStack} that modal is rendered.
+ var modal = $modalStack.getTop();
+ if (modal) {
+ $modalStack.modalRendered(modal.key);
+ }
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/**
* If something within the freshly-opened modal already has focus (perhaps via a
* directive that causes focus). then no need to try and focus anything.
}
}
});
++<<<<<<< HEAD
++=======
+
+ // Notify {@link $modalStack} that modal is rendered.
+ var modal = $modalStack.getTop();
+ if (modal) {
+ $modalStack.modalRendered(modal.key);
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
});
}
};
})
.factory('$uibModalStack', ['$animate', '$animateCss', '$document',
++<<<<<<< HEAD
+ '$compile', '$rootScope', '$q', '$$multiMap', '$$stackedMap', '$uibPosition',
+ function($animate, $animateCss, $document, $compile, $rootScope, $q, $$multiMap, $$stackedMap, $uibPosition) {
++=======
+ '$compile', '$rootScope', '$q', '$$multiMap', '$$stackedMap',
+ function($animate, $animateCss, $document, $compile, $rootScope, $q, $$multiMap, $$stackedMap) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var OPENED_MODAL_CLASS = 'modal-open';
var backdropDomEl, backdropScope;
var $modalStack = {
NOW_CLOSING_EVENT: 'modal.stack.now-closing'
};
++<<<<<<< HEAD
+ var topModalIndex = 0;
+ var previousTopOpenedModal = null;
+
+ //Modal focus behavior
+ var tabableSelector = 'a[href], area[href], input:not([disabled]), ' +
+ 'button:not([disabled]),select:not([disabled]), textarea:not([disabled]), ' +
+ 'iframe, object, embed, *[tabindex], *[contenteditable=true]';
+ var scrollbarPadding;
+
+ function isVisible(element) {
+ return !!(element.offsetWidth ||
+ element.offsetHeight ||
+ element.getClientRects().length);
+ }
++=======
+
+ //Modal focus behavior
+ var focusableElementList;
+ var focusIndex = 0;
+ var tababbleSelector = 'a[href], area[href], input:not([disabled]), ' +
+ 'button:not([disabled]),select:not([disabled]), textarea:not([disabled]), ' +
+ 'iframe, object, embed, *[tabindex], *[contenteditable=true]';
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
function backdropIndex() {
var topBackdropIndex = -1;
topBackdropIndex = i;
}
}
++<<<<<<< HEAD
+
+ // If any backdrop exist, ensure that it's index is always
+ // right below the top modal
+ if (topBackdropIndex > -1 && topBackdropIndex < topModalIndex) {
+ topBackdropIndex = topModalIndex;
+ }
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return topBackdropIndex;
}
//clean up the stack
openedWindows.remove(modalInstance);
++<<<<<<< HEAD
+ previousTopOpenedModal = openedWindows.top();
+ if (previousTopOpenedModal) {
+ topModalIndex = parseInt(previousTopOpenedModal.value.modalDomEl.attr('index'), 10);
+ }
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
removeAfterAnimate(modalWindow.modalDomEl, modalWindow.modalScope, function() {
var modalBodyClass = modalWindow.openedClass || OPENED_MODAL_CLASS;
openedClasses.remove(modalBodyClass, modalInstance);
++<<<<<<< HEAD
+ var areAnyOpen = openedClasses.hasKey(modalBodyClass);
+ appendToElement.toggleClass(modalBodyClass, areAnyOpen);
+ if (!areAnyOpen && scrollbarPadding && scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) {
+ if (scrollbarPadding.originalRight) {
+ appendToElement.css({paddingRight: scrollbarPadding.originalRight + 'px'});
+ } else {
+ appendToElement.css({paddingRight: ''});
+ }
+ scrollbarPadding = null;
+ }
+ toggleTopWindowClass(true);
+ }, modalWindow.closedDeferred);
++=======
+ appendToElement.toggleClass(modalBodyClass, openedClasses.hasKey(modalBodyClass));
+ toggleTopWindowClass(true);
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
checkRemoveBackdrop();
//move focus to specified element if available, or else to body
}
afterAnimating.done = true;
++<<<<<<< HEAD
+ $animate.leave(domEl).then(function() {
++=======
+ $animateCss(domEl, {
+ event: 'leave'
+ }).start().then(function() {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
domEl.remove();
if (closedDeferred) {
closedDeferred.resolve();
break;
}
case 9: {
++<<<<<<< HEAD
+ var list = $modalStack.loadFocusElementList(modal);
+ var focusChanged = false;
+ if (evt.shiftKey) {
+ if ($modalStack.isFocusInFirstItem(evt, list) || $modalStack.isModalFocused(evt, modal)) {
+ focusChanged = $modalStack.focusLastFocusableElement(list);
+ }
+ } else {
+ if ($modalStack.isFocusInLastItem(evt, list)) {
+ focusChanged = $modalStack.focusFirstFocusableElement(list);
++=======
+ $modalStack.loadFocusElementList(modal);
+ var focusChanged = false;
+ if (evt.shiftKey) {
+ if ($modalStack.isFocusInFirstItem(evt)) {
+ focusChanged = $modalStack.focusLastFocusableElement();
+ }
+ } else {
+ if ($modalStack.isFocusInLastItem(evt)) {
+ focusChanged = $modalStack.focusFirstFocusableElement();
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
}
evt.preventDefault();
evt.stopPropagation();
}
++<<<<<<< HEAD
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
break;
}
}
toggleTopWindowClass(false);
++<<<<<<< HEAD
+ // Store the current top first, to determine what index we ought to use
+ // for the current top modal
+ previousTopOpenedModal = openedWindows.top();
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
openedWindows.add(modalInstance, {
deferred: modal.deferred,
renderDeferred: modal.renderDeferred,
}
$compile(backdropDomEl)(backdropScope);
$animate.enter(backdropDomEl, appendToElement);
++<<<<<<< HEAD
+ scrollbarPadding = $uibPosition.scrollbarPadding(appendToElement);
+ if (scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) {
+ appendToElement.css({paddingRight: scrollbarPadding.right + 'px'});
+ }
+ }
+
+ // Set the top modal index based on the index of the previous top modal
+ topModalIndex = previousTopOpenedModal ? parseInt(previousTopOpenedModal.value.modalDomEl.attr('index'), 10) + 1 : 0;
++=======
+ }
+
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var angularDomEl = angular.element('<div uib-modal-window="modal-window"></div>');
angularDomEl.attr({
'template-url': modal.windowTemplateUrl,
'window-class': modal.windowClass,
'window-top-class': modal.windowTopClass,
'size': modal.size,
++<<<<<<< HEAD
+ 'index': topModalIndex,
++=======
+ 'index': openedWindows.length() - 1,
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
'animate': 'animate'
}).html(modal.content);
if (modal.animation) {
angularDomEl.attr('modal-animation', 'true');
}
++<<<<<<< HEAD
+ appendToElement.addClass(modalBodyClass);
+ $animate.enter($compile(angularDomEl)(modal.scope), appendToElement);
+
+ openedWindows.top().value.modalDomEl = angularDomEl;
+ openedWindows.top().value.modalOpener = modalOpener;
++=======
+ $animate.enter(angularDomEl, appendToElement)
+ .then(function() {
+ $compile(angularDomEl)(modal.scope);
+ $animate.addClass(appendToElement, modalBodyClass);
+ });
+
+ openedWindows.top().value.modalDomEl = angularDomEl;
+ openedWindows.top().value.modalOpener = modalOpener;
+
+ $modalStack.clearFocusListCache();
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
};
function broadcastClosing(modalWindow, resultOrReason, closing) {
}
};
++<<<<<<< HEAD
+ $modalStack.focusFirstFocusableElement = function(list) {
+ if (list.length > 0) {
+ list[0].focus();
++=======
+ $modalStack.focusFirstFocusableElement = function() {
+ if (focusableElementList.length > 0) {
+ focusableElementList[0].focus();
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return true;
}
return false;
};
++<<<<<<< HEAD
+
+ $modalStack.focusLastFocusableElement = function(list) {
+ if (list.length > 0) {
+ list[list.length - 1].focus();
++=======
+ $modalStack.focusLastFocusableElement = function() {
+ if (focusableElementList.length > 0) {
+ focusableElementList[focusableElementList.length - 1].focus();
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return true;
}
return false;
};
++<<<<<<< HEAD
+ $modalStack.isModalFocused = function(evt, modalWindow) {
+ if (evt && modalWindow) {
+ var modalDomEl = modalWindow.value.modalDomEl;
+ if (modalDomEl && modalDomEl.length) {
+ return (evt.target || evt.srcElement) === modalDomEl[0];
+ }
++=======
+ $modalStack.isFocusInFirstItem = function(evt) {
+ if (focusableElementList.length > 0) {
+ return (evt.target || evt.srcElement) === focusableElementList[0];
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
return false;
};
++<<<<<<< HEAD
+ $modalStack.isFocusInFirstItem = function(evt, list) {
+ if (list.length > 0) {
+ return (evt.target || evt.srcElement) === list[0];
++=======
+ $modalStack.isFocusInLastItem = function(evt) {
+ if (focusableElementList.length > 0) {
+ return (evt.target || evt.srcElement) === focusableElementList[focusableElementList.length - 1];
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ }
+ return false;
+ };
+
++<<<<<<< HEAD
+ $modalStack.isFocusInLastItem = function(evt, list) {
+ if (list.length > 0) {
+ return (evt.target || evt.srcElement) === list[list.length - 1];
}
return false;
};
+ $modalStack.loadFocusElementList = function(modalWindow) {
+ if (modalWindow) {
+ var modalDomE1 = modalWindow.value.modalDomEl;
+ if (modalDomE1 && modalDomE1.length) {
+ var elements = modalDomE1[0].querySelectorAll(tabableSelector);
+ return elements ?
+ Array.prototype.filter.call(elements, function(element) {
+ return isVisible(element);
+ }) : elements;
++=======
+ $modalStack.clearFocusListCache = function() {
+ focusableElementList = [];
+ focusIndex = 0;
+ };
+
+ $modalStack.loadFocusElementList = function(modalWindow) {
+ if (focusableElementList === undefined || !focusableElementList.length) {
+ if (modalWindow) {
+ var modalDomE1 = modalWindow.value.modalDomEl;
+ if (modalDomE1 && modalDomE1.length) {
+ focusableElementList = modalDomE1[0].querySelectorAll(tababbleSelector);
+ }
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
}
};
}
});
++<<<<<<< HEAD
+ var ctrlInstance, ctrlInstantiate, ctrlLocals = {};
++=======
+ var ctrlInstance, ctrlLocals = {};
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
//controllers
if (modalOptions.controller) {
ctrlLocals.$scope = modalScope;
++<<<<<<< HEAD
+ ctrlLocals.$scope.$resolve = {};
+ ctrlLocals.$uibModalInstance = modalInstance;
+ angular.forEach(tplAndVars[1], function(value, key) {
+ ctrlLocals[key] = value;
+ ctrlLocals.$scope.$resolve[key] = value;
+ });
+
+ // the third param will make the controller instantiate later,private api
+ // @see https://github.com/angular/angular.js/blob/master/src/ng/controller.js#L126
+ ctrlInstantiate = $controller(modalOptions.controller, ctrlLocals, true, modalOptions.controllerAs);
+ if (modalOptions.controllerAs && modalOptions.bindToController) {
+ ctrlInstance = ctrlInstantiate.instance;
+ ctrlInstance.$close = modalScope.$close;
+ ctrlInstance.$dismiss = modalScope.$dismiss;
+ angular.extend(ctrlInstance, {
+ $resolve: ctrlLocals.$scope.$resolve
+ }, providedScope);
+ }
+
+ ctrlInstance = ctrlInstantiate();
+
+ if (angular.isFunction(ctrlInstance.$onInit)) {
+ ctrlInstance.$onInit();
++=======
+ ctrlLocals.$uibModalInstance = modalInstance;
+ angular.forEach(tplAndVars[1], function(value, key) {
+ ctrlLocals[key] = value;
+ });
+
+ ctrlInstance = $controller(modalOptions.controller, ctrlLocals);
+ if (modalOptions.controllerAs) {
+ if (modalOptions.bindToController) {
+ ctrlInstance.$close = modalScope.$close;
+ ctrlInstance.$dismiss = modalScope.$dismiss;
+ angular.extend(ctrlInstance, providedScope);
+ }
+
+ modalScope[modalOptions.controllerAs] = ctrlInstance;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
}
create: function(ctrl, $scope, $attrs) {
ctrl.setNumPages = $attrs.numPages ? $parse($attrs.numPages).assign : angular.noop;
ctrl.ngModelCtrl = { $setViewValue: angular.noop }; // nullModelCtrl
++<<<<<<< HEAD
+ ctrl._watchers = [];
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
ctrl.init = function(ngModelCtrl, config) {
ctrl.ngModelCtrl = ngModelCtrl;
};
if ($attrs.itemsPerPage) {
++<<<<<<< HEAD
+ ctrl._watchers.push($scope.$parent.$watch($attrs.itemsPerPage, function(value) {
+ ctrl.itemsPerPage = parseInt(value, 10);
+ $scope.totalPages = ctrl.calculateTotalPages();
+ ctrl.updatePage();
+ }));
++=======
+ $scope.$parent.$watch($parse($attrs.itemsPerPage), function(value) {
+ ctrl.itemsPerPage = parseInt(value, 10);
+ $scope.totalPages = ctrl.calculateTotalPages();
+ ctrl.updatePage();
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
} else {
ctrl.itemsPerPage = config.itemsPerPage;
}
ctrl.ngModelCtrl.$render();
}
};
++<<<<<<< HEAD
+
+ $scope.$on('$destroy', function() {
+ while (ctrl._watchers.length) {
+ ctrl._watchers.shift()();
+ }
+ });
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
}]);
var maxSize = angular.isDefined($attrs.maxSize) ? $scope.$parent.$eval($attrs.maxSize) : uibPaginationConfig.maxSize,
rotate = angular.isDefined($attrs.rotate) ? $scope.$parent.$eval($attrs.rotate) : uibPaginationConfig.rotate,
forceEllipses = angular.isDefined($attrs.forceEllipses) ? $scope.$parent.$eval($attrs.forceEllipses) : uibPaginationConfig.forceEllipses,
++<<<<<<< HEAD
+ boundaryLinkNumbers = angular.isDefined($attrs.boundaryLinkNumbers) ? $scope.$parent.$eval($attrs.boundaryLinkNumbers) : uibPaginationConfig.boundaryLinkNumbers,
+ pageLabel = angular.isDefined($attrs.pageLabel) ? function(idx) { return $scope.$parent.$eval($attrs.pageLabel, {$page: idx}); } : angular.identity;
++=======
+ boundaryLinkNumbers = angular.isDefined($attrs.boundaryLinkNumbers) ? $scope.$parent.$eval($attrs.boundaryLinkNumbers) : uibPaginationConfig.boundaryLinkNumbers;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
$scope.boundaryLinks = angular.isDefined($attrs.boundaryLinks) ? $scope.$parent.$eval($attrs.boundaryLinks) : uibPaginationConfig.boundaryLinks;
$scope.directionLinks = angular.isDefined($attrs.directionLinks) ? $scope.$parent.$eval($attrs.directionLinks) : uibPaginationConfig.directionLinks;
uibPaging.create(this, $scope, $attrs);
if ($attrs.maxSize) {
++<<<<<<< HEAD
+ ctrl._watchers.push($scope.$parent.$watch($parse($attrs.maxSize), function(value) {
+ maxSize = parseInt(value, 10);
+ ctrl.render();
+ }));
++=======
+ $scope.$parent.$watch($parse($attrs.maxSize), function(value) {
+ maxSize = parseInt(value, 10);
+ ctrl.render();
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
// Create page object used in template
// Add page number links
for (var number = startPage; number <= endPage; number++) {
++<<<<<<< HEAD
+ var page = makePage(number, pageLabel(number), number === currentPage);
++=======
+ var page = makePage(number, number, number === currentPage);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
pages.push(page);
}
/**
* This allows you to extend the set of trigger mappings available. E.g.:
*
++<<<<<<< HEAD
+ * $tooltipProvider.setTriggers( { 'openTrigger': 'closeTrigger' } );
++=======
+ * $tooltipProvider.setTriggers( 'openTrigger': 'closeTrigger' );
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
*/
this.setTriggers = function setTriggers(triggers) {
angular.extend(triggerMap, triggers);
var startSym = $interpolate.startSymbol();
var endSym = $interpolate.endSymbol();
var template =
++<<<<<<< HEAD
+ '<div '+ directiveName + '-popup ' +
+ 'uib-title="' + startSym + 'title' + endSym + '" ' +
+ (options.useContentExp ?
+ 'content-exp="contentExp()" ' :
+ 'content="' + startSym + 'content' + endSym + '" ') +
+ 'placement="' + startSym + 'placement' + endSym + '" ' +
+ 'popup-class="' + startSym + 'popupClass' + endSym + '" ' +
+ 'animation="animation" ' +
+ 'is-open="isOpen" ' +
+ 'origin-scope="origScope" ' +
+ 'class="uib-position-measure"' +
++=======
+ '<div '+ directiveName + '-popup '+
+ 'title="' + startSym + 'title' + endSym + '" '+
+ (options.useContentExp ?
+ 'content-exp="contentExp()" ' :
+ 'content="' + startSym + 'content' + endSym + '" ') +
+ 'placement="' + startSym + 'placement' + endSym + '" '+
+ 'popup-class="' + startSym + 'popupClass' + endSym + '" '+
+ 'animation="animation" ' +
+ 'is-open="isOpen"' +
+ 'origin-scope="origScope" ' +
+ 'style="visibility: hidden; display: block; top: -9999px; left: -9999px;"' +
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
'>' +
'</div>';
var isOpenParse = angular.isDefined(attrs[prefix + 'IsOpen']) ? $parse(attrs[prefix + 'IsOpen']) : false;
var contentParse = options.useContentExp ? $parse(attrs[ttType]) : false;
var observers = [];
++<<<<<<< HEAD
+ var lastPlacement;
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var positionTooltip = function() {
// check if tooltip exists and is not empty
if (!positionTimeout) {
positionTimeout = $timeout(function() {
++<<<<<<< HEAD
+ var ttPosition = $position.positionElements(element, tooltip, ttScope.placement, appendToBody);
+ tooltip.css({ top: ttPosition.top + 'px', left: ttPosition.left + 'px' });
+
+ if (!tooltip.hasClass(ttPosition.placement.split('-')[0])) {
+ tooltip.removeClass(lastPlacement.split('-')[0]);
+ tooltip.addClass(ttPosition.placement.split('-')[0]);
+ }
+
+ if (!tooltip.hasClass(options.placementClassPrefix + ttPosition.placement)) {
+ tooltip.removeClass(options.placementClassPrefix + lastPlacement);
+ tooltip.addClass(options.placementClassPrefix + ttPosition.placement);
+ }
+
+ // first time through tt element will have the
+ // uib-position-measure class or if the placement
+ // has changed we need to position the arrow.
+ if (tooltip.hasClass('uib-position-measure')) {
+ $position.positionArrow(tooltip, ttPosition.placement);
+ tooltip.removeClass('uib-position-measure');
+ } else if (lastPlacement !== ttPosition.placement) {
+ $position.positionArrow(tooltip, ttPosition.placement);
+ }
+ lastPlacement = ttPosition.placement;
++=======
+ // Reset the positioning.
+ tooltip.css({ top: 0, left: 0 });
+
+ // Now set the calculated positioning.
+ var ttPosition = $position.positionElements(element, tooltip, ttScope.placement, appendToBody);
+ tooltip.css({ top: ttPosition.top + 'px', left: ttPosition.left + 'px', visibility: 'visible' });
+
+ // If the placement class is prefixed, still need
+ // to remove the TWBS standard class.
+ if (options.placementClassPrefix) {
+ tooltip.removeClass('top bottom left right');
+ }
+
+ tooltip.removeClass(
+ options.placementClassPrefix + 'top ' +
+ options.placementClassPrefix + 'top-left ' +
+ options.placementClassPrefix + 'top-right ' +
+ options.placementClassPrefix + 'bottom ' +
+ options.placementClassPrefix + 'bottom-left ' +
+ options.placementClassPrefix + 'bottom-right ' +
+ options.placementClassPrefix + 'left ' +
+ options.placementClassPrefix + 'left-top ' +
+ options.placementClassPrefix + 'left-bottom ' +
+ options.placementClassPrefix + 'right ' +
+ options.placementClassPrefix + 'right-top ' +
+ options.placementClassPrefix + 'right-bottom');
+
+ var placement = ttPosition.placement.split('-');
+ tooltip.addClass(placement[0], options.placementClassPrefix + ttPosition.placement);
+ $position.positionArrow(tooltip, ttPosition.placement);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
positionTimeout = null;
}, 0, false);
// First things first: we don't show it anymore.
ttScope.$evalAsync(function() {
++<<<<<<< HEAD
+ if (ttScope) {
+ ttScope.isOpen = false;
+ assignIsOpen(false);
+ // And now we remove it from the DOM. However, if we have animation, we
+ // need to wait for it to expire beforehand.
+ // FIXME: this is a placeholder for a port of the transitions library.
+ // The fade transition in TWBS is 150ms.
+ if (ttScope.animation) {
+ if (!transitionTimeout) {
+ transitionTimeout = $timeout(removeTooltip, 150, false);
+ }
+ } else {
+ removeTooltip();
+ }
++=======
+ ttScope.isOpen = false;
+ assignIsOpen(false);
+ // And now we remove it from the DOM. However, if we have animation, we
+ // need to wait for it to expire beforehand.
+ // FIXME: this is a placeholder for a port of the transitions library.
+ // The fade transition in TWBS is 150ms.
+ if (ttScope.animation) {
+ if (!transitionTimeout) {
+ transitionTimeout = $timeout(removeTooltip, 150, false);
+ }
+ } else {
+ removeTooltip();
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
});
}
$timeout.cancel(hideTimeout);
hideTimeout = null;
}
++<<<<<<< HEAD
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (transitionTimeout) {
$timeout.cancel(transitionTimeout);
transitionTimeout = null;
ttScope.popupClass = attrs[prefix + 'Class'];
ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;
++<<<<<<< HEAD
+ var placement = $position.parsePlacement(ttScope.placement);
+ lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);
var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);
appendToBody = angular.isDefined(appendToBodyVal) ? appendToBodyVal : appendToBody;
++<<<<<<< HEAD
++=======
+ // if a tooltip is attached to <body> we need to remove it on
+ // location change as its parent scope will probably not be destroyed
+ // by the change.
+ if (appendToBody) {
+ scope.$on('$locationChangeSuccess', function closeTooltipOnLocationChangeSuccess() {
+ if (ttScope.isOpen) {
+ hide();
+ }
+ });
+ }
+
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
// Make sure tooltip is destroyed and removed.
scope.$on('$destroy', function onDestroyTooltip() {
unregisterTriggers();
// // in TWBS, so we need the primary position.
var position = $uibPosition.parsePlacement(scope.placement);
element.addClass(position[0]);
++<<<<<<< HEAD
++=======
+ } else {
+ element.addClass('top');
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
if (scope.popupClass) {
.directive('uibPopoverTemplatePopup', function() {
return {
replace: true,
++<<<<<<< HEAD
+ scope: { uibTitle: '@', contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&',
++=======
+ scope: { title: '@', contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&',
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
originScope: '&' },
templateUrl: 'uib/template/popover/popover-template.html'
};
.directive('uibPopoverHtmlPopup', function() {
return {
replace: true,
++<<<<<<< HEAD
+ scope: { contentExp: '&', uibTitle: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },
++=======
+ scope: { contentExp: '&', title: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
templateUrl: 'uib/template/popover/popover-html.html'
};
})
.directive('uibPopoverPopup', function() {
return {
replace: true,
++<<<<<<< HEAD
+ scope: { uibTitle: '@', content: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },
++=======
+ scope: { title: '@', content: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
templateUrl: 'uib/template/popover/popover.html'
};
})
animate = angular.isDefined($attrs.animate) ? $scope.$parent.$eval($attrs.animate) : progressConfig.animate;
this.bars = [];
++<<<<<<< HEAD
+ $scope.max = getMaxOrDefault();
++=======
+ $scope.max = angular.isDefined($scope.max) ? $scope.max : progressConfig.max;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
this.addBar = function(bar, element, attrs) {
if (!animate) {
this.bars.push(bar);
++<<<<<<< HEAD
+ bar.max = getMaxOrDefault();
++=======
+ bar.max = $scope.max;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
bar.title = attrs && angular.isDefined(attrs.title) ? attrs.title : 'progressbar';
bar.$watch('value', function(value) {
});
};
++<<<<<<< HEAD
+ //$attrs.$observe('maxParam', function(maxParam) {
+ $scope.$watch('maxParam', function(maxParam) {
+ self.bars.forEach(function(bar) {
+ bar.max = getMaxOrDefault();
+ bar.recalculatePercentage();
+ });
+ });
+
+ function getMaxOrDefault () {
+ return angular.isDefined($scope.maxParam) ? $scope.maxParam : progressConfig.max;
+ }
++=======
+ $scope.$watch('max', function(max) {
+ self.bars.forEach(function(bar) {
+ bar.max = $scope.max;
+ bar.recalculatePercentage();
+ });
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}])
.directive('uibProgress', function() {
controller: 'UibProgressController',
require: 'uibProgress',
scope: {
++<<<<<<< HEAD
+ maxParam: '=?max'
++=======
+ max: '=?'
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
templateUrl: 'uib/template/progressbar/progress.html'
};
controller: 'UibProgressController',
scope: {
value: '=',
++<<<<<<< HEAD
+ maxParam: '=?max',
++=======
+ max: '=?',
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
type: '@'
},
templateUrl: 'uib/template/progressbar/progressbar.html',
max: 5,
stateOn: null,
stateOff: null,
++<<<<<<< HEAD
+ enableReset: true,
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
titles : ['one', 'two', 'three', 'four', 'five']
})
.controller('UibRatingController', ['$scope', '$attrs', 'uibRatingConfig', function($scope, $attrs, ratingConfig) {
++<<<<<<< HEAD
+ var ngModelCtrl = { $setViewValue: angular.noop },
+ self = this;
++=======
+ var ngModelCtrl = { $setViewValue: angular.noop };
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
this.init = function(ngModelCtrl_) {
ngModelCtrl = ngModelCtrl_;
this.stateOn = angular.isDefined($attrs.stateOn) ? $scope.$parent.$eval($attrs.stateOn) : ratingConfig.stateOn;
this.stateOff = angular.isDefined($attrs.stateOff) ? $scope.$parent.$eval($attrs.stateOff) : ratingConfig.stateOff;
++<<<<<<< HEAD
+ this.enableReset = angular.isDefined($attrs.enableReset) ?
+ $scope.$parent.$eval($attrs.enableReset) : ratingConfig.enableReset;
+ var tmpTitles = angular.isDefined($attrs.titles) ? $scope.$parent.$eval($attrs.titles) : ratingConfig.titles;
++=======
+ var tmpTitles = angular.isDefined($attrs.titles) ? $scope.$parent.$eval($attrs.titles) : ratingConfig.titles ;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
this.titles = angular.isArray(tmpTitles) && tmpTitles.length > 0 ?
tmpTitles : ratingConfig.titles;
$scope.rate = function(value) {
if (!$scope.readonly && value >= 0 && value <= $scope.range.length) {
++<<<<<<< HEAD
+ var newViewValue = self.enableReset && ngModelCtrl.$viewValue === value ? 0 : value;
+ ngModelCtrl.$setViewValue(newViewValue);
++=======
+ ngModelCtrl.$setViewValue(ngModelCtrl.$viewValue === value ? 0 : value);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
ngModelCtrl.$render();
}
};
this.render = function() {
$scope.value = ngModelCtrl.$viewValue;
++<<<<<<< HEAD
+ $scope.title = self.getTitle($scope.value - 1);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
};
}])
return {
require: ['uibRating', 'ngModel'],
scope: {
++<<<<<<< HEAD
+ readonly: '=?readOnly',
++=======
+ readonly: '=?',
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
onHover: '&',
onLeave: '&'
},
.controller('UibTabsetController', ['$scope', function ($scope) {
var ctrl = this,
++<<<<<<< HEAD
+ oldIndex;
+ ctrl.tabs = [];
+
+ ctrl.select = function(index, evt) {
+ if (!destroyed) {
+ var previousIndex = findTabIndex(oldIndex);
+ var previousSelected = ctrl.tabs[previousIndex];
+ if (previousSelected) {
+ previousSelected.tab.onDeselect({
+ $event: evt,
+ $selectedIndex: index
+ });
+ if (evt && evt.isDefaultPrevented()) {
+ return;
+ }
+ previousSelected.tab.active = false;
+ }
+
+ var selected = ctrl.tabs[index];
+ if (selected) {
+ selected.tab.onSelect({
+ $event: evt
+ });
+ selected.tab.active = true;
+ ctrl.active = selected.index;
+ oldIndex = selected.index;
+ } else if (!selected && angular.isDefined(oldIndex)) {
+ ctrl.active = null;
+ oldIndex = null;
+ }
++=======
+ tabs = ctrl.tabs = $scope.tabs = [];
+
+ ctrl.select = function(selectedTab) {
+ angular.forEach(tabs, function(tab) {
+ if (tab.active && tab !== selectedTab) {
+ tab.active = false;
+ tab.onDeselect();
+ selectedTab.selectCalled = false;
+ }
+ });
+ selectedTab.active = true;
+ // only call select if it has not already been called
+ if (!selectedTab.selectCalled) {
+ selectedTab.onSelect();
+ selectedTab.selectCalled = true;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
ctrl.addTab = function addTab(tab) {
++<<<<<<< HEAD
+ ctrl.tabs.push({
+ tab: tab,
+ index: tab.index
+ });
+ ctrl.tabs.sort(function(t1, t2) {
+ if (t1.index > t2.index) {
+ return 1;
+ }
+
+ if (t1.index < t2.index) {
+ return -1;
+ }
+
+ return 0;
+ });
+
+ if (tab.index === ctrl.active || !angular.isDefined(ctrl.active) && ctrl.tabs.length === 1) {
+ var newActiveIndex = findTabIndex(tab.index);
+ ctrl.select(newActiveIndex);
++=======
+ tabs.push(tab);
+ // we can't run the select function on the first tab
+ // since that would select it twice
+ if (tabs.length === 1 && tab.active !== false) {
+ tab.active = true;
+ } else if (tab.active) {
+ ctrl.select(tab);
+ } else {
+ tab.active = false;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
ctrl.removeTab = function removeTab(tab) {
++<<<<<<< HEAD
+ var index;
+ for (var i = 0; i < ctrl.tabs.length; i++) {
+ if (ctrl.tabs[i].tab === tab) {
+ index = i;
+ break;
+ }
+ }
+
+ if (ctrl.tabs[index].index === ctrl.active) {
+ var newActiveTabIndex = index === ctrl.tabs.length - 1 ?
+ index - 1 : index + 1 % ctrl.tabs.length;
+ ctrl.select(newActiveTabIndex);
+ }
+
+ ctrl.tabs.splice(index, 1);
+ };
+
+ $scope.$watch('tabset.active', function(val) {
+ if (angular.isDefined(val) && val !== oldIndex) {
+ ctrl.select(findTabIndex(val));
+ }
+ });
+
++=======
+ var index = tabs.indexOf(tab);
+ //Select a new tab if the tab to be removed is selected and not destroyed
+ if (tab.active && tabs.length > 1 && !destroyed) {
+ //If this is the last tab, select the previous tab. else, the next tab.
+ var newActiveIndex = index === tabs.length - 1 ? index - 1 : index + 1;
+ ctrl.select(tabs[newActiveIndex]);
+ }
+ tabs.splice(index, 1);
+ };
+
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var destroyed;
$scope.$on('$destroy', function() {
destroyed = true;
});
++<<<<<<< HEAD
+
+ function findTabIndex(index) {
+ for (var i = 0; i < ctrl.tabs.length; i++) {
+ if (ctrl.tabs[i].index === index) {
+ return i;
+ }
+ }
+ }
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}])
.directive('uibTabset', function() {
return {
transclude: true,
replace: true,
++<<<<<<< HEAD
+ scope: {},
+ bindToController: {
+ active: '=?',
+ type: '@'
+ },
+ controller: 'UibTabsetController',
+ controllerAs: 'tabset',
+ templateUrl: function(element, attrs) {
+ return attrs.templateUrl || 'uib/template/tabs/tabset.html';
+ },
+ link: function(scope, element, attrs) {
+ scope.vertical = angular.isDefined(attrs.vertical) ?
+ scope.$parent.$eval(attrs.vertical) : false;
+ scope.justified = angular.isDefined(attrs.justified) ?
+ scope.$parent.$eval(attrs.justified) : false;
++=======
+ scope: {
+ type: '@'
+ },
+ controller: 'UibTabsetController',
+ templateUrl: 'uib/template/tabs/tabset.html',
+ link: function(scope, element, attrs) {
+ scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false;
+ scope.justified = angular.isDefined(attrs.justified) ? scope.$parent.$eval(attrs.justified) : false;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
})
return {
require: '^uibTabset',
replace: true,
++<<<<<<< HEAD
+ templateUrl: function(element, attrs) {
+ return attrs.templateUrl || 'uib/template/tabs/tab.html';
+ },
+ transclude: true,
+ scope: {
+ heading: '@',
+ index: '=?',
+ classes: '@?',
++=======
+ templateUrl: 'uib/template/tabs/tab.html',
+ transclude: true,
+ scope: {
+ active: '=?',
+ heading: '@',
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
onSelect: '&select', //This callback is called in contentHeadingTransclude
//once it inserts the tab's content into the dom
onDeselect: '&deselect'
},
controllerAs: 'tab',
link: function(scope, elm, attrs, tabsetCtrl, transclude) {
++<<<<<<< HEAD
++=======
+ scope.$watch('active', function(active) {
+ if (active) {
+ tabsetCtrl.select(scope);
+ }
+ });
+
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
scope.disabled = false;
if (attrs.disable) {
scope.$parent.$watch($parse(attrs.disable), function(value) {
});
}
++<<<<<<< HEAD
+ if (angular.isUndefined(attrs.index)) {
+ if (tabsetCtrl.tabs && tabsetCtrl.tabs.length) {
+ scope.index = Math.max.apply(null, tabsetCtrl.tabs.map(function(t) { return t.index; })) + 1;
+ } else {
+ scope.index = 0;
+ }
+ }
+
+ if (angular.isUndefined(attrs.classes)) {
+ scope.classes = '';
+ }
+
+ scope.select = function(evt) {
+ if (!scope.disabled) {
+ var index;
+ for (var i = 0; i < tabsetCtrl.tabs.length; i++) {
+ if (tabsetCtrl.tabs[i].tab === scope) {
+ index = i;
+ break;
+ }
+ }
+
+ tabsetCtrl.select(index, evt);
++=======
+ scope.select = function() {
+ if (!scope.disabled) {
+ scope.active = true;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
};
restrict: 'A',
require: '^uibTabset',
link: function(scope, elm, attrs) {
++<<<<<<< HEAD
+ var tab = scope.$eval(attrs.uibTabContentTransclude).tab;
++=======
+ var tab = scope.$eval(attrs.uibTabContentTransclude);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
//Now our tab is ready to be transcluded: both the tab heading area
//and the tab content area are loaded. Transclude 'em both.
node.hasAttribute('x-uib-tab-heading') ||
node.tagName.toLowerCase() === 'uib-tab-heading' ||
node.tagName.toLowerCase() === 'data-uib-tab-heading' ||
++<<<<<<< HEAD
+ node.tagName.toLowerCase() === 'x-uib-tab-heading' ||
+ node.tagName.toLowerCase() === 'uib:tab-heading'
++=======
+ node.tagName.toLowerCase() === 'x-uib-tab-heading'
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
);
}
});
readonlyInput: false,
mousewheel: true,
arrowkeys: true,
++<<<<<<< HEAD
+ showSpinners: true,
+ templateUrl: 'uib/template/timepicker/timepicker.html'
++=======
+ showSpinners: true
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
})
.controller('UibTimepickerController', ['$scope', '$element', '$attrs', '$parse', '$log', '$locale', 'uibTimepickerConfig', function($scope, $element, $attrs, $parse, $log, $locale, timepickerConfig) {
var selected = new Date(),
++<<<<<<< HEAD
+ watchers = [],
+ ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl
+ meridians = angular.isDefined($attrs.meridians) ? $scope.$parent.$eval($attrs.meridians) : timepickerConfig.meridians || $locale.DATETIME_FORMATS.AMPMS,
+ padHours = angular.isDefined($attrs.padHours) ? $scope.$parent.$eval($attrs.padHours) : true;
++=======
+ ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl
+ meridians = angular.isDefined($attrs.meridians) ? $scope.$parent.$eval($attrs.meridians) : timepickerConfig.meridians || $locale.DATETIME_FORMATS.AMPMS;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
$scope.tabindex = angular.isDefined($attrs.tabindex) ? $attrs.tabindex : 0;
$element.removeAttr('tabindex');
var hourStep = timepickerConfig.hourStep;
if ($attrs.hourStep) {
++<<<<<<< HEAD
+ watchers.push($scope.$parent.$watch($parse($attrs.hourStep), function(value) {
+ hourStep = +value;
+ }));
++=======
+ $scope.$parent.$watch($parse($attrs.hourStep), function(value) {
+ hourStep = parseInt(value, 10);
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
var minuteStep = timepickerConfig.minuteStep;
if ($attrs.minuteStep) {
++<<<<<<< HEAD
+ watchers.push($scope.$parent.$watch($parse($attrs.minuteStep), function(value) {
+ minuteStep = +value;
+ }));
+ }
+
+ var min;
+ watchers.push($scope.$parent.$watch($parse($attrs.min), function(value) {
+ var dt = new Date(value);
+ min = isNaN(dt) ? undefined : dt;
+ }));
+
+ var max;
+ watchers.push($scope.$parent.$watch($parse($attrs.max), function(value) {
+ var dt = new Date(value);
+ max = isNaN(dt) ? undefined : dt;
+ }));
+
+ var disabled = false;
+ if ($attrs.ngDisabled) {
+ watchers.push($scope.$parent.$watch($parse($attrs.ngDisabled), function(value) {
+ disabled = value;
+ }));
++=======
+ $scope.$parent.$watch($parse($attrs.minuteStep), function(value) {
+ minuteStep = parseInt(value, 10);
+ });
+ }
+
+ var min;
+ $scope.$parent.$watch($parse($attrs.min), function(value) {
+ var dt = new Date(value);
+ min = isNaN(dt) ? undefined : dt;
+ });
+
+ var max;
+ $scope.$parent.$watch($parse($attrs.max), function(value) {
+ var dt = new Date(value);
+ max = isNaN(dt) ? undefined : dt;
+ });
+
+ var disabled = false;
+ if ($attrs.ngDisabled) {
+ $scope.$parent.$watch($parse($attrs.ngDisabled), function(value) {
+ disabled = value;
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
$scope.noIncrementHours = function() {
var secondStep = timepickerConfig.secondStep;
if ($attrs.secondStep) {
++<<<<<<< HEAD
+ watchers.push($scope.$parent.$watch($parse($attrs.secondStep), function(value) {
+ secondStep = +value;
+ }));
++=======
+ $scope.$parent.$watch($parse($attrs.secondStep), function(value) {
+ secondStep = parseInt(value, 10);
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
$scope.showSeconds = timepickerConfig.showSeconds;
if ($attrs.showSeconds) {
++<<<<<<< HEAD
+ watchers.push($scope.$parent.$watch($parse($attrs.showSeconds), function(value) {
+ $scope.showSeconds = !!value;
+ }));
++=======
+ $scope.$parent.$watch($parse($attrs.showSeconds), function(value) {
+ $scope.showSeconds = !!value;
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
// 12H / 24H mode
$scope.showMeridian = timepickerConfig.showMeridian;
if ($attrs.showMeridian) {
++<<<<<<< HEAD
+ watchers.push($scope.$parent.$watch($parse($attrs.showMeridian), function(value) {
++=======
+ $scope.$parent.$watch($parse($attrs.showMeridian), function(value) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
$scope.showMeridian = !!value;
if (ngModelCtrl.$error.time) {
} else {
updateTemplate();
}
++<<<<<<< HEAD
+ }));
++=======
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
}
// Get $scope.hours in 24H mode if valid
function getHoursFromTemplate() {
++<<<<<<< HEAD
+ var hours = +$scope.hours;
+ var valid = $scope.showMeridian ? hours > 0 && hours < 13 :
+ hours >= 0 && hours < 24;
+ if (!valid || $scope.hours === '') {
++=======
+ var hours = parseInt($scope.hours, 10);
+ var valid = $scope.showMeridian ? hours > 0 && hours < 13 :
+ hours >= 0 && hours < 24;
+ if (!valid) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return undefined;
}
}
function getMinutesFromTemplate() {
++<<<<<<< HEAD
+ var minutes = +$scope.minutes;
+ var valid = minutes >= 0 && minutes < 60;
+ if (!valid || $scope.minutes === '') {
+ return undefined;
+ }
+ return minutes;
+ }
+
+ function getSecondsFromTemplate() {
+ var seconds = +$scope.seconds;
+ return seconds >= 0 && seconds < 60 ? seconds : undefined;
+ }
+
+ function pad(value, noPad) {
++=======
+ var minutes = parseInt($scope.minutes, 10);
+ return minutes >= 0 && minutes < 60 ? minutes : undefined;
+ }
+
+ function getSecondsFromTemplate() {
+ var seconds = parseInt($scope.seconds, 10);
+ return seconds >= 0 && seconds < 60 ? seconds : undefined;
+ }
+
+ function pad(value) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (value === null) {
return '';
}
++<<<<<<< HEAD
+ return angular.isDefined(value) && value.toString().length < 2 && !noPad ?
++=======
+ return angular.isDefined(value) && value.toString().length < 2 ?
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
'0' + value : value.toString();
}
hoursInputEl.bind('blur', function(e) {
ngModelCtrl.$setTouched();
++<<<<<<< HEAD
+ if (modelIsEmpty()) {
+ makeValid();
+ } else if ($scope.hours === null || $scope.hours === '') {
+ invalidate(true);
+ } else if (!$scope.invalidHours && $scope.hours < 10) {
+ $scope.$apply(function() {
+ $scope.hours = pad($scope.hours, !padHours);
++=======
+ if ($scope.hours === null || $scope.hours === '') {
+ invalidate(true);
+ } else if (!$scope.invalidHours && $scope.hours < 10) {
+ $scope.$apply(function() {
+ $scope.hours = pad($scope.hours);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
});
}
});
minutesInputEl.bind('blur', function(e) {
ngModelCtrl.$setTouched();
++<<<<<<< HEAD
+ if (modelIsEmpty()) {
+ makeValid();
+ } else if ($scope.minutes === null) {
++=======
+ if ($scope.minutes === null) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
invalidate(undefined, true);
} else if (!$scope.invalidMinutes && $scope.minutes < 10) {
$scope.$apply(function() {
};
secondsInputEl.bind('blur', function(e) {
++<<<<<<< HEAD
+ if (modelIsEmpty()) {
+ makeValid();
+ } else if (!$scope.invalidSeconds && $scope.seconds < 10) {
++=======
+ if (!$scope.invalidSeconds && $scope.seconds < 10) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
$scope.$apply( function() {
$scope.seconds = pad($scope.seconds);
});
hours = hours === 0 || hours === 12 ? 12 : hours % 12; // Convert 24 to 12 hour system
}
++<<<<<<< HEAD
+ $scope.hours = keyboardChange === 'h' ? hours : pad(hours, !padHours);
++=======
+ $scope.hours = keyboardChange === 'h' ? hours : pad(hours);
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
if (keyboardChange !== 'm') {
$scope.minutes = pad(minutes);
}
return newDate;
}
++<<<<<<< HEAD
+ function modelIsEmpty() {
+ return ($scope.hours === null || $scope.hours === '') &&
+ ($scope.minutes === null || $scope.minutes === '') &&
+ (!$scope.showSeconds || $scope.showSeconds && ($scope.seconds === null || $scope.seconds === ''));
+ }
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
$scope.showSpinners = angular.isDefined($attrs.showSpinners) ?
$scope.$parent.$eval($attrs.showSpinners) : timepickerConfig.showSpinners;
$scope.blur = function() {
ngModelCtrl.$setTouched();
};
++<<<<<<< HEAD
+
+ $scope.$on('$destroy', function() {
+ while (watchers.length) {
+ watchers.shift()();
+ }
+ });
+ }])
+
+ .directive('uibTimepicker', ['uibTimepickerConfig', function(uibTimepickerConfig) {
++=======
+ }])
+
+ .directive('uibTimepicker', function() {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
return {
require: ['uibTimepicker', '?^ngModel'],
controller: 'UibTimepickerController',
replace: true,
scope: {},
templateUrl: function(element, attrs) {
++<<<<<<< HEAD
+ return attrs.templateUrl || uibTimepickerConfig.templateUrl;
++=======
+ return attrs.templateUrl || 'uib/template/timepicker/timepicker.html';
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
},
link: function(scope, element, attrs, ctrls) {
var timepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1];
}
}
};
++<<<<<<< HEAD
+ }]);
++=======
+ });
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap.position'])
minLength = 1;
}
++<<<<<<< HEAD
+ originalScope.$watch(attrs.typeaheadMinLength, function (newVal) {
+ minLength = !newVal && newVal !== 0 ? 1 : newVal;
+ });
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
//minimal wait time after last character typed before typeahead kicks-in
var waitTime = originalScope.$eval(attrs.typeaheadWaitMs) || 0;
//binding to a variable that indicates if matches are being retrieved asynchronously
var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop;
++<<<<<<< HEAD
+ //a function to determine if an event should cause selection
+ var isSelectEvent = attrs.typeaheadShouldSelect ? $parse(attrs.typeaheadShouldSelect) : function(scope, vals) {
+ var evt = vals.$event;
+ return evt.which === 13 || evt.which === 9;
+ };
+
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
//a callback executed when a match is selected
var onSelectCallback = $parse(attrs.typeaheadOnSelect);
element.after(inputsContainer);
hintInputElem = element.clone();
hintInputElem.attr('placeholder', '');
++<<<<<<< HEAD
+ hintInputElem.attr('tabindex', '-1');
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
hintInputElem.val('');
hintInputElem.css({
'position': 'absolute',
model: matches[i]
});
}
-
- scope.query = inputValue;
- //position pop-up with matches - we need to re-calculate its position each time we are opening a window
- //with matches as a pop-up might be absolute-positioned and position of an input might have changed on a page
- //due to other elements being rendered
- recalculatePosition();
-
- element.attr('aria-expanded', true);
-
- //Select the single remaining option if user input matches
- if (selectOnExact && scope.matches.length === 1 && inputIsExactMatch(inputValue, 0)) {
- if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) {
- $$debounce(function() {
- scope.select(0, evt);
- }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']);
- } else {
- scope.select(0, evt);
- }
+
+ scope.query = inputValue;
+ //position pop-up with matches - we need to re-calculate its position each time we are opening a window
+ //with matches as a pop-up might be absolute-positioned and position of an input might have changed on a page
+ //due to other elements being rendered
+ recalculatePosition();
+
+ element.attr('aria-expanded', true);
+
+ //Select the single remaining option if user input matches
+ if (selectOnExact && scope.matches.length === 1 && inputIsExactMatch(inputValue, 0)) {
+ if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) {
+ $$debounce(function() {
+ scope.select(0, evt);
+ }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']);
+ } else {
+ scope.select(0, evt);
+ }
+ }
+
+ if (showHint) {
+ var firstLabel = scope.matches[0].label;
++<<<<<<< HEAD
+ if (angular.isString(inputValue) &&
+ inputValue.length > 0 &&
+ firstLabel.slice(0, inputValue.length).toUpperCase() === inputValue.toUpperCase()) {
+ hintInputElem.val(inputValue + firstLabel.slice(inputValue.length));
+ } else {
++=======
++ if (inputValue.length > 0 && firstLabel.slice(0, inputValue.length).toUpperCase() === inputValue.toUpperCase()) {
++ hintInputElem.val(inputValue + firstLabel.slice(inputValue.length));
++ }
++ else {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ hintInputElem.val('');
+ }
+ }
+ } else {
+ resetMatches();
+ isNoResultsSetter(originalScope, true);
+ }
+ }
+ if (onCurrentRequest) {
+ isLoadingSetter(originalScope, false);
+ }
+ }, function() {
+ resetMatches();
+ isLoadingSetter(originalScope, false);
+ isNoResultsSetter(originalScope, true);
+ });
+ };
+
+ // bind events only if appendToBody params exist - performance feature
+ if (appendToBody) {
+ angular.element($window).on('resize', fireRecalculating);
+ $document.find('body').on('scroll', fireRecalculating);
+ }
+
+ // Declare the debounced function outside recalculating for
+ // proper debouncing
+ var debouncedRecalculate = $$debounce(function() {
+ // if popup is visible
+ if (scope.matches.length) {
+ recalculatePosition();
+ }
+
+ scope.moveInProgress = false;
+ }, eventDebounceTime);
+
+ // Default progress type
+ scope.moveInProgress = false;
+
+ function fireRecalculating() {
+ if (!scope.moveInProgress) {
+ scope.moveInProgress = true;
+ scope.$digest();
+ }
+
+ debouncedRecalculate();
+ }
+
+ // recalculate actual position and set new values to scope
+ // after digest loop is popup in right position
+ function recalculatePosition() {
+ scope.position = appendToBody ? $position.offset(element) : $position.position(element);
+ scope.position.top += element.prop('offsetHeight');
+ }
+
+ //we need to propagate user's query so we can higlight matches
+ scope.query = undefined;
+
+ //Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later
+ var timeoutPromise;
+
+ var scheduleSearchWithTimeout = function(inputValue) {
+ timeoutPromise = $timeout(function() {
+ getMatchesAsync(inputValue);
+ }, waitTime);
+ };
+
+ var cancelPreviousTimeout = function() {
+ if (timeoutPromise) {
+ $timeout.cancel(timeoutPromise);
+ }
+ };
+
+ resetMatches();
+
+ scope.assignIsOpen = function (isOpen) {
+ isOpenSetter(originalScope, isOpen);
+ };
+
+ scope.select = function(activeIdx, evt) {
+ //called from within the $digest() cycle
+ var locals = {};
+ var model, item;
+
+ selected = true;
+ locals[parserResult.itemName] = item = scope.matches[activeIdx].model;
+ model = parserResult.modelMapper(originalScope, locals);
+ $setModelValue(originalScope, model);
+ modelCtrl.$setValidity('editable', true);
+ modelCtrl.$setValidity('parse', true);
+
+ onSelectCallback(originalScope, {
+ $item: item,
+ $model: model,
+ $label: parserResult.viewMapper(originalScope, locals),
+ $event: evt
+ });
+
+ resetMatches();
+
+ //return focus to the input element if a match was selected via a mouse click event
+ // use timeout to avoid $rootScope:inprog error
+ if (scope.$eval(attrs.typeaheadFocusOnSelect) !== false) {
+ $timeout(function() { element[0].focus(); }, 0, false);
+ }
+ };
+
+ //bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(27)
+ element.on('keydown', function(evt) {
+ //typeahead is open and an "interesting" key was pressed
+ if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) {
+ return;
+ }
+
++<<<<<<< HEAD
+ var shouldSelect = isSelectEvent(originalScope, {$event: evt});
+
+ /**
+ * if there's nothing selected (i.e. focusFirst) and enter or tab is hit
+ * or
+ * shift + tab is pressed to bring focus to the previous element
+ * then clear the results
+ */
+ if (scope.activeIdx === -1 && shouldSelect || evt.which === 9 && !!evt.shiftKey) {
++=======
++ // if there's nothing selected (i.e. focusFirst) and enter or tab is hit, clear the results
++ if (scope.activeIdx === -1 && (evt.which === 9 || evt.which === 13)) {
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ resetMatches();
+ scope.$digest();
+ return;
+ }
+
+ evt.preventDefault();
++<<<<<<< HEAD
+ var target;
+ switch (evt.which) {
+ case 27: // escape
+ evt.stopPropagation();
+
+ resetMatches();
+ originalScope.$digest();
+ break;
+ case 38: // up arrow
+ scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;
+ scope.$digest();
+ target = popUpEl.find('li')[scope.activeIdx];
+ target.parentNode.scrollTop = target.offsetTop;
+ break;
+ case 40: // down arrow
+ scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length;
+ scope.$digest();
+ target = popUpEl.find('li')[scope.activeIdx];
+ target.parentNode.scrollTop = target.offsetTop;
+ break;
+ default:
+ if (shouldSelect) {
+ scope.$apply(function() {
+ if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) {
+ $$debounce(function() {
+ scope.select(scope.activeIdx, evt);
+ }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']);
+ } else {
+ scope.select(scope.activeIdx, evt);
+ }
+ });
+ }
++=======
++
++ switch (evt.which) {
++ case 9:
++ case 13:
++ scope.$apply(function () {
++ if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) {
++ $$debounce(function() {
++ scope.select(scope.activeIdx, evt);
++ }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']);
++ } else {
++ scope.select(scope.activeIdx, evt);
++ }
++ });
++ break;
++ case 27:
++ evt.stopPropagation();
++
++ resetMatches();
++ scope.$digest();
++ break;
++ case 38:
++ scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;
++ scope.$digest();
++ popUpEl.find('li')[scope.activeIdx].scrollIntoView(false);
++ break;
++ case 40:
++ scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length;
++ scope.$digest();
++ popUpEl.find('li')[scope.activeIdx].scrollIntoView(false);
++ break;
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ }
+ });
+
+ element.bind('focus', function (evt) {
+ hasFocus = true;
+ if (minLength === 0 && !modelCtrl.$viewValue) {
+ $timeout(function() {
+ getMatchesAsync(modelCtrl.$viewValue, evt);
+ }, 0);
+ }
+ });
+
+ element.bind('blur', function(evt) {
+ if (isSelectOnBlur && scope.matches.length && scope.activeIdx !== -1 && !selected) {
+ selected = true;
+ scope.$apply(function() {
+ if (angular.isObject(scope.debounceUpdate) && angular.isNumber(scope.debounceUpdate.blur)) {
+ $$debounce(function() {
+ scope.select(scope.activeIdx, evt);
+ }, scope.debounceUpdate.blur);
+ } else {
+ scope.select(scope.activeIdx, evt);
+ }
+ });
+ }
+ if (!isEditable && modelCtrl.$error.editable) {
++<<<<<<< HEAD
+ modelCtrl.$setViewValue();
+ // Reset validity as we are clearing
+ modelCtrl.$setValidity('editable', true);
+ modelCtrl.$setValidity('parse', true);
++=======
++ modelCtrl.$viewValue = '';
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ element.val('');
+ }
+ hasFocus = false;
+ selected = false;
+ });
+
+ // Keep reference to click handler to unbind it.
+ var dismissClickHandler = function(evt) {
+ // Issue #3973
+ // Firefox treats right click as a click on document
+ if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) {
+ resetMatches();
+ if (!$rootScope.$$phase) {
++<<<<<<< HEAD
+ originalScope.$digest();
++=======
++ scope.$digest();
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+ }
+ }
+ };
+
+ $document.on('click', dismissClickHandler);
+
+ originalScope.$on('$destroy', function() {
+ $document.off('click', dismissClickHandler);
+ if (appendToBody || appendTo) {
+ $popup.remove();
+ }
+
+ if (appendToBody) {
+ angular.element($window).off('resize', fireRecalculating);
+ $document.find('body').off('scroll', fireRecalculating);
+ }
+ // Prevent jQuery cache memory leak
+ popUpEl.remove();
+
+ if (showHint) {
+ inputsContainer.remove();
+ }
+ });
+
+ var $popup = $compile(popUpEl)(scope);
+
+ if (appendToBody) {
+ $document.find('body').append($popup);
+ } else if (appendTo) {
+ angular.element(appendTo).eq(0).append($popup);
+ } else {
+ element.after($popup);
+ }
+
+ this.init = function(_modelCtrl, _ngModelOptions) {
+ modelCtrl = _modelCtrl;
+ ngModelOptions = _ngModelOptions;
+
+ scope.debounceUpdate = modelCtrl.$options && $parse(modelCtrl.$options.debounce)(originalScope);
+
+ //plug into $parsers pipeline to open a typeahead on view changes initiated from DOM
+ //$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue
+ modelCtrl.$parsers.unshift(function(inputValue) {
+ hasFocus = true;
+
+ if (minLength === 0 || inputValue && inputValue.length >= minLength) {
+ if (waitTime > 0) {
+ cancelPreviousTimeout();
+ scheduleSearchWithTimeout(inputValue);
+ } else {
+ getMatchesAsync(inputValue);
+ }
+ } else {
+ isLoadingSetter(originalScope, false);
+ cancelPreviousTimeout();
+ resetMatches();
+ }
+
+ if (isEditable) {
+ return inputValue;
+ }
+
+ if (!inputValue) {
+ // Reset in case user had typed something previously.
+ modelCtrl.$setValidity('editable', true);
+ return null;
+ }
+
+ modelCtrl.$setValidity('editable', false);
+ return undefined;
+ });
+
+ modelCtrl.$formatters.push(function(modelValue) {
+ var candidateViewValue, emptyViewValue;
+ var locals = {};
+
+ // The validity may be set to false via $parsers (see above) if
+ // the model is restricted to selected values. If the model
+ // is set manually it is considered to be valid.
+ if (!isEditable) {
+ modelCtrl.$setValidity('editable', true);
+ }
+
+ if (inputFormatter) {
+ locals.$model = modelValue;
+ return inputFormatter(originalScope, locals);
+ }
+
+ //it might happen that we don't have enough info to properly render input value
+ //we need to check for this situation and simply return model value if we can't apply custom formatting
+ locals[parserResult.itemName] = modelValue;
+ candidateViewValue = parserResult.viewMapper(originalScope, locals);
+ locals[parserResult.itemName] = undefined;
+ emptyViewValue = parserResult.viewMapper(originalScope, locals);
+
+ return candidateViewValue !== emptyViewValue ? candidateViewValue : modelValue;
+ });
+ };
+ }])
+
+ .directive('uibTypeahead', function() {
+ return {
+ controller: 'UibTypeaheadController',
+ require: ['ngModel', '^?ngModelOptions', 'uibTypeahead'],
+ link: function(originalScope, element, attrs, ctrls) {
+ ctrls[2].init(ctrls[0], ctrls[1]);
+ }
+ };
+ })
+
+ .directive('uibTypeaheadPopup', ['$$debounce', function($$debounce) {
+ return {
+ scope: {
+ matches: '=',
+ query: '=',
+ active: '=',
+ position: '&',
+ moveInProgress: '=',
+ select: '&',
+ assignIsOpen: '&',
+ debounce: '&'
+ },
+ replace: true,
+ templateUrl: function(element, attrs) {
++<<<<<<< HEAD
+ return attrs.popupTemplateUrl || 'uib/template/typeahead/typeahead-popup.html';
+ },
+ link: function(scope, element, attrs) {
+ scope.templateUrl = attrs.templateUrl;
+
+ scope.isOpen = function() {
+ var isDropdownOpen = scope.matches.length > 0;
+ scope.assignIsOpen({ isOpen: isDropdownOpen });
+ return isDropdownOpen;
+ };
+
+ scope.isActive = function(matchIdx) {
+ return scope.active === matchIdx;
+ };
+
+ scope.selectActive = function(matchIdx) {
+ scope.active = matchIdx;
+ };
+
+ scope.selectMatch = function(activeIdx, evt) {
+ var debounce = scope.debounce();
+ if (angular.isNumber(debounce) || angular.isObject(debounce)) {
+ $$debounce(function() {
+ scope.select({activeIdx: activeIdx, evt: evt});
+ }, angular.isNumber(debounce) ? debounce : debounce['default']);
+ } else {
+ scope.select({activeIdx: activeIdx, evt: evt});
+ }
+ };
+ }
+ };
+ }])
+
+ .directive('uibTypeaheadMatch', ['$templateRequest', '$compile', '$parse', function($templateRequest, $compile, $parse) {
+ return {
+ scope: {
+ index: '=',
+ match: '=',
+ query: '='
+ },
+ link: function(scope, element, attrs) {
+ var tplUrl = $parse(attrs.templateUrl)(scope.$parent) || 'uib/template/typeahead/typeahead-match.html';
+ $templateRequest(tplUrl).then(function(tplContent) {
+ var tplEl = angular.element(tplContent.trim());
+ element.replaceWith(tplEl);
+ $compile(tplEl)(scope);
+ });
+ }
+ };
+ }])
+
+ .filter('uibTypeaheadHighlight', ['$sce', '$injector', '$log', function($sce, $injector, $log) {
+ var isSanitizePresent;
+ isSanitizePresent = $injector.has('$sanitize');
+
+ function escapeRegexp(queryToEscape) {
+ // Regex: capture the whole query string and replace it with the string that will be used to match
+ // the results, for example if the capture is "a" the result will be \a
+ return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
+ }
+
+ function containsHtml(matchItem) {
+ return /<.*>/g.test(matchItem);
+ }
+
+ return function(matchItem, query) {
+ if (!isSanitizePresent && containsHtml(matchItem)) {
+ $log.warn('Unsafe use of typeahead please use ngSanitize'); // Warn the user about the danger
+ }
+ matchItem = query ? ('' + matchItem).replace(new RegExp(escapeRegexp(query), 'gi'), '<strong>$&</strong>') : matchItem; // Replaces the capture string with a the same string inside of a "strong" tag
+ if (!isSanitizePresent) {
+ matchItem = $sce.trustAsHtml(matchItem); // If $sanitize is not present we pack the string in a $sce object for the ng-bind-html directive
+ }
+ return matchItem;
+ };
+ }]);
+
+ angular.module("uib/template/accordion/accordion-group.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/accordion/accordion-group.html",
+ "<div class=\"panel\" ng-class=\"panelClass || 'panel-default'\">\n" +
+ " <div role=\"tab\" id=\"{{::headingId}}\" aria-selected=\"{{isOpen}}\" class=\"panel-heading\" ng-keypress=\"toggleOpen($event)\">\n" +
+ " <h4 class=\"panel-title\">\n" +
+ " <a role=\"button\" data-toggle=\"collapse\" href aria-expanded=\"{{isOpen}}\" aria-controls=\"{{::panelId}}\" tabindex=\"0\" class=\"accordion-toggle\" ng-click=\"toggleOpen()\" uib-accordion-transclude=\"heading\"><span uib-accordion-header ng-class=\"{'text-muted': isDisabled}\">{{heading}}</span></a>\n" +
+ " </h4>\n" +
+ " </div>\n" +
+ " <div id=\"{{::panelId}}\" aria-labelledby=\"{{::headingId}}\" aria-hidden=\"{{!isOpen}}\" role=\"tabpanel\" class=\"panel-collapse collapse\" uib-collapse=\"!isOpen\">\n" +
+ " <div class=\"panel-body\" ng-transclude></div>\n" +
+ " </div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/accordion/accordion.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/accordion/accordion.html",
+ "<div role=\"tablist\" class=\"panel-group\" ng-transclude></div>");
+ }]);
+
+ angular.module("uib/template/alert/alert.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/alert/alert.html",
+ "<div class=\"alert\" ng-class=\"['alert-' + (type || 'warning'), closeable ? 'alert-dismissible' : null]\" role=\"alert\">\n" +
+ " <button ng-show=\"closeable\" type=\"button\" class=\"close\" ng-click=\"close({$event: $event})\">\n" +
+ " <span aria-hidden=\"true\">×</span>\n" +
+ " <span class=\"sr-only\">Close</span>\n" +
+ " </button>\n" +
+ " <div ng-transclude></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/carousel/carousel.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/carousel/carousel.html",
+ "<div ng-mouseenter=\"pause()\" ng-mouseleave=\"play()\" class=\"carousel\" ng-swipe-right=\"prev()\" ng-swipe-left=\"next()\">\n" +
+ " <div class=\"carousel-inner\" ng-transclude></div>\n" +
+ " <a role=\"button\" href class=\"left carousel-control\" ng-click=\"prev()\" ng-class=\"{ disabled: isPrevDisabled() }\" ng-show=\"slides.length > 1\">\n" +
+ " <span aria-hidden=\"true\" class=\"glyphicon glyphicon-chevron-left\"></span>\n" +
+ " <span class=\"sr-only\">previous</span>\n" +
+ " </a>\n" +
+ " <a role=\"button\" href class=\"right carousel-control\" ng-click=\"next()\" ng-class=\"{ disabled: isNextDisabled() }\" ng-show=\"slides.length > 1\">\n" +
+ " <span aria-hidden=\"true\" class=\"glyphicon glyphicon-chevron-right\"></span>\n" +
+ " <span class=\"sr-only\">next</span>\n" +
+ " </a>\n" +
+ " <ol class=\"carousel-indicators\" ng-show=\"slides.length > 1\">\n" +
+ " <li ng-repeat=\"slide in slides | orderBy:indexOfSlide track by $index\" ng-class=\"{ active: isActive(slide) }\" ng-click=\"select(slide)\">\n" +
+ " <span class=\"sr-only\">slide {{ $index + 1 }} of {{ slides.length }}<span ng-if=\"isActive(slide)\">, currently active</span></span>\n" +
+ " </li>\n" +
+ " </ol>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/carousel/slide.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/carousel/slide.html",
+ "<div ng-class=\"{\n" +
+ " 'active': active\n" +
+ " }\" class=\"item text-center\" ng-transclude></div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/datepicker/datepicker.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/datepicker/datepicker.html",
+ "<div class=\"uib-datepicker\" ng-switch=\"datepickerMode\" role=\"application\" ng-keydown=\"keydown($event)\">\n" +
+ " <uib-daypicker ng-switch-when=\"day\" tabindex=\"0\"></uib-daypicker>\n" +
+ " <uib-monthpicker ng-switch-when=\"month\" tabindex=\"0\"></uib-monthpicker>\n" +
+ " <uib-yearpicker ng-switch-when=\"year\" tabindex=\"0\"></uib-yearpicker>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/datepicker/day.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/datepicker/day.html",
+ "<table class=\"uib-daypicker\" role=\"grid\" aria-labelledby=\"{{::uniqueId}}-title\" aria-activedescendant=\"{{activeDateId}}\">\n" +
+ " <thead>\n" +
+ " <tr>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left uib-left\" ng-click=\"move(-1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
+ " <th colspan=\"{{::5 + showWeeks}}\"><button id=\"{{::uniqueId}}-title\" role=\"heading\" aria-live=\"assertive\" aria-atomic=\"true\" type=\"button\" class=\"btn btn-default btn-sm uib-title\" ng-click=\"toggleMode()\" ng-disabled=\"datepickerMode === maxMode\" tabindex=\"-1\"><strong>{{title}}</strong></button></th>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right uib-right\" ng-click=\"move(1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
+ " </tr>\n" +
+ " <tr>\n" +
+ " <th ng-if=\"showWeeks\" class=\"text-center\"></th>\n" +
+ " <th ng-repeat=\"label in ::labels track by $index\" class=\"text-center\"><small aria-label=\"{{::label.full}}\">{{::label.abbr}}</small></th>\n" +
+ " </tr>\n" +
+ " </thead>\n" +
+ " <tbody>\n" +
+ " <tr class=\"uib-weeks\" ng-repeat=\"row in rows track by $index\">\n" +
+ " <td ng-if=\"showWeeks\" class=\"text-center h6\"><em>{{ weekNumbers[$index] }}</em></td>\n" +
+ " <td ng-repeat=\"dt in row\" class=\"uib-day text-center\" role=\"gridcell\"\n" +
+ " id=\"{{::dt.uid}}\"\n" +
+ " ng-class=\"::dt.customClass\">\n" +
+ " <button type=\"button\" class=\"btn btn-default btn-sm\"\n" +
+ " uib-is-class=\"\n" +
+ " 'btn-info' for selectedDt,\n" +
+ " 'active' for activeDt\n" +
+ " on dt\"\n" +
+ " ng-click=\"select(dt.date)\"\n" +
+ " ng-disabled=\"::dt.disabled\"\n" +
+ " tabindex=\"-1\"><span ng-class=\"::{'text-muted': dt.secondary, 'text-info': dt.current}\">{{::dt.label}}</span></button>\n" +
+ " </td>\n" +
+ " </tr>\n" +
+ " </tbody>\n" +
+ "</table>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/datepicker/month.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/datepicker/month.html",
+ "<table class=\"uib-monthpicker\" role=\"grid\" aria-labelledby=\"{{::uniqueId}}-title\" aria-activedescendant=\"{{activeDateId}}\">\n" +
+ " <thead>\n" +
+ " <tr>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left uib-left\" ng-click=\"move(-1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
+ " <th><button id=\"{{::uniqueId}}-title\" role=\"heading\" aria-live=\"assertive\" aria-atomic=\"true\" type=\"button\" class=\"btn btn-default btn-sm uib-title\" ng-click=\"toggleMode()\" ng-disabled=\"datepickerMode === maxMode\" tabindex=\"-1\"><strong>{{title}}</strong></button></th>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right uib-right\" ng-click=\"move(1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
+ " </tr>\n" +
+ " </thead>\n" +
+ " <tbody>\n" +
+ " <tr class=\"uib-months\" ng-repeat=\"row in rows track by $index\">\n" +
+ " <td ng-repeat=\"dt in row\" class=\"uib-month text-center\" role=\"gridcell\"\n" +
+ " id=\"{{::dt.uid}}\"\n" +
+ " ng-class=\"::dt.customClass\">\n" +
+ " <button type=\"button\" class=\"btn btn-default\"\n" +
+ " uib-is-class=\"\n" +
+ " 'btn-info' for selectedDt,\n" +
+ " 'active' for activeDt\n" +
+ " on dt\"\n" +
+ " ng-click=\"select(dt.date)\"\n" +
+ " ng-disabled=\"::dt.disabled\"\n" +
+ " tabindex=\"-1\"><span ng-class=\"::{'text-info': dt.current}\">{{::dt.label}}</span></button>\n" +
+ " </td>\n" +
+ " </tr>\n" +
+ " </tbody>\n" +
+ "</table>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/datepicker/year.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/datepicker/year.html",
+ "<table class=\"uib-yearpicker\" role=\"grid\" aria-labelledby=\"{{::uniqueId}}-title\" aria-activedescendant=\"{{activeDateId}}\">\n" +
+ " <thead>\n" +
+ " <tr>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left uib-left\" ng-click=\"move(-1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
+ " <th colspan=\"{{::columns - 2}}\"><button id=\"{{::uniqueId}}-title\" role=\"heading\" aria-live=\"assertive\" aria-atomic=\"true\" type=\"button\" class=\"btn btn-default btn-sm uib-title\" ng-click=\"toggleMode()\" ng-disabled=\"datepickerMode === maxMode\" tabindex=\"-1\"><strong>{{title}}</strong></button></th>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right uib-right\" ng-click=\"move(1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
+ " </tr>\n" +
+ " </thead>\n" +
+ " <tbody>\n" +
+ " <tr class=\"uib-years\" ng-repeat=\"row in rows track by $index\">\n" +
+ " <td ng-repeat=\"dt in row\" class=\"uib-year text-center\" role=\"gridcell\"\n" +
+ " id=\"{{::dt.uid}}\"\n" +
+ " ng-class=\"::dt.customClass\">\n" +
+ " <button type=\"button\" class=\"btn btn-default\"\n" +
+ " uib-is-class=\"\n" +
+ " 'btn-info' for selectedDt,\n" +
+ " 'active' for activeDt\n" +
+ " on dt\"\n" +
+ " ng-click=\"select(dt.date)\"\n" +
+ " ng-disabled=\"::dt.disabled\"\n" +
+ " tabindex=\"-1\"><span ng-class=\"::{'text-info': dt.current}\">{{::dt.label}}</span></button>\n" +
+ " </td>\n" +
+ " </tr>\n" +
+ " </tbody>\n" +
+ "</table>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/datepickerPopup/popup.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/datepickerPopup/popup.html",
+ "<div>\n" +
+ " <ul class=\"uib-datepicker-popup dropdown-menu uib-position-measure\" dropdown-nested ng-if=\"isOpen\" ng-keydown=\"keydown($event)\" ng-click=\"$event.stopPropagation()\">\n" +
+ " <li ng-transclude></li>\n" +
+ " <li ng-if=\"showButtonBar\" class=\"uib-button-bar\">\n" +
+ " <span class=\"btn-group pull-left\">\n" +
+ " <button type=\"button\" class=\"btn btn-sm btn-info uib-datepicker-current\" ng-click=\"select('today', $event)\" ng-disabled=\"isDisabled('today')\">{{ getText('current') }}</button>\n" +
+ " <button type=\"button\" class=\"btn btn-sm btn-danger uib-clear\" ng-click=\"select(null, $event)\">{{ getText('clear') }}</button>\n" +
+ " </span>\n" +
+ " <button type=\"button\" class=\"btn btn-sm btn-success pull-right uib-close\" ng-click=\"close($event)\">{{ getText('close') }}</button>\n" +
+ " </li>\n" +
+ " </ul>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/modal/backdrop.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/modal/backdrop.html",
+ "<div class=\"modal-backdrop\"\n" +
+ " uib-modal-animation-class=\"fade\"\n" +
+ " modal-in-class=\"in\"\n" +
+ " ng-style=\"{'z-index': 1040 + (index && 1 || 0) + index*10}\"\n" +
+ "></div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/modal/window.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/modal/window.html",
+ "<div modal-render=\"{{$isRendered}}\" tabindex=\"-1\" role=\"dialog\" class=\"modal\"\n" +
+ " uib-modal-animation-class=\"fade\"\n" +
+ " modal-in-class=\"in\"\n" +
+ " ng-style=\"{'z-index': 1050 + index*10, display: 'block'}\">\n" +
+ " <div class=\"modal-dialog {{size ? 'modal-' + size : ''}}\"><div class=\"modal-content\" uib-modal-transclude></div></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/pager/pager.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/pager/pager.html",
+ "<ul class=\"pager\">\n" +
+ " <li ng-class=\"{disabled: noPrevious()||ngDisabled, previous: align}\"><a href ng-click=\"selectPage(page - 1, $event)\">{{::getText('previous')}}</a></li>\n" +
+ " <li ng-class=\"{disabled: noNext()||ngDisabled, next: align}\"><a href ng-click=\"selectPage(page + 1, $event)\">{{::getText('next')}}</a></li>\n" +
+ "</ul>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/pagination/pagination.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/pagination/pagination.html",
+ "<ul class=\"pagination\">\n" +
+ " <li ng-if=\"::boundaryLinks\" ng-class=\"{disabled: noPrevious()||ngDisabled}\" class=\"pagination-first\"><a href ng-click=\"selectPage(1, $event)\">{{::getText('first')}}</a></li>\n" +
+ " <li ng-if=\"::directionLinks\" ng-class=\"{disabled: noPrevious()||ngDisabled}\" class=\"pagination-prev\"><a href ng-click=\"selectPage(page - 1, $event)\">{{::getText('previous')}}</a></li>\n" +
+ " <li ng-repeat=\"page in pages track by $index\" ng-class=\"{active: page.active,disabled: ngDisabled&&!page.active}\" class=\"pagination-page\"><a href ng-click=\"selectPage(page.number, $event)\">{{page.text}}</a></li>\n" +
+ " <li ng-if=\"::directionLinks\" ng-class=\"{disabled: noNext()||ngDisabled}\" class=\"pagination-next\"><a href ng-click=\"selectPage(page + 1, $event)\">{{::getText('next')}}</a></li>\n" +
+ " <li ng-if=\"::boundaryLinks\" ng-class=\"{disabled: noNext()||ngDisabled}\" class=\"pagination-last\"><a href ng-click=\"selectPage(totalPages, $event)\">{{::getText('last')}}</a></li>\n" +
+ "</ul>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/tooltip/tooltip-html-popup.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/tooltip/tooltip-html-popup.html",
+ "<div class=\"tooltip\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"tooltip-arrow\"></div>\n" +
+ " <div class=\"tooltip-inner\" ng-bind-html=\"contentExp()\"></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/tooltip/tooltip-popup.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/tooltip/tooltip-popup.html",
+ "<div class=\"tooltip\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"tooltip-arrow\"></div>\n" +
+ " <div class=\"tooltip-inner\" ng-bind=\"content\"></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/tooltip/tooltip-template-popup.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/tooltip/tooltip-template-popup.html",
+ "<div class=\"tooltip\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"tooltip-arrow\"></div>\n" +
+ " <div class=\"tooltip-inner\"\n" +
+ " uib-tooltip-template-transclude=\"contentExp()\"\n" +
+ " tooltip-template-transclude-scope=\"originScope()\"></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/popover/popover-html.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/popover/popover-html.html",
+ "<div class=\"popover\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"arrow\"></div>\n" +
+ "\n" +
+ " <div class=\"popover-inner\">\n" +
+ " <h3 class=\"popover-title\" ng-bind=\"uibTitle\" ng-if=\"uibTitle\"></h3>\n" +
+ " <div class=\"popover-content\" ng-bind-html=\"contentExp()\"></div>\n" +
+ " </div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/popover/popover-template.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/popover/popover-template.html",
+ "<div class=\"popover\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"arrow\"></div>\n" +
+ "\n" +
+ " <div class=\"popover-inner\">\n" +
+ " <h3 class=\"popover-title\" ng-bind=\"uibTitle\" ng-if=\"uibTitle\"></h3>\n" +
+ " <div class=\"popover-content\"\n" +
+ " uib-tooltip-template-transclude=\"contentExp()\"\n" +
+ " tooltip-template-transclude-scope=\"originScope()\"></div>\n" +
+ " </div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/popover/popover.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/popover/popover.html",
+ "<div class=\"popover\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"arrow\"></div>\n" +
+ "\n" +
+ " <div class=\"popover-inner\">\n" +
+ " <h3 class=\"popover-title\" ng-bind=\"uibTitle\" ng-if=\"uibTitle\"></h3>\n" +
+ " <div class=\"popover-content\" ng-bind=\"content\"></div>\n" +
+ " </div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/progressbar/bar.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/progressbar/bar.html",
+ "<div class=\"progress-bar\" ng-class=\"type && 'progress-bar-' + type\" role=\"progressbar\" aria-valuenow=\"{{value}}\" aria-valuemin=\"0\" aria-valuemax=\"{{max}}\" ng-style=\"{width: (percent < 100 ? percent : 100) + '%'}\" aria-valuetext=\"{{percent | number:0}}%\" aria-labelledby=\"{{::title}}\" ng-transclude></div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/progressbar/progress.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/progressbar/progress.html",
+ "<div class=\"progress\" ng-transclude aria-labelledby=\"{{::title}}\"></div>");
+ }]);
+
+ angular.module("uib/template/progressbar/progressbar.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/progressbar/progressbar.html",
+ "<div class=\"progress\">\n" +
+ " <div class=\"progress-bar\" ng-class=\"type && 'progress-bar-' + type\" role=\"progressbar\" aria-valuenow=\"{{value}}\" aria-valuemin=\"0\" aria-valuemax=\"{{max}}\" ng-style=\"{width: (percent < 100 ? percent : 100) + '%'}\" aria-valuetext=\"{{percent | number:0}}%\" aria-labelledby=\"{{::title}}\" ng-transclude></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/rating/rating.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/rating/rating.html",
+ "<span ng-mouseleave=\"reset()\" ng-keydown=\"onKeydown($event)\" tabindex=\"0\" role=\"slider\" aria-valuemin=\"0\" aria-valuemax=\"{{range.length}}\" aria-valuenow=\"{{value}}\" aria-valuetext=\"{{title}}\">\n" +
+ " <span ng-repeat-start=\"r in range track by $index\" class=\"sr-only\">({{ $index < value ? '*' : ' ' }})</span>\n" +
+ " <i ng-repeat-end ng-mouseenter=\"enter($index + 1)\" ng-click=\"rate($index + 1)\" class=\"glyphicon\" ng-class=\"$index < value && (r.stateOn || 'glyphicon-star') || (r.stateOff || 'glyphicon-star-empty')\" ng-attr-title=\"{{r.title}}\"></i>\n" +
+ "</span>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/tabs/tab.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/tabs/tab.html",
+ "<li ng-class=\"[{active: active, disabled: disabled}, classes]\" class=\"uib-tab nav-item\">\n" +
+ " <a href ng-click=\"select($event)\" class=\"nav-link\" uib-tab-heading-transclude>{{heading}}</a>\n" +
+ "</li>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/tabs/tabset.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/tabs/tabset.html",
+ "<div>\n" +
+ " <ul class=\"nav nav-{{tabset.type || 'tabs'}}\" ng-class=\"{'nav-stacked': vertical, 'nav-justified': justified}\" ng-transclude></ul>\n" +
+ " <div class=\"tab-content\">\n" +
+ " <div class=\"tab-pane\"\n" +
+ " ng-repeat=\"tab in tabset.tabs\"\n" +
+ " ng-class=\"{active: tabset.active === tab.index}\"\n" +
+ " uib-tab-content-transclude=\"tab\">\n" +
+ " </div>\n" +
+ " </div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/timepicker/timepicker.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/timepicker/timepicker.html",
+ "<table class=\"uib-timepicker\">\n" +
+ " <tbody>\n" +
+ " <tr class=\"text-center\" ng-show=\"::showSpinners\">\n" +
+ " <td class=\"uib-increment hours\"><a ng-click=\"incrementHours()\" ng-class=\"{disabled: noIncrementHours()}\" class=\"btn btn-link\" ng-disabled=\"noIncrementHours()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-up\"></span></a></td>\n" +
+ " <td> </td>\n" +
+ " <td class=\"uib-increment minutes\"><a ng-click=\"incrementMinutes()\" ng-class=\"{disabled: noIncrementMinutes()}\" class=\"btn btn-link\" ng-disabled=\"noIncrementMinutes()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-up\"></span></a></td>\n" +
+ " <td ng-show=\"showSeconds\"> </td>\n" +
+ " <td ng-show=\"showSeconds\" class=\"uib-increment seconds\"><a ng-click=\"incrementSeconds()\" ng-class=\"{disabled: noIncrementSeconds()}\" class=\"btn btn-link\" ng-disabled=\"noIncrementSeconds()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-up\"></span></a></td>\n" +
+ " <td ng-show=\"showMeridian\"></td>\n" +
+ " </tr>\n" +
+ " <tr>\n" +
+ " <td class=\"form-group uib-time hours\" ng-class=\"{'has-error': invalidHours}\">\n" +
+ " <input type=\"text\" placeholder=\"HH\" ng-model=\"hours\" ng-change=\"updateHours()\" class=\"form-control text-center\" ng-readonly=\"::readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"noIncrementHours()\" ng-blur=\"blur()\">\n" +
+ " </td>\n" +
+ " <td class=\"uib-separator\">:</td>\n" +
+ " <td class=\"form-group uib-time minutes\" ng-class=\"{'has-error': invalidMinutes}\">\n" +
+ " <input type=\"text\" placeholder=\"MM\" ng-model=\"minutes\" ng-change=\"updateMinutes()\" class=\"form-control text-center\" ng-readonly=\"::readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"noIncrementMinutes()\" ng-blur=\"blur()\">\n" +
+ " </td>\n" +
+ " <td ng-show=\"showSeconds\" class=\"uib-separator\">:</td>\n" +
+ " <td class=\"form-group uib-time seconds\" ng-class=\"{'has-error': invalidSeconds}\" ng-show=\"showSeconds\">\n" +
+ " <input type=\"text\" placeholder=\"SS\" ng-model=\"seconds\" ng-change=\"updateSeconds()\" class=\"form-control text-center\" ng-readonly=\"readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"noIncrementSeconds()\" ng-blur=\"blur()\">\n" +
+ " </td>\n" +
+ " <td ng-show=\"showMeridian\" class=\"uib-time am-pm\"><button type=\"button\" ng-class=\"{disabled: noToggleMeridian()}\" class=\"btn btn-default text-center\" ng-click=\"toggleMeridian()\" ng-disabled=\"noToggleMeridian()\" tabindex=\"{{::tabindex}}\">{{meridian}}</button></td>\n" +
+ " </tr>\n" +
+ " <tr class=\"text-center\" ng-show=\"::showSpinners\">\n" +
+ " <td class=\"uib-decrement hours\"><a ng-click=\"decrementHours()\" ng-class=\"{disabled: noDecrementHours()}\" class=\"btn btn-link\" ng-disabled=\"noDecrementHours()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +
+ " <td> </td>\n" +
+ " <td class=\"uib-decrement minutes\"><a ng-click=\"decrementMinutes()\" ng-class=\"{disabled: noDecrementMinutes()}\" class=\"btn btn-link\" ng-disabled=\"noDecrementMinutes()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +
+ " <td ng-show=\"showSeconds\"> </td>\n" +
+ " <td ng-show=\"showSeconds\" class=\"uib-decrement seconds\"><a ng-click=\"decrementSeconds()\" ng-class=\"{disabled: noDecrementSeconds()}\" class=\"btn btn-link\" ng-disabled=\"noDecrementSeconds()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +
+ " <td ng-show=\"showMeridian\"></td>\n" +
+ " </tr>\n" +
+ " </tbody>\n" +
+ "</table>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/typeahead/typeahead-match.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/typeahead/typeahead-match.html",
+ "<a href\n" +
+ " tabindex=\"-1\"\n" +
+ " ng-bind-html=\"match.label | uibTypeaheadHighlight:query\"\n" +
+ " ng-attr-title=\"{{match.label}}\"></a>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/typeahead/typeahead-popup.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/typeahead/typeahead-popup.html",
+ "<ul class=\"dropdown-menu\" ng-show=\"isOpen() && !moveInProgress\" ng-style=\"{top: position().top+'px', left: position().left+'px'}\" role=\"listbox\" aria-hidden=\"{{!isOpen()}}\">\n" +
+ " <li ng-repeat=\"match in matches track by $index\" ng-class=\"{active: isActive($index) }\" ng-mouseenter=\"selectActive($index)\" ng-click=\"selectMatch($index, $event)\" role=\"option\" id=\"{{::match.id}}\">\n" +
+ " <div uib-typeahead-match index=\"$index\" match=\"match\" query=\"query\" template-url=\"templateUrl\"></div>\n" +
+ " </li>\n" +
+ "</ul>\n" +
+ "");
+ }]);
+ angular.module('ui.bootstrap.carousel').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibCarouselCss && angular.element(document).find('head').prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>'); angular.$$uibCarouselCss = true; });
+ angular.module('ui.bootstrap.datepicker').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibDatepickerCss && angular.element(document).find('head').prepend('<style type="text/css">.uib-datepicker .uib-title{width:100%;}.uib-day button,.uib-month button,.uib-year button{min-width:100%;}.uib-left,.uib-right{width:100%}</style>'); angular.$$uibDatepickerCss = true; });
+ angular.module('ui.bootstrap.position').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibPositionCss && angular.element(document).find('head').prepend('<style type="text/css">.uib-position-measure{display:block !important;visibility:hidden !important;position:absolute !important;top:-9999px !important;left:-9999px !important;}.uib-position-scrollbar-measure{position:absolute !important;top:-9999px !important;width:50px !important;height:50px !important;overflow:scroll !important;}.uib-position-body-scrollbar-measure{overflow:scroll !important;}</style>'); angular.$$uibPositionCss = true; });
+ angular.module('ui.bootstrap.datepickerPopup').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibDatepickerpopupCss && angular.element(document).find('head').prepend('<style type="text/css">.uib-datepicker-popup.dropdown-menu{display:block;float:none;margin:0;}.uib-button-bar{padding:10px 9px 2px;}</style>'); angular.$$uibDatepickerpopupCss = true; });
+ angular.module('ui.bootstrap.tooltip').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTooltipCss && angular.element(document).find('head').prepend('<style type="text/css">[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,[uib-popover-popup].popover.top-left > .arrow,[uib-popover-popup].popover.top-right > .arrow,[uib-popover-popup].popover.bottom-left > .arrow,[uib-popover-popup].popover.bottom-right > .arrow,[uib-popover-popup].popover.left-top > .arrow,[uib-popover-popup].popover.left-bottom > .arrow,[uib-popover-popup].popover.right-top > .arrow,[uib-popover-popup].popover.right-bottom > .arrow,[uib-popover-html-popup].popover.top-left > .arrow,[uib-popover-html-popup].popover.top-right > .arrow,[uib-popover-html-popup].popover.bottom-left > .arrow,[uib-popover-html-popup].popover.bottom-right > .arrow,[uib-popover-html-popup].popover.left-top > .arrow,[uib-popover-html-popup].popover.left-bottom > .arrow,[uib-popover-html-popup].popover.right-top > .arrow,[uib-popover-html-popup].popover.right-bottom > .arrow,[uib-popover-template-popup].popover.top-left > .arrow,[uib-popover-template-popup].popover.top-right > .arrow,[uib-popover-template-popup].popover.bottom-left > .arrow,[uib-popover-template-popup].popover.bottom-right > .arrow,[uib-popover-template-popup].popover.left-top > .arrow,[uib-popover-template-popup].popover.left-bottom > .arrow,[uib-popover-template-popup].popover.right-top > .arrow,[uib-popover-template-popup].popover.right-bottom > .arrow{top:auto;bottom:auto;left:auto;right:auto;margin:0;}[uib-popover-popup].popover,[uib-popover-html-popup].popover,[uib-popover-template-popup].popover{display:block !important;}</style>'); angular.$$uibTooltipCss = true; });
+ angular.module('ui.bootstrap.timepicker').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTimepickerCss && angular.element(document).find('head').prepend('<style type="text/css">.uib-time input{width:50px;}</style>'); angular.$$uibTimepickerCss = true; });
+ angular.module('ui.bootstrap.typeahead').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTypeaheadCss && angular.element(document).find('head').prepend('<style type="text/css">[uib-typeahead-popup].dropdown-menu{display:block;}</style>'); angular.$$uibTypeaheadCss = true; });
+
+/***/ },
+/* 8 */
+/***/ function(module, exports) {
+
+ var app;
+ (function (app) {
+ var declares;
+ (function (declares) {
+ var CommandInfo = (function () {
+ function CommandInfo(name) {
+ this.name = name;
+ }
+ return CommandInfo;
+ })();
+ declares.CommandInfo = CommandInfo;
+ })(declares = app.declares || (app.declares = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var services;
+ (function (services) {
+ var APIEndPoint = (function () {
+ function APIEndPoint($resource, $http) {
+ this.$resource = $resource;
+ this.$http = $http;
+ }
+ APIEndPoint.prototype.resource = function (endPoint, data) {
+ var customAction = {
+ method: 'GET',
+ isArray: false
+ };
+ var execute = {
+ method: 'POST',
+ headers: { 'Content-Type': undefined, enctype: 'multipart/form-data' }
+ };
+ return this.$resource(endPoint, {}, { execute: execute });
+ };
+ APIEndPoint.prototype.getOptionControlFile = function (command) {
+ var endPoint = '/api/v1/optionControlFile/' + command;
+ return this.resource(endPoint, {}).get();
+ };
+ APIEndPoint.prototype.getFiles = function (fileId) {
+ var endPoint = '/api/v1/workspace';
+ if (fileId) {
+ endPoint += '/' + fileId;
+ }
+ return this.resource(endPoint, {}).get();
+ };
+ APIEndPoint.prototype.getDirectories = function () {
+ var endPoint = '/api/v1/all/workspace/directory';
+ return this.resource(endPoint, {}).get();
+ };
+ APIEndPoint.prototype.getTags = function () {
+ var endPoint = '/api/v1/tagList';
+ return this.resource(endPoint, {}).get();
+ };
+ APIEndPoint.prototype.getCommands = function () {
+ var endPoint = '/api/v1/commandList';
+ return this.resource(endPoint, {}).get();
+ };
+ APIEndPoint.prototype.execute = function (data) {
+ var endPoint = '/api/v1/execution';
+ var fd = new FormData();
+ fd.append('data', data);
+ return this.$http.post(endPoint, fd, {
+ headers: { 'Content-Type': undefined },
+ transformRequest: angular.identity
+ });
+ };
+ APIEndPoint.prototype.debug = function () {
+ var endPoint = '/api/v1/debug';
+ return this.$http.get(endPoint);
+ };
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
+ APIEndPoint.prototype.help = function (command) {
+ var endPoint = '/api/v1/help/' + command;
+ return this.$http.get(endPoint);
+ };
+ return APIEndPoint;
+ })();
+ services.APIEndPoint = APIEndPoint;
+ })(services = app.services || (app.services = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var services;
+ (function (services) {
+ var MyModal = (function () {
+ function MyModal($uibModal) {
+ this.$uibModal = $uibModal;
+ this.modalOption = {
+ backdrop: true,
+ controller: null,
+ templateUrl: null,
+ size: null
+ };
+ }
+ MyModal.prototype.open = function (modalName) {
+ if (modalName === 'SelectCommand') {
+ this.modalOption.templateUrl = 'templates/select-command.html';
+ this.modalOption.size = 'lg';
+ }
+ return this.$uibModal.open(this.modalOption);
+ };
+ MyModal.prototype.selectCommand = function () {
+ this.modalOption.templateUrl = 'templates/select-command.html';
+ this.modalOption.controller = 'selectCommandController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
+ MyModal.prototype.preview = function () {
+ this.modalOption.templateUrl = 'templates/preview.html';
+ this.modalOption.controller = 'previewController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
+ MyModal.$inject = ['$uibModal'];
+ return MyModal;
+ })();
+ services.MyModal = MyModal;
+ })(services = app.services || (app.services = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var services;
+ (function (services) {
+ var WebSocket = (function () {
+ function WebSocket($rootScope) {
+ this.$rootScope = $rootScope;
+ this.socket = io.connect();
+ }
+ WebSocket.prototype.on = function (eventName, callback) {
+ var socket = this.socket;
+ var rootScope = this.$rootScope;
+ socket.on(eventName, function () {
+ var args = arguments;
+ rootScope.$apply(function () {
+ callback.apply(socket, args);
+ });
+ });
+ };
+ WebSocket.prototype.emit = function (eventName, data, callback) {
+ var socket = this.socket;
+ var rootScope = this.$rootScope;
+ this.socket.emit(eventName, data, function () {
+ var args = arguments;
+ rootScope.$apply(function () {
+ if (callback)
+ callback.apply(socket, args);
+ });
+ });
+ };
+ return WebSocket;
+ })();
+ services.WebSocket = WebSocket;
+ })(services = app.services || (app.services = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var services;
+ (function (services) {
+ var Console = (function () {
+ function Console(WebSocket, $rootScope) {
+ this.WebSocket = WebSocket;
+ this.$rootScope = $rootScope;
+ this.WebSocket = WebSocket;
+ this.$rootScope = $rootScope;
+ this.directiveIDs = [];
+ var directiveIDs = this.directiveIDs;
+ this.WebSocket.on('console', function (d) {
+ var id = d.id;
+ var message = d.message;
+ if (directiveIDs.indexOf(id) > -1) {
+ $rootScope.$emit(id, message);
+ }
+ });
+ }
+ Console.prototype.addDirective = function (id) {
+ if (!(this.directiveIDs.indexOf(id) > -1)) {
+ this.directiveIDs.push(id);
+ }
+ };
+ Console.prototype.removeDirective = function (id) {
+ var i = this.directiveIDs.indexOf(id);
+ if (i > -1) {
+ this.directiveIDs.splice(i, 1);
+ }
+ };
+ Console.prototype.showIDs = function () {
+ console.log(this.directiveIDs);
+ };
+ return Console;
+ })();
+ services.Console = Console;
+ })(services = app.services || (app.services = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var directives;
+ (function (directives) {
+ var Command = (function () {
+ function Command() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'commandController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/command.html';
+ }
+ Command.Factory = function () {
+ var directive = function () {
+ return new Command();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Command;
+ })();
+ directives.Command = Command;
+ var CommandController = (function () {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ this.APIEndPoint
+ .getOptionControlFile(this.name)
+ .$promise
+ .then(function (result) {
+ controller.options = result.info;
+ });
+ this.APIEndPoint
+ .getDirectories()
+ .$promise
+ .then(function (result) {
+ controller.dirs = result.info;
+ });
+ this.heading = "[" + this.index + "]: dcdFilePrint";
+ this.isOpen = true;
+ this.$scope.$on('close', function () {
+ controller.isOpen = false;
+ });
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
+ }
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ this.uuid = guid();
+ this.Console.addDirective(this.uuid);
+ this.Console.showIDs();
+ }
+ CommandController.prototype.submit = function () {
+ var opt = [];
+ angular.forEach(this.options, function (option) {
+ var obj = {
+ name: option.option,
+ arguments: []
+ };
+ angular.forEach(option.arg, function (arg) {
+ if (arg.input) {
+ if (typeof arg.input === 'object') {
+ obj.arguments.push(arg.input.name);
+ }
+ else {
+ obj.arguments.push(arg.input);
+ }
+ }
+ });
+ if (obj.arguments.length > 0) {
+ opt.push(obj);
+ }
+ });
+ var execObj = {
+ command: this.name,
+ workspace: this.workspace.fileId,
+ options: opt
+ };
+ this.APIEndPoint
+ .execute(JSON.stringify(execObj))
+ .then(function (result) {
+ console.log(result);
+ });
+ };
+ CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
+ this.Console.removeDirective(this.uuid);
+ this.remove()(index, this.list);
+ this.Console.showIDs();
+ };
+ CommandController.prototype.reloadFiles = function () {
+ var _this = this;
+ var fileId = this.workspace.fileId;
+ this.APIEndPoint
+ .getFiles(fileId)
+ .$promise
+ .then(function (result) {
+ var status = result.status;
+ if (status === 'success') {
+ _this.files = result.info;
+ }
+ else {
+ console.log(result.message);
+ }
+ });
+ };
+ CommandController.prototype.debug = function () {
+ var div = angular.element(this.$window.document).find("div");
+ var consoleTag;
+ var parametersTag;
+ angular.forEach(div, function (v) {
+ if (v.className === "panel-body console") {
+ consoleTag = v;
+ }
+ else if (v.className === "row parameters-console") {
+ parametersTag = v;
+ }
+ });
+ var consoleHeight = parseInt(parametersTag.clientHeight.toString().replace('px', '')) - 150 + 'px';
+ var consoleWidth = parseInt(parametersTag.clientWidth.toString().replace('px', '')) / 3 * 2 - 150 + 'px';
+ consoleTag.style.height = consoleHeight;
+ consoleTag.style.width = consoleWidth;
+ };
+ CommandController.prototype.help = function () {
+ this.APIEndPoint
+ .help(this.name)
+ .then(function (result) {
+ console.log(result);
+ });
+ };
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return CommandController;
+ })();
+ directives.CommandController = CommandController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var directives;
+ (function (directives) {
+ var HeaderMenu = (function () {
+ function HeaderMenu() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.templateUrl = 'templates/header-menu.html';
+ this.controller = 'HeaderMenuController';
+ this.controllerAs = 'hmc';
+ this.scope = true;
+ }
+ HeaderMenu.Factory = function () {
+ var directive = function () {
+ return new HeaderMenu();
+ };
+ return directive;
+ };
+ return HeaderMenu;
+ })();
+ directives.HeaderMenu = HeaderMenu;
+ var HeaderMenuController = (function () {
+ function HeaderMenuController($state) {
+ this.$state = $state;
+ this.isExecution = this.$state.current.name === 'execution';
+ this.isWorkspace = this.$state.current.name === 'workspace';
+ this.isHistory = this.$state.current.name === 'history';
+ }
+ HeaderMenuController.prototype.transit = function (state) {
+ this.$state.go(state);
+ };
+ HeaderMenuController.$inject = ['$state'];
+ return HeaderMenuController;
+ })();
+ directives.HeaderMenuController = HeaderMenuController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var directives;
+ (function (directives) {
+ var Option = (function () {
+ function Option() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.controller = 'optionController';
+ this.bindToController = {
+ info: '=',
+ files: '='
+ };
+ this.scope = true;
+ this.templateUrl = 'templates/option.html';
+ this.controllerAs = 'ctrl';
+ }
+ Option.Factory = function () {
+ var directive = function () {
+ return new Option();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Option;
+ })();
+ directives.Option = Option;
+ var OptionController = (function () {
+ function OptionController() {
+ var controller = this;
+ angular.forEach(controller.info.arg, function (arg) {
+ if (arg.initialValue) {
+ if (arg.formType === 'number') {
+ arg.input = parseInt(arg.initialValue);
+ }
+ else {
+ arg.input = arg.initialValue;
+ }
+ }
+ });
+ }
+ OptionController.$inject = [];
+ return OptionController;
+ })();
+ directives.OptionController = OptionController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var directives;
+ (function (directives) {
+ var Directory = (function () {
+ function Directory() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.controller = 'directoryController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ info: '=',
+ add: '&',
+ list: '=',
+ files: '='
+ };
+ this.templateUrl = 'templates/directory.html';
+ }
+ Directory.Factory = function () {
+ var directive = function () {
+ return new Directory();
+ };
+ return directive;
+ };
+ return Directory;
+ })();
+ directives.Directory = Directory;
+ var DirectoryController = (function () {
+ function DirectoryController(APIEndPoint, $scope) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ var controller = this;
+ this.APIEndPoint
+ .getFiles(this.info.fileId)
+ .$promise
+ .then(function (result) {
+ if (result.status === 'success') {
+ controller.files = result.info;
+ angular.forEach(result.info, function (file) {
+ if (file.fileType === '0') {
+ var o = file;
+ if (controller.info.path === '/') {
+ o.path = '/' + file.name;
+ }
+ else {
+ o.path = controller.info.path + '/' + file.name;
+ }
+ controller.add()(o, controller.list);
+ }
+ });
+ }
+ ;
+ });
+ }
+ DirectoryController.$inject = ['APIEndPoint', '$scope'];
+ return DirectoryController;
+ })();
+ directives.DirectoryController = DirectoryController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var Execution = (function () {
+ function Execution(MyModal, $scope) {
+ this.MyModal = MyModal;
+ this.$scope = $scope;
+ this.commandInfoList = [];
+ }
+ ;
+ Execution.prototype.add = function () {
+ this.$scope.$broadcast('close');
+ var commandInfoList = this.commandInfoList;
+ var commandInstance = this.MyModal.selectCommand();
+ commandInstance
+ .result
+ .then(function (command) {
+ commandInfoList.push(new app.declares.CommandInfo(command));
+ });
+ };
+ Execution.prototype.open = function () {
+ var result = this.MyModal.open('SelectCommand');
+ console.log(result);
+ };
+ Execution.prototype.remove = function (index, list) {
+ list.splice(index, 1);
+ };
+ Execution.prototype.close = function () {
+ console.log("close");
+ };
+ Execution.$inject = ['MyModal', '$scope'];
+ return Execution;
+ })();
+ controllers.Execution = Execution;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var Workspace = (function () {
+ function Workspace($scope, APIEndPoint, MyModal) {
+ this.$scope = $scope;
+ this.APIEndPoint = APIEndPoint;
+ this.MyModal = MyModal;
+ this.directoryList = [];
+ var controller = this;
+ var directoryList = this.directoryList;
+ var o = {
+ fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+ name: '',
+ parentId: '',
+ fileType: '',
+ createdAt: '',
+ updatedAt: '',
+ path: '/'
+ };
+ directoryList.push(o);
+ }
+ Workspace.prototype.addDirectory = function (info, directoryList) {
+ directoryList.push(info);
+ };
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
+ Workspace.prototype.debug = function () {
+ this.MyModal.preview();
+ };
+ Workspace.$inject = ['$scope', 'APIEndPoint', 'MyModal'];
+ return Workspace;
+ })();
+ controllers.Workspace = Workspace;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var History = (function () {
+ function History($scope) {
+ this.page = "History";
+ }
+ History.$inject = ['$scope'];
+ return History;
+ })();
+ controllers.History = History;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var SelectCommand = (function () {
+ function SelectCommand($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ this.APIEndPoint
+ .getTags()
+ .$promise.then(function (result) {
+ controller.tags = result.info;
+ });
+ this.APIEndPoint
+ .getCommands()
+ .$promise.then(function (result) {
+ controller.commands = result.info;
+ });
+ this.currentTag = 'all';
+ }
+ SelectCommand.prototype.changeTag = function (tag) {
+ this.currentTag = tag;
+ };
+ SelectCommand.prototype.selectCommand = function (command) {
+ this.$modalInstance.close(command);
+ };
+ SelectCommand.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return SelectCommand;
+ })();
+ controllers.SelectCommand = SelectCommand;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var Preview = (function () {
+ function Preview($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('preview');
+ }
+ Preview.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Preview;
+ })();
+ controllers.Preview = Preview;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var filters;
+ (function (filters) {
+ function Tag() {
+ return function (commands, tag) {
+ var result = [];
+ angular.forEach(commands, function (command) {
+ var flag = false;
+ angular.forEach(command.tags, function (value) {
+ if (tag === value)
+ flag = true;
+ });
+ if (flag)
+ result.push(command);
+ });
+ return result;
+ };
+ }
+ filters.Tag = Tag;
+ })(filters || (filters = {}));
+ var app;
+ (function (app) {
+ 'use strict';
+ var appName = 'zephyr';
+ app.zephyr = angular.module(appName, ['ui.router', 'ngResource', 'ui.bootstrap']);
+ app.zephyr.config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
+ $urlRouterProvider.otherwise('/execution');
+ $locationProvider.html5Mode({
+ enabled: true,
+ requireBase: false
+ });
+ $stateProvider
+ .state('execution', {
+ url: '/execution',
+ templateUrl: 'templates/execution.html',
+ controller: 'executionController',
+ controllerAs: 'c'
+ })
+ .state('workspace', {
+ url: '/workspace',
+ templateUrl: 'templates/workspace.html',
+ controller: 'workspaceController',
+ controllerAs: 'c'
+ })
+ .state('history', {
+ url: '/history',
+ templateUrl: 'templates/history.html',
+ controller: 'historyController',
+ controllerAs: 'c'
+ });
+ });
+ app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+ app.zephyr.service('MyModal', app.services.MyModal);
+ app.zephyr.service('WebSocket', app.services.WebSocket);
+ app.zephyr.service('Console', app.services.Console);
+ app.zephyr.filter('Tag', filters.Tag);
+ app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
+ app.zephyr.controller('previewController', app.controllers.Preview);
+ app.zephyr.controller('uploadController', app.controllers.Upload);
+ app.zephyr.controller('executionController', app.controllers.Execution);
+ app.zephyr.controller('workspaceController', app.controllers.Workspace);
+ app.zephyr.controller('historyController', app.controllers.History);
+ app.zephyr.controller('commandController', app.directives.CommandController);
+ app.zephyr.controller('optionController', app.directives.OptionController);
+ app.zephyr.controller('directoryController', app.directives.DirectoryController);
+ app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
+ app.zephyr.controller('uploadController', app.directives.UploadController);
+ app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
+ app.zephyr.directive('command', app.directives.Command.Factory());
+ app.zephyr.directive('option', app.directives.Option.Factory());
+ app.zephyr.directive('directory', app.directives.Directory.Factory());
+ })(app || (app = {}));
+
+
+/***/ },
+/* 9 */
+/***/ function(module, exports) {
+
+ var app;
+ (function (app) {
+ var declares;
+ (function (declares) {
+ var CommandInfo = (function () {
+ function CommandInfo(name) {
+ this.name = name;
+ }
+ return CommandInfo;
+ })();
+ declares.CommandInfo = CommandInfo;
+ })(declares = app.declares || (app.declares = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var services;
+ (function (services) {
+ var APIEndPoint = (function () {
+ function APIEndPoint($resource, $http) {
+ this.$resource = $resource;
+ this.$http = $http;
+ }
+ APIEndPoint.prototype.resource = function (endPoint, data) {
+ var customAction = {
+ method: 'GET',
+ isArray: false
+ };
+ var execute = {
+ method: 'POST',
+ headers: { 'Content-Type': undefined, enctype: 'multipart/form-data' }
+ };
+ return this.$resource(endPoint, {}, { execute: execute });
+ };
+ APIEndPoint.prototype.getOptionControlFile = function (command) {
+ var endPoint = '/api/v1/optionControlFile/' + command;
+ return this.resource(endPoint, {}).get();
+ };
+ APIEndPoint.prototype.getFiles = function (fileId) {
+ var endPoint = '/api/v1/workspace';
+ if (fileId) {
+ endPoint += '/' + fileId;
+ }
+ return this.resource(endPoint, {}).get();
+ };
+ APIEndPoint.prototype.getDirectories = function () {
+ var endPoint = '/api/v1/all/workspace/directory';
+ return this.resource(endPoint, {}).get();
+ };
+ APIEndPoint.prototype.getTags = function () {
+ var endPoint = '/api/v1/tagList';
+ return this.resource(endPoint, {}).get();
+ };
+ APIEndPoint.prototype.getCommands = function () {
+ var endPoint = '/api/v1/commandList';
+ return this.resource(endPoint, {}).get();
+ };
+ APIEndPoint.prototype.execute = function (data) {
+ var endPoint = '/api/v1/execution';
+ var fd = new FormData();
+ fd.append('data', data);
+ return this.$http.post(endPoint, fd, {
+ headers: { 'Content-Type': undefined },
+ transformRequest: angular.identity
+ });
+ };
+ APIEndPoint.prototype.debug = function () {
+ var endPoint = '/api/v1/debug';
+ return this.$http.get(endPoint);
+ };
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
+ APIEndPoint.prototype.help = function (command) {
+ var endPoint = '/api/v1/help/' + command;
+ return this.$http.get(endPoint);
+ };
+ return APIEndPoint;
+ })();
+ services.APIEndPoint = APIEndPoint;
+ })(services = app.services || (app.services = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var services;
+ (function (services) {
+ var MyModal = (function () {
+ function MyModal($uibModal) {
+ this.$uibModal = $uibModal;
+ this.modalOption = {
+ backdrop: true,
+ controller: null,
+ templateUrl: null,
+ size: null
+ };
+ }
+ MyModal.prototype.open = function (modalName) {
+ if (modalName === 'SelectCommand') {
+ this.modalOption.templateUrl = 'templates/select-command.html';
+ this.modalOption.size = 'lg';
+ }
+ return this.$uibModal.open(this.modalOption);
+ };
+ MyModal.prototype.selectCommand = function () {
+ this.modalOption.templateUrl = 'templates/select-command.html';
+ this.modalOption.controller = 'selectCommandController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
+ MyModal.prototype.preview = function () {
+ this.modalOption.templateUrl = 'templates/preview.html';
+ this.modalOption.controller = 'previewController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
+ MyModal.$inject = ['$uibModal'];
+ return MyModal;
+ })();
+ services.MyModal = MyModal;
+ })(services = app.services || (app.services = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var services;
+ (function (services) {
+ var WebSocket = (function () {
+ function WebSocket($rootScope) {
+ this.$rootScope = $rootScope;
+ this.socket = io.connect();
+ }
+ WebSocket.prototype.on = function (eventName, callback) {
+ var socket = this.socket;
+ var rootScope = this.$rootScope;
+ socket.on(eventName, function () {
+ var args = arguments;
+ rootScope.$apply(function () {
+ callback.apply(socket, args);
+ });
+ });
+ };
+ WebSocket.prototype.emit = function (eventName, data, callback) {
+ var socket = this.socket;
+ var rootScope = this.$rootScope;
+ this.socket.emit(eventName, data, function () {
+ var args = arguments;
+ rootScope.$apply(function () {
+ if (callback)
+ callback.apply(socket, args);
+ });
+ });
+ };
+ return WebSocket;
+ })();
+ services.WebSocket = WebSocket;
+ })(services = app.services || (app.services = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var services;
+ (function (services) {
+ var Console = (function () {
+ function Console(WebSocket, $rootScope) {
+ this.WebSocket = WebSocket;
+ this.$rootScope = $rootScope;
+ this.WebSocket = WebSocket;
+ this.$rootScope = $rootScope;
+ this.directiveIDs = [];
+ var directiveIDs = this.directiveIDs;
+ this.WebSocket.on('console', function (d) {
+ var id = d.id;
+ var message = d.message;
+ if (directiveIDs.indexOf(id) > -1) {
+ $rootScope.$emit(id, message);
+ }
+ });
+ }
+ Console.prototype.addDirective = function (id) {
+ if (!(this.directiveIDs.indexOf(id) > -1)) {
+ this.directiveIDs.push(id);
+ }
+ };
+ Console.prototype.removeDirective = function (id) {
+ var i = this.directiveIDs.indexOf(id);
+ if (i > -1) {
+ this.directiveIDs.splice(i, 1);
+ }
+ };
+ Console.prototype.showIDs = function () {
+ console.log(this.directiveIDs);
+ };
+ return Console;
+ })();
+ services.Console = Console;
+ })(services = app.services || (app.services = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var directives;
+ (function (directives) {
+ var Command = (function () {
+ function Command() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'commandController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/command.html';
+ }
+ Command.Factory = function () {
+ var directive = function () {
+ return new Command();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Command;
+ })();
+ directives.Command = Command;
+ var CommandController = (function () {
+ function CommandController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ this.APIEndPoint
+ .getOptionControlFile(this.name)
+ .$promise
+ .then(function (result) {
+ controller.options = result.info;
+ });
+ this.APIEndPoint
+ .getDirectories()
+ .$promise
+ .then(function (result) {
+ controller.dirs = result.info;
+ });
+ this.heading = "[" + this.index + "]: dcdFilePrint";
+ this.isOpen = true;
+ this.$scope.$on('close', function () {
+ controller.isOpen = false;
+ });
+ function guid() {
+ function s4() {
+ return Math.floor((1 + Math.random()) * 0x10000)
+ .toString(16)
+ .substring(1);
+ }
+ return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
+ s4() + '-' + s4() + s4() + s4();
+ }
+ this.uuid = guid();
+ this.Console.addDirective(this.uuid);
+ this.Console.showIDs();
+ }
+ CommandController.prototype.submit = function () {
+ var opt = [];
+ angular.forEach(this.options, function (option) {
+ var obj = {
+ name: option.option,
+ arguments: []
+ };
+ angular.forEach(option.arg, function (arg) {
+ if (arg.input) {
+ if (typeof arg.input === 'object') {
+ obj.arguments.push(arg.input.name);
+ }
+ else {
+ obj.arguments.push(arg.input);
+ }
+ }
+ });
+ if (obj.arguments.length > 0) {
+ opt.push(obj);
+ }
+ });
+ var execObj = {
+ command: this.name,
+ workspace: this.workspace.fileId,
+ options: opt
+ };
+ this.APIEndPoint
+ .execute(JSON.stringify(execObj))
+ .then(function (result) {
+ console.log(result);
+ });
+ };
+ CommandController.prototype.removeMySelf = function (index) {
+ this.$scope.$destroy();
+ this.Console.removeDirective(this.uuid);
+ this.remove()(index, this.list);
+ this.Console.showIDs();
+ };
+ CommandController.prototype.reloadFiles = function () {
+ var _this = this;
+ var fileId = this.workspace.fileId;
+ this.APIEndPoint
+ .getFiles(fileId)
+ .$promise
+ .then(function (result) {
+ var status = result.status;
+ if (status === 'success') {
+ _this.files = result.info;
+ }
+ else {
+ console.log(result.message);
+ }
+ });
+ };
+ CommandController.prototype.debug = function () {
+ var div = angular.element(this.$window.document).find("div");
+ var consoleTag;
+ var parametersTag;
+ angular.forEach(div, function (v) {
+ if (v.className === "panel-body console") {
+ consoleTag = v;
+ }
+ else if (v.className === "row parameters-console") {
+ parametersTag = v;
+ }
+ });
+ var consoleHeight = parseInt(parametersTag.clientHeight.toString().replace('px', '')) - 150 + 'px';
+ var consoleWidth = parseInt(parametersTag.clientWidth.toString().replace('px', '')) / 3 * 2 - 150 + 'px';
+ consoleTag.style.height = consoleHeight;
+ consoleTag.style.width = consoleWidth;
+ };
+ CommandController.prototype.help = function () {
+ this.APIEndPoint
+ .help(this.name)
+ .then(function (result) {
+ console.log(result);
+ });
+ };
+ CommandController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return CommandController;
+ })();
+ directives.CommandController = CommandController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var directives;
+ (function (directives) {
+ var HeaderMenu = (function () {
+ function HeaderMenu() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.templateUrl = 'templates/header-menu.html';
+ this.controller = 'HeaderMenuController';
+ this.controllerAs = 'hmc';
+ this.scope = true;
+ }
+ HeaderMenu.Factory = function () {
+ var directive = function () {
+ return new HeaderMenu();
+ };
+ return directive;
+ };
+ return HeaderMenu;
+ })();
+ directives.HeaderMenu = HeaderMenu;
+ var HeaderMenuController = (function () {
+ function HeaderMenuController($state) {
+ this.$state = $state;
+ this.isExecution = this.$state.current.name === 'execution';
+ this.isWorkspace = this.$state.current.name === 'workspace';
+ this.isHistory = this.$state.current.name === 'history';
+ }
+ HeaderMenuController.prototype.transit = function (state) {
+ this.$state.go(state);
+ };
+ HeaderMenuController.$inject = ['$state'];
+ return HeaderMenuController;
+ })();
+ directives.HeaderMenuController = HeaderMenuController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var directives;
+ (function (directives) {
+ var Option = (function () {
+ function Option() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.controller = 'optionController';
+ this.bindToController = {
+ info: '=',
+ files: '='
+ };
+ this.scope = true;
+ this.templateUrl = 'templates/option.html';
+ this.controllerAs = 'ctrl';
+ }
+ Option.Factory = function () {
+ var directive = function () {
+ return new Option();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Option;
+ })();
+ directives.Option = Option;
+ var OptionController = (function () {
+ function OptionController() {
+ var controller = this;
+ angular.forEach(controller.info.arg, function (arg) {
+ if (arg.initialValue) {
+ if (arg.formType === 'number') {
+ arg.input = parseInt(arg.initialValue);
+ }
+ else {
+ arg.input = arg.initialValue;
+ }
+ }
+ });
+ }
+ OptionController.$inject = [];
+ return OptionController;
+ })();
+ directives.OptionController = OptionController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var directives;
+ (function (directives) {
+ var Directory = (function () {
+ function Directory() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.controller = 'directoryController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ info: '=',
+ add: '&',
+ list: '=',
+ files: '='
+ };
+ this.templateUrl = 'templates/directory.html';
+ }
+ Directory.Factory = function () {
+ var directive = function () {
+ return new Directory();
+ };
+ return directive;
+ };
+ return Directory;
+ })();
+ directives.Directory = Directory;
+ var DirectoryController = (function () {
+ function DirectoryController(APIEndPoint, $scope) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ var controller = this;
+ this.APIEndPoint
+ .getFiles(this.info.fileId)
+ .$promise
+ .then(function (result) {
+ if (result.status === 'success') {
+ controller.files = result.info;
+ angular.forEach(result.info, function (file) {
+ if (file.fileType === '0') {
+ var o = file;
+ if (controller.info.path === '/') {
+ o.path = '/' + file.name;
+ }
+ else {
+ o.path = controller.info.path + '/' + file.name;
+ }
+ controller.add()(o, controller.list);
+ }
+ });
+ }
+ ;
+ });
+ }
+ DirectoryController.$inject = ['APIEndPoint', '$scope'];
+ return DirectoryController;
+ })();
+ directives.DirectoryController = DirectoryController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var Execution = (function () {
+ function Execution(MyModal, $scope) {
+ this.MyModal = MyModal;
+ this.$scope = $scope;
+ this.commandInfoList = [];
+ }
+ ;
+ Execution.prototype.add = function () {
+ this.$scope.$broadcast('close');
+ var commandInfoList = this.commandInfoList;
+ var commandInstance = this.MyModal.selectCommand();
+ commandInstance
+ .result
+ .then(function (command) {
+ commandInfoList.push(new app.declares.CommandInfo(command));
+ });
+ };
+ Execution.prototype.open = function () {
+ var result = this.MyModal.open('SelectCommand');
+ console.log(result);
+ };
+ Execution.prototype.remove = function (index, list) {
+ list.splice(index, 1);
+ };
+ Execution.prototype.close = function () {
+ console.log("close");
+ };
+ Execution.$inject = ['MyModal', '$scope'];
+ return Execution;
+ })();
+ controllers.Execution = Execution;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var Workspace = (function () {
+ function Workspace($scope, APIEndPoint, MyModal) {
+ this.$scope = $scope;
+ this.APIEndPoint = APIEndPoint;
+ this.MyModal = MyModal;
+ this.directoryList = [];
+ var controller = this;
+ var directoryList = this.directoryList;
+ var o = {
+ fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+ name: '',
+ parentId: '',
+ fileType: '',
+ createdAt: '',
+ updatedAt: '',
+ path: '/'
+ };
+ directoryList.push(o);
+ }
+ Workspace.prototype.addDirectory = function (info, directoryList) {
+ directoryList.push(info);
+ };
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
+ Workspace.prototype.debug = function () {
+ this.MyModal.preview();
+ };
+ Workspace.$inject = ['$scope', 'APIEndPoint', 'MyModal'];
+ return Workspace;
+ })();
+ controllers.Workspace = Workspace;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var History = (function () {
+ function History($scope) {
+ this.page = "History";
}
-
- if (showHint) {
- var firstLabel = scope.matches[0].label;
- if (inputValue.length > 0 && firstLabel.slice(0, inputValue.length).toUpperCase() === inputValue.toUpperCase()) {
- hintInputElem.val(inputValue + firstLabel.slice(inputValue.length));
- }
- else {
- hintInputElem.val('');
- }
+ History.$inject = ['$scope'];
+ return History;
+ })();
+ controllers.History = History;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var SelectCommand = (function () {
+ function SelectCommand($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ this.APIEndPoint
+ .getTags()
+ .$promise.then(function (result) {
+ controller.tags = result.info;
+ });
+ this.APIEndPoint
+ .getCommands()
+ .$promise.then(function (result) {
+ controller.commands = result.info;
+ });
+ this.currentTag = 'all';
}
- } else {
- resetMatches();
- isNoResultsSetter(originalScope, true);
- }
- }
- if (onCurrentRequest) {
- isLoadingSetter(originalScope, false);
- }
- }, function() {
- resetMatches();
- isLoadingSetter(originalScope, false);
- isNoResultsSetter(originalScope, true);
- });
- };
-
- // bind events only if appendToBody params exist - performance feature
- if (appendToBody) {
- angular.element($window).on('resize', fireRecalculating);
- $document.find('body').on('scroll', fireRecalculating);
- }
-
- // Declare the debounced function outside recalculating for
- // proper debouncing
- var debouncedRecalculate = $$debounce(function() {
- // if popup is visible
- if (scope.matches.length) {
- recalculatePosition();
- }
-
- scope.moveInProgress = false;
- }, eventDebounceTime);
-
- // Default progress type
- scope.moveInProgress = false;
-
- function fireRecalculating() {
- if (!scope.moveInProgress) {
- scope.moveInProgress = true;
- scope.$digest();
- }
-
- debouncedRecalculate();
- }
-
- // recalculate actual position and set new values to scope
- // after digest loop is popup in right position
- function recalculatePosition() {
- scope.position = appendToBody ? $position.offset(element) : $position.position(element);
- scope.position.top += element.prop('offsetHeight');
- }
-
- //we need to propagate user's query so we can higlight matches
- scope.query = undefined;
-
- //Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later
- var timeoutPromise;
-
- var scheduleSearchWithTimeout = function(inputValue) {
- timeoutPromise = $timeout(function() {
- getMatchesAsync(inputValue);
- }, waitTime);
- };
-
- var cancelPreviousTimeout = function() {
- if (timeoutPromise) {
- $timeout.cancel(timeoutPromise);
- }
- };
-
- resetMatches();
-
- scope.assignIsOpen = function (isOpen) {
- isOpenSetter(originalScope, isOpen);
- };
-
- scope.select = function(activeIdx, evt) {
- //called from within the $digest() cycle
- var locals = {};
- var model, item;
-
- selected = true;
- locals[parserResult.itemName] = item = scope.matches[activeIdx].model;
- model = parserResult.modelMapper(originalScope, locals);
- $setModelValue(originalScope, model);
- modelCtrl.$setValidity('editable', true);
- modelCtrl.$setValidity('parse', true);
-
- onSelectCallback(originalScope, {
- $item: item,
- $model: model,
- $label: parserResult.viewMapper(originalScope, locals),
- $event: evt
- });
-
- resetMatches();
-
- //return focus to the input element if a match was selected via a mouse click event
- // use timeout to avoid $rootScope:inprog error
- if (scope.$eval(attrs.typeaheadFocusOnSelect) !== false) {
- $timeout(function() { element[0].focus(); }, 0, false);
- }
- };
-
- //bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(27)
- element.on('keydown', function(evt) {
- //typeahead is open and an "interesting" key was pressed
- if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) {
- return;
- }
-
- // if there's nothing selected (i.e. focusFirst) and enter or tab is hit, clear the results
- if (scope.activeIdx === -1 && (evt.which === 9 || evt.which === 13)) {
- resetMatches();
- scope.$digest();
- return;
- }
-
- evt.preventDefault();
-
- switch (evt.which) {
- case 9:
- case 13:
- scope.$apply(function () {
- if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) {
- $$debounce(function() {
- scope.select(scope.activeIdx, evt);
- }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']);
- } else {
- scope.select(scope.activeIdx, evt);
+ SelectCommand.prototype.changeTag = function (tag) {
+ this.currentTag = tag;
+ };
+ SelectCommand.prototype.selectCommand = function (command) {
+ this.$modalInstance.close(command);
+ };
+ SelectCommand.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return SelectCommand;
+ })();
+ controllers.SelectCommand = SelectCommand;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
}
- });
- break;
- case 27:
- evt.stopPropagation();
-
- resetMatches();
- scope.$digest();
- break;
- case 38:
- scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;
- scope.$digest();
- popUpEl.find('li')[scope.activeIdx].scrollIntoView(false);
- break;
- case 40:
- scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length;
- scope.$digest();
- popUpEl.find('li')[scope.activeIdx].scrollIntoView(false);
- break;
- }
- });
-
- element.bind('focus', function (evt) {
- hasFocus = true;
- if (minLength === 0 && !modelCtrl.$viewValue) {
- $timeout(function() {
- getMatchesAsync(modelCtrl.$viewValue, evt);
- }, 0);
- }
- });
-
- element.bind('blur', function(evt) {
- if (isSelectOnBlur && scope.matches.length && scope.activeIdx !== -1 && !selected) {
- selected = true;
- scope.$apply(function() {
- if (angular.isObject(scope.debounceUpdate) && angular.isNumber(scope.debounceUpdate.blur)) {
- $$debounce(function() {
- scope.select(scope.activeIdx, evt);
- }, scope.debounceUpdate.blur);
- } else {
- scope.select(scope.activeIdx, evt);
- }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
+ var Preview = (function () {
+ function Preview($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('preview');
+ }
+ Preview.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Preview;
+ })();
+ controllers.Preview = Preview;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var filters;
+ (function (filters) {
+ function Tag() {
+ return function (commands, tag) {
+ var result = [];
+ angular.forEach(commands, function (command) {
+ var flag = false;
+ angular.forEach(command.tags, function (value) {
+ if (tag === value)
+ flag = true;
+ });
+ if (flag)
+ result.push(command);
+ });
+ return result;
+ };
+ }
+ filters.Tag = Tag;
+ })(filters || (filters = {}));
+ var app;
+ (function (app) {
+ 'use strict';
+ var appName = 'zephyr';
+ app.zephyr = angular.module(appName, ['ui.router', 'ngResource', 'ui.bootstrap']);
+ app.zephyr.config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
+ $urlRouterProvider.otherwise('/execution');
+ $locationProvider.html5Mode({
+ enabled: true,
+ requireBase: false
+ });
+ $stateProvider
+ .state('execution', {
+ url: '/execution',
+ templateUrl: 'templates/execution.html',
+ controller: 'executionController',
+ controllerAs: 'c'
+ })
+ .state('workspace', {
+ url: '/workspace',
+ templateUrl: 'templates/workspace.html',
+ controller: 'workspaceController',
+ controllerAs: 'c'
+ })
+ .state('history', {
+ url: '/history',
+ templateUrl: 'templates/history.html',
+ controller: 'historyController',
+ controllerAs: 'c'
});
- }
- if (!isEditable && modelCtrl.$error.editable) {
- modelCtrl.$viewValue = '';
- element.val('');
- }
- hasFocus = false;
- selected = false;
- });
-
- // Keep reference to click handler to unbind it.
- var dismissClickHandler = function(evt) {
- // Issue #3973
- // Firefox treats right click as a click on document
- if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) {
- resetMatches();
- if (!$rootScope.$$phase) {
- scope.$digest();
- }
- }
- };
-
- $document.on('click', dismissClickHandler);
-
- originalScope.$on('$destroy', function() {
- $document.off('click', dismissClickHandler);
- if (appendToBody || appendTo) {
- $popup.remove();
- }
-
- if (appendToBody) {
- angular.element($window).off('resize', fireRecalculating);
- $document.find('body').off('scroll', fireRecalculating);
- }
- // Prevent jQuery cache memory leak
- popUpEl.remove();
-
- if (showHint) {
- inputsContainer.remove();
- }
});
+ app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+ app.zephyr.service('MyModal', app.services.MyModal);
+ app.zephyr.service('WebSocket', app.services.WebSocket);
+ app.zephyr.service('Console', app.services.Console);
+ app.zephyr.filter('Tag', filters.Tag);
+ app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
+ app.zephyr.controller('previewController', app.controllers.Preview);
+ app.zephyr.controller('uploadController', app.controllers.Upload);
+ app.zephyr.controller('executionController', app.controllers.Execution);
+ app.zephyr.controller('workspaceController', app.controllers.Workspace);
+ app.zephyr.controller('historyController', app.controllers.History);
+ app.zephyr.controller('commandController', app.directives.CommandController);
+ app.zephyr.controller('optionController', app.directives.OptionController);
+ app.zephyr.controller('directoryController', app.directives.DirectoryController);
+ app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
+ app.zephyr.controller('uploadController', app.directives.UploadController);
+ app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
+ app.zephyr.directive('command', app.directives.Command.Factory());
+ app.zephyr.directive('option', app.directives.Option.Factory());
+ app.zephyr.directive('directory', app.directives.Directory.Factory());
+ })(app || (app = {}));
- var $popup = $compile(popUpEl)(scope);
-
- if (appendToBody) {
- $document.find('body').append($popup);
- } else if (appendTo) {
- angular.element(appendTo).eq(0).append($popup);
- } else {
- element.after($popup);
- }
-
- this.init = function(_modelCtrl, _ngModelOptions) {
- modelCtrl = _modelCtrl;
- ngModelOptions = _ngModelOptions;
-
- scope.debounceUpdate = modelCtrl.$options && $parse(modelCtrl.$options.debounce)(originalScope);
-
- //plug into $parsers pipeline to open a typeahead on view changes initiated from DOM
- //$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue
- modelCtrl.$parsers.unshift(function(inputValue) {
- hasFocus = true;
-
- if (minLength === 0 || inputValue && inputValue.length >= minLength) {
- if (waitTime > 0) {
- cancelPreviousTimeout();
- scheduleSearchWithTimeout(inputValue);
- } else {
- getMatchesAsync(inputValue);
- }
- } else {
- isLoadingSetter(originalScope, false);
- cancelPreviousTimeout();
- resetMatches();
- }
-
- if (isEditable) {
- return inputValue;
- }
-
- if (!inputValue) {
- // Reset in case user had typed something previously.
- modelCtrl.$setValidity('editable', true);
- return null;
- }
-
- modelCtrl.$setValidity('editable', false);
- return undefined;
- });
-
- modelCtrl.$formatters.push(function(modelValue) {
- var candidateViewValue, emptyViewValue;
- var locals = {};
-
- // The validity may be set to false via $parsers (see above) if
- // the model is restricted to selected values. If the model
- // is set manually it is considered to be valid.
- if (!isEditable) {
- modelCtrl.$setValidity('editable', true);
- }
-
- if (inputFormatter) {
- locals.$model = modelValue;
- return inputFormatter(originalScope, locals);
- }
-
- //it might happen that we don't have enough info to properly render input value
- //we need to check for this situation and simply return model value if we can't apply custom formatting
- locals[parserResult.itemName] = modelValue;
- candidateViewValue = parserResult.viewMapper(originalScope, locals);
- locals[parserResult.itemName] = undefined;
- emptyViewValue = parserResult.viewMapper(originalScope, locals);
-
- return candidateViewValue !== emptyViewValue ? candidateViewValue : modelValue;
- });
- };
- }])
-
- .directive('uibTypeahead', function() {
- return {
- controller: 'UibTypeaheadController',
- require: ['ngModel', '^?ngModelOptions', 'uibTypeahead'],
- link: function(originalScope, element, attrs, ctrls) {
- ctrls[2].init(ctrls[0], ctrls[1]);
- }
- };
- })
- .directive('uibTypeaheadPopup', ['$$debounce', function($$debounce) {
- return {
- scope: {
- matches: '=',
- query: '=',
- active: '=',
- position: '&',
- moveInProgress: '=',
- select: '&',
- assignIsOpen: '&',
- debounce: '&'
- },
- replace: true,
- templateUrl: function(element, attrs) {
+/***/ },
+/* 10 */
++=======
+ return attrs.popupTemplateUrl || 'uib/template/typeahead/typeahead-popup.html';
+ },
+ link: function(scope, element, attrs) {
+ scope.templateUrl = attrs.templateUrl;
+
+ scope.isOpen = function() {
+ var isDropdownOpen = scope.matches.length > 0;
+ scope.assignIsOpen({ isOpen: isDropdownOpen });
+ return isDropdownOpen;
+ };
+
+ scope.isActive = function(matchIdx) {
+ return scope.active === matchIdx;
+ };
+
+ scope.selectActive = function(matchIdx) {
+ scope.active = matchIdx;
+ };
+
+ scope.selectMatch = function(activeIdx, evt) {
+ var debounce = scope.debounce();
+ if (angular.isNumber(debounce) || angular.isObject(debounce)) {
+ $$debounce(function() {
+ scope.select({activeIdx: activeIdx, evt: evt});
+ }, angular.isNumber(debounce) ? debounce : debounce['default']);
+ } else {
+ scope.select({activeIdx: activeIdx, evt: evt});
+ }
+ };
+ }
+ };
+ }])
+
+ .directive('uibTypeaheadMatch', ['$templateRequest', '$compile', '$parse', function($templateRequest, $compile, $parse) {
+ return {
+ scope: {
+ index: '=',
+ match: '=',
+ query: '='
+ },
+ link: function(scope, element, attrs) {
+ var tplUrl = $parse(attrs.templateUrl)(scope.$parent) || 'uib/template/typeahead/typeahead-match.html';
+ $templateRequest(tplUrl).then(function(tplContent) {
+ var tplEl = angular.element(tplContent.trim());
+ element.replaceWith(tplEl);
+ $compile(tplEl)(scope);
+ });
+ }
+ };
+ }])
+
+ .filter('uibTypeaheadHighlight', ['$sce', '$injector', '$log', function($sce, $injector, $log) {
+ var isSanitizePresent;
+ isSanitizePresent = $injector.has('$sanitize');
+
+ function escapeRegexp(queryToEscape) {
+ // Regex: capture the whole query string and replace it with the string that will be used to match
+ // the results, for example if the capture is "a" the result will be \a
+ return queryToEscape.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1');
+ }
+
+ function containsHtml(matchItem) {
+ return /<.*>/g.test(matchItem);
+ }
+
+ return function(matchItem, query) {
+ if (!isSanitizePresent && containsHtml(matchItem)) {
+ $log.warn('Unsafe use of typeahead please use ngSanitize'); // Warn the user about the danger
+ }
+ matchItem = query ? ('' + matchItem).replace(new RegExp(escapeRegexp(query), 'gi'), '<strong>$&</strong>') : matchItem; // Replaces the capture string with a the same string inside of a "strong" tag
+ if (!isSanitizePresent) {
+ matchItem = $sce.trustAsHtml(matchItem); // If $sanitize is not present we pack the string in a $sce object for the ng-bind-html directive
+ }
+ return matchItem;
+ };
+ }]);
+
+ angular.module("uib/template/accordion/accordion-group.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/accordion/accordion-group.html",
+ "<div class=\"panel\" ng-class=\"panelClass || 'panel-default'\">\n" +
+ " <div class=\"panel-heading\" ng-keypress=\"toggleOpen($event)\">\n" +
+ " <h4 class=\"panel-title\">\n" +
+ " <div tabindex=\"0\" class=\"accordion-toggle\" ng-click=\"toggleOpen()\" uib-accordion-transclude=\"heading\"><span ng-class=\"{'text-muted': isDisabled}\">{{heading}}</span></div>\n" +
+ " </h4>\n" +
+ " </div>\n" +
+ " <div class=\"panel-collapse collapse\" uib-collapse=\"!isOpen\">\n" +
+ " <div class=\"panel-body\" ng-transclude></div>\n" +
+ " </div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/accordion/accordion.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/accordion/accordion.html",
+ "<div class=\"panel-group\" ng-transclude></div>");
+ }]);
+
+ angular.module("uib/template/alert/alert.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/alert/alert.html",
+ "<div class=\"alert\" ng-class=\"['alert-' + (type || 'warning'), closeable ? 'alert-dismissible' : null]\" role=\"alert\">\n" +
+ " <button ng-show=\"closeable\" type=\"button\" class=\"close\" ng-click=\"close({$event: $event})\">\n" +
+ " <span aria-hidden=\"true\">×</span>\n" +
+ " <span class=\"sr-only\">Close</span>\n" +
+ " </button>\n" +
+ " <div ng-transclude></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/carousel/carousel.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/carousel/carousel.html",
+ "<div ng-mouseenter=\"pause()\" ng-mouseleave=\"play()\" class=\"carousel\" ng-swipe-right=\"prev()\" ng-swipe-left=\"next()\">\n" +
+ " <div class=\"carousel-inner\" ng-transclude></div>\n" +
+ " <a role=\"button\" href class=\"left carousel-control\" ng-click=\"prev()\" ng-show=\"slides.length > 1\">\n" +
+ " <span aria-hidden=\"true\" class=\"glyphicon glyphicon-chevron-left\"></span>\n" +
+ " <span class=\"sr-only\">previous</span>\n" +
+ " </a>\n" +
+ " <a role=\"button\" href class=\"right carousel-control\" ng-click=\"next()\" ng-show=\"slides.length > 1\">\n" +
+ " <span aria-hidden=\"true\" class=\"glyphicon glyphicon-chevron-right\"></span>\n" +
+ " <span class=\"sr-only\">next</span>\n" +
+ " </a>\n" +
+ " <ol class=\"carousel-indicators\" ng-show=\"slides.length > 1\">\n" +
+ " <li ng-repeat=\"slide in slides | orderBy:indexOfSlide track by $index\" ng-class=\"{ active: isActive(slide) }\" ng-click=\"select(slide)\">\n" +
+ " <span class=\"sr-only\">slide {{ $index + 1 }} of {{ slides.length }}<span ng-if=\"isActive(slide)\">, currently active</span></span>\n" +
+ " </li>\n" +
+ " </ol>\n" +
+ "</div>");
+ }]);
+
+ angular.module("uib/template/carousel/slide.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/carousel/slide.html",
+ "<div ng-class=\"{\n" +
+ " 'active': active\n" +
+ " }\" class=\"item text-center\" ng-transclude></div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/datepicker/datepicker.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/datepicker/datepicker.html",
+ "<div class=\"uib-datepicker\" ng-switch=\"datepickerMode\" role=\"application\" ng-keydown=\"keydown($event)\">\n" +
+ " <uib-daypicker ng-switch-when=\"day\" tabindex=\"0\"></uib-daypicker>\n" +
+ " <uib-monthpicker ng-switch-when=\"month\" tabindex=\"0\"></uib-monthpicker>\n" +
+ " <uib-yearpicker ng-switch-when=\"year\" tabindex=\"0\"></uib-yearpicker>\n" +
+ "</div>");
+ }]);
+
+ angular.module("uib/template/datepicker/day.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/datepicker/day.html",
+ "<table class=\"uib-daypicker\" role=\"grid\" aria-labelledby=\"{{::uniqueId}}-title\" aria-activedescendant=\"{{activeDateId}}\">\n" +
+ " <thead>\n" +
+ " <tr>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left uib-left\" ng-click=\"move(-1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
+ " <th colspan=\"{{::5 + showWeeks}}\"><button id=\"{{::uniqueId}}-title\" role=\"heading\" aria-live=\"assertive\" aria-atomic=\"true\" type=\"button\" class=\"btn btn-default btn-sm uib-title\" ng-click=\"toggleMode()\" ng-disabled=\"datepickerMode === maxMode\" tabindex=\"-1\" style=\"width:100%;\"><strong>{{title}}</strong></button></th>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right uib-right\" ng-click=\"move(1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
+ " </tr>\n" +
+ " <tr>\n" +
+ " <th ng-if=\"showWeeks\" class=\"text-center\"></th>\n" +
+ " <th ng-repeat=\"label in ::labels track by $index\" class=\"text-center\"><small aria-label=\"{{::label.full}}\">{{::label.abbr}}</small></th>\n" +
+ " </tr>\n" +
+ " </thead>\n" +
+ " <tbody>\n" +
+ " <tr class=\"uib-weeks\" ng-repeat=\"row in rows track by $index\">\n" +
+ " <td ng-if=\"showWeeks\" class=\"text-center h6\"><em>{{ weekNumbers[$index] }}</em></td>\n" +
+ " <td ng-repeat=\"dt in row\" class=\"uib-day text-center\" role=\"gridcell\"\n" +
+ " id=\"{{::dt.uid}}\"\n" +
+ " ng-class=\"::dt.customClass\">\n" +
+ " <button type=\"button\" style=\"min-width:100%;\" class=\"btn btn-default btn-sm\"\n" +
+ " uib-is-class=\"\n" +
+ " 'btn-info' for selectedDt,\n" +
+ " 'active' for activeDt\n" +
+ " on dt\"\n" +
+ " ng-click=\"select(dt.date)\"\n" +
+ " ng-disabled=\"::dt.disabled\"\n" +
+ " tabindex=\"-1\"><span ng-class=\"::{'text-muted': dt.secondary, 'text-info': dt.current}\">{{::dt.label}}</span></button>\n" +
+ " </td>\n" +
+ " </tr>\n" +
+ " </tbody>\n" +
+ "</table>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/datepicker/month.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/datepicker/month.html",
+ "<table class=\"uib-monthpicker\" role=\"grid\" aria-labelledby=\"{{::uniqueId}}-title\" aria-activedescendant=\"{{activeDateId}}\">\n" +
+ " <thead>\n" +
+ " <tr>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left uib-left\" ng-click=\"move(-1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
+ " <th><button id=\"{{::uniqueId}}-title\" role=\"heading\" aria-live=\"assertive\" aria-atomic=\"true\" type=\"button\" class=\"btn btn-default btn-sm uib-title\" ng-click=\"toggleMode()\" ng-disabled=\"datepickerMode === maxMode\" tabindex=\"-1\" style=\"width:100%;\"><strong>{{title}}</strong></button></th>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right uib-right\" ng-click=\"move(1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
+ " </tr>\n" +
+ " </thead>\n" +
+ " <tbody>\n" +
+ " <tr class=\"uib-months\" ng-repeat=\"row in rows track by $index\">\n" +
+ " <td ng-repeat=\"dt in row\" class=\"uib-month text-center\" role=\"gridcell\"\n" +
+ " id=\"{{::dt.uid}}\"\n" +
+ " ng-class=\"::dt.customClass\">\n" +
+ " <button type=\"button\" style=\"min-width:100%;\" class=\"btn btn-default\"\n" +
+ " uib-is-class=\"\n" +
+ " 'btn-info' for selectedDt,\n" +
+ " 'active' for activeDt\n" +
+ " on dt\"\n" +
+ " ng-click=\"select(dt.date)\"\n" +
+ " ng-disabled=\"::dt.disabled\"\n" +
+ " tabindex=\"-1\"><span ng-class=\"::{'text-info': dt.current}\">{{::dt.label}}</span></button>\n" +
+ " </td>\n" +
+ " </tr>\n" +
+ " </tbody>\n" +
+ "</table>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/datepicker/popup.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/datepicker/popup.html",
+ "<ul class=\"uib-datepicker-popup dropdown-menu\" dropdown-nested ng-if=\"isOpen\" style=\"display: block\" ng-style=\"{top: position.top+'px', left: position.left+'px'}\" ng-keydown=\"keydown($event)\" ng-click=\"$event.stopPropagation()\">\n" +
+ " <li ng-transclude></li>\n" +
+ " <li ng-if=\"showButtonBar\" style=\"padding:10px 9px 2px\" class=\"uib-button-bar\">\n" +
+ " <span class=\"btn-group pull-left\">\n" +
+ " <button type=\"button\" class=\"btn btn-sm btn-info uib-datepicker-current\" ng-click=\"select('today')\" ng-disabled=\"isDisabled('today')\">{{ getText('current') }}</button>\n" +
+ " <button type=\"button\" class=\"btn btn-sm btn-danger uib-clear\" ng-click=\"select(null)\">{{ getText('clear') }}</button>\n" +
+ " </span>\n" +
+ " <button type=\"button\" class=\"btn btn-sm btn-success pull-right uib-close\" ng-click=\"close()\">{{ getText('close') }}</button>\n" +
+ " </li>\n" +
+ "</ul>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/datepicker/year.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/datepicker/year.html",
+ "<table class=\"uib-yearpicker\" role=\"grid\" aria-labelledby=\"{{::uniqueId}}-title\" aria-activedescendant=\"{{activeDateId}}\">\n" +
+ " <thead>\n" +
+ " <tr>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-left uib-left\" ng-click=\"move(-1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-left\"></i></button></th>\n" +
+ " <th colspan=\"{{::columns - 2}}\"><button id=\"{{::uniqueId}}-title\" role=\"heading\" aria-live=\"assertive\" aria-atomic=\"true\" type=\"button\" class=\"btn btn-default btn-sm uib-title\" ng-click=\"toggleMode()\" ng-disabled=\"datepickerMode === maxMode\" tabindex=\"-1\" style=\"width:100%;\"><strong>{{title}}</strong></button></th>\n" +
+ " <th><button type=\"button\" class=\"btn btn-default btn-sm pull-right uib-right\" ng-click=\"move(1)\" tabindex=\"-1\"><i class=\"glyphicon glyphicon-chevron-right\"></i></button></th>\n" +
+ " </tr>\n" +
+ " </thead>\n" +
+ " <tbody>\n" +
+ " <tr class=\"uib-years\" ng-repeat=\"row in rows track by $index\">\n" +
+ " <td ng-repeat=\"dt in row\" class=\"uib-year text-center\" role=\"gridcell\"\n" +
+ " id=\"{{::dt.uid}}\"\n" +
+ " ng-class=\"::dt.customClass\">\n" +
+ " <button type=\"button\" style=\"min-width:100%;\" class=\"btn btn-default\"\n" +
+ " uib-is-class=\"\n" +
+ " 'btn-info' for selectedDt,\n" +
+ " 'active' for activeDt\n" +
+ " on dt\"\n" +
+ " ng-click=\"select(dt.date)\"\n" +
+ " ng-disabled=\"::dt.disabled\"\n" +
+ " tabindex=\"-1\"><span ng-class=\"::{'text-info': dt.current}\">{{::dt.label}}</span></button>\n" +
+ " </td>\n" +
+ " </tr>\n" +
+ " </tbody>\n" +
+ "</table>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/modal/backdrop.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/modal/backdrop.html",
+ "<div class=\"modal-backdrop\"\n" +
+ " uib-modal-animation-class=\"fade\"\n" +
+ " modal-in-class=\"in\"\n" +
+ " ng-style=\"{'z-index': 1040 + (index && 1 || 0) + index*10}\"\n" +
+ "></div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/modal/window.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/modal/window.html",
+ "<div modal-render=\"{{$isRendered}}\" tabindex=\"-1\" role=\"dialog\" class=\"modal\"\n" +
+ " uib-modal-animation-class=\"fade\"\n" +
+ " modal-in-class=\"in\"\n" +
+ " ng-style=\"{'z-index': 1050 + index*10, display: 'block'}\">\n" +
+ " <div class=\"modal-dialog\" ng-class=\"size ? 'modal-' + size : ''\"><div class=\"modal-content\" uib-modal-transclude></div></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/pager/pager.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/pager/pager.html",
+ "<ul class=\"pager\">\n" +
+ " <li ng-class=\"{disabled: noPrevious()||ngDisabled, previous: align}\"><a href ng-click=\"selectPage(page - 1, $event)\">{{::getText('previous')}}</a></li>\n" +
+ " <li ng-class=\"{disabled: noNext()||ngDisabled, next: align}\"><a href ng-click=\"selectPage(page + 1, $event)\">{{::getText('next')}}</a></li>\n" +
+ "</ul>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/pagination/pager.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/pagination/pager.html",
+ "<ul class=\"pager\">\n" +
+ " <li ng-class=\"{disabled: noPrevious()||ngDisabled, previous: align}\"><a href ng-click=\"selectPage(page - 1, $event)\">{{::getText('previous')}}</a></li>\n" +
+ " <li ng-class=\"{disabled: noNext()||ngDisabled, next: align}\"><a href ng-click=\"selectPage(page + 1, $event)\">{{::getText('next')}}</a></li>\n" +
+ "</ul>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/pagination/pagination.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/pagination/pagination.html",
+ "<ul class=\"pagination\">\n" +
+ " <li ng-if=\"::boundaryLinks\" ng-class=\"{disabled: noPrevious()||ngDisabled}\" class=\"pagination-first\"><a href ng-click=\"selectPage(1, $event)\">{{::getText('first')}}</a></li>\n" +
+ " <li ng-if=\"::directionLinks\" ng-class=\"{disabled: noPrevious()||ngDisabled}\" class=\"pagination-prev\"><a href ng-click=\"selectPage(page - 1, $event)\">{{::getText('previous')}}</a></li>\n" +
+ " <li ng-repeat=\"page in pages track by $index\" ng-class=\"{active: page.active,disabled: ngDisabled&&!page.active}\" class=\"pagination-page\"><a href ng-click=\"selectPage(page.number, $event)\">{{page.text}}</a></li>\n" +
+ " <li ng-if=\"::directionLinks\" ng-class=\"{disabled: noNext()||ngDisabled}\" class=\"pagination-next\"><a href ng-click=\"selectPage(page + 1, $event)\">{{::getText('next')}}</a></li>\n" +
+ " <li ng-if=\"::boundaryLinks\" ng-class=\"{disabled: noNext()||ngDisabled}\" class=\"pagination-last\"><a href ng-click=\"selectPage(totalPages, $event)\">{{::getText('last')}}</a></li>\n" +
+ "</ul>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/tooltip/tooltip-html-popup.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/tooltip/tooltip-html-popup.html",
+ "<div class=\"tooltip\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"tooltip-arrow\"></div>\n" +
+ " <div class=\"tooltip-inner\" ng-bind-html=\"contentExp()\"></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/tooltip/tooltip-popup.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/tooltip/tooltip-popup.html",
+ "<div class=\"tooltip\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"tooltip-arrow\"></div>\n" +
+ " <div class=\"tooltip-inner\" ng-bind=\"content\"></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/tooltip/tooltip-template-popup.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/tooltip/tooltip-template-popup.html",
+ "<div class=\"tooltip\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"tooltip-arrow\"></div>\n" +
+ " <div class=\"tooltip-inner\"\n" +
+ " uib-tooltip-template-transclude=\"contentExp()\"\n" +
+ " tooltip-template-transclude-scope=\"originScope()\"></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/popover/popover-html.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/popover/popover-html.html",
+ "<div class=\"popover\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"arrow\"></div>\n" +
+ "\n" +
+ " <div class=\"popover-inner\">\n" +
+ " <h3 class=\"popover-title\" ng-bind=\"title\" ng-if=\"title\"></h3>\n" +
+ " <div class=\"popover-content\" ng-bind-html=\"contentExp()\"></div>\n" +
+ " </div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/popover/popover-template.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/popover/popover-template.html",
+ "<div class=\"popover\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"arrow\"></div>\n" +
+ "\n" +
+ " <div class=\"popover-inner\">\n" +
+ " <h3 class=\"popover-title\" ng-bind=\"title\" ng-if=\"title\"></h3>\n" +
+ " <div class=\"popover-content\"\n" +
+ " uib-tooltip-template-transclude=\"contentExp()\"\n" +
+ " tooltip-template-transclude-scope=\"originScope()\"></div>\n" +
+ " </div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/popover/popover.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/popover/popover.html",
+ "<div class=\"popover\"\n" +
+ " tooltip-animation-class=\"fade\"\n" +
+ " uib-tooltip-classes\n" +
+ " ng-class=\"{ in: isOpen() }\">\n" +
+ " <div class=\"arrow\"></div>\n" +
+ "\n" +
+ " <div class=\"popover-inner\">\n" +
+ " <h3 class=\"popover-title\" ng-bind=\"title\" ng-if=\"title\"></h3>\n" +
+ " <div class=\"popover-content\" ng-bind=\"content\"></div>\n" +
+ " </div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/progressbar/bar.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/progressbar/bar.html",
+ "<div class=\"progress-bar\" ng-class=\"type && 'progress-bar-' + type\" role=\"progressbar\" aria-valuenow=\"{{value}}\" aria-valuemin=\"0\" aria-valuemax=\"{{max}}\" ng-style=\"{width: (percent < 100 ? percent : 100) + '%'}\" aria-valuetext=\"{{percent | number:0}}%\" aria-labelledby=\"{{::title}}\" ng-transclude></div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/progressbar/progress.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/progressbar/progress.html",
+ "<div class=\"progress\" ng-transclude aria-labelledby=\"{{::title}}\"></div>");
+ }]);
+
+ angular.module("uib/template/progressbar/progressbar.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/progressbar/progressbar.html",
+ "<div class=\"progress\">\n" +
+ " <div class=\"progress-bar\" ng-class=\"type && 'progress-bar-' + type\" role=\"progressbar\" aria-valuenow=\"{{value}}\" aria-valuemin=\"0\" aria-valuemax=\"{{max}}\" ng-style=\"{width: (percent < 100 ? percent : 100) + '%'}\" aria-valuetext=\"{{percent | number:0}}%\" aria-labelledby=\"{{::title}}\" ng-transclude></div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/rating/rating.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/rating/rating.html",
+ "<span ng-mouseleave=\"reset()\" ng-keydown=\"onKeydown($event)\" tabindex=\"0\" role=\"slider\" aria-valuemin=\"0\" aria-valuemax=\"{{range.length}}\" aria-valuenow=\"{{value}}\">\n" +
+ " <span ng-repeat-start=\"r in range track by $index\" class=\"sr-only\">({{ $index < value ? '*' : ' ' }})</span>\n" +
+ " <i ng-repeat-end ng-mouseenter=\"enter($index + 1)\" ng-click=\"rate($index + 1)\" class=\"glyphicon\" ng-class=\"$index < value && (r.stateOn || 'glyphicon-star') || (r.stateOff || 'glyphicon-star-empty')\" ng-attr-title=\"{{r.title}}\" aria-valuetext=\"{{r.title}}\"></i>\n" +
+ "</span>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/tabs/tab.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/tabs/tab.html",
+ "<li ng-class=\"{active: active, disabled: disabled}\" class=\"uib-tab\">\n" +
+ " <div ng-click=\"select()\" uib-tab-heading-transclude>{{heading}}</div>\n" +
+ "</li>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/tabs/tabset.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/tabs/tabset.html",
+ "<div>\n" +
+ " <ul class=\"nav nav-{{type || 'tabs'}}\" ng-class=\"{'nav-stacked': vertical, 'nav-justified': justified}\" ng-transclude></ul>\n" +
+ " <div class=\"tab-content\">\n" +
+ " <div class=\"tab-pane\" \n" +
+ " ng-repeat=\"tab in tabs\" \n" +
+ " ng-class=\"{active: tab.active}\"\n" +
+ " uib-tab-content-transclude=\"tab\">\n" +
+ " </div>\n" +
+ " </div>\n" +
+ "</div>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/timepicker/timepicker.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/timepicker/timepicker.html",
+ "<table class=\"uib-timepicker\">\n" +
+ " <tbody>\n" +
+ " <tr class=\"text-center\" ng-show=\"::showSpinners\">\n" +
+ " <td class=\"uib-increment hours\"><a ng-click=\"incrementHours()\" ng-class=\"{disabled: noIncrementHours()}\" class=\"btn btn-link\" ng-disabled=\"noIncrementHours()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-up\"></span></a></td>\n" +
+ " <td> </td>\n" +
+ " <td class=\"uib-increment minutes\"><a ng-click=\"incrementMinutes()\" ng-class=\"{disabled: noIncrementMinutes()}\" class=\"btn btn-link\" ng-disabled=\"noIncrementMinutes()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-up\"></span></a></td>\n" +
+ " <td ng-show=\"showSeconds\"> </td>\n" +
+ " <td ng-show=\"showSeconds\" class=\"uib-increment seconds\"><a ng-click=\"incrementSeconds()\" ng-class=\"{disabled: noIncrementSeconds()}\" class=\"btn btn-link\" ng-disabled=\"noIncrementSeconds()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-up\"></span></a></td>\n" +
+ " <td ng-show=\"showMeridian\"></td>\n" +
+ " </tr>\n" +
+ " <tr>\n" +
+ " <td class=\"form-group uib-time hours\" ng-class=\"{'has-error': invalidHours}\">\n" +
+ " <input style=\"width:50px;\" type=\"text\" placeholder=\"HH\" ng-model=\"hours\" ng-change=\"updateHours()\" class=\"form-control text-center\" ng-readonly=\"::readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"disabled\" ng-blur=\"blur()\">\n" +
+ " </td>\n" +
+ " <td class=\"uib-separator\">:</td>\n" +
+ " <td class=\"form-group uib-time minutes\" ng-class=\"{'has-error': invalidMinutes}\">\n" +
+ " <input style=\"width:50px;\" type=\"text\" placeholder=\"MM\" ng-model=\"minutes\" ng-change=\"updateMinutes()\" class=\"form-control text-center\" ng-readonly=\"::readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"disabled\" ng-blur=\"blur()\">\n" +
+ " </td>\n" +
+ " <td ng-show=\"showSeconds\" class=\"uib-separator\">:</td>\n" +
+ " <td class=\"form-group uib-time seconds\" ng-class=\"{'has-error': invalidSeconds}\" ng-show=\"showSeconds\">\n" +
+ " <input style=\"width:50px;\" type=\"text\" ng-model=\"seconds\" ng-change=\"updateSeconds()\" class=\"form-control text-center\" ng-readonly=\"readonlyInput\" maxlength=\"2\" tabindex=\"{{::tabindex}}\" ng-disabled=\"disabled\" ng-blur=\"blur()\">\n" +
+ " </td>\n" +
+ " <td ng-show=\"showMeridian\" class=\"uib-time am-pm\"><button type=\"button\" ng-class=\"{disabled: noToggleMeridian()}\" class=\"btn btn-default text-center\" ng-click=\"toggleMeridian()\" ng-disabled=\"noToggleMeridian()\" tabindex=\"{{::tabindex}}\">{{meridian}}</button></td>\n" +
+ " </tr>\n" +
+ " <tr class=\"text-center\" ng-show=\"::showSpinners\">\n" +
+ " <td class=\"uib-decrement hours\"><a ng-click=\"decrementHours()\" ng-class=\"{disabled: noDecrementHours()}\" class=\"btn btn-link\" ng-disabled=\"noDecrementHours()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +
+ " <td> </td>\n" +
+ " <td class=\"uib-decrement minutes\"><a ng-click=\"decrementMinutes()\" ng-class=\"{disabled: noDecrementMinutes()}\" class=\"btn btn-link\" ng-disabled=\"noDecrementMinutes()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +
+ " <td ng-show=\"showSeconds\"> </td>\n" +
+ " <td ng-show=\"showSeconds\" class=\"uib-decrement seconds\"><a ng-click=\"decrementSeconds()\" ng-class=\"{disabled: noDecrementSeconds()}\" class=\"btn btn-link\" ng-disabled=\"noDecrementSeconds()\" tabindex=\"{{::tabindex}}\"><span class=\"glyphicon glyphicon-chevron-down\"></span></a></td>\n" +
+ " <td ng-show=\"showMeridian\"></td>\n" +
+ " </tr>\n" +
+ " </tbody>\n" +
+ "</table>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/typeahead/typeahead-match.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/typeahead/typeahead-match.html",
+ "<a href tabindex=\"-1\" ng-bind-html=\"match.label | uibTypeaheadHighlight:query\"></a>\n" +
+ "");
+ }]);
+
+ angular.module("uib/template/typeahead/typeahead-popup.html", []).run(["$templateCache", function($templateCache) {
+ $templateCache.put("uib/template/typeahead/typeahead-popup.html",
+ "<ul class=\"dropdown-menu\" ng-show=\"isOpen() && !moveInProgress\" ng-style=\"{top: position().top+'px', left: position().left+'px'}\" style=\"display: block;\" role=\"listbox\" aria-hidden=\"{{!isOpen()}}\">\n" +
+ " <li ng-repeat=\"match in matches track by $index\" ng-class=\"{active: isActive($index) }\" ng-mouseenter=\"selectActive($index)\" ng-click=\"selectMatch($index, $event)\" role=\"option\" id=\"{{::match.id}}\">\n" +
+ " <div uib-typeahead-match index=\"$index\" match=\"match\" query=\"query\" template-url=\"templateUrl\"></div>\n" +
+ " </li>\n" +
+ "</ul>\n" +
+ "");
+ }]);
+ angular.module('ui.bootstrap.carousel').run(function() {!angular.$$csp() && angular.element(document).find('head').prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>'); })
+
+ /***/ },
+ /* 8 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 11 */
++=======
+ /* 9 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 12 */
++=======
+ /* 10 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 13 */
++=======
+ /* 11 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 14 */
++=======
+ /* 12 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 15 */
++=======
+ /* 13 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 16 */
++=======
+ /* 14 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 17 */
++=======
+ /* 15 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 18 */
++=======
+ /* 16 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 19 */
++=======
+ /* 17 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 20 */
++=======
+ /* 18 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 21 */
++=======
+ /* 19 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 22 */
++=======
+ /* 20 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 23 */
++=======
+ /* 21 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());
/***/ },
++<<<<<<< HEAD
+/* 24 */
++=======
+ /* 22 */
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
/***/ function(module, exports) {
var app;
var endPoint = '/api/v1/debug';
return this.$http.get(endPoint);
};
++<<<<<<< HEAD
+ APIEndPoint.prototype.upload = function () {
+ var endPoint = '/api/v1/upload';
+ return this.$http.get(endPoint);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
APIEndPoint.prototype.help = function (command) {
var endPoint = '/api/v1/help/' + command;
return this.$http.get(endPoint);
this.modalOption.size = 'lg';
return this.$uibModal.open(this.modalOption);
};
++<<<<<<< HEAD
+ MyModal.prototype.upload = function () {
+ this.modalOption.templateUrl = 'templates/upload.html';
+ this.modalOption.controller = 'uploadController';
+ this.modalOption.controllerAs = 'c';
+ this.modalOption.size = 'lg';
+ return this.$uibModal.open(this.modalOption);
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
MyModal.$inject = ['$uibModal'];
return MyModal;
})();
})(app || (app = {}));
var app;
(function (app) {
++<<<<<<< HEAD
+ var directives;
+ (function (directives) {
+ var Upload = (function () {
+ function Upload() {
+ this.restrict = 'E';
+ this.replace = true;
+ this.scope = true;
+ this.controller = 'UploadController';
+ this.controllerAs = 'ctrl';
+ this.bindToController = {
+ index: '=',
+ name: '=',
+ remove: '&',
+ list: '='
+ };
+ this.templateUrl = 'templates/upload.html';
+ console.log("templates/upload.html-constructor");
+ }
+ Upload.Factory = function () {
+ var directive = function () {
+ return new Upload();
+ };
+ directive.$inject = [];
+ return directive;
+ };
+ return Upload;
+ })();
+ directives.Upload = Upload;
+ var UploadController = (function () {
+ function UploadController(APIEndPoint, $scope, MyModal, WebSocket, $window, $rootScope, Console) {
+ this.APIEndPoint = APIEndPoint;
+ this.$scope = $scope;
+ this.MyModal = MyModal;
+ this.WebSocket = WebSocket;
+ this.$window = $window;
+ this.$rootScope = $rootScope;
+ this.Console = Console;
+ var controller = this;
+ console.log("directive.upload-constructor");
+ }
+ UploadController.prototype.submit = function () {
+ console.log("submit: function not supported¥n");
+ };
+ UploadController.$inject = ['APIEndPoint', '$scope', 'MyModal', 'WebSocket', '$window', '$rootScope', 'Console'];
+ return UploadController;
+ })();
+ directives.UploadController = UploadController;
+ })(directives = app.directives || (app.directives = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var controllers;
(function (controllers) {
var Execution = (function () {
Workspace.prototype.addDirectory = function (info, directoryList) {
directoryList.push(info);
};
++<<<<<<< HEAD
+ Workspace.prototype.upload = function () {
+ this.MyModal.upload();
+ };
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
Workspace.prototype.debug = function () {
this.MyModal.preview();
};
(function (app) {
var controllers;
(function (controllers) {
++<<<<<<< HEAD
+ var Upload = (function () {
+ function Upload($scope, APIEndPoint, $modalInstance) {
+ this.APIEndPoint = APIEndPoint;
+ this.$modalInstance = $modalInstance;
+ var controller = this;
+ console.log('controller.upload-controllers');
+ }
+ Upload.$inject = ['$scope', 'APIEndPoint', '$uibModalInstance'];
+ return Upload;
+ })();
+ controllers.Upload = Upload;
+ })(controllers = app.controllers || (app.controllers = {}));
+ })(app || (app = {}));
+ var app;
+ (function (app) {
+ var controllers;
+ (function (controllers) {
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
var Preview = (function () {
function Preview($scope, APIEndPoint, $modalInstance) {
this.APIEndPoint = APIEndPoint;
app.zephyr.filter('Tag', filters.Tag);
app.zephyr.controller('selectCommandController', app.controllers.SelectCommand);
app.zephyr.controller('previewController', app.controllers.Preview);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.controllers.Upload);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.controller('executionController', app.controllers.Execution);
app.zephyr.controller('workspaceController', app.controllers.Workspace);
app.zephyr.controller('historyController', app.controllers.History);
app.zephyr.controller('optionController', app.directives.OptionController);
app.zephyr.controller('directoryController', app.directives.DirectoryController);
app.zephyr.controller('HeaderMenuController', app.directives.HeaderMenuController);
++<<<<<<< HEAD
+ app.zephyr.controller('uploadController', app.directives.UploadController);
++=======
++>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
app.zephyr.directive('command', app.directives.Command.Factory());
app.zephyr.directive('option', app.directives.Option.Factory());