|
1 | 1 | /*!
|
2 |
| - * vue-html-editor v0.2.0 |
| 2 | + * vue-html-editor v0.2.1 |
3 | 3 | * (c) 2016 Haixing Hu
|
4 | 4 | * Released under the MIT License.
|
5 | 5 | */
|
|
73 | 73 | /***/ function(module, exports, __webpack_require__) {
|
74 | 74 |
|
75 | 75 | /* WEBPACK VAR INJECTION */(function(global) {/*!
|
76 |
| - * Vue.js v1.0.24 |
| 76 | + * Vue.js v1.0.26 |
77 | 77 | * (c) 2016 Evan You
|
78 | 78 | * Released under the MIT License.
|
79 | 79 | */
|
|
476 | 476 |
|
477 | 477 | // UA sniffing for working around browser-specific quirks
|
478 | 478 | var UA = inBrowser && window.navigator.userAgent.toLowerCase();
|
| 479 | + var isIE = UA && UA.indexOf('trident') > 0; |
479 | 480 | var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
|
480 | 481 | var isAndroid = UA && UA.indexOf('android') > 0;
|
481 | 482 | var isIos = UA && /(iphone|ipad|ipod|ios)/i.test(UA);
|
482 |
| - var isWechat = UA && UA.indexOf('micromessenger') > 0; |
| 483 | + var iosVersionMatch = isIos && UA.match(/os ([\d_]+)/); |
| 484 | + var iosVersion = iosVersionMatch && iosVersionMatch[1].split('_'); |
| 485 | + |
| 486 | + // detecting iOS UIWebView by indexedDB |
| 487 | + var hasMutationObserverBug = iosVersion && Number(iosVersion[0]) >= 9 && Number(iosVersion[1]) >= 3 && !window.indexedDB; |
483 | 488 |
|
484 | 489 | var transitionProp = undefined;
|
485 | 490 | var transitionEndEvent = undefined;
|
|
520 | 525 | }
|
521 | 526 |
|
522 | 527 | /* istanbul ignore if */
|
523 |
| - if (typeof MutationObserver !== 'undefined' && !(isWechat && isIos)) { |
| 528 | + if (typeof MutationObserver !== 'undefined' && !hasMutationObserverBug) { |
524 | 529 | var counter = 1;
|
525 | 530 | var observer = new MutationObserver(nextTickHandler);
|
526 | 531 | var textNode = document.createTextNode(counter);
|
|
592 | 597 |
|
593 | 598 | p.put = function (key, value) {
|
594 | 599 | var removed;
|
595 |
| - if (this.size === this.limit) { |
596 |
| - removed = this.shift(); |
597 |
| - } |
598 | 600 |
|
599 | 601 | var entry = this.get(key, true);
|
600 | 602 | if (!entry) {
|
| 603 | + if (this.size === this.limit) { |
| 604 | + removed = this.shift(); |
| 605 | + } |
601 | 606 | entry = {
|
602 | 607 | key: key
|
603 | 608 | };
|
|
842 | 847 | var unsafeOpen = escapeRegex(config.unsafeDelimiters[0]);
|
843 | 848 | var unsafeClose = escapeRegex(config.unsafeDelimiters[1]);
|
844 | 849 | tagRE = new RegExp(unsafeOpen + '((?:.|\\n)+?)' + unsafeClose + '|' + open + '((?:.|\\n)+?)' + close, 'g');
|
845 |
| - htmlRE = new RegExp('^' + unsafeOpen + '.*' + unsafeClose + '$'); |
| 850 | + htmlRE = new RegExp('^' + unsafeOpen + '((?:.|\\n)+?)' + unsafeClose + '$'); |
846 | 851 | // reset cache
|
847 | 852 | cache = new Cache(1000);
|
848 | 853 | }
|
|
1629 | 1634 | return (/HTMLUnknownElement/.test(el.toString()) &&
|
1630 | 1635 | // Chrome returns unknown for several HTML5 elements.
|
1631 | 1636 | // https://code.google.com/p/chromium/issues/detail?id=540526
|
1632 |
| - !/^(data|time|rtc|rb)$/.test(tag) |
| 1637 | + // Firefox returns unknown for some "Interactive elements." |
| 1638 | + !/^(data|time|rtc|rb|details|dialog|summary)$/.test(tag) |
1633 | 1639 | );
|
1634 | 1640 | }
|
1635 | 1641 | };
|
|
1965 | 1971 | }
|
1966 | 1972 | if (child.mixins) {
|
1967 | 1973 | for (var i = 0, l = child.mixins.length; i < l; i++) {
|
1968 |
| - parent = mergeOptions(parent, child.mixins[i], vm); |
| 1974 | + var mixin = child.mixins[i]; |
| 1975 | + var mixinOptions = mixin.prototype instanceof Vue ? mixin.options : mixin; |
| 1976 | + parent = mergeOptions(parent, mixinOptions, vm); |
1969 | 1977 | }
|
1970 | 1978 | }
|
1971 | 1979 | for (key in parent) {
|
|
2393 | 2401 | hasProto: hasProto,
|
2394 | 2402 | inBrowser: inBrowser,
|
2395 | 2403 | devtools: devtools,
|
| 2404 | + isIE: isIE, |
2396 | 2405 | isIE9: isIE9,
|
2397 | 2406 | isAndroid: isAndroid,
|
2398 | 2407 | isIos: isIos,
|
2399 |
| - isWechat: isWechat, |
| 2408 | + iosVersionMatch: iosVersionMatch, |
| 2409 | + iosVersion: iosVersion, |
| 2410 | + hasMutationObserverBug: hasMutationObserverBug, |
2400 | 2411 | get transitionProp () { return transitionProp; },
|
2401 | 2412 | get transitionEndEvent () { return transitionEndEvent; },
|
2402 | 2413 | get animationProp () { return animationProp; },
|
|
2884 | 2895 | var restoreRE = /"(\d+)"/g;
|
2885 | 2896 | var pathTestRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/;
|
2886 | 2897 | var identRE = /[^\w$\.](?:[A-Za-z_$][\w$]*)/g;
|
2887 |
| - var booleanLiteralRE = /^(?:true|false)$/; |
| 2898 | + var literalValueRE$1 = /^(?:true|false|null|undefined|Infinity|NaN)$/; |
| 2899 | + |
| 2900 | + function noop() {} |
2888 | 2901 |
|
2889 | 2902 | /**
|
2890 | 2903 | * Save / Rewrite / Restore
|
|
2966 | 2979 | // save strings and object literal keys
|
2967 | 2980 | var body = exp.replace(saveRE, save).replace(wsRE, '');
|
2968 | 2981 | // rewrite all paths
|
2969 |
| - // pad 1 space here becaue the regex matches 1 extra char |
| 2982 | + // pad 1 space here because the regex matches 1 extra char |
2970 | 2983 | body = (' ' + body).replace(identRE, rewrite).replace(restoreRE, restore);
|
2971 | 2984 | return makeGetterFn(body);
|
2972 | 2985 | }
|
|
2987 | 3000 | return new Function('scope', 'return ' + body + ';');
|
2988 | 3001 | /* eslint-enable no-new-func */
|
2989 | 3002 | } catch (e) {
|
2990 |
| - 'development' !== 'production' && warn('Invalid expression. ' + 'Generated function body: ' + body); |
| 3003 | + if (true) { |
| 3004 | + /* istanbul ignore if */ |
| 3005 | + if (e.toString().match(/unsafe-eval|CSP/)) { |
| 3006 | + warn('It seems you are using the default build of Vue.js in an environment ' + 'with Content Security Policy that prohibits unsafe-eval. ' + 'Use the CSP-compliant build instead: ' + 'http://vuejs.org/guide/installation.html#CSP-compliant-build'); |
| 3007 | + } else { |
| 3008 | + warn('Invalid expression. ' + 'Generated function body: ' + body); |
| 3009 | + } |
| 3010 | + } |
| 3011 | + return noop; |
2991 | 3012 | }
|
2992 | 3013 | }
|
2993 | 3014 |
|
|
3049 | 3070 |
|
3050 | 3071 | function isSimplePath(exp) {
|
3051 | 3072 | return pathTestRE.test(exp) &&
|
3052 |
| - // don't treat true/false as paths |
3053 |
| - !booleanLiteralRE.test(exp) && |
| 3073 | + // don't treat literal values as paths |
| 3074 | + !literalValueRE$1.test(exp) && |
3054 | 3075 | // Math constants e.g. Math.PI, Math.E etc.
|
3055 | 3076 | exp.slice(0, 5) !== 'Math.';
|
3056 | 3077 | }
|
|
3466 | 3487 | }
|
3467 | 3488 | var isA = isArray(val);
|
3468 | 3489 | var isO = isObject(val);
|
3469 |
| - if (isA || isO) { |
| 3490 | + if ((isA || isO) && Object.isExtensible(val)) { |
3470 | 3491 | if (val.__ob__) {
|
3471 | 3492 | var depId = val.__ob__.dep.id;
|
3472 | 3493 | if (seen.has(depId)) {
|
|
3529 | 3550 |
|
3530 | 3551 | var tagRE$1 = /<([\w:-]+)/;
|
3531 | 3552 | var entityRE = /&#?\w+?;/;
|
| 3553 | + var commentRE = /<!--/; |
3532 | 3554 |
|
3533 | 3555 | /**
|
3534 | 3556 | * Convert a string template to a DocumentFragment.
|
|
3551 | 3573 | var frag = document.createDocumentFragment();
|
3552 | 3574 | var tagMatch = templateString.match(tagRE$1);
|
3553 | 3575 | var entityMatch = entityRE.test(templateString);
|
| 3576 | + var commentMatch = commentRE.test(templateString); |
3554 | 3577 |
|
3555 |
| - if (!tagMatch && !entityMatch) { |
| 3578 | + if (!tagMatch && !entityMatch && !commentMatch) { |
3556 | 3579 | // text only, return a single text node.
|
3557 | 3580 | frag.appendChild(document.createTextNode(templateString));
|
3558 | 3581 | } else {
|
|
4519 | 4542 | * the filters. This is passed to and called by the watcher.
|
4520 | 4543 | *
|
4521 | 4544 | * It is necessary for this to be called during the
|
4522 |
| - * wathcer's dependency collection phase because we want |
| 4545 | + * watcher's dependency collection phase because we want |
4523 | 4546 | * the v-for to update when the source Object is mutated.
|
4524 | 4547 | */
|
4525 | 4548 |
|
|
4862 | 4885 | },
|
4863 | 4886 |
|
4864 | 4887 | update: function update(value) {
|
4865 |
| - this.el.value = _toString(value); |
| 4888 | + // #3029 only update when the value changes. This prevent |
| 4889 | + // browsers from overwriting values like selectionStart |
| 4890 | + value = _toString(value); |
| 4891 | + if (value !== this.el.value) this.el.value = value; |
4866 | 4892 | },
|
4867 | 4893 |
|
4868 | 4894 | unbind: function unbind() {
|
|
4911 | 4937 | var select = {
|
4912 | 4938 |
|
4913 | 4939 | bind: function bind() {
|
| 4940 | + var _this = this; |
| 4941 | + |
4914 | 4942 | var self = this;
|
4915 | 4943 | var el = this.el;
|
4916 | 4944 |
|
|
4942 | 4970 | // selectedIndex with value -1 to 0 when the element
|
4943 | 4971 | // is appended to a new parent, therefore we have to
|
4944 | 4972 | // force a DOM update whenever that happens...
|
4945 |
| - this.vm.$on('hook:attached', this.forceUpdate); |
| 4973 | + this.vm.$on('hook:attached', function () { |
| 4974 | + nextTick(_this.forceUpdate); |
| 4975 | + }); |
| 4976 | + if (!inDoc(el)) { |
| 4977 | + nextTick(this.forceUpdate); |
| 4978 | + } |
4946 | 4979 | },
|
4947 | 4980 |
|
4948 | 4981 | update: function update(value) {
|
|
6212 | 6245 | if (value === undefined) {
|
6213 | 6246 | value = getPropDefaultValue(vm, prop);
|
6214 | 6247 | }
|
6215 |
| - value = coerceProp(prop, value); |
| 6248 | + value = coerceProp(prop, value, vm); |
6216 | 6249 | var coerced = value !== rawValue;
|
6217 | 6250 | if (!assertProp(prop, value, vm)) {
|
6218 | 6251 | value = undefined;
|
|
6331 | 6364 | * @return {*}
|
6332 | 6365 | */
|
6333 | 6366 |
|
6334 |
| - function coerceProp(prop, value) { |
| 6367 | + function coerceProp(prop, value, vm) { |
6335 | 6368 | var coerce = prop.options.coerce;
|
6336 | 6369 | if (!coerce) {
|
6337 | 6370 | return value;
|
6338 | 6371 | }
|
6339 |
| - // coerce is a function |
6340 |
| - return coerce(value); |
| 6372 | + if (typeof coerce === 'function') { |
| 6373 | + return coerce(value); |
| 6374 | + } else { |
| 6375 | + 'development' !== 'production' && warn('Invalid coerce for prop "' + prop.name + '": expected function, got ' + typeof coerce + '.', vm); |
| 6376 | + return value; |
| 6377 | + } |
6341 | 6378 | }
|
6342 | 6379 |
|
6343 | 6380 | /**
|
|
6869 | 6906 | // resolve on owner vm
|
6870 | 6907 | var hooks = resolveAsset(this.vm.$options, 'transitions', id);
|
6871 | 6908 | id = id || 'v';
|
| 6909 | + oldId = oldId || 'v'; |
6872 | 6910 | el.__v_trans = new Transition(el, id, hooks, this.vm);
|
6873 |
| - if (oldId) { |
6874 |
| - removeClass(el, oldId + '-transition'); |
6875 |
| - } |
| 6911 | + removeClass(el, oldId + '-transition'); |
6876 | 6912 | addClass(el, id + '-transition');
|
6877 | 6913 | }
|
6878 | 6914 | };
|
|
7290 | 7326 | if (token.html) {
|
7291 | 7327 | replace(node, parseTemplate(value, true));
|
7292 | 7328 | } else {
|
7293 |
| - node.data = value; |
| 7329 | + node.data = _toString(value); |
7294 | 7330 | }
|
7295 | 7331 | } else {
|
7296 | 7332 | vm._bindDir(token.descriptor, node, host, scope);
|
|
8274 | 8310 | };
|
8275 | 8311 | }
|
8276 | 8312 |
|
8277 |
| - function noop() {} |
| 8313 | + function noop$1() {} |
8278 | 8314 |
|
8279 | 8315 | /**
|
8280 | 8316 | * A directive links a DOM element with a piece of data,
|
|
8373 | 8409 | }
|
8374 | 8410 | };
|
8375 | 8411 | } else {
|
8376 |
| - this._update = noop; |
| 8412 | + this._update = noop$1; |
8377 | 8413 | }
|
8378 | 8414 | var preProcess = this._preProcess ? bind(this._preProcess, this) : null;
|
8379 | 8415 | var postProcess = this._postProcess ? bind(this._postProcess, this) : null;
|
|
9811 | 9847 |
|
9812 | 9848 | json: {
|
9813 | 9849 | read: function read(value, indent) {
|
9814 |
| - return typeof value === 'string' ? value : JSON.stringify(value, null, Number(indent) || 2); |
| 9850 | + return typeof value === 'string' ? value : JSON.stringify(value, null, arguments.length > 1 ? indent : 2); |
9815 | 9851 | },
|
9816 | 9852 | write: function write(value) {
|
9817 | 9853 | try {
|
|
9884 | 9920 |
|
9885 | 9921 | pluralize: function pluralize(value) {
|
9886 | 9922 | var args = toArray(arguments, 1);
|
9887 |
| - return args.length > 1 ? args[value % 10 - 1] || args[args.length - 1] : args[0] + (value === 1 ? '' : 's'); |
| 9923 | + var length = args.length; |
| 9924 | + if (length > 1) { |
| 9925 | + var index = value % 10 - 1; |
| 9926 | + return index in args ? args[index] : args[length - 1]; |
| 9927 | + } else { |
| 9928 | + return args[0] + (value === 1 ? '' : 's'); |
| 9929 | + } |
9888 | 9930 | },
|
9889 | 9931 |
|
9890 | 9932 | /**
|
|
10069 | 10111 | }
|
10070 | 10112 | }
|
10071 | 10113 | if (type === 'component' && isPlainObject(definition)) {
|
10072 |
| - definition.name = id; |
| 10114 | + if (!definition.name) { |
| 10115 | + definition.name = id; |
| 10116 | + } |
10073 | 10117 | definition = Vue.extend(definition);
|
10074 | 10118 | }
|
10075 | 10119 | this.options[type + 's'][id] = definition;
|
|
10084 | 10128 |
|
10085 | 10129 | installGlobalAPI(Vue);
|
10086 | 10130 |
|
10087 |
| - Vue.version = '1.0.24'; |
| 10131 | + Vue.version = '1.0.26'; |
10088 | 10132 |
|
10089 | 10133 | // devtools global hook
|
10090 | 10134 | /* istanbul ignore next */
|
|
0 commit comments