diff --git a/chrome-extension/js/etherwallet-master.js b/chrome-extension/js/etherwallet-master.js
index f2ba82d927..5ece1e9975 100644
--- a/chrome-extension/js/etherwallet-master.js
+++ b/chrome-extension/js/etherwallet-master.js
@@ -4145,6 +4145,8 @@ var walletGenCtrl = function walletGenCtrl($scope) {
module.exports = walletGenCtrl;
},{}],36:[function(require,module,exports){
+'use strict';
+
// For token sale holders:
// 1. Add the address users are sending to
// 2. Add the gas limit users should use to send successfully (this avoids OOG errors)
@@ -4691,6 +4693,8 @@ var walletDecryptDrtv = function walletDecryptDrtv() {
module.exports = walletDecryptDrtv;
},{"./walletDecryptDrtv.html":45}],47:[function(require,module,exports){
+'use strict';
+
var ens = require('./ens');
var domainsaleInterface = require('./domainsaleConfigs/domainsaleABI.json');
@@ -5272,6 +5276,8 @@ module.exports=[
},{}],49:[function(require,module,exports){
(function (Buffer){
+'use strict';
+
var uts46 = require('idna-uts46');
var registryInterface = require('./ensConfigs/registryABI.json');
var resolverInterface = require('./ensConfigs/resolverABI.json');
@@ -8287,6 +8293,8 @@ var walletService = function walletService() {
module.exports = walletService;
},{}],73:[function(require,module,exports){
+'use strict';
+
var f = require('./formatters');
var SolidityType = require('./type');
@@ -8315,6 +8323,8 @@ SolidityTypeAddress.prototype.isType = function (name) {
module.exports = SolidityTypeAddress;
},{"./formatters":79,"./type":84}],74:[function(require,module,exports){
+'use strict';
+
var f = require('./formatters');
var SolidityType = require('./type');
@@ -8343,6 +8353,8 @@ SolidityTypeBool.prototype.isType = function (name) {
module.exports = SolidityTypeBool;
},{"./formatters":79,"./type":84}],75:[function(require,module,exports){
+'use strict';
+
var f = require('./formatters');
var SolidityType = require('./type');
@@ -8374,6 +8386,8 @@ SolidityTypeBytes.prototype.isType = function (name) {
module.exports = SolidityTypeBytes;
},{"./formatters":79,"./type":84}],76:[function(require,module,exports){
+'use strict';
+
/*
This file is part of web3.js.
@@ -8625,6 +8639,8 @@ var coder = new SolidityCoder([new SolidityTypeAddress(), new SolidityTypeBool()
module.exports = coder;
},{"./address":73,"./bool":74,"./bytes":75,"./dynamicbytes":78,"./formatters":79,"./int":80,"./real":82,"./string":83,"./uint":85,"./ureal":86,"./utils":87}],77:[function(require,module,exports){
+'use strict';
+
/*
This file is part of web3.js.
@@ -8676,6 +8692,8 @@ module.exports = {
};
},{"bignumber.js":158}],78:[function(require,module,exports){
+'use strict';
+
var f = require('./formatters');
var SolidityType = require('./type');
@@ -8698,6 +8716,8 @@ SolidityTypeDynamicBytes.prototype.isDynamicType = function () {
module.exports = SolidityTypeDynamicBytes;
},{"./formatters":79,"./type":84}],79:[function(require,module,exports){
+'use strict';
+
/*
This file is part of web3.js.
@@ -8951,6 +8971,8 @@ module.exports = {
};
},{"./config":77,"./param":81,"./utils":87,"bignumber.js":158}],80:[function(require,module,exports){
+'use strict';
+
var f = require('./formatters');
var SolidityType = require('./type');
@@ -8985,6 +9007,8 @@ SolidityTypeInt.prototype.isType = function (name) {
module.exports = SolidityTypeInt;
},{"./formatters":79,"./type":84}],81:[function(require,module,exports){
+'use strict';
+
/*
This file is part of web3.js.
@@ -9136,6 +9160,8 @@ SolidityParam.encodeList = function (params) {
module.exports = SolidityParam;
},{"./utils":87}],82:[function(require,module,exports){
+'use strict';
+
var f = require('./formatters');
var SolidityType = require('./type');
@@ -9170,6 +9196,8 @@ SolidityTypeReal.prototype.isType = function (name) {
module.exports = SolidityTypeReal;
},{"./formatters":79,"./type":84}],83:[function(require,module,exports){
+'use strict';
+
var f = require('./formatters');
var SolidityType = require('./type');
@@ -9192,6 +9220,8 @@ SolidityTypeString.prototype.isDynamicType = function () {
module.exports = SolidityTypeString;
},{"./formatters":79,"./type":84}],84:[function(require,module,exports){
+'use strict';
+
var f = require('./formatters');
var SolidityParam = require('./param');
@@ -9444,6 +9474,8 @@ SolidityType.prototype.decode = function (bytes, offset, name) {
module.exports = SolidityType;
},{"./formatters":79,"./param":81}],85:[function(require,module,exports){
+'use strict';
+
var f = require('./formatters');
var SolidityType = require('./type');
@@ -9478,6 +9510,8 @@ SolidityTypeUInt.prototype.isType = function (name) {
module.exports = SolidityTypeUInt;
},{"./formatters":79,"./type":84}],86:[function(require,module,exports){
+'use strict';
+
var f = require('./formatters');
var SolidityType = require('./type');
@@ -9512,6 +9546,8 @@ SolidityTypeUReal.prototype.isType = function (name) {
module.exports = SolidityTypeUReal;
},{"./formatters":79,"./type":84}],87:[function(require,module,exports){
+'use strict';
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
/*
@@ -10638,6 +10674,8 @@ module.exports = Ledger3;
}).call(this,require("buffer").Buffer)
},{"buffer":201}],93:[function(require,module,exports){
+'use strict';
+
/**
* (C) 2017 SatoshiLabs
*
@@ -19910,2284 +19948,2247 @@ Web3Wallet.prototype.getV3Filename = function (timestamp) {
module.exports = Web3Wallet;
},{"./myetherwallet.js":62}],134:[function(require,module,exports){
+'use strict';
+
/**
* @license AngularJS v1.6.8
* (c) 2010-2017 Google, Inc. http://angularjs.org
* License: MIT
*/
-(function(window, angular) {'use strict';
-
-var ELEMENT_NODE = 1;
-var COMMENT_NODE = 8;
-
-var ADD_CLASS_SUFFIX = '-add';
-var REMOVE_CLASS_SUFFIX = '-remove';
-var EVENT_CLASS_PREFIX = 'ng-';
-var ACTIVE_CLASS_SUFFIX = '-active';
-var PREPARE_CLASS_SUFFIX = '-prepare';
-
-var NG_ANIMATE_CLASSNAME = 'ng-animate';
-var NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren';
-
-// Detect proper transitionend/animationend event names.
-var CSS_PREFIX = '', TRANSITION_PROP, TRANSITIONEND_EVENT, ANIMATION_PROP, ANIMATIONEND_EVENT;
-
-// If unprefixed events are not supported but webkit-prefixed are, use the latter.
-// Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.
-// Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`
-// but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.
-// Register both events in case `window.onanimationend` is not supported because of that,
-// do the same for `transitionend` as Safari is likely to exhibit similar behavior.
-// Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit
-// therefore there is no reason to test anymore for other vendor prefixes:
-// http://caniuse.com/#search=transition
-if ((window.ontransitionend === undefined) && (window.onwebkittransitionend !== undefined)) {
- CSS_PREFIX = '-webkit-';
- TRANSITION_PROP = 'WebkitTransition';
- TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';
-} else {
- TRANSITION_PROP = 'transition';
- TRANSITIONEND_EVENT = 'transitionend';
-}
+(function (window, angular) {
+ 'use strict';
-if ((window.onanimationend === undefined) && (window.onwebkitanimationend !== undefined)) {
- CSS_PREFIX = '-webkit-';
- ANIMATION_PROP = 'WebkitAnimation';
- ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';
-} else {
- ANIMATION_PROP = 'animation';
- ANIMATIONEND_EVENT = 'animationend';
-}
-
-var DURATION_KEY = 'Duration';
-var PROPERTY_KEY = 'Property';
-var DELAY_KEY = 'Delay';
-var TIMING_KEY = 'TimingFunction';
-var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';
-var ANIMATION_PLAYSTATE_KEY = 'PlayState';
-var SAFE_FAST_FORWARD_DURATION_VALUE = 9999;
-
-var ANIMATION_DELAY_PROP = ANIMATION_PROP + DELAY_KEY;
-var ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY;
-var TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY;
-var TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY;
-
-var ngMinErr = angular.$$minErr('ng');
-function assertArg(arg, name, reason) {
- if (!arg) {
- throw ngMinErr('areq', 'Argument \'{0}\' is {1}', (name || '?'), (reason || 'required'));
- }
- return arg;
-}
-
-function mergeClasses(a,b) {
- if (!a && !b) return '';
- if (!a) return b;
- if (!b) return a;
- if (isArray(a)) a = a.join(' ');
- if (isArray(b)) b = b.join(' ');
- return a + ' ' + b;
-}
-
-function packageStyles(options) {
- var styles = {};
- if (options && (options.to || options.from)) {
- styles.to = options.to;
- styles.from = options.from;
- }
- return styles;
-}
-
-function pendClasses(classes, fix, isPrefix) {
- var className = '';
- classes = isArray(classes)
- ? classes
- : classes && isString(classes) && classes.length
- ? classes.split(/\s+/)
- : [];
- forEach(classes, function(klass, i) {
- if (klass && klass.length > 0) {
- className += (i > 0) ? ' ' : '';
- className += isPrefix ? fix + klass
- : klass + fix;
- }
- });
- return className;
-}
+ var ELEMENT_NODE = 1;
+ var COMMENT_NODE = 8;
+
+ var ADD_CLASS_SUFFIX = '-add';
+ var REMOVE_CLASS_SUFFIX = '-remove';
+ var EVENT_CLASS_PREFIX = 'ng-';
+ var ACTIVE_CLASS_SUFFIX = '-active';
+ var PREPARE_CLASS_SUFFIX = '-prepare';
+
+ var NG_ANIMATE_CLASSNAME = 'ng-animate';
+ var NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren';
+
+ // Detect proper transitionend/animationend event names.
+ var CSS_PREFIX = '',
+ TRANSITION_PROP,
+ TRANSITIONEND_EVENT,
+ ANIMATION_PROP,
+ ANIMATIONEND_EVENT;
+
+ // If unprefixed events are not supported but webkit-prefixed are, use the latter.
+ // Otherwise, just use W3C names, browsers not supporting them at all will just ignore them.
+ // Note: Chrome implements `window.onwebkitanimationend` and doesn't implement `window.onanimationend`
+ // but at the same time dispatches the `animationend` event and not `webkitAnimationEnd`.
+ // Register both events in case `window.onanimationend` is not supported because of that,
+ // do the same for `transitionend` as Safari is likely to exhibit similar behavior.
+ // Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit
+ // therefore there is no reason to test anymore for other vendor prefixes:
+ // http://caniuse.com/#search=transition
+ if (window.ontransitionend === undefined && window.onwebkittransitionend !== undefined) {
+ CSS_PREFIX = '-webkit-';
+ TRANSITION_PROP = 'WebkitTransition';
+ TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';
+ } else {
+ TRANSITION_PROP = 'transition';
+ TRANSITIONEND_EVENT = 'transitionend';
+ }
-function removeFromArray(arr, val) {
- var index = arr.indexOf(val);
- if (val >= 0) {
- arr.splice(index, 1);
+ if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) {
+ CSS_PREFIX = '-webkit-';
+ ANIMATION_PROP = 'WebkitAnimation';
+ ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';
+ } else {
+ ANIMATION_PROP = 'animation';
+ ANIMATIONEND_EVENT = 'animationend';
}
-}
-function stripCommentsFromElement(element) {
- if (element instanceof jqLite) {
- switch (element.length) {
- case 0:
- return element;
+ var DURATION_KEY = 'Duration';
+ var PROPERTY_KEY = 'Property';
+ var DELAY_KEY = 'Delay';
+ var TIMING_KEY = 'TimingFunction';
+ var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';
+ var ANIMATION_PLAYSTATE_KEY = 'PlayState';
+ var SAFE_FAST_FORWARD_DURATION_VALUE = 9999;
- case 1:
- // there is no point of stripping anything if the element
- // is the only element within the jqLite wrapper.
- // (it's important that we retain the element instance.)
- if (element[0].nodeType === ELEMENT_NODE) {
- return element;
- }
- break;
+ var ANIMATION_DELAY_PROP = ANIMATION_PROP + DELAY_KEY;
+ var ANIMATION_DURATION_PROP = ANIMATION_PROP + DURATION_KEY;
+ var TRANSITION_DELAY_PROP = TRANSITION_PROP + DELAY_KEY;
+ var TRANSITION_DURATION_PROP = TRANSITION_PROP + DURATION_KEY;
- default:
- return jqLite(extractElementNode(element));
+ var ngMinErr = angular.$$minErr('ng');
+ function assertArg(arg, name, reason) {
+ if (!arg) {
+ throw ngMinErr('areq', 'Argument \'{0}\' is {1}', name || '?', reason || 'required');
}
+ return arg;
}
- if (element.nodeType === ELEMENT_NODE) {
- return jqLite(element);
+ function mergeClasses(a, b) {
+ if (!a && !b) return '';
+ if (!a) return b;
+ if (!b) return a;
+ if (isArray(a)) a = a.join(' ');
+ if (isArray(b)) b = b.join(' ');
+ return a + ' ' + b;
}
-}
-function extractElementNode(element) {
- if (!element[0]) return element;
- for (var i = 0; i < element.length; i++) {
- var elm = element[i];
- if (elm.nodeType === ELEMENT_NODE) {
- return elm;
+ function packageStyles(options) {
+ var styles = {};
+ if (options && (options.to || options.from)) {
+ styles.to = options.to;
+ styles.from = options.from;
}
+ return styles;
}
-}
-
-function $$addClass($$jqLite, element, className) {
- forEach(element, function(elm) {
- $$jqLite.addClass(elm, className);
- });
-}
-
-function $$removeClass($$jqLite, element, className) {
- forEach(element, function(elm) {
- $$jqLite.removeClass(elm, className);
- });
-}
-function applyAnimationClassesFactory($$jqLite) {
- return function(element, options) {
- if (options.addClass) {
- $$addClass($$jqLite, element, options.addClass);
- options.addClass = null;
- }
- if (options.removeClass) {
- $$removeClass($$jqLite, element, options.removeClass);
- options.removeClass = null;
- }
- };
-}
-
-function prepareAnimationOptions(options) {
- options = options || {};
- if (!options.$$prepared) {
- var domOperation = options.domOperation || noop;
- options.domOperation = function() {
- options.$$domOperationFired = true;
- domOperation();
- domOperation = noop;
- };
- options.$$prepared = true;
+ function pendClasses(classes, fix, isPrefix) {
+ var className = '';
+ classes = isArray(classes) ? classes : classes && isString(classes) && classes.length ? classes.split(/\s+/) : [];
+ forEach(classes, function (klass, i) {
+ if (klass && klass.length > 0) {
+ className += i > 0 ? ' ' : '';
+ className += isPrefix ? fix + klass : klass + fix;
+ }
+ });
+ return className;
}
- return options;
-}
-function applyAnimationStyles(element, options) {
- applyAnimationFromStyles(element, options);
- applyAnimationToStyles(element, options);
-}
-
-function applyAnimationFromStyles(element, options) {
- if (options.from) {
- element.css(options.from);
- options.from = null;
+ function removeFromArray(arr, val) {
+ var index = arr.indexOf(val);
+ if (val >= 0) {
+ arr.splice(index, 1);
+ }
}
-}
-function applyAnimationToStyles(element, options) {
- if (options.to) {
- element.css(options.to);
- options.to = null;
- }
-}
+ function stripCommentsFromElement(element) {
+ if (element instanceof jqLite) {
+ switch (element.length) {
+ case 0:
+ return element;
-function mergeAnimationDetails(element, oldAnimation, newAnimation) {
- var target = oldAnimation.options || {};
- var newOptions = newAnimation.options || {};
+ case 1:
+ // there is no point of stripping anything if the element
+ // is the only element within the jqLite wrapper.
+ // (it's important that we retain the element instance.)
+ if (element[0].nodeType === ELEMENT_NODE) {
+ return element;
+ }
+ break;
- var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || '');
- var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || '');
- var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove);
+ default:
+ return jqLite(extractElementNode(element));
+ }
+ }
- if (newOptions.preparationClasses) {
- target.preparationClasses = concatWithSpace(newOptions.preparationClasses, target.preparationClasses);
- delete newOptions.preparationClasses;
+ if (element.nodeType === ELEMENT_NODE) {
+ return jqLite(element);
+ }
}
- // noop is basically when there is no callback; otherwise something has been set
- var realDomOperation = target.domOperation !== noop ? target.domOperation : null;
-
- extend(target, newOptions);
-
- // TODO(matsko or sreeramu): proper fix is to maintain all animation callback in array and call at last,but now only leave has the callback so no issue with this.
- if (realDomOperation) {
- target.domOperation = realDomOperation;
+ function extractElementNode(element) {
+ if (!element[0]) return element;
+ for (var i = 0; i < element.length; i++) {
+ var elm = element[i];
+ if (elm.nodeType === ELEMENT_NODE) {
+ return elm;
+ }
+ }
}
- if (classes.addClass) {
- target.addClass = classes.addClass;
- } else {
- target.addClass = null;
+ function $$addClass($$jqLite, element, className) {
+ forEach(element, function (elm) {
+ $$jqLite.addClass(elm, className);
+ });
}
- if (classes.removeClass) {
- target.removeClass = classes.removeClass;
- } else {
- target.removeClass = null;
+ function $$removeClass($$jqLite, element, className) {
+ forEach(element, function (elm) {
+ $$jqLite.removeClass(elm, className);
+ });
}
- oldAnimation.addClass = target.addClass;
- oldAnimation.removeClass = target.removeClass;
-
- return target;
-}
-
-function resolveElementClasses(existing, toAdd, toRemove) {
- var ADD_CLASS = 1;
- var REMOVE_CLASS = -1;
-
- var flags = {};
- existing = splitClassesToLookup(existing);
-
- toAdd = splitClassesToLookup(toAdd);
- forEach(toAdd, function(value, key) {
- flags[key] = ADD_CLASS;
- });
+ function applyAnimationClassesFactory($$jqLite) {
+ return function (element, options) {
+ if (options.addClass) {
+ $$addClass($$jqLite, element, options.addClass);
+ options.addClass = null;
+ }
+ if (options.removeClass) {
+ $$removeClass($$jqLite, element, options.removeClass);
+ options.removeClass = null;
+ }
+ };
+ }
- toRemove = splitClassesToLookup(toRemove);
- forEach(toRemove, function(value, key) {
- flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;
- });
+ function prepareAnimationOptions(options) {
+ options = options || {};
+ if (!options.$$prepared) {
+ var domOperation = options.domOperation || noop;
+ options.domOperation = function () {
+ options.$$domOperationFired = true;
+ domOperation();
+ domOperation = noop;
+ };
+ options.$$prepared = true;
+ }
+ return options;
+ }
- var classes = {
- addClass: '',
- removeClass: ''
- };
+ function applyAnimationStyles(element, options) {
+ applyAnimationFromStyles(element, options);
+ applyAnimationToStyles(element, options);
+ }
- forEach(flags, function(val, klass) {
- var prop, allow;
- if (val === ADD_CLASS) {
- prop = 'addClass';
- allow = !existing[klass] || existing[klass + REMOVE_CLASS_SUFFIX];
- } else if (val === REMOVE_CLASS) {
- prop = 'removeClass';
- allow = existing[klass] || existing[klass + ADD_CLASS_SUFFIX];
- }
- if (allow) {
- if (classes[prop].length) {
- classes[prop] += ' ';
- }
- classes[prop] += klass;
+ function applyAnimationFromStyles(element, options) {
+ if (options.from) {
+ element.css(options.from);
+ options.from = null;
}
- });
+ }
- function splitClassesToLookup(classes) {
- if (isString(classes)) {
- classes = classes.split(' ');
+ function applyAnimationToStyles(element, options) {
+ if (options.to) {
+ element.css(options.to);
+ options.to = null;
}
-
- var obj = {};
- forEach(classes, function(klass) {
- // sometimes the split leaves empty string values
- // incase extra spaces were applied to the options
- if (klass.length) {
- obj[klass] = true;
- }
- });
- return obj;
}
- return classes;
-}
+ function mergeAnimationDetails(element, oldAnimation, newAnimation) {
+ var target = oldAnimation.options || {};
+ var newOptions = newAnimation.options || {};
-function getDomNode(element) {
- return (element instanceof jqLite) ? element[0] : element;
-}
+ var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || '');
+ var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || '');
+ var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove);
-function applyGeneratedPreparationClasses(element, event, options) {
- var classes = '';
- if (event) {
- classes = pendClasses(event, EVENT_CLASS_PREFIX, true);
- }
- if (options.addClass) {
- classes = concatWithSpace(classes, pendClasses(options.addClass, ADD_CLASS_SUFFIX));
- }
- if (options.removeClass) {
- classes = concatWithSpace(classes, pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX));
- }
- if (classes.length) {
- options.preparationClasses = classes;
- element.addClass(classes);
- }
-}
+ if (newOptions.preparationClasses) {
+ target.preparationClasses = concatWithSpace(newOptions.preparationClasses, target.preparationClasses);
+ delete newOptions.preparationClasses;
+ }
-function clearGeneratedClasses(element, options) {
- if (options.preparationClasses) {
- element.removeClass(options.preparationClasses);
- options.preparationClasses = null;
- }
- if (options.activeClasses) {
- element.removeClass(options.activeClasses);
- options.activeClasses = null;
- }
-}
+ // noop is basically when there is no callback; otherwise something has been set
+ var realDomOperation = target.domOperation !== noop ? target.domOperation : null;
-function blockTransitions(node, duration) {
- // we use a negative delay value since it performs blocking
- // yet it doesn't kill any existing transitions running on the
- // same element which makes this safe for class-based animations
- var value = duration ? '-' + duration + 's' : '';
- applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]);
- return [TRANSITION_DELAY_PROP, value];
-}
+ extend(target, newOptions);
-function blockKeyframeAnimations(node, applyBlock) {
- var value = applyBlock ? 'paused' : '';
- var key = ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY;
- applyInlineStyle(node, [key, value]);
- return [key, value];
-}
+ // TODO(matsko or sreeramu): proper fix is to maintain all animation callback in array and call at last,but now only leave has the callback so no issue with this.
+ if (realDomOperation) {
+ target.domOperation = realDomOperation;
+ }
-function applyInlineStyle(node, styleTuple) {
- var prop = styleTuple[0];
- var value = styleTuple[1];
- node.style[prop] = value;
-}
+ if (classes.addClass) {
+ target.addClass = classes.addClass;
+ } else {
+ target.addClass = null;
+ }
-function concatWithSpace(a,b) {
- if (!a) return b;
- if (!b) return a;
- return a + ' ' + b;
-}
+ if (classes.removeClass) {
+ target.removeClass = classes.removeClass;
+ } else {
+ target.removeClass = null;
+ }
-var $$rAFSchedulerFactory = ['$$rAF', function($$rAF) {
- var queue, cancelFn;
+ oldAnimation.addClass = target.addClass;
+ oldAnimation.removeClass = target.removeClass;
- function scheduler(tasks) {
- // we make a copy since RAFScheduler mutates the state
- // of the passed in array variable and this would be difficult
- // to track down on the outside code
- queue = queue.concat(tasks);
- nextTick();
+ return target;
}
- queue = scheduler.queue = [];
+ function resolveElementClasses(existing, toAdd, toRemove) {
+ var ADD_CLASS = 1;
+ var REMOVE_CLASS = -1;
- /* waitUntilQuiet does two things:
- * 1. It will run the FINAL `fn` value only when an uncanceled RAF has passed through
- * 2. It will delay the next wave of tasks from running until the quiet `fn` has run.
- *
- * The motivation here is that animation code can request more time from the scheduler
- * before the next wave runs. This allows for certain DOM properties such as classes to
- * be resolved in time for the next animation to run.
- */
- scheduler.waitUntilQuiet = function(fn) {
- if (cancelFn) cancelFn();
+ var flags = {};
+ existing = splitClassesToLookup(existing);
- cancelFn = $$rAF(function() {
- cancelFn = null;
- fn();
- nextTick();
+ toAdd = splitClassesToLookup(toAdd);
+ forEach(toAdd, function (value, key) {
+ flags[key] = ADD_CLASS;
});
- };
-
- return scheduler;
- function nextTick() {
- if (!queue.length) return;
-
- var items = queue.shift();
- for (var i = 0; i < items.length; i++) {
- items[i]();
- }
-
- if (!cancelFn) {
- $$rAF(function() {
- if (!cancelFn) nextTick();
- });
- }
- }
-}];
+ toRemove = splitClassesToLookup(toRemove);
+ forEach(toRemove, function (value, key) {
+ flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;
+ });
-/**
- * @ngdoc directive
- * @name ngAnimateChildren
- * @restrict AE
- * @element ANY
- *
- * @description
- *
- * ngAnimateChildren allows you to specify that children of this element should animate even if any
- * of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move`
- * (structural) animation, child elements that also have an active structural animation are not animated.
- *
- * Note that even if `ngAnimateChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation).
- *
- *
- * @param {string} ngAnimateChildren If the value is empty, `true` or `on`,
- * then child animations are allowed. If the value is `false`, child animations are not allowed.
- *
- * @example
- *
-
Please click on an element
- - {{ record.title }} - -Directive | -How | -Source | -Rendered | -
ng-bind-html | -Automatically uses $sanitize | -<div ng-bind-html="snippet"> |
- - |
ng-bind-html | -Bypass $sanitize by explicitly trusting the dangerous value | -
- <div ng-bind-html="deliberatelyTrustDangerousSnippet()"> -</div>- |
- - |
ng-bind | -Automatically escapes | -<div ng-bind="snippet"> |
- - |
an html\nclick here\nsnippet
'); - }); - - it('should inline raw snippet if bound to a trusted value', function() { - expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')). - toBe("an html\n" + - "click here\n" + - "snippet
"); - }); - - it('should escape snippet without any filter', function() { - expect(element(by.css('#bind-default div')).getAttribute('innerHTML')). - toBe("<p style=\"color:blue\">an html\n" + - "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + - "snippet</p>"); - }); - - it('should update', function() { - element(by.model('snippet')).clear(); - element(by.model('snippet')).sendKeys('new text'); - expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')). - toBe('new text'); - expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).toBe( - 'new text'); - expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).toBe( - "new <b onclick=\"alert(1)\">text</b>"); - }); -By enabling this setting without taking other precautions, you might expose your - * application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned - * outside of the containing element and be rendered over other elements on the page (e.g. a login - * link). Such behavior can then result in phishing incidents.
+ * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via + * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an Angular app. * - *To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg - * tags within the sanitized content:
+ * ## Usage + * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based + * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For + * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within + * the HTML element that the animation will be triggered on. * - *
- * .rootOfTheIncludedContent svg {
- * overflow: hidden !important;
- * }
- *
+ * | Directive | Supported Animations |
+ * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
+ * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave and move |
+ * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave |
+ * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |
+ * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |
+ * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |
+ * | {@link ng.directive:ngClass#animations ngClass} | add and remove (the CSS class(es) present) |
+ * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide} | add and remove (the ng-hide class value) |
+ * | {@link ng.directive:form#animations form} & {@link ng.directive:ngModel#animations ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) |
+ * | {@link module:ngMessages#animations ngMessages} | add and remove (ng-active & ng-inactive) |
+ * | {@link module:ngMessages#animations ngMessage} | enter and leave |
+ *
+ * (More information can be found by visiting each the documentation associated with each directive.)
+ *
+ * ## CSS-based Animations
+ *
+ * CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML
+ * and CSS code we can create an animation that will be picked up by Angular when an underlying directive performs an operation.
+ *
+ * The example below shows how an `enter` animation can be made possible on an element using `ng-if`:
+ *
+ * ```html
+ * Please click on an element
+ + {{ record.title }} + +Directive | +How | +Source | +Rendered | +
ng-bind-html | +Automatically uses $sanitize | +<div ng-bind-html="snippet"> |
+ + |
ng-bind-html | +Bypass $sanitize by explicitly trusting the dangerous value | +
+ <div ng-bind-html="deliberatelyTrustDangerousSnippet()"> + </div>+ |
+ + |
ng-bind | +Automatically escapes | +<div ng-bind="snippet"> |
+ + |
an html\nclick here\nsnippet
'); + }); + + it('should inline raw snippet if bound to a trusted value', function() { + expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')). + toBe("an html\n" + + "click here\n" + + "snippet
"); + }); + + it('should escape snippet without any filter', function() { + expect(element(by.css('#bind-default div')).getAttribute('innerHTML')). + toBe("<p style=\"color:blue\">an html\n" + + "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + + "snippet</p>"); + }); + + it('should update', function() { + element(by.model('snippet')).clear(); + element(by.model('snippet')).sendKeys('new text'); + expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')). + toBe('new text'); + expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).toBe( + 'new text'); + expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).toBe( + "new <b onclick=\"alert(1)\">text</b>"); + }); +