Update autosize, which should fix stack overflow error (#1560)

* Update to the latest version of autosize.js

* gitignore: Restrict 'dist' matches to the root dist folder

The global search for 'dist' caused problems when updateing bower
components.

* A couple minor version updates: ByteBuffer, filesize, intlTel

moment-with-localse, ProtoBuf
This commit is contained in:
Scott Nonnenberg 2017-10-13 11:44:35 -07:00 committed by GitHub
parent 3dc3667b45
commit fb7701576e
10 changed files with 398 additions and 202 deletions

2
.gitignore vendored
View File

@ -3,7 +3,7 @@ node_modules
build/curve25519_compiled.js build/curve25519_compiled.js
build/icons/* build/icons/*
stylesheets/*.css.map stylesheets/*.css.map
dist /dist
.DS_Store .DS_Store
config/local.json config/local.json
config/local-*.json config/local-*.json

View File

@ -17,7 +17,7 @@
"intl-tel-input": "~4.0.1", "intl-tel-input": "~4.0.1",
"blueimp-load-image": "~1.13.0", "blueimp-load-image": "~1.13.0",
"blueimp-canvas-to-blob": "~2.1.1", "blueimp-canvas-to-blob": "~2.1.1",
"autosize": "~3.0.6", "autosize": "~4.0.0",
"webaudiorecorder": "https://github.com/higuma/web-audio-recorder-js.git", "webaudiorecorder": "https://github.com/higuma/web-audio-recorder-js.git",
"mp3lameencoder": "https://github.com/higuma/mp3-lame-encoder-js.git", "mp3lameencoder": "https://github.com/higuma/mp3-lame-encoder-js.git",
"filesize": "https://github.com/avoidwork/filesize.js.git" "filesize": "https://github.com/avoidwork/filesize.js.git"

View File

@ -1,5 +1,5 @@
/*! /*!
Autosize 3.0.5 Autosize 4.0.0
license: MIT license: MIT
http://www.jacklmoore.com/autosize http://www.jacklmoore.com/autosize
*/ */
@ -18,18 +18,53 @@
})(this, function (exports, module) { })(this, function (exports, module) {
'use strict'; 'use strict';
var map = typeof Map === "function" ? new Map() : (function () {
var keys = [];
var values = [];
return {
has: function has(key) {
return keys.indexOf(key) > -1;
},
get: function get(key) {
return values[keys.indexOf(key)];
},
set: function set(key, value) {
if (keys.indexOf(key) === -1) {
keys.push(key);
values.push(value);
}
},
'delete': function _delete(key) {
var index = keys.indexOf(key);
if (index > -1) {
keys.splice(index, 1);
values.splice(index, 1);
}
}
};
})();
var createEvent = function createEvent(name) {
return new Event(name, { bubbles: true });
};
try {
new Event('test');
} catch (e) {
// IE does not support `new Event()`
createEvent = function (name) {
var evt = document.createEvent('Event');
evt.initEvent(name, true, false);
return evt;
};
}
function assign(ta) { function assign(ta) {
var _ref = arguments[1] === undefined ? {} : arguments[1]; if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
var _ref$setOverflowX = _ref.setOverflowX;
var setOverflowX = _ref$setOverflowX === undefined ? true : _ref$setOverflowX;
var _ref$setOverflowY = _ref.setOverflowY;
var setOverflowY = _ref$setOverflowY === undefined ? true : _ref$setOverflowY;
if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || ta.hasAttribute('data-autosize-on')) return;
var heightOffset = null; var heightOffset = null;
var overflowY = 'hidden'; var clientWidth = ta.clientWidth;
var cachedHeight = null;
function init() { function init() {
var style = window.getComputedStyle(ta, null); var style = window.getComputedStyle(ta, null);
@ -45,6 +80,10 @@
} else { } else {
heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
} }
// Fix when a textarea is not on document body and heightOffset is Not a Number
if (isNaN(heightOffset)) {
heightOffset = 0;
}
update(); update();
} }
@ -63,22 +102,31 @@
ta.style.width = width; ta.style.width = width;
} }
overflowY = value; ta.style.overflowY = value;
if (setOverflowY) {
ta.style.overflowY = value;
}
update();
} }
function update() { function getParentOverflows(el) {
var startHeight = ta.style.height; var arr = [];
var htmlTop = document.documentElement.scrollTop;
var bodyTop = document.body.scrollTop;
var originalHeight = ta.style.height;
ta.style.height = 'auto'; while (el && el.parentNode && el.parentNode instanceof Element) {
if (el.parentNode.scrollTop) {
arr.push({
node: el.parentNode,
scrollTop: el.parentNode.scrollTop
});
}
el = el.parentNode;
}
return arr;
}
function resize() {
var originalHeight = ta.style.height;
var overflows = getParentOverflows(ta);
var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
ta.style.height = '';
var endHeight = ta.scrollHeight + heightOffset; var endHeight = ta.scrollHeight + heightOffset;
@ -90,85 +138,118 @@
ta.style.height = endHeight + 'px'; ta.style.height = endHeight + 'px';
// used to check if an update is actually necessary on window.resize
clientWidth = ta.clientWidth;
// prevents scroll-position jumping // prevents scroll-position jumping
document.documentElement.scrollTop = htmlTop; overflows.forEach(function (el) {
document.body.scrollTop = bodyTop; el.node.scrollTop = el.scrollTop;
});
var style = window.getComputedStyle(ta, null); if (docTop) {
document.documentElement.scrollTop = docTop;
if (style.height !== ta.style.height) {
if (overflowY !== 'visible') {
changeOverflow('visible');
return;
}
} else {
if (overflowY !== 'hidden') {
changeOverflow('hidden');
return;
}
}
if (startHeight !== ta.style.height) {
var evt = document.createEvent('Event');
evt.initEvent('autosize:resized', true, false);
ta.dispatchEvent(evt);
} }
} }
function update() {
resize();
var styleHeight = Math.round(parseFloat(ta.style.height));
var computed = window.getComputedStyle(ta, null);
// Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
// The actual height not matching the style height (set via the resize method) indicates that
// the max-height has been exceeded, in which case the overflow should be allowed.
if (actualHeight !== styleHeight) {
if (computed.overflowY === 'hidden') {
changeOverflow('scroll');
resize();
actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
}
} else {
// Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
if (computed.overflowY !== 'hidden') {
changeOverflow('hidden');
resize();
actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
}
}
if (cachedHeight !== actualHeight) {
cachedHeight = actualHeight;
var evt = createEvent('autosize:resized');
try {
ta.dispatchEvent(evt);
} catch (err) {
// Firefox will throw an error on dispatchEvent for a detached element
// https://bugzilla.mozilla.org/show_bug.cgi?id=889376
}
}
}
var pageResize = function pageResize() {
if (ta.clientWidth !== clientWidth) {
update();
}
};
var destroy = (function (style) { var destroy = (function (style) {
window.removeEventListener('resize', update); window.removeEventListener('resize', pageResize, false);
ta.removeEventListener('input', update); ta.removeEventListener('input', update, false);
ta.removeEventListener('keyup', update); ta.removeEventListener('keyup', update, false);
ta.removeAttribute('data-autosize-on'); ta.removeEventListener('autosize:destroy', destroy, false);
ta.removeEventListener('autosize:destroy', destroy); ta.removeEventListener('autosize:update', update, false);
Object.keys(style).forEach(function (key) { Object.keys(style).forEach(function (key) {
ta.style[key] = style[key]; ta.style[key] = style[key];
}); });
map['delete'](ta);
}).bind(ta, { }).bind(ta, {
height: ta.style.height, height: ta.style.height,
resize: ta.style.resize, resize: ta.style.resize,
overflowY: ta.style.overflowY, overflowY: ta.style.overflowY,
overflowX: ta.style.overflowX, overflowX: ta.style.overflowX,
wordWrap: ta.style.wordWrap }); wordWrap: ta.style.wordWrap
});
ta.addEventListener('autosize:destroy', destroy); ta.addEventListener('autosize:destroy', destroy, false);
// IE9 does not fire onpropertychange or oninput for deletions, // IE9 does not fire onpropertychange or oninput for deletions,
// so binding to onkeyup to catch most of those events. // so binding to onkeyup to catch most of those events.
// There is no way that I know of to detect something like 'cut' in IE9. // There is no way that I know of to detect something like 'cut' in IE9.
if ('onpropertychange' in ta && 'oninput' in ta) { if ('onpropertychange' in ta && 'oninput' in ta) {
ta.addEventListener('keyup', update); ta.addEventListener('keyup', update, false);
} }
window.addEventListener('resize', update); window.addEventListener('resize', pageResize, false);
ta.addEventListener('input', update); ta.addEventListener('input', update, false);
ta.addEventListener('autosize:update', update); ta.addEventListener('autosize:update', update, false);
ta.setAttribute('data-autosize-on', true); ta.style.overflowX = 'hidden';
ta.style.wordWrap = 'break-word';
if (setOverflowY) { map.set(ta, {
ta.style.overflowY = 'hidden'; destroy: destroy,
} update: update
if (setOverflowX) { });
ta.style.overflowX = 'hidden';
ta.style.wordWrap = 'break-word';
}
init(); init();
} }
function destroy(ta) { function destroy(ta) {
if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return; var methods = map.get(ta);
var evt = document.createEvent('Event'); if (methods) {
evt.initEvent('autosize:destroy', true, false); methods.destroy();
ta.dispatchEvent(evt); }
} }
function update(ta) { function update(ta) {
if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return; var methods = map.get(ta);
var evt = document.createEvent('Event'); if (methods) {
evt.initEvent('autosize:update', true, false); methods.update();
ta.dispatchEvent(evt); }
} }
var autosize = null; var autosize = null;

View File

@ -16,7 +16,8 @@
/** /**
* @license ByteBuffer.js (c) 2013-2014 Daniel Wirtz <dcode@dcode.io> * @license ByteBuffer.js (c) 2013-2014 Daniel Wirtz <dcode@dcode.io>
* This version of ByteBuffer.js uses an ArrayBuffer (AB) as its backing buffer and is compatible with modern browsers. * This version of ByteBuffer.js uses an ArrayBuffer as its backing buffer which is accessed through a DataView and is
* compatible with modern browsers.
* Released under the Apache License, Version 2.0 * Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/ByteBuffer.js for details * see: https://github.com/dcodeIO/ByteBuffer.js for details
*/ // */ //
@ -116,7 +117,7 @@
* @const * @const
* @expose * @expose
*/ */
ByteBuffer.VERSION = "3.5.4"; ByteBuffer.VERSION = "3.5.5";
/** /**
* Little endian constant that can be used instead of its boolean value. Evaluates to `true`. * Little endian constant that can be used instead of its boolean value. Evaluates to `true`.
@ -752,6 +753,8 @@
if (!this.noAssert) { if (!this.noAssert) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long)) else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)"); throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0) if (typeof offset !== 'number' || offset % 1 !== 0)
@ -762,6 +765,8 @@
} }
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
offset += 8; offset += 8;
var capacity6 = this.buffer.byteLength; var capacity6 = this.buffer.byteLength;
if (offset > capacity6) if (offset > capacity6)
@ -831,6 +836,8 @@
if (!this.noAssert) { if (!this.noAssert) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long)) else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)"); throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0) if (typeof offset !== 'number' || offset % 1 !== 0)
@ -841,6 +848,8 @@
} }
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
offset += 8; offset += 8;
var capacity7 = this.buffer.byteLength; var capacity7 = this.buffer.byteLength;
if (offset > capacity7) if (offset > capacity7)
@ -1237,6 +1246,8 @@
ByteBuffer.calculateVarint64 = function(value) { ByteBuffer.calculateVarint64 = function(value) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
// ref: src/google/protobuf/io/coded_stream.cc // ref: src/google/protobuf/io/coded_stream.cc
var part0 = value.toInt() >>> 0, var part0 = value.toInt() >>> 0,
part1 = value.shiftRightUnsigned(28).toInt() >>> 0, part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
@ -1266,6 +1277,8 @@
ByteBuffer.zigZagEncode64 = function(value) { ByteBuffer.zigZagEncode64 = function(value) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value, false); value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned(); else if (value.unsigned !== false) value = value.toSigned();
// ref: src/google/protobuf/wire_format_lite.h // ref: src/google/protobuf/wire_format_lite.h
return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned(); return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();
@ -1280,6 +1293,8 @@
ByteBuffer.zigZagDecode64 = function(value) { ByteBuffer.zigZagDecode64 = function(value) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value, false); value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned(); else if (value.unsigned !== false) value = value.toSigned();
// ref: src/google/protobuf/wire_format_lite.h // ref: src/google/protobuf/wire_format_lite.h
return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned(); return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();
@ -1299,6 +1314,8 @@
if (!this.noAssert) { if (!this.noAssert) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long)) else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)"); throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0) if (typeof offset !== 'number' || offset % 1 !== 0)
@ -1309,6 +1326,8 @@
} }
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value, false); value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned(); else if (value.unsigned !== false) value = value.toSigned();
var size = ByteBuffer.calculateVarint64(value), var size = ByteBuffer.calculateVarint64(value),
part0 = value.toInt() >>> 0, part0 = value.toInt() >>> 0,
@ -1449,7 +1468,6 @@
if (offset < 0 || offset + 0 > this.buffer.byteLength) if (offset < 0 || offset + 0 > this.buffer.byteLength)
throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
} }
var start = offset;
// UTF8 strings do not contain zero bytes in between except for the zero character, so: // UTF8 strings do not contain zero bytes in between except for the zero character, so:
k = utfx.calculateUTF16asUTF8(stringSource(str))[1]; k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
offset += k+1; offset += k+1;
@ -1462,7 +1480,7 @@
}.bind(this)); }.bind(this));
this.view.setUint8(offset++, 0); this.view.setUint8(offset++, 0);
if (relative) { if (relative) {
this.offset = offset - start; this.offset = offset;
return this; return this;
} }
return k; return k;
@ -1901,8 +1919,8 @@
}; };
/** /**
* Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents behind the specified * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents at and after the
* offset up to the length of this ByteBuffer's data. specified offset up to the length of this ByteBuffer's data.
* @param {!ByteBuffer} target Target ByteBuffer * @param {!ByteBuffer} target Target ByteBuffer
* @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes * @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
* read if omitted. * read if omitted.

View File

@ -5,7 +5,7 @@
* *
* @copyright 2017 Jason Mulligan <jason.mulligan@avoidwork.com> * @copyright 2017 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause * @license BSD-3-Clause
* @version 3.5.9 * @version 3.5.10
*/ */
(function (global) { (function (global) {
var b = /^(b|B)$/, var b = /^(b|B)$/,

View File

@ -1,5 +1,5 @@
/* /*
International Telephone Input v4.0.1 International Telephone Input v4.0.2
https://github.com/Bluefieldscom/intl-tel-input.git https://github.com/Bluefieldscom/intl-tel-input.git
*/ */
// wrap in UMD - see https://github.com/umdjs/umd/blob/master/jqueryPlugin.js // wrap in UMD - see https://github.com/umdjs/umd/blob/master/jqueryPlugin.js
@ -651,14 +651,7 @@ https://github.com/Bluefieldscom/intl-tel-input.git
var dialCode = this._getDialCode(number); var dialCode = this._getDialCode(number);
if (dialCode) { if (dialCode) {
// check if one of the matching countries is already selected // check if one of the matching countries is already selected
var countryCodes = this.countryCodes[this._getNumeric(dialCode)], alreadySelected = false; var countryCodes = this.countryCodes[this._getNumeric(dialCode)], alreadySelected = this.selectedCountryData && $.inArray(this.selectedCountryData.iso2, countryCodes) != -1;
if (this.selectedCountryData) {
for (var i = 0; i < countryCodes.length; i++) {
if (countryCodes[i] == this.selectedCountryData.iso2) {
alreadySelected = true;
}
}
}
// if a matching country is not already selected (or this is an unknown NANP area code): choose the first in the list // if a matching country is not already selected (or this is an unknown NANP area code): choose the first in the list
if (!alreadySelected || this._isUnknownNanp(number, dialCode)) { if (!alreadySelected || this._isUnknownNanp(number, dialCode)) {
// if using onlyCountries option, countryCodes[0] may be empty, so we must find the first non-empty index // if using onlyCountries option, countryCodes[0] may be empty, so we must find the first non-empty index
@ -706,9 +699,8 @@ https://github.com/Bluefieldscom/intl-tel-input.git
// and the input's placeholder // and the input's placeholder
this._updatePlaceholder(); this._updatePlaceholder();
// update the active list item // update the active list item
var listItem = this.countryListItems.children(".iti-flag." + countryCode).first().parent();
this.countryListItems.removeClass("active"); this.countryListItems.removeClass("active");
listItem.addClass("active"); this.countryListItems.children(".iti-flag." + countryCode).first().parent().addClass("active");
}, },
// update the input placeholder to an example number from the currently selected country // update the input placeholder to an example number from the currently selected country
_updatePlaceholder: function() { _updatePlaceholder: function() {
@ -1004,4 +996,4 @@ JSON.stringify(result);
areaCodes: c[4] || null areaCodes: c[4] || null
}; };
} }
}); });

View File

@ -1,5 +1,5 @@
//! moment.js //! moment.js
//! version : 2.14.1 //! version : 2.14.2
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT //! license : MIT
//! momentjs.com //! momentjs.com
@ -4158,7 +4158,7 @@
; ;
utils_hooks__hooks.version = '2.14.1'; utils_hooks__hooks.version = '2.14.2';
setHookCallback(local__createLocal); setHookCallback(local__createLocal);

View File

@ -38,7 +38,7 @@
* @const * @const
* @expose * @expose
*/ */
ProtoBuf.VERSION = "3.8.0"; ProtoBuf.VERSION = "3.8.2";
/** /**
* Wire types. * Wire types.
@ -402,7 +402,7 @@
ID: /^(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/, ID: /^(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/,
NEGID: /^\-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/, NEGID: /^\-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/,
WHITESPACE: /\s/, WHITESPACE: /\s/,
STRING: /['"]([^'"\\]*(\\.[^"\\]*)*)['"]/g, STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
BOOL: /^(?:true|false)$/i BOOL: /^(?:true|false)$/i
}; };
@ -488,7 +488,7 @@
Lang.STRING.lastIndex = this.index-1; // Include the open quote Lang.STRING.lastIndex = this.index-1; // Include the open quote
var match; var match;
if ((match = Lang.STRING.exec(this.source)) !== null) { if ((match = Lang.STRING.exec(this.source)) !== null) {
var s = match[1]; var s = typeof match[1] !== 'undefined' ? match[1] : match[2];
this.index = Lang.STRING.lastIndex; this.index = Lang.STRING.lastIndex;
this.stack.push(this.stringEndsWith); this.stack.push(this.stringEndsWith);
return s; return s;
@ -4285,7 +4285,6 @@
json = JSON.parse(json); json = JSON.parse(json);
builder["import"](json, filename); builder["import"](json, filename);
builder.resolveAll(); builder.resolveAll();
builder.build();
return builder; return builder;
}; };

View File

@ -10165,7 +10165,8 @@ return jQuery;
/** /**
* @license ByteBuffer.js (c) 2013-2014 Daniel Wirtz <dcode@dcode.io> * @license ByteBuffer.js (c) 2013-2014 Daniel Wirtz <dcode@dcode.io>
* This version of ByteBuffer.js uses an ArrayBuffer (AB) as its backing buffer and is compatible with modern browsers. * This version of ByteBuffer.js uses an ArrayBuffer as its backing buffer which is accessed through a DataView and is
* compatible with modern browsers.
* Released under the Apache License, Version 2.0 * Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/ByteBuffer.js for details * see: https://github.com/dcodeIO/ByteBuffer.js for details
*/ // */ //
@ -10265,7 +10266,7 @@ return jQuery;
* @const * @const
* @expose * @expose
*/ */
ByteBuffer.VERSION = "3.5.4"; ByteBuffer.VERSION = "3.5.5";
/** /**
* Little endian constant that can be used instead of its boolean value. Evaluates to `true`. * Little endian constant that can be used instead of its boolean value. Evaluates to `true`.
@ -10901,6 +10902,8 @@ return jQuery;
if (!this.noAssert) { if (!this.noAssert) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long)) else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)"); throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0) if (typeof offset !== 'number' || offset % 1 !== 0)
@ -10911,6 +10914,8 @@ return jQuery;
} }
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
offset += 8; offset += 8;
var capacity6 = this.buffer.byteLength; var capacity6 = this.buffer.byteLength;
if (offset > capacity6) if (offset > capacity6)
@ -10980,6 +10985,8 @@ return jQuery;
if (!this.noAssert) { if (!this.noAssert) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long)) else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)"); throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0) if (typeof offset !== 'number' || offset % 1 !== 0)
@ -10990,6 +10997,8 @@ return jQuery;
} }
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
offset += 8; offset += 8;
var capacity7 = this.buffer.byteLength; var capacity7 = this.buffer.byteLength;
if (offset > capacity7) if (offset > capacity7)
@ -11386,6 +11395,8 @@ return jQuery;
ByteBuffer.calculateVarint64 = function(value) { ByteBuffer.calculateVarint64 = function(value) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
// ref: src/google/protobuf/io/coded_stream.cc // ref: src/google/protobuf/io/coded_stream.cc
var part0 = value.toInt() >>> 0, var part0 = value.toInt() >>> 0,
part1 = value.shiftRightUnsigned(28).toInt() >>> 0, part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
@ -11415,6 +11426,8 @@ return jQuery;
ByteBuffer.zigZagEncode64 = function(value) { ByteBuffer.zigZagEncode64 = function(value) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value, false); value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned(); else if (value.unsigned !== false) value = value.toSigned();
// ref: src/google/protobuf/wire_format_lite.h // ref: src/google/protobuf/wire_format_lite.h
return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned(); return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();
@ -11429,6 +11442,8 @@ return jQuery;
ByteBuffer.zigZagDecode64 = function(value) { ByteBuffer.zigZagDecode64 = function(value) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value, false); value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned(); else if (value.unsigned !== false) value = value.toSigned();
// ref: src/google/protobuf/wire_format_lite.h // ref: src/google/protobuf/wire_format_lite.h
return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned(); return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();
@ -11448,6 +11463,8 @@ return jQuery;
if (!this.noAssert) { if (!this.noAssert) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long)) else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)"); throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0) if (typeof offset !== 'number' || offset % 1 !== 0)
@ -11458,6 +11475,8 @@ return jQuery;
} }
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value, false); value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned(); else if (value.unsigned !== false) value = value.toSigned();
var size = ByteBuffer.calculateVarint64(value), var size = ByteBuffer.calculateVarint64(value),
part0 = value.toInt() >>> 0, part0 = value.toInt() >>> 0,
@ -11598,7 +11617,6 @@ return jQuery;
if (offset < 0 || offset + 0 > this.buffer.byteLength) if (offset < 0 || offset + 0 > this.buffer.byteLength)
throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
} }
var start = offset;
// UTF8 strings do not contain zero bytes in between except for the zero character, so: // UTF8 strings do not contain zero bytes in between except for the zero character, so:
k = utfx.calculateUTF16asUTF8(stringSource(str))[1]; k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
offset += k+1; offset += k+1;
@ -11611,7 +11629,7 @@ return jQuery;
}.bind(this)); }.bind(this));
this.view.setUint8(offset++, 0); this.view.setUint8(offset++, 0);
if (relative) { if (relative) {
this.offset = offset - start; this.offset = offset;
return this; return this;
} }
return k; return k;
@ -12050,8 +12068,8 @@ return jQuery;
}; };
/** /**
* Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents behind the specified * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents at and after the
* offset up to the length of this ByteBuffer's data. specified offset up to the length of this ByteBuffer's data.
* @param {!ByteBuffer} target Target ByteBuffer * @param {!ByteBuffer} target Target ByteBuffer
* @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes * @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
* read if omitted. * read if omitted.
@ -13463,7 +13481,7 @@ return jQuery;
* @const * @const
* @expose * @expose
*/ */
ProtoBuf.VERSION = "3.8.0"; ProtoBuf.VERSION = "3.8.2";
/** /**
* Wire types. * Wire types.
@ -13827,7 +13845,7 @@ return jQuery;
ID: /^(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/, ID: /^(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/,
NEGID: /^\-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/, NEGID: /^\-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/,
WHITESPACE: /\s/, WHITESPACE: /\s/,
STRING: /['"]([^'"\\]*(\\.[^"\\]*)*)['"]/g, STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
BOOL: /^(?:true|false)$/i BOOL: /^(?:true|false)$/i
}; };
@ -13913,7 +13931,7 @@ return jQuery;
Lang.STRING.lastIndex = this.index-1; // Include the open quote Lang.STRING.lastIndex = this.index-1; // Include the open quote
var match; var match;
if ((match = Lang.STRING.exec(this.source)) !== null) { if ((match = Lang.STRING.exec(this.source)) !== null) {
var s = match[1]; var s = typeof match[1] !== 'undefined' ? match[1] : match[2];
this.index = Lang.STRING.lastIndex; this.index = Lang.STRING.lastIndex;
this.stack.push(this.stringEndsWith); this.stack.push(this.stringEndsWith);
return s; return s;
@ -17710,7 +17728,6 @@ return jQuery;
json = JSON.parse(json); json = JSON.parse(json);
builder["import"](json, filename); builder["import"](json, filename);
builder.resolveAll(); builder.resolveAll();
builder.build();
return builder; return builder;
}; };
@ -23445,7 +23462,7 @@ goog.exportSymbol("libphonenumber.isValidNumber",libphonenumber.isValidNumber);g
goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.PhoneNumberFormat.NATIONAL);goog.exportSymbol("libphonenumber.PhoneNumberFormat.RFC3966",libphonenumber.PhoneNumberFormat.RFC3966);goog.exportSymbol("libphonenumber.format",libphonenumber.format);})(); goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.PhoneNumberFormat.NATIONAL);goog.exportSymbol("libphonenumber.PhoneNumberFormat.RFC3966",libphonenumber.PhoneNumberFormat.RFC3966);goog.exportSymbol("libphonenumber.format",libphonenumber.format);})();
//! moment.js //! moment.js
//! version : 2.14.1 //! version : 2.14.2
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT //! license : MIT
//! momentjs.com //! momentjs.com
@ -27604,7 +27621,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho
; ;
utils_hooks__hooks.version = '2.14.1'; utils_hooks__hooks.version = '2.14.2';
setHookCallback(local__createLocal); setHookCallback(local__createLocal);
@ -35399,7 +35416,7 @@ goog.exportSymbol("libphonenumber.PhoneNumberFormat.NATIONAL",libphonenumber.Pho
})); }));
/* /*
International Telephone Input v4.0.1 International Telephone Input v4.0.2
https://github.com/Bluefieldscom/intl-tel-input.git https://github.com/Bluefieldscom/intl-tel-input.git
*/ */
// wrap in UMD - see https://github.com/umdjs/umd/blob/master/jqueryPlugin.js // wrap in UMD - see https://github.com/umdjs/umd/blob/master/jqueryPlugin.js
@ -36051,14 +36068,7 @@ https://github.com/Bluefieldscom/intl-tel-input.git
var dialCode = this._getDialCode(number); var dialCode = this._getDialCode(number);
if (dialCode) { if (dialCode) {
// check if one of the matching countries is already selected // check if one of the matching countries is already selected
var countryCodes = this.countryCodes[this._getNumeric(dialCode)], alreadySelected = false; var countryCodes = this.countryCodes[this._getNumeric(dialCode)], alreadySelected = this.selectedCountryData && $.inArray(this.selectedCountryData.iso2, countryCodes) != -1;
if (this.selectedCountryData) {
for (var i = 0; i < countryCodes.length; i++) {
if (countryCodes[i] == this.selectedCountryData.iso2) {
alreadySelected = true;
}
}
}
// if a matching country is not already selected (or this is an unknown NANP area code): choose the first in the list // if a matching country is not already selected (or this is an unknown NANP area code): choose the first in the list
if (!alreadySelected || this._isUnknownNanp(number, dialCode)) { if (!alreadySelected || this._isUnknownNanp(number, dialCode)) {
// if using onlyCountries option, countryCodes[0] may be empty, so we must find the first non-empty index // if using onlyCountries option, countryCodes[0] may be empty, so we must find the first non-empty index
@ -36106,9 +36116,8 @@ https://github.com/Bluefieldscom/intl-tel-input.git
// and the input's placeholder // and the input's placeholder
this._updatePlaceholder(); this._updatePlaceholder();
// update the active list item // update the active list item
var listItem = this.countryListItems.children(".iti-flag." + countryCode).first().parent();
this.countryListItems.removeClass("active"); this.countryListItems.removeClass("active");
listItem.addClass("active"); this.countryListItems.children(".iti-flag." + countryCode).first().parent().addClass("active");
}, },
// update the input placeholder to an example number from the currently selected country // update the input placeholder to an example number from the currently selected country
_updatePlaceholder: function() { _updatePlaceholder: function() {
@ -36405,7 +36414,6 @@ JSON.stringify(result);
}; };
} }
}); });
/* /*
* JavaScript Load Image 1.10.0 * JavaScript Load Image 1.10.0
* https://github.com/blueimp/JavaScript-Load-Image * https://github.com/blueimp/JavaScript-Load-Image
@ -36805,7 +36813,7 @@ JSON.stringify(result);
}(this)); }(this));
/*! /*!
Autosize 3.0.5 Autosize 4.0.0
license: MIT license: MIT
http://www.jacklmoore.com/autosize http://www.jacklmoore.com/autosize
*/ */
@ -36824,18 +36832,53 @@ JSON.stringify(result);
})(this, function (exports, module) { })(this, function (exports, module) {
'use strict'; 'use strict';
var map = typeof Map === "function" ? new Map() : (function () {
var keys = [];
var values = [];
return {
has: function has(key) {
return keys.indexOf(key) > -1;
},
get: function get(key) {
return values[keys.indexOf(key)];
},
set: function set(key, value) {
if (keys.indexOf(key) === -1) {
keys.push(key);
values.push(value);
}
},
'delete': function _delete(key) {
var index = keys.indexOf(key);
if (index > -1) {
keys.splice(index, 1);
values.splice(index, 1);
}
}
};
})();
var createEvent = function createEvent(name) {
return new Event(name, { bubbles: true });
};
try {
new Event('test');
} catch (e) {
// IE does not support `new Event()`
createEvent = function (name) {
var evt = document.createEvent('Event');
evt.initEvent(name, true, false);
return evt;
};
}
function assign(ta) { function assign(ta) {
var _ref = arguments[1] === undefined ? {} : arguments[1]; if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
var _ref$setOverflowX = _ref.setOverflowX;
var setOverflowX = _ref$setOverflowX === undefined ? true : _ref$setOverflowX;
var _ref$setOverflowY = _ref.setOverflowY;
var setOverflowY = _ref$setOverflowY === undefined ? true : _ref$setOverflowY;
if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || ta.hasAttribute('data-autosize-on')) return;
var heightOffset = null; var heightOffset = null;
var overflowY = 'hidden'; var clientWidth = ta.clientWidth;
var cachedHeight = null;
function init() { function init() {
var style = window.getComputedStyle(ta, null); var style = window.getComputedStyle(ta, null);
@ -36851,6 +36894,10 @@ JSON.stringify(result);
} else { } else {
heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
} }
// Fix when a textarea is not on document body and heightOffset is Not a Number
if (isNaN(heightOffset)) {
heightOffset = 0;
}
update(); update();
} }
@ -36869,22 +36916,31 @@ JSON.stringify(result);
ta.style.width = width; ta.style.width = width;
} }
overflowY = value; ta.style.overflowY = value;
if (setOverflowY) {
ta.style.overflowY = value;
}
update();
} }
function update() { function getParentOverflows(el) {
var startHeight = ta.style.height; var arr = [];
var htmlTop = document.documentElement.scrollTop;
var bodyTop = document.body.scrollTop;
var originalHeight = ta.style.height;
ta.style.height = 'auto'; while (el && el.parentNode && el.parentNode instanceof Element) {
if (el.parentNode.scrollTop) {
arr.push({
node: el.parentNode,
scrollTop: el.parentNode.scrollTop
});
}
el = el.parentNode;
}
return arr;
}
function resize() {
var originalHeight = ta.style.height;
var overflows = getParentOverflows(ta);
var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
ta.style.height = '';
var endHeight = ta.scrollHeight + heightOffset; var endHeight = ta.scrollHeight + heightOffset;
@ -36896,85 +36952,118 @@ JSON.stringify(result);
ta.style.height = endHeight + 'px'; ta.style.height = endHeight + 'px';
// used to check if an update is actually necessary on window.resize
clientWidth = ta.clientWidth;
// prevents scroll-position jumping // prevents scroll-position jumping
document.documentElement.scrollTop = htmlTop; overflows.forEach(function (el) {
document.body.scrollTop = bodyTop; el.node.scrollTop = el.scrollTop;
});
var style = window.getComputedStyle(ta, null); if (docTop) {
document.documentElement.scrollTop = docTop;
if (style.height !== ta.style.height) {
if (overflowY !== 'visible') {
changeOverflow('visible');
return;
}
} else {
if (overflowY !== 'hidden') {
changeOverflow('hidden');
return;
}
}
if (startHeight !== ta.style.height) {
var evt = document.createEvent('Event');
evt.initEvent('autosize:resized', true, false);
ta.dispatchEvent(evt);
} }
} }
function update() {
resize();
var styleHeight = Math.round(parseFloat(ta.style.height));
var computed = window.getComputedStyle(ta, null);
// Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
// The actual height not matching the style height (set via the resize method) indicates that
// the max-height has been exceeded, in which case the overflow should be allowed.
if (actualHeight !== styleHeight) {
if (computed.overflowY === 'hidden') {
changeOverflow('scroll');
resize();
actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
}
} else {
// Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
if (computed.overflowY !== 'hidden') {
changeOverflow('hidden');
resize();
actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
}
}
if (cachedHeight !== actualHeight) {
cachedHeight = actualHeight;
var evt = createEvent('autosize:resized');
try {
ta.dispatchEvent(evt);
} catch (err) {
// Firefox will throw an error on dispatchEvent for a detached element
// https://bugzilla.mozilla.org/show_bug.cgi?id=889376
}
}
}
var pageResize = function pageResize() {
if (ta.clientWidth !== clientWidth) {
update();
}
};
var destroy = (function (style) { var destroy = (function (style) {
window.removeEventListener('resize', update); window.removeEventListener('resize', pageResize, false);
ta.removeEventListener('input', update); ta.removeEventListener('input', update, false);
ta.removeEventListener('keyup', update); ta.removeEventListener('keyup', update, false);
ta.removeAttribute('data-autosize-on'); ta.removeEventListener('autosize:destroy', destroy, false);
ta.removeEventListener('autosize:destroy', destroy); ta.removeEventListener('autosize:update', update, false);
Object.keys(style).forEach(function (key) { Object.keys(style).forEach(function (key) {
ta.style[key] = style[key]; ta.style[key] = style[key];
}); });
map['delete'](ta);
}).bind(ta, { }).bind(ta, {
height: ta.style.height, height: ta.style.height,
resize: ta.style.resize, resize: ta.style.resize,
overflowY: ta.style.overflowY, overflowY: ta.style.overflowY,
overflowX: ta.style.overflowX, overflowX: ta.style.overflowX,
wordWrap: ta.style.wordWrap }); wordWrap: ta.style.wordWrap
});
ta.addEventListener('autosize:destroy', destroy); ta.addEventListener('autosize:destroy', destroy, false);
// IE9 does not fire onpropertychange or oninput for deletions, // IE9 does not fire onpropertychange or oninput for deletions,
// so binding to onkeyup to catch most of those events. // so binding to onkeyup to catch most of those events.
// There is no way that I know of to detect something like 'cut' in IE9. // There is no way that I know of to detect something like 'cut' in IE9.
if ('onpropertychange' in ta && 'oninput' in ta) { if ('onpropertychange' in ta && 'oninput' in ta) {
ta.addEventListener('keyup', update); ta.addEventListener('keyup', update, false);
} }
window.addEventListener('resize', update); window.addEventListener('resize', pageResize, false);
ta.addEventListener('input', update); ta.addEventListener('input', update, false);
ta.addEventListener('autosize:update', update); ta.addEventListener('autosize:update', update, false);
ta.setAttribute('data-autosize-on', true); ta.style.overflowX = 'hidden';
ta.style.wordWrap = 'break-word';
if (setOverflowY) { map.set(ta, {
ta.style.overflowY = 'hidden'; destroy: destroy,
} update: update
if (setOverflowX) { });
ta.style.overflowX = 'hidden';
ta.style.wordWrap = 'break-word';
}
init(); init();
} }
function destroy(ta) { function destroy(ta) {
if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return; var methods = map.get(ta);
var evt = document.createEvent('Event'); if (methods) {
evt.initEvent('autosize:destroy', true, false); methods.destroy();
ta.dispatchEvent(evt); }
} }
function update(ta) { function update(ta) {
if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return; var methods = map.get(ta);
var evt = document.createEvent('Event'); if (methods) {
evt.initEvent('autosize:update', true, false); methods.update();
ta.dispatchEvent(evt); }
} }
var autosize = null; var autosize = null;
@ -37022,7 +37111,7 @@ JSON.stringify(result);
* *
* @copyright 2017 Jason Mulligan <jason.mulligan@avoidwork.com> * @copyright 2017 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause * @license BSD-3-Clause
* @version 3.5.9 * @version 3.5.10
*/ */
(function (global) { (function (global) {
var b = /^(b|B)$/, var b = /^(b|B)$/,

View File

@ -959,7 +959,8 @@
/** /**
* @license ByteBuffer.js (c) 2013-2014 Daniel Wirtz <dcode@dcode.io> * @license ByteBuffer.js (c) 2013-2014 Daniel Wirtz <dcode@dcode.io>
* This version of ByteBuffer.js uses an ArrayBuffer (AB) as its backing buffer and is compatible with modern browsers. * This version of ByteBuffer.js uses an ArrayBuffer as its backing buffer which is accessed through a DataView and is
* compatible with modern browsers.
* Released under the Apache License, Version 2.0 * Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/ByteBuffer.js for details * see: https://github.com/dcodeIO/ByteBuffer.js for details
*/ // */ //
@ -1059,7 +1060,7 @@
* @const * @const
* @expose * @expose
*/ */
ByteBuffer.VERSION = "3.5.4"; ByteBuffer.VERSION = "3.5.5";
/** /**
* Little endian constant that can be used instead of its boolean value. Evaluates to `true`. * Little endian constant that can be used instead of its boolean value. Evaluates to `true`.
@ -1695,6 +1696,8 @@
if (!this.noAssert) { if (!this.noAssert) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long)) else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)"); throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0) if (typeof offset !== 'number' || offset % 1 !== 0)
@ -1705,6 +1708,8 @@
} }
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
offset += 8; offset += 8;
var capacity6 = this.buffer.byteLength; var capacity6 = this.buffer.byteLength;
if (offset > capacity6) if (offset > capacity6)
@ -1774,6 +1779,8 @@
if (!this.noAssert) { if (!this.noAssert) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long)) else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)"); throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0) if (typeof offset !== 'number' || offset % 1 !== 0)
@ -1784,6 +1791,8 @@
} }
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
offset += 8; offset += 8;
var capacity7 = this.buffer.byteLength; var capacity7 = this.buffer.byteLength;
if (offset > capacity7) if (offset > capacity7)
@ -2180,6 +2189,8 @@
ByteBuffer.calculateVarint64 = function(value) { ByteBuffer.calculateVarint64 = function(value) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
// ref: src/google/protobuf/io/coded_stream.cc // ref: src/google/protobuf/io/coded_stream.cc
var part0 = value.toInt() >>> 0, var part0 = value.toInt() >>> 0,
part1 = value.shiftRightUnsigned(28).toInt() >>> 0, part1 = value.shiftRightUnsigned(28).toInt() >>> 0,
@ -2209,6 +2220,8 @@
ByteBuffer.zigZagEncode64 = function(value) { ByteBuffer.zigZagEncode64 = function(value) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value, false); value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned(); else if (value.unsigned !== false) value = value.toSigned();
// ref: src/google/protobuf/wire_format_lite.h // ref: src/google/protobuf/wire_format_lite.h
return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned(); return value.shiftLeft(1).xor(value.shiftRight(63)).toUnsigned();
@ -2223,6 +2236,8 @@
ByteBuffer.zigZagDecode64 = function(value) { ByteBuffer.zigZagDecode64 = function(value) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value, false); value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned(); else if (value.unsigned !== false) value = value.toSigned();
// ref: src/google/protobuf/wire_format_lite.h // ref: src/google/protobuf/wire_format_lite.h
return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned(); return value.shiftRightUnsigned(1).xor(value.and(Long.ONE).toSigned().negate()).toSigned();
@ -2242,6 +2257,8 @@
if (!this.noAssert) { if (!this.noAssert) {
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value); value = Long.fromNumber(value);
else if (typeof value === 'string')
value = Long.fromString(value);
else if (!(value && value instanceof Long)) else if (!(value && value instanceof Long))
throw TypeError("Illegal value: "+value+" (not an integer or Long)"); throw TypeError("Illegal value: "+value+" (not an integer or Long)");
if (typeof offset !== 'number' || offset % 1 !== 0) if (typeof offset !== 'number' || offset % 1 !== 0)
@ -2252,6 +2269,8 @@
} }
if (typeof value === 'number') if (typeof value === 'number')
value = Long.fromNumber(value, false); value = Long.fromNumber(value, false);
else if (typeof value === 'string')
value = Long.fromString(value, false);
else if (value.unsigned !== false) value = value.toSigned(); else if (value.unsigned !== false) value = value.toSigned();
var size = ByteBuffer.calculateVarint64(value), var size = ByteBuffer.calculateVarint64(value),
part0 = value.toInt() >>> 0, part0 = value.toInt() >>> 0,
@ -2392,7 +2411,6 @@
if (offset < 0 || offset + 0 > this.buffer.byteLength) if (offset < 0 || offset + 0 > this.buffer.byteLength)
throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength); throw RangeError("Illegal offset: 0 <= "+offset+" (+"+0+") <= "+this.buffer.byteLength);
} }
var start = offset;
// UTF8 strings do not contain zero bytes in between except for the zero character, so: // UTF8 strings do not contain zero bytes in between except for the zero character, so:
k = utfx.calculateUTF16asUTF8(stringSource(str))[1]; k = utfx.calculateUTF16asUTF8(stringSource(str))[1];
offset += k+1; offset += k+1;
@ -2405,7 +2423,7 @@
}.bind(this)); }.bind(this));
this.view.setUint8(offset++, 0); this.view.setUint8(offset++, 0);
if (relative) { if (relative) {
this.offset = offset - start; this.offset = offset;
return this; return this;
} }
return k; return k;
@ -2844,8 +2862,8 @@
}; };
/** /**
* Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents behind the specified * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents at and after the
* offset up to the length of this ByteBuffer's data. specified offset up to the length of this ByteBuffer's data.
* @param {!ByteBuffer} target Target ByteBuffer * @param {!ByteBuffer} target Target ByteBuffer
* @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes * @param {number=} offset Offset to append to. Will use and increase {@link ByteBuffer#offset} by the number of bytes
* read if omitted. * read if omitted.
@ -4257,7 +4275,7 @@
* @const * @const
* @expose * @expose
*/ */
ProtoBuf.VERSION = "3.8.0"; ProtoBuf.VERSION = "3.8.2";
/** /**
* Wire types. * Wire types.
@ -4621,7 +4639,7 @@
ID: /^(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/, ID: /^(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/,
NEGID: /^\-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/, NEGID: /^\-?(?:[1-9][0-9]*|0|0x[0-9a-fA-F]+|0[0-7]+)$/,
WHITESPACE: /\s/, WHITESPACE: /\s/,
STRING: /['"]([^'"\\]*(\\.[^"\\]*)*)['"]/g, STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
BOOL: /^(?:true|false)$/i BOOL: /^(?:true|false)$/i
}; };
@ -4707,7 +4725,7 @@
Lang.STRING.lastIndex = this.index-1; // Include the open quote Lang.STRING.lastIndex = this.index-1; // Include the open quote
var match; var match;
if ((match = Lang.STRING.exec(this.source)) !== null) { if ((match = Lang.STRING.exec(this.source)) !== null) {
var s = match[1]; var s = typeof match[1] !== 'undefined' ? match[1] : match[2];
this.index = Lang.STRING.lastIndex; this.index = Lang.STRING.lastIndex;
this.stack.push(this.stringEndsWith); this.stack.push(this.stringEndsWith);
return s; return s;
@ -8504,7 +8522,6 @@
json = JSON.parse(json); json = JSON.parse(json);
builder["import"](json, filename); builder["import"](json, filename);
builder.resolveAll(); builder.resolveAll();
builder.build();
return builder; return builder;
}; };