diff --git a/.eslintignore b/.eslintignore index e6e1cbbc2eb..81b9e250bd6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,7 +7,6 @@ app/favico/favico.js app/katex/client/katex/katex.min.js packages/rocketchat-livechat/assets/rocketchat-livechat.min.js packages/rocketchat-livechat/assets/rocket-livechat.js -app/theme/client/minicolors/jquery.minicolors.js app/theme/client/vendor/ app/ui/client/lib/customEventPolyfill.js app/ui/client/lib/Modernizr.js diff --git a/.eslintrc b/.eslintrc index b78b5466277..a8bdb516600 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,8 +5,7 @@ "__meteor_bootstrap__" : false, "__meteor_runtime_config__" : false, "Assets" : false, - "chrome" : false, - "jscolor" : false + "chrome" : false }, "plugins": ["react"], "rules": { diff --git a/app/lib/server/methods/removeOAuthService.js b/app/lib/server/methods/removeOAuthService.js index e1dbf2cee0d..5a5f07fb69c 100644 --- a/app/lib/server/methods/removeOAuthService.js +++ b/app/lib/server/methods/removeOAuthService.js @@ -40,5 +40,6 @@ Meteor.methods({ settings.removeById(`Accounts_OAuth_Custom-${ name }-roles_claim`); settings.removeById(`Accounts_OAuth_Custom-${ name }-merge_roles`); settings.removeById(`Accounts_OAuth_Custom-${ name }-merge_users`); + settings.removeById(`Accounts_OAuth_Custom-${ name }-show_button`); }, }); diff --git a/app/livechat/client/views/app/livechatAppearance.html b/app/livechat/client/views/app/livechatAppearance.html index 774aae058c3..a5532e7e174 100644 --- a/app/livechat/client/views/app/livechatAppearance.html +++ b/app/livechat/client/views/app/livechatAppearance.html @@ -14,10 +14,7 @@
-
- - -
+
@@ -63,10 +60,7 @@
-
- - -
+
diff --git a/app/livechat/client/views/app/livechatAppearance.js b/app/livechat/client/views/app/livechatAppearance.js index 71ae119cef6..6fcca80a9e1 100644 --- a/app/livechat/client/views/app/livechatAppearance.js +++ b/app/livechat/client/views/app/livechatAppearance.js @@ -1,4 +1,3 @@ -/* eslint new-cap: ["error", { "newIsCapExceptions": ["jscolor"] }]*/ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; @@ -312,11 +311,3 @@ Template.livechatAppearance.events({ }); }, }); - -Template.livechatAppearance.onRendered(function() { - Meteor.setTimeout(() => { - $('.colorpicker-input').each((index, el) => { - new jscolor(el); - }); - }, 500); -}); diff --git a/app/theme/client/index.js b/app/theme/client/index.js deleted file mode 100644 index 597665c39fa..00000000000 --- a/app/theme/client/index.js +++ /dev/null @@ -1 +0,0 @@ -import './vendor/jscolor'; diff --git a/app/theme/client/vendor/jscolor.js b/app/theme/client/vendor/jscolor.js deleted file mode 100644 index 8d65d83740e..00000000000 --- a/app/theme/client/vendor/jscolor.js +++ /dev/null @@ -1,1844 +0,0 @@ -/** - * jscolor - JavaScript Color Picker - * - * @link http://jscolor.com - * @license For open source use: GPLv3 - * For commercial use: JSColor Commercial License - * @author Jan Odvarko - * @version 2.0.4 - * - * See usage examples at http://jscolor.com/examples/ - */ - - -"use strict"; - - -if (!window.jscolor) { window.jscolor = (function () { - - -var jsc = { - - - register : function () { - jsc.attachDOMReadyEvent(jsc.init); - jsc.attachEvent(document, 'mousedown', jsc.onDocumentMouseDown); - jsc.attachEvent(document, 'touchstart', jsc.onDocumentTouchStart); - jsc.attachEvent(window, 'resize', jsc.onWindowResize); - }, - - - init : function () { - if (jsc.jscolor.lookupClass) { - jsc.jscolor.installByClassName(jsc.jscolor.lookupClass); - } - }, - - - tryInstallOnElements : function (elms, className) { - var matchClass = new RegExp('(^|\\s)(' + className + ')(\\s*(\\{[^}]*\\})|\\s|$)', 'i'); - - for (var i = 0; i < elms.length; i += 1) { - if (elms[i].type !== undefined && elms[i].type.toLowerCase() == 'color') { - if (jsc.isColorAttrSupported) { - // skip inputs of type 'color' if supported by the browser - continue; - } - } - var m; - if (!elms[i].jscolor && elms[i].className && (m = elms[i].className.match(matchClass))) { - var targetElm = elms[i]; - var optsStr = null; - - var dataOptions = jsc.getDataAttr(targetElm, 'jscolor'); - if (dataOptions !== null) { - optsStr = dataOptions; - } else if (m[4]) { - optsStr = m[4]; - } - - var opts = {}; - if (optsStr) { - try { - opts = (new Function ('return (' + optsStr + ')'))(); - } catch(eParseError) { - jsc.warn('Error parsing jscolor options: ' + eParseError + ':\n' + optsStr); - } - } - targetElm.jscolor = new jsc.jscolor(targetElm, opts); - } - } - }, - - - isColorAttrSupported : (function () { - var elm = document.createElement('input'); - if (elm.setAttribute) { - elm.setAttribute('type', 'color'); - if (elm.type.toLowerCase() == 'color') { - return true; - } - } - return false; - })(), - - - isCanvasSupported : (function () { - var elm = document.createElement('canvas'); - return !!(elm.getContext && elm.getContext('2d')); - })(), - - - fetchElement : function (mixed) { - return typeof mixed === 'string' ? document.getElementById(mixed) : mixed; - }, - - - isElementType : function (elm, type) { - return elm.nodeName.toLowerCase() === type.toLowerCase(); - }, - - - getDataAttr : function (el, name) { - var attrName = 'data-' + name; - var attrValue = el.getAttribute(attrName); - if (attrValue !== null) { - return attrValue; - } - return null; - }, - - - attachEvent : function (el, evnt, func) { - if (el.addEventListener) { - el.addEventListener(evnt, func, false); - } else if (el.attachEvent) { - el.attachEvent('on' + evnt, func); - } - }, - - - detachEvent : function (el, evnt, func) { - if (el.removeEventListener) { - el.removeEventListener(evnt, func, false); - } else if (el.detachEvent) { - el.detachEvent('on' + evnt, func); - } - }, - - - _attachedGroupEvents : {}, - - - attachGroupEvent : function (groupName, el, evnt, func) { - if (!jsc._attachedGroupEvents.hasOwnProperty(groupName)) { - jsc._attachedGroupEvents[groupName] = []; - } - jsc._attachedGroupEvents[groupName].push([el, evnt, func]); - jsc.attachEvent(el, evnt, func); - }, - - - detachGroupEvents : function (groupName) { - if (jsc._attachedGroupEvents.hasOwnProperty(groupName)) { - for (var i = 0; i < jsc._attachedGroupEvents[groupName].length; i += 1) { - var evt = jsc._attachedGroupEvents[groupName][i]; - jsc.detachEvent(evt[0], evt[1], evt[2]); - } - delete jsc._attachedGroupEvents[groupName]; - } - }, - - - attachDOMReadyEvent : function (func) { - var fired = false; - var fireOnce = function () { - if (!fired) { - fired = true; - func(); - } - }; - - if (document.readyState === 'complete') { - setTimeout(fireOnce, 1); // async - return; - } - - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', fireOnce, false); - - // Fallback - window.addEventListener('load', fireOnce, false); - - } else if (document.attachEvent) { - // IE - document.attachEvent('onreadystatechange', function () { - if (document.readyState === 'complete') { - document.detachEvent('onreadystatechange', arguments.callee); - fireOnce(); - } - }) - - // Fallback - window.attachEvent('onload', fireOnce); - - // IE7/8 - if (document.documentElement.doScroll && window == window.top) { - var tryScroll = function () { - if (!document.body) { return; } - try { - document.documentElement.doScroll('left'); - fireOnce(); - } catch (e) { - setTimeout(tryScroll, 1); - } - }; - tryScroll(); - } - } - }, - - - warn : function (msg) { - if (window.console && window.console.warn) { - window.console.warn(msg); - } - }, - - - preventDefault : function (e) { - if (e.preventDefault) { e.preventDefault(); } - e.returnValue = false; - }, - - - captureTarget : function (target) { - // IE - if (target.setCapture) { - jsc._capturedTarget = target; - jsc._capturedTarget.setCapture(); - } - }, - - - releaseTarget : function () { - // IE - if (jsc._capturedTarget) { - jsc._capturedTarget.releaseCapture(); - jsc._capturedTarget = null; - } - }, - - - fireEvent : function (el, evnt) { - if (!el) { - return; - } - if (document.createEvent) { - var ev = document.createEvent('HTMLEvents'); - ev.initEvent(evnt, true, true); - el.dispatchEvent(ev); - } else if (document.createEventObject) { - var ev = document.createEventObject(); - el.fireEvent('on' + evnt, ev); - } else if (el['on' + evnt]) { // alternatively use the traditional event model - el['on' + evnt](); - } - }, - - - classNameToList : function (className) { - return className.replace(/^\s+|\s+$/g, '').split(/\s+/); - }, - - - // The className parameter (str) can only contain a single class name - hasClass : function (elm, className) { - if (!className) { - return false; - } - return -1 != (' ' + elm.className.replace(/\s+/g, ' ') + ' ').indexOf(' ' + className + ' '); - }, - - - // The className parameter (str) can contain multiple class names separated by whitespace - setClass : function (elm, className) { - var classList = jsc.classNameToList(className); - for (var i = 0; i < classList.length; i += 1) { - if (!jsc.hasClass(elm, classList[i])) { - elm.className += (elm.className ? ' ' : '') + classList[i]; - } - } - }, - - - // The className parameter (str) can contain multiple class names separated by whitespace - unsetClass : function (elm, className) { - var classList = jsc.classNameToList(className); - for (var i = 0; i < classList.length; i += 1) { - var repl = new RegExp( - '^\\s*' + classList[i] + '\\s*|' + - '\\s*' + classList[i] + '\\s*$|' + - '\\s+' + classList[i] + '(\\s+)', - 'g' - ); - elm.className = elm.className.replace(repl, '$1'); - } - }, - - - getStyle : function (elm) { - return window.getComputedStyle ? window.getComputedStyle(elm) : elm.currentStyle; - }, - - - setStyle : (function () { - var helper = document.createElement('div'); - var getSupportedProp = function (names) { - for (var i = 0; i < names.length; i += 1) { - if (names[i] in helper.style) { - return names[i]; - } - } - }; - var props = { - borderRadius: getSupportedProp(['borderRadius', 'MozBorderRadius', 'webkitBorderRadius']), - boxShadow: getSupportedProp(['boxShadow', 'MozBoxShadow', 'webkitBoxShadow']) - }; - return function (elm, prop, value) { - switch (prop.toLowerCase()) { - case 'opacity': - var alphaOpacity = Math.round(parseFloat(value) * 100); - elm.style.opacity = value; - elm.style.filter = 'alpha(opacity=' + alphaOpacity + ')'; - break; - default: - elm.style[props[prop]] = value; - break; - } - }; - })(), - - - setBorderRadius : function (elm, value) { - jsc.setStyle(elm, 'borderRadius', value || '0'); - }, - - - setBoxShadow : function (elm, value) { - jsc.setStyle(elm, 'boxShadow', value || 'none'); - }, - - - getElementPos : function (e, relativeToViewport) { - var x=0, y=0; - var rect = e.getBoundingClientRect(); - x = rect.left; - y = rect.top; - if (!relativeToViewport) { - var viewPos = jsc.getViewPos(); - x += viewPos[0]; - y += viewPos[1]; - } - return [x, y]; - }, - - - getElementSize : function (e) { - return [e.offsetWidth, e.offsetHeight]; - }, - - - // get pointer's X/Y coordinates relative to viewport - getAbsPointerPos : function (e) { - if (!e) { e = window.event; } - var x = 0, y = 0; - if (typeof e.changedTouches !== 'undefined' && e.changedTouches.length) { - // touch devices - x = e.changedTouches[0].clientX; - y = e.changedTouches[0].clientY; - } else if (typeof e.clientX === 'number') { - x = e.clientX; - y = e.clientY; - } - return { x: x, y: y }; - }, - - - // get pointer's X/Y coordinates relative to target element - getRelPointerPos : function (e) { - if (!e) { e = window.event; } - var target = e.target || e.srcElement; - var targetRect = target.getBoundingClientRect(); - - var x = 0, y = 0; - - var clientX = 0, clientY = 0; - if (typeof e.changedTouches !== 'undefined' && e.changedTouches.length) { - // touch devices - clientX = e.changedTouches[0].clientX; - clientY = e.changedTouches[0].clientY; - } else if (typeof e.clientX === 'number') { - clientX = e.clientX; - clientY = e.clientY; - } - - x = clientX - targetRect.left; - y = clientY - targetRect.top; - return { x: x, y: y }; - }, - - - getViewPos : function () { - var doc = document.documentElement; - return [ - (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0), - (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0) - ]; - }, - - - getViewSize : function () { - var doc = document.documentElement; - return [ - (window.innerWidth || doc.clientWidth), - (window.innerHeight || doc.clientHeight), - ]; - }, - - - redrawPosition : function () { - - if (jsc.picker && jsc.picker.owner) { - var thisObj = jsc.picker.owner; - - var tp, vp; - - if (thisObj.fixed) { - // Fixed elements are positioned relative to viewport, - // therefore we can ignore the scroll offset - tp = jsc.getElementPos(thisObj.targetElement, true); // target pos - vp = [0, 0]; // view pos - } else { - tp = jsc.getElementPos(thisObj.targetElement); // target pos - vp = jsc.getViewPos(); // view pos - } - - var ts = jsc.getElementSize(thisObj.targetElement); // target size - var vs = jsc.getViewSize(); // view size - var ps = jsc.getPickerOuterDims(thisObj); // picker size - var a, b, c; - switch (thisObj.position.toLowerCase()) { - case 'left': a=1; b=0; c=-1; break; - case 'right':a=1; b=0; c=1; break; - case 'top': a=0; b=1; c=-1; break; - default: a=0; b=1; c=1; break; - } - var l = (ts[b]+ps[b])/2; - - // compute picker position - if (!thisObj.smartPosition) { - var pp = [ - tp[a], - tp[b]+ts[b]-l+l*c - ]; - } else { - var pp = [ - -vp[a]+tp[a]+ps[a] > vs[a] ? - (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) : - tp[a], - -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ? - (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) : - (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c) - ]; - } - - var x = pp[a]; - var y = pp[b]; - var positionValue = thisObj.fixed ? 'fixed' : 'absolute'; - var contractShadow = - (pp[0] + ps[0] > tp[0] || pp[0] < tp[0] + ts[0]) && - (pp[1] + ps[1] < tp[1] + ts[1]); - - jsc._drawPosition(thisObj, x, y, positionValue, contractShadow); - } - }, - - - _drawPosition : function (thisObj, x, y, positionValue, contractShadow) { - var vShadow = contractShadow ? 0 : thisObj.shadowBlur; // px - - jsc.picker.wrap.style.position = positionValue; - jsc.picker.wrap.style.left = x + 'px'; - jsc.picker.wrap.style.top = y + 'px'; - - jsc.setBoxShadow( - jsc.picker.boxS, - thisObj.shadow ? - new jsc.BoxShadow(0, vShadow, thisObj.shadowBlur, 0, thisObj.shadowColor) : - null); - }, - - - getPickerDims : function (thisObj) { - var displaySlider = !!jsc.getSliderComponent(thisObj); - var dims = [ - 2 * thisObj.insetWidth + 2 * thisObj.padding + thisObj.width + - (displaySlider ? 2 * thisObj.insetWidth + jsc.getPadToSliderPadding(thisObj) + thisObj.sliderSize : 0), - 2 * thisObj.insetWidth + 2 * thisObj.padding + thisObj.height + - (thisObj.closable ? 2 * thisObj.insetWidth + thisObj.padding + thisObj.buttonHeight : 0) - ]; - return dims; - }, - - - getPickerOuterDims : function (thisObj) { - var dims = jsc.getPickerDims(thisObj); - return [ - dims[0] + 2 * thisObj.borderWidth, - dims[1] + 2 * thisObj.borderWidth - ]; - }, - - - getPadToSliderPadding : function (thisObj) { - return Math.max(thisObj.padding, 1.5 * (2 * thisObj.pointerBorderWidth + thisObj.pointerThickness)); - }, - - - getPadYComponent : function (thisObj) { - switch (thisObj.mode.charAt(1).toLowerCase()) { - case 'v': return 'v'; break; - } - return 's'; - }, - - - getSliderComponent : function (thisObj) { - if (thisObj.mode.length > 2) { - switch (thisObj.mode.charAt(2).toLowerCase()) { - case 's': return 's'; break; - case 'v': return 'v'; break; - } - } - return null; - }, - - - onDocumentMouseDown : function (e) { - if (!e) { e = window.event; } - var target = e.target || e.srcElement; - - if (target._jscLinkedInstance) { - if (target._jscLinkedInstance.showOnClick) { - target._jscLinkedInstance.show(); - } - } else if (target._jscControlName) { - jsc.onControlPointerStart(e, target, target._jscControlName, 'mouse'); - } else { - // Mouse is outside the picker controls -> hide the color picker! - if (jsc.picker && jsc.picker.owner) { - jsc.picker.owner.hide(); - } - } - }, - - - onDocumentTouchStart : function (e) { - if (!e) { e = window.event; } - var target = e.target || e.srcElement; - - if (target._jscLinkedInstance) { - if (target._jscLinkedInstance.showOnClick) { - target._jscLinkedInstance.show(); - } - } else if (target._jscControlName) { - jsc.onControlPointerStart(e, target, target._jscControlName, 'touch'); - } else { - if (jsc.picker && jsc.picker.owner) { - jsc.picker.owner.hide(); - } - } - }, - - - onWindowResize : function (e) { - jsc.redrawPosition(); - }, - - - onParentScroll : function (e) { - // hide the picker when one of the parent elements is scrolled - if (jsc.picker && jsc.picker.owner) { - jsc.picker.owner.hide(); - } - }, - - - _pointerMoveEvent : { - mouse: 'mousemove', - touch: 'touchmove' - }, - _pointerEndEvent : { - mouse: 'mouseup', - touch: 'touchend' - }, - - - _pointerOrigin : null, - _capturedTarget : null, - - - onControlPointerStart : function (e, target, controlName, pointerType) { - var thisObj = target._jscInstance; - - jsc.preventDefault(e); - jsc.captureTarget(target); - - var registerDragEvents = function (doc, offset) { - jsc.attachGroupEvent('drag', doc, jsc._pointerMoveEvent[pointerType], - jsc.onDocumentPointerMove(e, target, controlName, pointerType, offset)); - jsc.attachGroupEvent('drag', doc, jsc._pointerEndEvent[pointerType], - jsc.onDocumentPointerEnd(e, target, controlName, pointerType)); - }; - - registerDragEvents(document, [0, 0]); - - if (window.parent && window.frameElement) { - var rect = window.frameElement.getBoundingClientRect(); - var ofs = [-rect.left, -rect.top]; - registerDragEvents(window.parent.window.document, ofs); - } - - var abs = jsc.getAbsPointerPos(e); - var rel = jsc.getRelPointerPos(e); - jsc._pointerOrigin = { - x: abs.x - rel.x, - y: abs.y - rel.y - }; - - switch (controlName) { - case 'pad': - // if the slider is at the bottom, move it up - switch (jsc.getSliderComponent(thisObj)) { - case 's': if (thisObj.hsv[1] === 0) { thisObj.fromHSV(null, 100, null); }; break; - case 'v': if (thisObj.hsv[2] === 0) { thisObj.fromHSV(null, null, 100); }; break; - } - jsc.setPad(thisObj, e, 0, 0); - break; - - case 'sld': - jsc.setSld(thisObj, e, 0); - break; - } - - jsc.dispatchFineChange(thisObj); - }, - - - onDocumentPointerMove : function (e, target, controlName, pointerType, offset) { - return function (e) { - var thisObj = target._jscInstance; - switch (controlName) { - case 'pad': - if (!e) { e = window.event; } - jsc.setPad(thisObj, e, offset[0], offset[1]); - jsc.dispatchFineChange(thisObj); - break; - - case 'sld': - if (!e) { e = window.event; } - jsc.setSld(thisObj, e, offset[1]); - jsc.dispatchFineChange(thisObj); - break; - } - } - }, - - - onDocumentPointerEnd : function (e, target, controlName, pointerType) { - return function (e) { - var thisObj = target._jscInstance; - jsc.detachGroupEvents('drag'); - jsc.releaseTarget(); - // Always dispatch changes after detaching outstanding mouse handlers, - // in case some user interaction will occur in user's onchange callback - // that would intrude with current mouse events - jsc.dispatchChange(thisObj); - }; - }, - - - dispatchChange : function (thisObj) { - if (thisObj.valueElement) { - if (jsc.isElementType(thisObj.valueElement, 'input')) { - jsc.fireEvent(thisObj.valueElement, 'change'); - } - } - }, - - - dispatchFineChange : function (thisObj) { - if (thisObj.onFineChange) { - var callback; - if (typeof thisObj.onFineChange === 'string') { - callback = new Function (thisObj.onFineChange); - } else { - callback = thisObj.onFineChange; - } - callback.call(thisObj); - } - }, - - - setPad : function (thisObj, e, ofsX, ofsY) { - var pointerAbs = jsc.getAbsPointerPos(e); - var x = ofsX + pointerAbs.x - jsc._pointerOrigin.x - thisObj.padding - thisObj.insetWidth; - var y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.insetWidth; - - var xVal = x * (360 / (thisObj.width - 1)); - var yVal = 100 - (y * (100 / (thisObj.height - 1))); - - switch (jsc.getPadYComponent(thisObj)) { - case 's': thisObj.fromHSV(xVal, yVal, null, jsc.leaveSld); break; - case 'v': thisObj.fromHSV(xVal, null, yVal, jsc.leaveSld); break; - } - }, - - - setSld : function (thisObj, e, ofsY) { - var pointerAbs = jsc.getAbsPointerPos(e); - var y = ofsY + pointerAbs.y - jsc._pointerOrigin.y - thisObj.padding - thisObj.insetWidth; - - var yVal = 100 - (y * (100 / (thisObj.height - 1))); - - switch (jsc.getSliderComponent(thisObj)) { - case 's': thisObj.fromHSV(null, yVal, null, jsc.leavePad); break; - case 'v': thisObj.fromHSV(null, null, yVal, jsc.leavePad); break; - } - }, - - - _vmlNS : 'jsc_vml_', - _vmlCSS : 'jsc_vml_css_', - _vmlReady : false, - - - initVML : function () { - if (!jsc._vmlReady) { - // init VML namespace - var doc = document; - if (!doc.namespaces[jsc._vmlNS]) { - doc.namespaces.add(jsc._vmlNS, 'urn:schemas-microsoft-com:vml'); - } - if (!doc.styleSheets[jsc._vmlCSS]) { - var tags = ['shape', 'shapetype', 'group', 'background', 'path', 'formulas', 'handles', 'fill', 'stroke', 'shadow', 'textbox', 'textpath', 'imagedata', 'line', 'polyline', 'curve', 'rect', 'roundrect', 'oval', 'arc', 'image']; - var ss = doc.createStyleSheet(); - ss.owningElement.id = jsc._vmlCSS; - for (var i = 0; i < tags.length; i += 1) { - ss.addRule(jsc._vmlNS + '\\:' + tags[i], 'behavior:url(#default#VML);'); - } - } - jsc._vmlReady = true; - } - }, - - - createPalette : function () { - - var paletteObj = { - elm: null, - draw: null - }; - - if (jsc.isCanvasSupported) { - // Canvas implementation for modern browsers - - var canvas = document.createElement('canvas'); - var ctx = canvas.getContext('2d'); - - var drawFunc = function (width, height, type) { - canvas.width = width; - canvas.height = height; - - ctx.clearRect(0, 0, canvas.width, canvas.height); - - var hGrad = ctx.createLinearGradient(0, 0, canvas.width, 0); - hGrad.addColorStop(0 / 6, '#F00'); - hGrad.addColorStop(1 / 6, '#FF0'); - hGrad.addColorStop(2 / 6, '#0F0'); - hGrad.addColorStop(3 / 6, '#0FF'); - hGrad.addColorStop(4 / 6, '#00F'); - hGrad.addColorStop(5 / 6, '#F0F'); - hGrad.addColorStop(6 / 6, '#F00'); - - ctx.fillStyle = hGrad; - ctx.fillRect(0, 0, canvas.width, canvas.height); - - var vGrad = ctx.createLinearGradient(0, 0, 0, canvas.height); - switch (type.toLowerCase()) { - case 's': - vGrad.addColorStop(0, 'rgba(255,255,255,0)'); - vGrad.addColorStop(1, 'rgba(255,255,255,1)'); - break; - case 'v': - vGrad.addColorStop(0, 'rgba(0,0,0,0)'); - vGrad.addColorStop(1, 'rgba(0,0,0,1)'); - break; - } - ctx.fillStyle = vGrad; - ctx.fillRect(0, 0, canvas.width, canvas.height); - }; - - paletteObj.elm = canvas; - paletteObj.draw = drawFunc; - - } else { - // VML fallback for IE 7 and 8 - - jsc.initVML(); - - var vmlContainer = document.createElement('div'); - vmlContainer.style.position = 'relative'; - vmlContainer.style.overflow = 'hidden'; - - var hGrad = document.createElement(jsc._vmlNS + ':fill'); - hGrad.type = 'gradient'; - hGrad.method = 'linear'; - hGrad.angle = '90'; - hGrad.colors = '16.67% #F0F, 33.33% #00F, 50% #0FF, 66.67% #0F0, 83.33% #FF0' - - var hRect = document.createElement(jsc._vmlNS + ':rect'); - hRect.style.position = 'absolute'; - hRect.style.left = -1 + 'px'; - hRect.style.top = -1 + 'px'; - hRect.stroked = false; - hRect.appendChild(hGrad); - vmlContainer.appendChild(hRect); - - var vGrad = document.createElement(jsc._vmlNS + ':fill'); - vGrad.type = 'gradient'; - vGrad.method = 'linear'; - vGrad.angle = '180'; - vGrad.opacity = '0'; - - var vRect = document.createElement(jsc._vmlNS + ':rect'); - vRect.style.position = 'absolute'; - vRect.style.left = -1 + 'px'; - vRect.style.top = -1 + 'px'; - vRect.stroked = false; - vRect.appendChild(vGrad); - vmlContainer.appendChild(vRect); - - var drawFunc = function (width, height, type) { - vmlContainer.style.width = width + 'px'; - vmlContainer.style.height = height + 'px'; - - hRect.style.width = - vRect.style.width = - (width + 1) + 'px'; - hRect.style.height = - vRect.style.height = - (height + 1) + 'px'; - - // Colors must be specified during every redraw, otherwise IE won't display - // a full gradient during a subsequential redraw - hGrad.color = '#F00'; - hGrad.color2 = '#F00'; - - switch (type.toLowerCase()) { - case 's': - vGrad.color = vGrad.color2 = '#FFF'; - break; - case 'v': - vGrad.color = vGrad.color2 = '#000'; - break; - } - }; - - paletteObj.elm = vmlContainer; - paletteObj.draw = drawFunc; - } - - return paletteObj; - }, - - - createSliderGradient : function () { - - var sliderObj = { - elm: null, - draw: null - }; - - if (jsc.isCanvasSupported) { - // Canvas implementation for modern browsers - - var canvas = document.createElement('canvas'); - var ctx = canvas.getContext('2d'); - - var drawFunc = function (width, height, color1, color2) { - canvas.width = width; - canvas.height = height; - - ctx.clearRect(0, 0, canvas.width, canvas.height); - - var grad = ctx.createLinearGradient(0, 0, 0, canvas.height); - grad.addColorStop(0, color1); - grad.addColorStop(1, color2); - - ctx.fillStyle = grad; - ctx.fillRect(0, 0, canvas.width, canvas.height); - }; - - sliderObj.elm = canvas; - sliderObj.draw = drawFunc; - - } else { - // VML fallback for IE 7 and 8 - - jsc.initVML(); - - var vmlContainer = document.createElement('div'); - vmlContainer.style.position = 'relative'; - vmlContainer.style.overflow = 'hidden'; - - var grad = document.createElement(jsc._vmlNS + ':fill'); - grad.type = 'gradient'; - grad.method = 'linear'; - grad.angle = '180'; - - var rect = document.createElement(jsc._vmlNS + ':rect'); - rect.style.position = 'absolute'; - rect.style.left = -1 + 'px'; - rect.style.top = -1 + 'px'; - rect.stroked = false; - rect.appendChild(grad); - vmlContainer.appendChild(rect); - - var drawFunc = function (width, height, color1, color2) { - vmlContainer.style.width = width + 'px'; - vmlContainer.style.height = height + 'px'; - - rect.style.width = (width + 1) + 'px'; - rect.style.height = (height + 1) + 'px'; - - grad.color = color1; - grad.color2 = color2; - }; - - sliderObj.elm = vmlContainer; - sliderObj.draw = drawFunc; - } - - return sliderObj; - }, - - - leaveValue : 1<<0, - leaveStyle : 1<<1, - leavePad : 1<<2, - leaveSld : 1<<3, - - - BoxShadow : (function () { - var BoxShadow = function (hShadow, vShadow, blur, spread, color, inset) { - this.hShadow = hShadow; - this.vShadow = vShadow; - this.blur = blur; - this.spread = spread; - this.color = color; - this.inset = !!inset; - }; - - BoxShadow.prototype.toString = function () { - var vals = [ - Math.round(this.hShadow) + 'px', - Math.round(this.vShadow) + 'px', - Math.round(this.blur) + 'px', - Math.round(this.spread) + 'px', - this.color - ]; - if (this.inset) { - vals.push('inset'); - } - return vals.join(' '); - }; - - return BoxShadow; - })(), - - - // - // Usage: - // var myColor = new jscolor( [, ]) - // - - jscolor : function (targetElement, options) { - - // General options - // - this.value = null; // initial HEX color. To change it later, use methods fromString(), fromHSV() and fromRGB() - this.valueElement = targetElement; // element that will be used to display and input the color code - this.styleElement = targetElement; // element that will preview the picked color using CSS backgroundColor - this.required = true; // whether the associated text can be left empty - this.refine = true; // whether to refine the entered color code (e.g. uppercase it and remove whitespace) - this.hash = true; // whether to prefix the HEX color code with # symbol - this.uppercase = true; // whether to uppercase the color code - this.onFineChange = null; // called instantly every time the color changes (value can be either a function or a string with javascript code) - this.activeClass = 'jscolor-active'; // class to be set to the target element when a picker window is open on it - this.minS = 0; // min allowed saturation (0 - 100) - this.maxS = 100; // max allowed saturation (0 - 100) - this.minV = 0; // min allowed value (brightness) (0 - 100) - this.maxV = 100; // max allowed value (brightness) (0 - 100) - - // Accessing the picked color - // - this.hsv = [0, 0, 100]; // read-only [0-360, 0-100, 0-100] - this.rgb = [255, 255, 255]; // read-only [0-255, 0-255, 0-255] - - // Color Picker options - // - this.width = 181; // width of color palette (in px) - this.height = 101; // height of color palette (in px) - this.showOnClick = true; // whether to display the color picker when user clicks on its target element - this.mode = 'HSV'; // HSV | HVS | HS | HV - layout of the color picker controls - this.position = 'bottom'; // left | right | top | bottom - position relative to the target element - this.smartPosition = true; // automatically change picker position when there is not enough space for it - this.sliderSize = 16; // px - this.crossSize = 8; // px - this.closable = false; // whether to display the Close button - this.closeText = 'Close'; - this.buttonColor = '#000000'; // CSS color - this.buttonHeight = 18; // px - this.padding = 8; // px - this.backgroundColor = '#FFFFFF'; // CSS color - this.borderWidth = 1; // px - this.borderColor = '#BBBBBB'; // CSS color - this.borderRadius = 4; // px - this.insetWidth = 1; // px - this.insetColor = '#BBBBBB'; // CSS color - this.shadow = false; // whether to display shadow - this.shadowBlur = 15; // px - this.shadowColor = 'rgba(0,0,0,0.2)'; // CSS color - this.pointerColor = '#4C4C4C'; // px - this.pointerBorderColor = '#FFFFFF'; // px - this.pointerBorderWidth = 1; // px - this.pointerThickness = 2; // px - this.zIndex = 1000; - this.container = null; // where to append the color picker (BODY element by default) - - - for (var opt in options) { - if (options.hasOwnProperty(opt)) { - this[opt] = options[opt]; - } - } - - - this.hide = function () { - if (isPickerOwner()) { - detachPicker(); - } - }; - - - this.show = function () { - drawPicker(); - }; - - - this.redraw = function () { - if (isPickerOwner()) { - drawPicker(); - } - }; - - - this.importColor = function () { - if (!this.valueElement) { - this.exportColor(); - } else { - if (jsc.isElementType(this.valueElement, 'input')) { - if (!this.refine) { - if (!this.fromString(this.valueElement.value, jsc.leaveValue)) { - if (this.styleElement) { - this.styleElement.style.backgroundImage = this.styleElement._jscOrigStyle.backgroundImage; - this.styleElement.style.backgroundColor = this.styleElement._jscOrigStyle.backgroundColor; - this.styleElement.style.color = this.styleElement._jscOrigStyle.color; - } - this.exportColor(jsc.leaveValue | jsc.leaveStyle); - } - } else if (!this.required && /^\s*$/.test(this.valueElement.value)) { - this.valueElement.value = ''; - if (this.styleElement) { - this.styleElement.style.backgroundImage = this.styleElement._jscOrigStyle.backgroundImage; - this.styleElement.style.backgroundColor = this.styleElement._jscOrigStyle.backgroundColor; - this.styleElement.style.color = this.styleElement._jscOrigStyle.color; - } - this.exportColor(jsc.leaveValue | jsc.leaveStyle); - - } else if (this.fromString(this.valueElement.value)) { - // managed to import color successfully from the value -> OK, don't do anything - } else { - this.exportColor(); - } - } else { - // not an input element -> doesn't have any value - this.exportColor(); - } - } - }; - - - this.exportColor = function (flags) { - if (!(flags & jsc.leaveValue) && this.valueElement) { - var value = this.toString(); - if (this.uppercase) { value = value.toUpperCase(); } - if (this.hash) { value = '#' + value; } - - if (jsc.isElementType(this.valueElement, 'input')) { - this.valueElement.value = value; - } else { - this.valueElement.innerHTML = value; - } - } - // if (!(flags & jsc.leaveStyle)) { - // if (this.styleElement) { - // this.styleElement.style.backgroundImage = 'none'; - // this.styleElement.style.backgroundColor = '#' + this.toString(); - // this.styleElement.style.color = this.isLight() ? '#000' : '#FFF'; - // } - // } - if (!(flags & jsc.leavePad) && isPickerOwner()) { - redrawPad(); - } - if (!(flags & jsc.leaveSld) && isPickerOwner()) { - redrawSld(); - } - }; - - - // h: 0-360 - // s: 0-100 - // v: 0-100 - // - this.fromHSV = function (h, s, v, flags) { // null = don't change - if (h !== null) { - if (isNaN(h)) { return false; } - h = Math.max(0, Math.min(360, h)); - } - if (s !== null) { - if (isNaN(s)) { return false; } - s = Math.max(0, Math.min(100, this.maxS, s), this.minS); - } - if (v !== null) { - if (isNaN(v)) { return false; } - v = Math.max(0, Math.min(100, this.maxV, v), this.minV); - } - - this.rgb = HSV_RGB( - h===null ? this.hsv[0] : (this.hsv[0]=h), - s===null ? this.hsv[1] : (this.hsv[1]=s), - v===null ? this.hsv[2] : (this.hsv[2]=v) - ); - - this.exportColor(flags); - }; - - - // r: 0-255 - // g: 0-255 - // b: 0-255 - // - this.fromRGB = function (r, g, b, flags) { // null = don't change - if (r !== null) { - if (isNaN(r)) { return false; } - r = Math.max(0, Math.min(255, r)); - } - if (g !== null) { - if (isNaN(g)) { return false; } - g = Math.max(0, Math.min(255, g)); - } - if (b !== null) { - if (isNaN(b)) { return false; } - b = Math.max(0, Math.min(255, b)); - } - - var hsv = RGB_HSV( - r===null ? this.rgb[0] : r, - g===null ? this.rgb[1] : g, - b===null ? this.rgb[2] : b - ); - if (hsv[0] !== null) { - this.hsv[0] = Math.max(0, Math.min(360, hsv[0])); - } - if (hsv[2] !== 0) { - this.hsv[1] = hsv[1]===null ? null : Math.max(0, this.minS, Math.min(100, this.maxS, hsv[1])); - } - this.hsv[2] = hsv[2]===null ? null : Math.max(0, this.minV, Math.min(100, this.maxV, hsv[2])); - - // update RGB according to final HSV, as some values might be trimmed - var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]); - this.rgb[0] = rgb[0]; - this.rgb[1] = rgb[1]; - this.rgb[2] = rgb[2]; - - this.exportColor(flags); - }; - - - this.fromString = function (str, flags) { - var m; - if (m = str.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i)) { - // HEX notation - // - - if (m[1].length === 6) { - // 6-char notation - this.fromRGB( - parseInt(m[1].substr(0,2),16), - parseInt(m[1].substr(2,2),16), - parseInt(m[1].substr(4,2),16), - flags - ); - } else { - // 3-char notation - this.fromRGB( - parseInt(m[1].charAt(0) + m[1].charAt(0),16), - parseInt(m[1].charAt(1) + m[1].charAt(1),16), - parseInt(m[1].charAt(2) + m[1].charAt(2),16), - flags - ); - } - return true; - - } else if (m = str.match(/^\W*rgba?\(([^)]*)\)\W*$/i)) { - var params = m[1].split(','); - var re = /^\s*(\d*)(\.\d+)?\s*$/; - var mR, mG, mB; - if ( - params.length >= 3 && - (mR = params[0].match(re)) && - (mG = params[1].match(re)) && - (mB = params[2].match(re)) - ) { - var r = parseFloat((mR[1] || '0') + (mR[2] || '')); - var g = parseFloat((mG[1] || '0') + (mG[2] || '')); - var b = parseFloat((mB[1] || '0') + (mB[2] || '')); - this.fromRGB(r, g, b, flags); - return true; - } - } - return false; - }; - - - this.toString = function () { - return ( - (0x100 | Math.round(this.rgb[0])).toString(16).substr(1) + - (0x100 | Math.round(this.rgb[1])).toString(16).substr(1) + - (0x100 | Math.round(this.rgb[2])).toString(16).substr(1) - ); - }; - - - this.toHEXString = function () { - return '#' + this.toString().toUpperCase(); - }; - - - this.toRGBString = function () { - return ('rgb(' + - Math.round(this.rgb[0]) + ',' + - Math.round(this.rgb[1]) + ',' + - Math.round(this.rgb[2]) + ')' - ); - }; - - - this.isLight = function () { - return ( - 0.213 * this.rgb[0] + - 0.715 * this.rgb[1] + - 0.072 * this.rgb[2] > - 255 / 2 - ); - }; - - - this._processParentElementsInDOM = function () { - if (this._linkedElementsProcessed) { return; } - this._linkedElementsProcessed = true; - - var elm = this.targetElement; - do { - // If the target element or one of its parent nodes has fixed position, - // then use fixed positioning instead - // - // Note: In Firefox, getComputedStyle returns null in a hidden iframe, - // that's why we need to check if the returned style object is non-empty - var currStyle = jsc.getStyle(elm); - if (currStyle && currStyle.position.toLowerCase() === 'fixed') { - this.fixed = true; - } - - if (elm !== this.targetElement) { - // Ensure to attach onParentScroll only once to each parent element - // (multiple targetElements can share the same parent nodes) - // - // Note: It's not just offsetParents that can be scrollable, - // that's why we loop through all parent nodes - if (!elm._jscEventsAttached) { - jsc.attachEvent(elm, 'scroll', jsc.onParentScroll); - elm._jscEventsAttached = true; - } - } - } while ((elm = elm.parentNode) && !jsc.isElementType(elm, 'body')); - }; - - - // r: 0-255 - // g: 0-255 - // b: 0-255 - // - // returns: [ 0-360, 0-100, 0-100 ] - // - function RGB_HSV (r, g, b) { - r /= 255; - g /= 255; - b /= 255; - var n = Math.min(Math.min(r,g),b); - var v = Math.max(Math.max(r,g),b); - var m = v - n; - if (m === 0) { return [ null, 0, 100 * v ]; } - var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m); - return [ - 60 * (h===6?0:h), - 100 * (m/v), - 100 * v - ]; - } - - - // h: 0-360 - // s: 0-100 - // v: 0-100 - // - // returns: [ 0-255, 0-255, 0-255 ] - // - function HSV_RGB (h, s, v) { - var u = 255 * (v / 100); - - if (h === null) { - return [ u, u, u ]; - } - - h /= 60; - s /= 100; - - var i = Math.floor(h); - var f = i%2 ? h-i : 1-(h-i); - var m = u * (1 - s); - var n = u * (1 - s * f); - switch (i) { - case 6: - case 0: return [u,n,m]; - case 1: return [n,u,m]; - case 2: return [m,u,n]; - case 3: return [m,n,u]; - case 4: return [n,m,u]; - case 5: return [u,m,n]; - } - } - - - function detachPicker () { - jsc.unsetClass(THIS.targetElement, THIS.activeClass); - jsc.picker.wrap.parentNode.removeChild(jsc.picker.wrap); - delete jsc.picker.owner; - } - - - function drawPicker () { - - // At this point, when drawing the picker, we know what the parent elements are - // and we can do all related DOM operations, such as registering events on them - // or checking their positioning - THIS._processParentElementsInDOM(); - - if (!jsc.picker) { - jsc.picker = { - owner: null, - wrap : document.createElement('div'), - box : document.createElement('div'), - boxS : document.createElement('div'), // shadow area - boxB : document.createElement('div'), // border - pad : document.createElement('div'), - padB : document.createElement('div'), // border - padM : document.createElement('div'), // mouse/touch area - padPal : jsc.createPalette(), - cross : document.createElement('div'), - crossBY : document.createElement('div'), // border Y - crossBX : document.createElement('div'), // border X - crossLY : document.createElement('div'), // line Y - crossLX : document.createElement('div'), // line X - sld : document.createElement('div'), - sldB : document.createElement('div'), // border - sldM : document.createElement('div'), // mouse/touch area - sldGrad : jsc.createSliderGradient(), - sldPtrS : document.createElement('div'), // slider pointer spacer - sldPtrIB : document.createElement('div'), // slider pointer inner border - sldPtrMB : document.createElement('div'), // slider pointer middle border - sldPtrOB : document.createElement('div'), // slider pointer outer border - btn : document.createElement('div'), - btnT : document.createElement('span') // text - }; - - jsc.picker.pad.appendChild(jsc.picker.padPal.elm); - jsc.picker.padB.appendChild(jsc.picker.pad); - jsc.picker.cross.appendChild(jsc.picker.crossBY); - jsc.picker.cross.appendChild(jsc.picker.crossBX); - jsc.picker.cross.appendChild(jsc.picker.crossLY); - jsc.picker.cross.appendChild(jsc.picker.crossLX); - jsc.picker.padB.appendChild(jsc.picker.cross); - jsc.picker.box.appendChild(jsc.picker.padB); - jsc.picker.box.appendChild(jsc.picker.padM); - - jsc.picker.sld.appendChild(jsc.picker.sldGrad.elm); - jsc.picker.sldB.appendChild(jsc.picker.sld); - jsc.picker.sldB.appendChild(jsc.picker.sldPtrOB); - jsc.picker.sldPtrOB.appendChild(jsc.picker.sldPtrMB); - jsc.picker.sldPtrMB.appendChild(jsc.picker.sldPtrIB); - jsc.picker.sldPtrIB.appendChild(jsc.picker.sldPtrS); - jsc.picker.box.appendChild(jsc.picker.sldB); - jsc.picker.box.appendChild(jsc.picker.sldM); - - jsc.picker.btn.appendChild(jsc.picker.btnT); - jsc.picker.box.appendChild(jsc.picker.btn); - - jsc.picker.boxB.appendChild(jsc.picker.box); - jsc.picker.wrap.appendChild(jsc.picker.boxS); - jsc.picker.wrap.appendChild(jsc.picker.boxB); - } - - var p = jsc.picker; - - var displaySlider = !!jsc.getSliderComponent(THIS); - var dims = jsc.getPickerDims(THIS); - var crossOuterSize = (2 * THIS.pointerBorderWidth + THIS.pointerThickness + 2 * THIS.crossSize); - var padToSliderPadding = jsc.getPadToSliderPadding(THIS); - var borderRadius = Math.min( - THIS.borderRadius, - Math.round(THIS.padding * Math.PI)); // px - var padCursor = 'crosshair'; - - // wrap - p.wrap.style.clear = 'both'; - p.wrap.style.width = (dims[0] + 2 * THIS.borderWidth) + 'px'; - p.wrap.style.height = (dims[1] + 2 * THIS.borderWidth) + 'px'; - p.wrap.style.zIndex = THIS.zIndex; - - // picker - p.box.style.width = dims[0] + 'px'; - p.box.style.height = dims[1] + 'px'; - - p.boxS.style.position = 'absolute'; - p.boxS.style.left = '0'; - p.boxS.style.top = '0'; - p.boxS.style.width = '100%'; - p.boxS.style.height = '100%'; - jsc.setBorderRadius(p.boxS, borderRadius + 'px'); - - // picker border - p.boxB.style.position = 'relative'; - p.boxB.style.border = THIS.borderWidth + 'px solid'; - p.boxB.style.borderColor = THIS.borderColor; - p.boxB.style.background = THIS.backgroundColor; - jsc.setBorderRadius(p.boxB, borderRadius + 'px'); - - // IE hack: - // If the element is transparent, IE will trigger the event on the elements under it, - // e.g. on Canvas or on elements with border - p.padM.style.background = - p.sldM.style.background = - '#FFF'; - jsc.setStyle(p.padM, 'opacity', '0'); - jsc.setStyle(p.sldM, 'opacity', '0'); - - // pad - p.pad.style.position = 'relative'; - p.pad.style.width = THIS.width + 'px'; - p.pad.style.height = THIS.height + 'px'; - - // pad palettes (HSV and HVS) - p.padPal.draw(THIS.width, THIS.height, jsc.getPadYComponent(THIS)); - - // pad border - p.padB.style.position = 'absolute'; - p.padB.style.left = THIS.padding + 'px'; - p.padB.style.top = THIS.padding + 'px'; - p.padB.style.border = THIS.insetWidth + 'px solid'; - p.padB.style.borderColor = THIS.insetColor; - - // pad mouse area - p.padM._jscInstance = THIS; - p.padM._jscControlName = 'pad'; - p.padM.style.position = 'absolute'; - p.padM.style.left = '0'; - p.padM.style.top = '0'; - p.padM.style.width = (THIS.padding + 2 * THIS.insetWidth + THIS.width + padToSliderPadding / 2) + 'px'; - p.padM.style.height = dims[1] + 'px'; - p.padM.style.cursor = padCursor; - - // pad cross - p.cross.style.position = 'absolute'; - p.cross.style.left = - p.cross.style.top = - '0'; - p.cross.style.width = - p.cross.style.height = - crossOuterSize + 'px'; - - // pad cross border Y and X - p.crossBY.style.position = - p.crossBX.style.position = - 'absolute'; - p.crossBY.style.background = - p.crossBX.style.background = - THIS.pointerBorderColor; - p.crossBY.style.width = - p.crossBX.style.height = - (2 * THIS.pointerBorderWidth + THIS.pointerThickness) + 'px'; - p.crossBY.style.height = - p.crossBX.style.width = - crossOuterSize + 'px'; - p.crossBY.style.left = - p.crossBX.style.top = - (Math.floor(crossOuterSize / 2) - Math.floor(THIS.pointerThickness / 2) - THIS.pointerBorderWidth) + 'px'; - p.crossBY.style.top = - p.crossBX.style.left = - '0'; - - // pad cross line Y and X - p.crossLY.style.position = - p.crossLX.style.position = - 'absolute'; - p.crossLY.style.background = - p.crossLX.style.background = - THIS.pointerColor; - p.crossLY.style.height = - p.crossLX.style.width = - (crossOuterSize - 2 * THIS.pointerBorderWidth) + 'px'; - p.crossLY.style.width = - p.crossLX.style.height = - THIS.pointerThickness + 'px'; - p.crossLY.style.left = - p.crossLX.style.top = - (Math.floor(crossOuterSize / 2) - Math.floor(THIS.pointerThickness / 2)) + 'px'; - p.crossLY.style.top = - p.crossLX.style.left = - THIS.pointerBorderWidth + 'px'; - - // slider - p.sld.style.overflow = 'hidden'; - p.sld.style.width = THIS.sliderSize + 'px'; - p.sld.style.height = THIS.height + 'px'; - - // slider gradient - p.sldGrad.draw(THIS.sliderSize, THIS.height, '#000', '#000'); - - // slider border - p.sldB.style.display = displaySlider ? 'block' : 'none'; - p.sldB.style.position = 'absolute'; - p.sldB.style.right = THIS.padding + 'px'; - p.sldB.style.top = THIS.padding + 'px'; - p.sldB.style.border = THIS.insetWidth + 'px solid'; - p.sldB.style.borderColor = THIS.insetColor; - - // slider mouse area - p.sldM._jscInstance = THIS; - p.sldM._jscControlName = 'sld'; - p.sldM.style.display = displaySlider ? 'block' : 'none'; - p.sldM.style.position = 'absolute'; - p.sldM.style.right = '0'; - p.sldM.style.top = '0'; - p.sldM.style.width = (THIS.sliderSize + padToSliderPadding / 2 + THIS.padding + 2 * THIS.insetWidth) + 'px'; - p.sldM.style.height = dims[1] + 'px'; - p.sldM.style.cursor = 'default'; - - // slider pointer inner and outer border - p.sldPtrIB.style.border = - p.sldPtrOB.style.border = - THIS.pointerBorderWidth + 'px solid ' + THIS.pointerBorderColor; - - // slider pointer outer border - p.sldPtrOB.style.position = 'absolute'; - p.sldPtrOB.style.left = -(2 * THIS.pointerBorderWidth + THIS.pointerThickness) + 'px'; - p.sldPtrOB.style.top = '0'; - - // slider pointer middle border - p.sldPtrMB.style.border = THIS.pointerThickness + 'px solid ' + THIS.pointerColor; - - // slider pointer spacer - p.sldPtrS.style.width = THIS.sliderSize + 'px'; - p.sldPtrS.style.height = sliderPtrSpace + 'px'; - - // the Close button - function setBtnBorder () { - var insetColors = THIS.insetColor.split(/\s+/); - var outsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1]; - p.btn.style.borderColor = outsetColor; - } - p.btn.style.display = THIS.closable ? 'block' : 'none'; - p.btn.style.position = 'absolute'; - p.btn.style.left = THIS.padding + 'px'; - p.btn.style.bottom = THIS.padding + 'px'; - p.btn.style.padding = '0 15px'; - p.btn.style.height = THIS.buttonHeight + 'px'; - p.btn.style.border = THIS.insetWidth + 'px solid'; - setBtnBorder(); - p.btn.style.color = THIS.buttonColor; - p.btn.style.font = '12px sans-serif'; - p.btn.style.textAlign = 'center'; - try { - p.btn.style.cursor = 'pointer'; - } catch(eOldIE) { - p.btn.style.cursor = 'hand'; - } - p.btn.onmousedown = function () { - THIS.hide(); - }; - p.btnT.style.lineHeight = THIS.buttonHeight + 'px'; - p.btnT.innerHTML = ''; - p.btnT.appendChild(document.createTextNode(THIS.closeText)); - - // place pointers - redrawPad(); - redrawSld(); - - // If we are changing the owner without first closing the picker, - // make sure to first deal with the old owner - if (jsc.picker.owner && jsc.picker.owner !== THIS) { - jsc.unsetClass(jsc.picker.owner.targetElement, THIS.activeClass); - } - - // Set the new picker owner - jsc.picker.owner = THIS; - - // The redrawPosition() method needs picker.owner to be set, that's why we call it here, - // after setting the owner - if (jsc.isElementType(container, 'body')) { - jsc.redrawPosition(); - } else { - jsc._drawPosition(THIS, 0, 0, 'relative', false); - } - - if (p.wrap.parentNode != container) { - container.appendChild(p.wrap); - } - - jsc.setClass(THIS.targetElement, THIS.activeClass); - } - - - function redrawPad () { - // redraw the pad pointer - switch (jsc.getPadYComponent(THIS)) { - case 's': var yComponent = 1; break; - case 'v': var yComponent = 2; break; - } - var x = Math.round((THIS.hsv[0] / 360) * (THIS.width - 1)); - var y = Math.round((1 - THIS.hsv[yComponent] / 100) * (THIS.height - 1)); - var crossOuterSize = (2 * THIS.pointerBorderWidth + THIS.pointerThickness + 2 * THIS.crossSize); - var ofs = -Math.floor(crossOuterSize / 2); - jsc.picker.cross.style.left = (x + ofs) + 'px'; - jsc.picker.cross.style.top = (y + ofs) + 'px'; - - // redraw the slider - switch (jsc.getSliderComponent(THIS)) { - case 's': - var rgb1 = HSV_RGB(THIS.hsv[0], 100, THIS.hsv[2]); - var rgb2 = HSV_RGB(THIS.hsv[0], 0, THIS.hsv[2]); - var color1 = 'rgb(' + - Math.round(rgb1[0]) + ',' + - Math.round(rgb1[1]) + ',' + - Math.round(rgb1[2]) + ')'; - var color2 = 'rgb(' + - Math.round(rgb2[0]) + ',' + - Math.round(rgb2[1]) + ',' + - Math.round(rgb2[2]) + ')'; - jsc.picker.sldGrad.draw(THIS.sliderSize, THIS.height, color1, color2); - break; - case 'v': - var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 100); - var color1 = 'rgb(' + - Math.round(rgb[0]) + ',' + - Math.round(rgb[1]) + ',' + - Math.round(rgb[2]) + ')'; - var color2 = '#000'; - jsc.picker.sldGrad.draw(THIS.sliderSize, THIS.height, color1, color2); - break; - } - } - - - function redrawSld () { - var sldComponent = jsc.getSliderComponent(THIS); - if (sldComponent) { - // redraw the slider pointer - switch (sldComponent) { - case 's': var yComponent = 1; break; - case 'v': var yComponent = 2; break; - } - var y = Math.round((1 - THIS.hsv[yComponent] / 100) * (THIS.height - 1)); - jsc.picker.sldPtrOB.style.top = (y - (2 * THIS.pointerBorderWidth + THIS.pointerThickness) - Math.floor(sliderPtrSpace / 2)) + 'px'; - } - } - - - function isPickerOwner () { - return jsc.picker && jsc.picker.owner === THIS; - } - - - function blurValue () { - THIS.importColor(); - } - - - // Find the target element - if (typeof targetElement === 'string') { - var id = targetElement; - var elm = document.getElementById(id); - if (elm) { - this.targetElement = elm; - } else { - jsc.warn('Could not find target element with ID \'' + id + '\''); - } - } else if (targetElement) { - this.targetElement = targetElement; - } else { - jsc.warn('Invalid target element: \'' + targetElement + '\''); - } - - if (this.targetElement._jscLinkedInstance) { - jsc.warn('Cannot link jscolor twice to the same element. Skipping.'); - return; - } - this.targetElement._jscLinkedInstance = this; - - // Find the value element - this.valueElement = jsc.fetchElement(this.valueElement); - // Find the style element - this.styleElement = jsc.fetchElement(this.styleElement); - - var THIS = this; - var container = - this.container ? - jsc.fetchElement(this.container) : - document.getElementsByTagName('body')[0]; - var sliderPtrSpace = 3; // px - - // For BUTTON elements it's important to stop them from sending the form when clicked - // (e.g. in Safari) - if (jsc.isElementType(this.targetElement, 'button')) { - if (this.targetElement.onclick) { - var origCallback = this.targetElement.onclick; - this.targetElement.onclick = function (evt) { - origCallback.call(this, evt); - return false; - }; - } else { - this.targetElement.onclick = function () { return false; }; - } - } - - /* - var elm = this.targetElement; - do { - // If the target element or one of its offsetParents has fixed position, - // then use fixed positioning instead - // - // Note: In Firefox, getComputedStyle returns null in a hidden iframe, - // that's why we need to check if the returned style object is non-empty - var currStyle = jsc.getStyle(elm); - if (currStyle && currStyle.position.toLowerCase() === 'fixed') { - this.fixed = true; - } - - if (elm !== this.targetElement) { - // attach onParentScroll so that we can recompute the picker position - // when one of the offsetParents is scrolled - if (!elm._jscEventsAttached) { - jsc.attachEvent(elm, 'scroll', jsc.onParentScroll); - elm._jscEventsAttached = true; - } - } - } while ((elm = elm.offsetParent) && !jsc.isElementType(elm, 'body')); - */ - - // valueElement - if (this.valueElement) { - if (jsc.isElementType(this.valueElement, 'input')) { - var updateField = function () { - THIS.fromString(THIS.valueElement.value, jsc.leaveValue); - jsc.dispatchFineChange(THIS); - }; - jsc.attachEvent(this.valueElement, 'keyup', updateField); - jsc.attachEvent(this.valueElement, 'input', updateField); - jsc.attachEvent(this.valueElement, 'blur', blurValue); - this.valueElement.setAttribute('autocomplete', 'off'); - } - } - - // styleElement - if (this.styleElement) { - this.styleElement._jscOrigStyle = { - backgroundImage : this.styleElement.style.backgroundImage, - backgroundColor : this.styleElement.style.backgroundColor, - color : this.styleElement.style.color - }; - } - - if (this.value) { - // Try to set the color from the .value option and if unsuccessful, - // export the current color - this.fromString(this.value) || this.exportColor(); - } else { - this.importColor(); - } - } - -}; - - -//================================ -// Public properties and methods -//================================ - - -// By default, search for all elements with class="jscolor" and install a color picker on them. -// -// You can change what class name will be looked for by setting the property jscolor.lookupClass -// anywhere in your HTML document. To completely disable the automatic lookup, set it to null. -// -jsc.jscolor.lookupClass = 'jscolor'; - - -jsc.jscolor.installByClassName = function (className) { - var inputElms = document.getElementsByTagName('input'); - var buttonElms = document.getElementsByTagName('button'); - - jsc.tryInstallOnElements(inputElms, className); - jsc.tryInstallOnElements(buttonElms, className); -}; - - -jsc.register(); - - -return jsc.jscolor; - - -})(); } diff --git a/app/theme/server/variables.js b/app/theme/server/variables.js index afa654c04a3..cf4d7bd587f 100644 --- a/app/theme/server/variables.js +++ b/app/theme/server/variables.js @@ -3,8 +3,6 @@ import { settings } from '../../settings'; // TODO: Define registers/getters/setters for packages to work with established // heirarchy of colors instead of making duplicate definitions // TODO: Settings pages to show simple separation of major/minor/addon colors -// TODO: Get major colours as swatches for minor colors in minicolors plugin -// TODO: Minicolors settings to use rgb for alphas, hex otherwise // TODO: Add setting toggle to use defaults for minor colours and hide settings // New colors, used for shades on solid backgrounds diff --git a/app/ui-admin/client/admin.html b/app/ui-admin/client/admin.html deleted file mode 100644 index 34a383bd52a..00000000000 --- a/app/ui-admin/client/admin.html +++ /dev/null @@ -1,228 +0,0 @@ - diff --git a/app/ui-admin/client/admin.js b/app/ui-admin/client/admin.js deleted file mode 100644 index f1d7a0157e9..00000000000 --- a/app/ui-admin/client/admin.js +++ /dev/null @@ -1,642 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import { Mongo } from 'meteor/mongo'; -import { ReactiveVar } from 'meteor/reactive-var'; -import { Random } from 'meteor/random'; -import { Tracker } from 'meteor/tracker'; -import { FlowRouter } from 'meteor/kadira:flow-router'; -import { Template } from 'meteor/templating'; -import { TAPi18n } from 'meteor/rocketchat:tap-i18n'; -import _ from 'underscore'; -import s from 'underscore.string'; -import toastr from 'toastr'; - -import { settings } from '../../settings'; -import { SideNav, modal } from '../../ui-utils'; -import { t, handleError } from '../../utils'; -import { PrivateSettingsCachedCollection } from './SettingsCachedCollection'; -import { hasAtLeastOnePermission } from '../../authorization/client'; - -const TempSettings = new Mongo.Collection(null); - -const getDefaultSetting = function(settingId) { - return settings.collectionPrivate.findOne({ - _id: settingId, - }); -}; - -const setFieldValue = function(settingId, value, type, editor) { - const input = $('.page-settings').find(`[name="${ settingId }"]`); - switch (type) { - case 'boolean': - $('.page-settings').find(`[name="${ settingId }"][value="${ Number(value) }"]`).prop('checked', true).change(); - break; - case 'code': - input.next()[0].CodeMirror.setValue(value); - break; - case 'color': - editor = value && value[0] === '#' ? 'color' : 'expression'; - input.parents('.horizontal').find('select[name="color-editor"]').val(editor).change(); - input.val(value).change(); - break; - case 'roomPick': - const selectedRooms = Template.instance().selectedRooms.get(); - selectedRooms[settingId] = value; - Template.instance().selectedRooms.set(selectedRooms); - TempSettings.update({ _id: settingId }, { $set: { value, changed: JSON.stringify(settings.collectionPrivate.findOne(settingId).value) !== JSON.stringify(value) } }); - break; - default: - input.val(value).change(); - } -}; - -Template.admin.onCreated(function() { - if (settings.cachedCollectionPrivate == null) { - settings.cachedCollectionPrivate = new PrivateSettingsCachedCollection(); - settings.collectionPrivate = settings.cachedCollectionPrivate.collection; - settings.cachedCollectionPrivate.init(); - } - this.selectedRooms = new ReactiveVar({}); - settings.collectionPrivate.find().observe({ - added: (data) => { - const selectedRooms = this.selectedRooms.get(); - if (data.type === 'roomPick') { - selectedRooms[data._id] = data.value; - this.selectedRooms.set(selectedRooms); - } - TempSettings.insert(data); - }, - changed: (data) => { - const selectedRooms = this.selectedRooms.get(); - if (data.type === 'roomPick') { - selectedRooms[data._id] = data.value; - this.selectedRooms.set(selectedRooms); - } - TempSettings.update(data._id, data); - }, - removed: (data) => { - const selectedRooms = this.selectedRooms.get(); - if (data.type === 'roomPick') { - delete selectedRooms[data._id]; - this.selectedRooms.set(selectedRooms); - } - TempSettings.remove(data._id); - }, - }); -}); - -Template.admin.onDestroyed(function() { - TempSettings.remove({}); -}); - -Template.admin.helpers({ - hasSettingPermission() { - return hasAtLeastOnePermission(['view-privileged-setting', 'edit-privileged-setting', 'manage-selected-settings']); - }, - languages() { - const languages = TAPi18n.getLanguages(); - - const result = Object.entries(languages) - .map(([key, language]) => ({ ...language, key: key.toLowerCase() })) - .sort((a, b) => a.key - b.key); - - result.unshift({ - name: 'Default', - en: 'Default', - key: '', - }); - - return result; - }, - isAppLanguage(key) { - const languageKey = settings.get('Language'); - return typeof languageKey === 'string' && languageKey.toLowerCase() === key; - }, - group() { - const groupId = FlowRouter.getParam('group'); - const group = settings.collectionPrivate.findOne({ - _id: groupId, - type: 'group', - }); - if (!group) { - return; - } - const rcSettings = settings.collectionPrivate.find({ group: groupId }, { sort: { section: 1, sorter: 1, i18nLabel: 1 } }).fetch(); - const sections = {}; - - Object.keys(rcSettings).forEach((key) => { - const setting = rcSettings[key]; - let i18nDefaultQuery; - if (setting.i18nDefaultQuery != null) { - if (_.isString(setting.i18nDefaultQuery)) { - i18nDefaultQuery = JSON.parse(setting.i18nDefaultQuery); - } else { - i18nDefaultQuery = setting.i18nDefaultQuery; - } - if (!_.isArray(i18nDefaultQuery)) { - i18nDefaultQuery = [i18nDefaultQuery]; - } - Object.keys(i18nDefaultQuery).forEach((key) => { - const item = i18nDefaultQuery[key]; - if (settings.collectionPrivate.findOne(item) != null) { - setting.value = TAPi18n.__(`${ setting._id }_Default`); - } - }); - } - const settingSection = setting.section || ''; - if (sections[settingSection] == null) { - sections[settingSection] = []; - } - sections[settingSection].push(setting); - }); - - group.sections = Object.keys(sections).map((key) => { - const value = sections[key]; - return { - section: key, - settings: value, - }; - }); - return group; - }, - i18nDefaultValue() { - return TAPi18n.__(`${ this._id }_Default`); - }, - isDisabled() { - let enableQuery; - if (this.blocked) { - return { - disabled: 'disabled', - }; - } - if (this.enableQuery == null) { - return {}; - } - if (_.isString(this.enableQuery)) { - enableQuery = JSON.parse(this.enableQuery); - } else { - enableQuery = this.enableQuery; - } - if (!_.isArray(enableQuery)) { - enableQuery = [enableQuery]; - } - let found = 0; - - Object.keys(enableQuery).forEach((key) => { - const item = enableQuery[key]; - if (TempSettings.findOne(item) != null) { - found++; - } - }); - if (found === enableQuery.length) { - return {}; - } - return { - disabled: 'disabled', - }; - }, - isReadonly() { - if (this.readonly === true) { - return { - readonly: 'readonly', - }; - } - }, - canAutocomplete() { - if (this.autocomplete === false) { - return { - autocomplete: 'off', - }; - } - }, - hasChanges(section) { - const group = FlowRouter.getParam('group'); - const query = { - group, - changed: true, - }; - if (section != null) { - if (section === '') { - query.$or = [ - { - section: '', - }, { - section: { - $exists: false, - }, - }, - ]; - } else { - query.section = section; - } - } - return TempSettings.find(query).count() > 0; - }, - isSettingChanged(id) { - return TempSettings.findOne({ - _id: id, - }, { - fields: { - changed: 1, - }, - }).changed; - }, - translateSection(section) { - if (section.indexOf(':') > -1) { - return section; - } - return t(section); - }, - label() { - const label = this.i18nLabel || this._id; - if (label) { - return TAPi18n.__(label); - } - }, - description() { - let description; - if (this.i18nDescription) { - description = TAPi18n.__(this.i18nDescription); - } - if ((description != null) && description !== this.i18nDescription) { - return description; - } - }, - sectionIsCustomOAuth(section) { - return /^Custom OAuth:\s.+/.test(section); - }, - callbackURL(section) { - const id = s.strRight(section, 'Custom OAuth: ').toLowerCase(); - return Meteor.absoluteUrl(`_oauth/${ id }`); - }, - relativeUrl(url) { - return Meteor.absoluteUrl(url); - }, - selectedOption(_id, val) { - const option = settings.collectionPrivate.findOne({ _id }); - return option && option.value === val; - }, - random() { - return Random.id(); - }, - getEditorOptions(readOnly = false) { - return { - lineNumbers: true, - mode: this.code || 'javascript', - gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'], - foldGutter: true, - matchBrackets: true, - autoCloseBrackets: true, - matchTags: true, - showTrailingSpace: true, - highlightSelectionMatches: true, - readOnly, - }; - }, - setEditorOnBlur() { - return function(_id) { - if (!$(`.code-mirror-box[data-editor-id="${ _id }"] .CodeMirror`)[0]) { - return; - } - const codeMirror = $(`.code-mirror-box[data-editor-id="${ _id }"] .CodeMirror`)[0].CodeMirror; - if (codeMirror.changeAdded === true) { - return; - } - const onChange = function() { - const value = codeMirror.getValue(); - TempSettings.update({ _id }, { $set: { value, changed: settings.collectionPrivate.findOne(_id).value !== value } }); - }; - const onChangeDelayed = _.debounce(onChange, 500); - codeMirror.on('change', onChangeDelayed); - codeMirror.changeAdded = true; - }; - }, - assetAccept(fileConstraints) { - if (fileConstraints.extensions && fileConstraints.extensions.length) { - return `.${ fileConstraints.extensions.join(', .') }`; - } - }, - autocompleteRoom() { - return { - limit: 10, - // inputDelay: 300 - rules: [ - { - // @TODO maybe change this 'collection' and/or template - collection: 'CachedChannelList', - subscription: 'channelAndPrivateAutocomplete', - field: 'name', - template: Template.roomSearch, - noMatchTemplate: Template.roomSearchEmpty, - matchAll: true, - selector(match) { - return { - name: match, - }; - }, - sort: 'name', - }, - ], - }; - }, - selectedRooms() { - return Template.instance().selectedRooms.get()[this._id] || []; - }, - getColorVariable(color) { - return color.replace(/theme-color-/, '@'); - }, - showResetButton() { - const setting = TempSettings.findOne({ _id: this._id }, { fields: { value: 1, packageValue: 1 } }); - return !this.disableReset && !this.readonly && this.type !== 'asset' && setting.value !== setting.packageValue && !this.blocked; - }, -}); - -Template.admin.events({ - 'change .input-monitor, keyup .input-monitor': _.throttle(function(e) { - let value = s.trim($(e.target).val()); - switch (this.type) { - case 'int': - value = parseInt(value); - break; - case 'boolean': - value = value === '1'; - break; - case 'color': - $(e.target).siblings('.colorpicker-swatch').css('background-color', value); - } - TempSettings.update({ - _id: this._id, - }, { - $set: { - value, - changed: settings.collectionPrivate.findOne(this._id).value !== value, - }, - }); - }, 500), - 'change select[name=color-editor]'(e) { - const value = s.trim($(e.target).val()); - TempSettings.update({ _id: this._id }, { $set: { editor: value } }); - settings.collectionPrivate.update({ _id: this._id }, { $set: { editor: value } }); - }, - 'click .rc-header__section-button .discard'() { - const group = FlowRouter.getParam('group'); - const query = { - group, - changed: true, - }; - const rcSettings = TempSettings.find(query, { - fields: { _id: 1, value: 1, packageValue: 1 }, - }).fetch(); - rcSettings.forEach(function(setting) { - const oldSetting = settings.collectionPrivate.findOne({ _id: setting._id }, { fields: { value: 1, type: 1, editor: 1 } }); - setFieldValue(setting._id, oldSetting.value, oldSetting.type, oldSetting.editor); - }); - }, - 'click .reset-setting'(e) { - e.preventDefault(); - let settingId = $(e.target).data('setting'); - if (typeof settingId === 'undefined') { - settingId = $(e.target).parent().data('setting'); - } - const defaultValue = getDefaultSetting(settingId); - setFieldValue(settingId, defaultValue.packageValue, defaultValue.type, defaultValue.editor); - }, - 'click .reset-group'(e) { - let rcSettings; - e.preventDefault(); - const group = FlowRouter.getParam('group'); - const section = $(e.target).data('section'); - if (section === '') { - rcSettings = TempSettings.find({ group, section: { $exists: false } }, { fields: { _id: 1 } }).fetch(); - } else { - rcSettings = TempSettings.find({ group, section }, { fields: { _id: 1 } }).fetch(); - } - rcSettings.forEach(function(setting) { - const defaultValue = getDefaultSetting(setting._id); - setFieldValue(setting._id, defaultValue.packageValue, defaultValue.type, defaultValue.editor); - TempSettings.update({ _id: setting._id }, { - $set: { - value: defaultValue.packageValue, - changed: settings.collectionPrivate.findOne(setting._id).value !== defaultValue.packageValue, - }, - }); - }); - }, - 'click .rc-header__section-button .save'() { - const group = FlowRouter.getParam('group'); - const query = { group, changed: true }; - const rcSettings = TempSettings.find(query, { fields: { _id: 1, value: 1, editor: 1 } }).fetch() || []; - if (rcSettings.length === 0) { - return; - } - - const failedSettings = []; - - settings.batchSet(rcSettings, (err) => { - if (err) { - // Handle error for every settings failed. - err.details.settingIds.forEach((settingId) => { - const error = Object.assign({}, err); - failedSettings.push(settingId); - error.details.settingIds = settingId; - handleError(error); - }); - } - rcSettings.forEach((setting) => { - if (!failedSettings.includes(setting._id)) { - TempSettings.update({ _id: setting._id }, { $unset: { changed: 1 } }); - } - }); - - if (rcSettings.some(({ _id }) => _id === 'Language')) { - const lng = Meteor.user().language - || rcSettings.filter(({ _id }) => _id === 'Language').shift().value - || 'en'; - return TAPi18n._loadLanguage(lng).then(() => toastr.success(TAPi18n.__('Settings_updated', { lng }))); - } - toastr.success(TAPi18n.__('Settings_updated')); - }); - }, - 'click .rc-header__section-button .refresh-clients'() { - Meteor.call('refreshClients', function() { - toastr.success(TAPi18n.__('Clients_will_refresh_in_a_few_seconds')); - }); - }, - 'click .rc-header__section-button .add-custom-oauth'() { - const config = { - title: TAPi18n.__('Add_custom_oauth'), - text: TAPi18n.__('Give_a_unique_name_for_the_custom_oauth'), - type: 'input', - showCancelButton: true, - closeOnConfirm: true, - inputPlaceholder: TAPi18n.__('Custom_oauth_unique_name'), - }; - modal.open(config, function(inputValue) { - if (inputValue === false) { - return false; - } - if (inputValue === '') { - modal.showInputError(TAPi18n.__('Name_cant_be_empty')); - return false; - } - Meteor.call('addOAuthService', inputValue, function(err) { - if (err) { - handleError(err); - } - }); - }); - }, - 'click .rc-header__section-button .refresh-oauth'() { - toastr.info(TAPi18n.__('Refreshing')); - return Meteor.call('refreshOAuthService', function(err) { - if (err) { - return handleError(err); - } - return toastr.success(TAPi18n.__('Done')); - }); - }, - 'click .remove-custom-oauth'() { - const name = this.section.replace('Custom OAuth: ', ''); - const config = { - title: TAPi18n.__('Are_you_sure'), - type: 'warning', - showCancelButton: true, - confirmButtonColor: '#DD6B55', - confirmButtonText: TAPi18n.__('Yes_delete_it'), - cancelButtonText: TAPi18n.__('Cancel'), - closeOnConfirm: true, - }; - modal.open(config, function() { - Meteor.call('removeOAuthService', name); - }); - }, - 'click .delete-asset'() { - Meteor.call('unsetAsset', this.asset); - }, - 'change input[type=file]'(ev) { - const e = ev.originalEvent || ev; - let { files } = e.target; - if (!files || files.length === 0) { - if (e.dataTransfer && e.dataTransfer.files) { - files = e.dataTransfer.files; - } else { - files = []; - } - } - - Object.keys(files).forEach((key) => { - const blob = files[key]; - toastr.info(TAPi18n.__('Uploading_file')); - const reader = new FileReader(); - reader.readAsBinaryString(blob); - reader.onloadend = () => Meteor.call('setAsset', reader.result, blob.type, this.asset, function(err) { - if (err != null) { - handleError(err); - console.log(err); - return; - } - return toastr.success(TAPi18n.__('File_uploaded')); - }); - }); - }, - 'click .expand'(e) { - const sectionTitle = e.currentTarget; - const section = sectionTitle.closest('.section'); - const button = sectionTitle.querySelector('button'); - const i = button.querySelector('i'); - - sectionTitle.classList.remove('expand'); - sectionTitle.classList.add('collapse'); - section.classList.remove('section-collapsed'); - button.setAttribute('title', TAPi18n.__('Collapse')); - i.className = 'icon-angle-up'; - - $('.CodeMirror').each(function(index, codeMirror) { - codeMirror.CodeMirror.refresh(); - }); - }, - 'click .collapse'(e) { - const sectionTitle = e.currentTarget; - const section = sectionTitle.closest('.section'); - const button = sectionTitle.querySelector('button'); - const i = button.querySelector('i'); - - sectionTitle.classList.remove('collapse'); - sectionTitle.classList.add('expand'); - section.classList.add('section-collapsed'); - button.setAttribute('title', TAPi18n.__('Expand')); - i.className = 'icon-angle-down'; - }, - 'click button.action'() { - if (this.type !== 'action') { - return; - } - Meteor.call(this.value, function(err, data) { - if (err != null) { - err.details = _.extend(err.details || {}, { - errorTitle: 'Error', - }); - handleError(err); - return; - } - const args = [data.message].concat(data.params); - toastr.success(TAPi18n.__.apply(TAPi18n, args), TAPi18n.__('Success')); - }); - }, - 'click .button-fullscreen'() { - const codeMirrorBox = $(`.code-mirror-box[data-editor-id="${ this._id }"]`); - codeMirrorBox.addClass('code-mirror-box-fullscreen content-background-color'); - codeMirrorBox.find('.CodeMirror')[0].CodeMirror.refresh(); - }, - 'click .button-restore'() { - const codeMirrorBox = $(`.code-mirror-box[data-editor-id="${ this._id }"]`); - codeMirrorBox.removeClass('code-mirror-box-fullscreen content-background-color'); - codeMirrorBox.find('.CodeMirror')[0].CodeMirror.refresh(); - }, - 'autocompleteselect .autocomplete'(event, instance, doc) { - const selectedRooms = instance.selectedRooms.get(); - selectedRooms[this.id] = (selectedRooms[this.id] || []).concat(doc); - instance.selectedRooms.set(selectedRooms); - const value = selectedRooms[this.id]; - TempSettings.update({ _id: this.id }, { $set: { value, changed: JSON.stringify(settings.collectionPrivate.findOne(this.id).value) !== JSON.stringify(value) } }); - event.currentTarget.value = ''; - event.currentTarget.focus(); - }, - 'click .remove-room'(event, instance) { - const docId = this._id; - const settingId = event.currentTarget.getAttribute('data-setting'); - const selectedRooms = instance.selectedRooms.get(); - selectedRooms[settingId] = _.reject(selectedRooms[settingId] || [], function(setting) { - return setting._id === docId; - }); - instance.selectedRooms.set(selectedRooms); - const value = selectedRooms[settingId]; - TempSettings.update({ _id: settingId }, { - $set: { - value, - changed: JSON.stringify(settings.collectionPrivate.findOne(settingId).value) !== JSON.stringify(value), - }, - }); - }, -}); - -Template.admin.onRendered(function() { - Tracker.afterFlush(function() { - SideNav.setFlex('adminFlex'); - SideNav.openFlex(); - }); - Tracker.autorun(function() { - const hasColor = TempSettings.find({ - group: FlowRouter.getParam('group'), - type: 'color', - }, { fields: { _id: 1, editor: 1 } }).fetch().length; - if (hasColor) { - Meteor.setTimeout(function() { - $('.colorpicker-input').each(function(index, el) { - if (!el._jscLinkedInstance) { - new jscolor(el); //eslint-disable-line - } - }); - }, 400); - } - }); -}); diff --git a/app/ui-admin/client/index.js b/app/ui-admin/client/index.js index 8f4ee861818..93eca42775a 100644 --- a/app/ui-admin/client/index.js +++ b/app/ui-admin/client/index.js @@ -1,9 +1,3 @@ -import './admin.html'; import './adminFlex.html'; -import './admin'; import './adminFlex'; import './routes'; - - -// import './users/adminUserChannels'; -// import './users/adminUserChannels.html'; diff --git a/client/components/admin/settings/Section.js b/client/components/admin/settings/Section.js index 95e8280cf7f..3db61d9160a 100644 --- a/client/components/admin/settings/Section.js +++ b/client/components/admin/settings/Section.js @@ -18,14 +18,13 @@ export function Section({ children, groupId, hasReset = true, help, sectionName, noncollapsible={solo || !section.name} title={section.name && t(section.name)} > - {help && {help}} + {help && {help}} {section.settings.map((settingId) => )} {hasReset && section.canReset && + }> {group.sections.map((sectionName) =>
{ + toastr.info(t('Refreshing')); + call('refreshOAuthService').then(() => { + toastr.success(t('Done')); + }); + }; + + const handleAddCustomOAuthButtonClick = () => { + modal.open({ + title: t('Add_custom_oauth'), + text: t('Give_a_unique_name_for_the_custom_oauth'), + type: 'input', + showCancelButton: true, + closeOnConfirm: true, + inputPlaceholder: t('Custom_oauth_unique_name'), + }, (inputValue) => { + if (inputValue === false) { + return false; + } + if (inputValue === '') { + modal.showInputError(t('Name_cant_be_empty')); + return false; + } + call('addOAuthService', inputValue); + }); + }; + return - - + + }> - {group.sections.map((sectionName) => (sectionIsCustomOAuth(sectionName) - ?
{t('Custom_oauth_helper', callbackURL(sectionName))}} - sectionName={sectionName} - solo={solo} - > -
- -
-
- :
))} + {group.sections.map((sectionName) => { + if (sectionIsCustomOAuth(sectionName)) { + const id = s.strRight(sectionName, 'Custom OAuth: ').toLowerCase(); + + const handleRemoveCustomOAuthButtonClick = () => { + modal.open({ + title: t('Are_you_sure'), + type: 'warning', + showCancelButton: true, + confirmButtonColor: '#DD6B55', + confirmButtonText: t('Yes_delete_it'), + cancelButtonText: t('Cancel'), + closeOnConfirm: true, + }, () => { + call('removeOAuthService', id); + }); + }; + + return
{t('Custom_oauth_helper', callbackURL(sectionName))}} + sectionName={sectionName} + solo={solo} + > +
+ +
+
; + } + + return
; + })} ; } diff --git a/client/components/admin/settings/inputs/AssetSettingInput.js b/client/components/admin/settings/inputs/AssetSettingInput.js index 22abcbcf90e..e41691a5d58 100644 --- a/client/components/admin/settings/inputs/AssetSettingInput.js +++ b/client/components/admin/settings/inputs/AssetSettingInput.js @@ -1,11 +1,9 @@ import { Button, Icon, Label } from '@rocket.chat/fuselage'; -import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; -import { TAPi18n } from 'meteor/rocketchat:tap-i18n'; import React from 'react'; import toastr from 'toastr'; -import { handleError } from '../../../../../app/utils/client'; +import { call } from '../../../../../app/ui-utils/client/lib/callMethod'; import { useTranslation } from '../../../providers/TranslationProvider'; export function AssetSettingInput({ @@ -30,22 +28,19 @@ export function AssetSettingInput({ } Object.values(files).forEach((blob) => { - toastr.info(TAPi18n.__('Uploading_file')); + toastr.info(t('Uploading_file')); const reader = new FileReader(); reader.readAsBinaryString(blob); - reader.onloadend = () => Meteor.call('setAsset', reader.result, blob.type, asset, function(err) { - if (err != null) { - handleError(err); - console.log(err); - return; - } - return toastr.success(TAPi18n.__('File_uploaded')); - }); + reader.onloadend = () => + call('setAsset', reader.result, blob.type, asset) + .then(() => { + toastr.success(t('File_uploaded')); + }); }); }; const handleDeleteButtonClick = () => { - Meteor.call('unsetAsset', asset); + call('unsetAsset', asset); }; return <> diff --git a/client/components/providers/TranslationProvider.js b/client/components/providers/TranslationProvider.js index 2b2e169eddc..d64d2b422e3 100644 --- a/client/components/providers/TranslationProvider.js +++ b/client/components/providers/TranslationProvider.js @@ -3,9 +3,7 @@ import { TAPi18n, TAPi18next } from 'meteor/rocketchat:tap-i18n'; import { useReactiveValue } from '../../hooks/useReactiveValue'; -const translate = function(key) { - return key; -}; +const translate = (key) => key; translate.has = () => true; @@ -34,7 +32,7 @@ const createContextValue = (language) => { }); }; - const has = (key, { lng = language, ...options } = {}) => TAPi18next.exists(key, { ...options, lng }); + const has = (key, { lng = language, ...options } = {}) => !!key && TAPi18next.exists(key, { ...options, lng }); translate.has = has; diff --git a/client/importPackages.js b/client/importPackages.js index e14e4744c61..39eb960be40 100644 --- a/client/importPackages.js +++ b/client/importPackages.js @@ -69,7 +69,6 @@ import '../app/slashcommands-topic/client'; import '../app/slashcommands-unarchiveroom/client'; import '../app/slider'; import '../app/spotify/client'; -import '../app/theme/client'; import '../app/tokenpass/client'; import '../app/ui'; import '../app/ui-account'; diff --git a/package-lock.json b/package-lock.json index a531cc0ab0f..e53f74691ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Rocket.Chat", - "version": "2.3.0-develop", + "version": "3.0.0-develop", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -181,7 +181,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -5308,7 +5308,7 @@ }, "@types/events": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==" }, "@types/express": { @@ -6534,7 +6534,7 @@ "dependencies": { "buffer": { "version": "4.9.1", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "requires": { "base64-js": "^1.0.2", @@ -6566,7 +6566,7 @@ }, "axios": { "version": "0.18.0", - "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", "requires": { "follow-redirects": "^1.3.0", @@ -6651,7 +6651,7 @@ "dependencies": { "jsesc": { "version": "1.3.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", "dev": true } @@ -6966,7 +6966,7 @@ }, "babel-plugin-add-module-exports": { "version": "0.2.1", - "resolved": "http://registry.npmjs.org/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz", "integrity": "sha1-mumh9KjcZ/DN7E9K7aHkOl/2XiU=", "dev": true }, @@ -7217,78 +7217,78 @@ }, "babel-plugin-syntax-async-functions": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", "dev": true }, "babel-plugin-syntax-async-generators": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz", "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=", "dev": true }, "babel-plugin-syntax-class-constructor-call": { "version": "6.18.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz", "integrity": "sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY=", "dev": true }, "babel-plugin-syntax-class-properties": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", "dev": true }, "babel-plugin-syntax-decorators": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz", "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=", "dev": true }, "babel-plugin-syntax-do-expressions": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz", "integrity": "sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0=", "dev": true }, "babel-plugin-syntax-dynamic-import": { "version": "6.18.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=", "dev": true }, "babel-plugin-syntax-exponentiation-operator": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", "dev": true }, "babel-plugin-syntax-export-extensions": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz", "integrity": "sha1-cKFITw+QiaToStRLrDU8lbmxJyE=", "dev": true }, "babel-plugin-syntax-flow": { "version": "6.18.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=", "dev": true }, "babel-plugin-syntax-function-bind": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz", "integrity": "sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y=", "dev": true }, "babel-plugin-syntax-jsx": { "version": "6.18.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=" }, "babel-plugin-syntax-object-rest-spread": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", "dev": true }, @@ -7763,7 +7763,7 @@ }, "babel-preset-es2015": { "version": "6.3.13", - "resolved": "http://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.3.13.tgz", + "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.3.13.tgz", "integrity": "sha1-l9zn7ykuGMubK3VF2AxZPCjZUX8=", "dev": true, "requires": { @@ -7822,7 +7822,7 @@ }, "babel-preset-react": { "version": "6.3.13", - "resolved": "http://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.3.13.tgz", + "resolved": "https://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.3.13.tgz", "integrity": "sha1-E9VeBqZfqqoHw5v2Op2DbgMhFvo=", "dev": true, "requires": { @@ -8088,7 +8088,7 @@ }, "babel-preset-stage-0": { "version": "6.3.13", - "resolved": "http://registry.npmjs.org/babel-preset-stage-0/-/babel-preset-stage-0-6.3.13.tgz", + "resolved": "https://registry.npmjs.org/babel-preset-stage-0/-/babel-preset-stage-0-6.3.13.tgz", "integrity": "sha1-eKN8VvCzmI8qeZMtywzrj/N3sNE=", "dev": true, "requires": { @@ -9001,7 +9001,7 @@ }, "bl": { "version": "1.2.2", - "resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "requires": { "readable-stream": "^2.3.5", @@ -9266,7 +9266,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "requires": { "buffer-xor": "^1.0.3", @@ -9300,7 +9300,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "requires": { "bn.js": "^4.1.0", @@ -9488,7 +9488,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { "core-util-is": "~1.0.0", @@ -9600,7 +9600,7 @@ "dependencies": { "callsites": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", "dev": true } @@ -9691,7 +9691,7 @@ "dependencies": { "cheerio": { "version": "0.19.0", - "resolved": "http://registry.npmjs.org/cheerio/-/cheerio-0.19.0.tgz", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.19.0.tgz", "integrity": "sha1-dy5wFfLuKZZQltcepBdbdas1SSU=", "requires": { "css-select": "~1.0.0", @@ -9703,7 +9703,7 @@ }, "css-select": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/css-select/-/css-select-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.0.0.tgz", "integrity": "sha1-sRIcpRhI3SZOIkTQWM7iVN7rRLA=", "requires": { "boolbase": "~1.0.0", @@ -9714,7 +9714,7 @@ }, "css-what": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/css-what/-/css-what-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-1.0.0.tgz", "integrity": "sha1-18wt9FGAZm+Z0rFEYmOUaeAPc2w=" }, "domhandler": { @@ -9735,7 +9735,7 @@ }, "htmlparser2": { "version": "3.8.3", - "resolved": "http://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", "requires": { "domelementtype": "1", @@ -9756,7 +9756,7 @@ }, "entities": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=" } } @@ -9768,12 +9768,12 @@ }, "lodash": { "version": "3.10.1", - "resolved": "http://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" }, "readable-stream": { "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { "core-util-is": "~1.0.0", @@ -9784,7 +9784,7 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" } } @@ -9862,7 +9862,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { "ansi-styles": "^2.2.1", @@ -9936,7 +9936,7 @@ }, "cheerio": { "version": "0.22.0", - "resolved": "http://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", "requires": { "css-select": "~1.2.0", @@ -9965,7 +9965,7 @@ }, "chimp": { "version": "0.51.1", - "resolved": "http://registry.npmjs.org/chimp/-/chimp-0.51.1.tgz", + "resolved": "https://registry.npmjs.org/chimp/-/chimp-0.51.1.tgz", "integrity": "sha1-6hIbzfJsidV/jvNBlUDPPCeaPMU=", "dev": true, "requires": { @@ -10011,7 +10011,7 @@ "dependencies": { "async": { "version": "0.9.2", - "resolved": "http://registry.npmjs.org/async/-/async-0.9.2.tgz", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", "dev": true }, @@ -10083,7 +10083,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -10135,7 +10135,7 @@ }, "progress": { "version": "1.1.8", - "resolved": "http://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", "dev": true }, @@ -10158,7 +10158,7 @@ }, "chokidar": { "version": "1.6.1", - "resolved": "http://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", "integrity": "sha1-L0RHq16W5Q+z14n9kNTHLg5McMI=", "dev": true, "requires": { @@ -10557,7 +10557,7 @@ }, "color-convert": { "version": "0.5.3", - "resolved": "http://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz", "integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0=" }, "color-name": { @@ -10576,7 +10576,7 @@ }, "colors": { "version": "1.1.2", - "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", "dev": true }, @@ -11522,7 +11522,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "requires": { "cipher-base": "^1.0.1", @@ -11534,7 +11534,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "requires": { "cipher-base": "^1.0.3", @@ -11566,7 +11566,7 @@ "dependencies": { "node-fetch": { "version": "2.1.2", - "resolved": "http://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.1.2.tgz", "integrity": "sha1-q4hOjn5X44qUR1POxwb3iNF2i7U=" } } @@ -11828,7 +11828,7 @@ }, "css-select": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", "requires": { "boolbase": "~1.0.0", @@ -11979,7 +11979,7 @@ "dependencies": { "core-js": { "version": "1.2.7", - "resolved": "http://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" } } @@ -12387,7 +12387,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -12480,7 +12480,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { "core-util-is": "~1.0.0", @@ -12509,7 +12509,7 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "requires": { "bn.js": "^4.1.0", @@ -12528,7 +12528,7 @@ }, "doctrine": { "version": "1.5.0", - "resolved": "http://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { @@ -12565,7 +12565,7 @@ "dependencies": { "domelementtype": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=" } } @@ -13027,7 +13027,7 @@ }, "es6-promisify": { "version": "5.0.0", - "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { "es6-promise": "^4.0.3" @@ -13512,7 +13512,7 @@ }, "events": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" }, "eventsource": { @@ -13750,7 +13750,7 @@ }, "finalhandler": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "requires": { "debug": "2.6.9", @@ -13769,7 +13769,7 @@ }, "http-errors": { "version": "1.6.3", - "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { "depd": "~1.1.2", @@ -13939,7 +13939,7 @@ }, "external-editor": { "version": "2.2.0", - "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "dev": true, "requires": { @@ -14141,13 +14141,13 @@ "dependencies": { "lodash": { "version": "2.4.2", - "resolved": "http://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", "dev": true }, "underscore.string": { "version": "2.3.3", - "resolved": "http://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz", "integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=", "dev": true } @@ -15306,7 +15306,7 @@ }, "get-stream": { "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" }, "get-value": { @@ -15555,7 +15555,7 @@ "dependencies": { "minimist": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", "integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=", "dev": true } @@ -16251,7 +16251,7 @@ }, "hapi": { "version": "8.8.0", - "resolved": "http://registry.npmjs.org/hapi/-/hapi-8.8.0.tgz", + "resolved": "https://registry.npmjs.org/hapi/-/hapi-8.8.0.tgz", "integrity": "sha1-h+N6Bum0meiXkOLcERqpZotuYX8=", "dev": true, "requires": { @@ -16321,7 +16321,7 @@ }, "catbox": { "version": "4.3.0", - "resolved": "http://registry.npmjs.org/catbox/-/catbox-4.3.0.tgz", + "resolved": "https://registry.npmjs.org/catbox/-/catbox-4.3.0.tgz", "integrity": "sha1-IiN3vWfxKRrA4l0AAC0GWp3385o=", "dev": true, "requires": { @@ -16418,7 +16418,7 @@ }, "joi": { "version": "6.4.1", - "resolved": "http://registry.npmjs.org/joi/-/joi-6.4.1.tgz", + "resolved": "https://registry.npmjs.org/joi/-/joi-6.4.1.tgz", "integrity": "sha1-9Q9CRTVgBo5jg9oVrC0w3Xzra24=", "dev": true, "requires": { @@ -16430,7 +16430,7 @@ "dependencies": { "isemail": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/isemail/-/isemail-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.1.1.tgz", "integrity": "sha1-4Mj23D9HCX53dzlcaJYnGqJWw7U=", "dev": true }, @@ -16463,7 +16463,7 @@ "dependencies": { "mime-db": { "version": "1.14.0", - "resolved": "http://registry.npmjs.org/mime-db/-/mime-db-1.14.0.tgz", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.14.0.tgz", "integrity": "sha1-1WHxC27mbbUflK5leilRp0IX7YM=", "dev": true } @@ -16981,7 +16981,7 @@ "dependencies": { "domelementtype": { "version": "1.3.0", - "resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=" }, "readable-stream": { @@ -16998,7 +16998,7 @@ }, "http-errors": { "version": "1.6.3", - "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { "depd": "~1.1.2", @@ -17436,7 +17436,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { "core-util-is": "~1.0.0", @@ -17796,7 +17796,7 @@ }, "is-builtin-module": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { @@ -17973,7 +17973,7 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" }, "is-object": { @@ -18151,7 +18151,7 @@ }, "isemail": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.2.0.tgz", "integrity": "sha1-vgPfjMPineTSxd9lASY/H6RZXpo=" }, "isexe": { @@ -18204,7 +18204,7 @@ }, "jasmine-core": { "version": "2.99.1", - "resolved": "http://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz", "integrity": "sha1-5kAN8ea1bhMLYcS80JPap/boyhU=", "dev": true }, @@ -18415,12 +18415,12 @@ }, "json5": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" }, "jsonfile": { "version": "2.4.0", - "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "dev": true, "requires": { @@ -18799,7 +18799,7 @@ }, "promise": { "version": "6.1.0", - "resolved": "http://registry.npmjs.org/promise/-/promise-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/promise/-/promise-6.1.0.tgz", "integrity": "sha1-LOcp9rlLRcJoka0GAsXJDgTG7vY=", "optional": true, "requires": { @@ -19031,7 +19031,7 @@ }, "load-json-file": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { @@ -19043,7 +19043,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -19606,7 +19606,7 @@ }, "media-typer": { "version": "0.3.0", - "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, "mem": { @@ -20005,7 +20005,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "~1.0.0", @@ -20027,7 +20027,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" @@ -20234,7 +20234,7 @@ }, "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "minimist-options": { @@ -20340,7 +20340,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -20373,7 +20373,7 @@ }, "commander": { "version": "2.15.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, @@ -20721,7 +20721,7 @@ }, "ncp": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", "optional": true }, @@ -21097,7 +21097,7 @@ }, "npm-install-package": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/npm-install-package/-/npm-install-package-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/npm-install-package/-/npm-install-package-2.1.0.tgz", "integrity": "sha1-1+/jz816sAYUuJbqUxGdyaslkSU=", "dev": true }, @@ -21378,7 +21378,7 @@ }, "os-locale": { "version": "1.4.0", - "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "requires": { "lcid": "^1.0.0" @@ -21468,7 +21468,7 @@ }, "pako": { "version": "0.2.9", - "resolved": "http://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=" }, "parallel-transform": { @@ -21493,7 +21493,7 @@ }, "parse-asn1": { "version": "5.1.1", - "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", "requires": { "asn1.js": "^4.0.0", @@ -21720,7 +21720,7 @@ }, "es6-promise": { "version": "4.0.5", - "resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-4.0.5.tgz", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.0.5.tgz", "integrity": "sha1-eILzCt3lskDM+n99eMVIMwlRrkI=", "dev": true }, @@ -21776,7 +21776,7 @@ }, "progress": { "version": "1.1.8", - "resolved": "http://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", "dev": true }, @@ -21824,7 +21824,7 @@ }, "tough-cookie": { "version": "2.3.4", - "resolved": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, "requires": { @@ -22242,7 +22242,7 @@ }, "globby": { "version": "6.1.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -22255,7 +22255,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -23461,7 +23461,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } @@ -24156,7 +24156,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -24190,7 +24190,7 @@ }, "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -24253,7 +24253,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "~1.0.0", @@ -24438,7 +24438,7 @@ }, "regjsgen": { "version": "0.2.0", - "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", "dev": true }, @@ -24643,7 +24643,7 @@ }, "requestretry": { "version": "1.5.0", - "resolved": "http://registry.npmjs.org/requestretry/-/requestretry-1.5.0.tgz", + "resolved": "https://registry.npmjs.org/requestretry/-/requestretry-1.5.0.tgz", "integrity": "sha1-7RV7ulNSbt6z7DKo5wSkmYvs5ic=", "dev": true, "requires": { @@ -24781,7 +24781,7 @@ }, "rimraf": { "version": "2.4.5", - "resolved": "http://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", "integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=", "requires": { "glob": "^6.0.1" @@ -24876,7 +24876,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "requires": { "ret": "~0.1.10" @@ -24907,7 +24907,7 @@ }, "sax": { "version": "1.2.1", - "resolved": "http://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=" }, "scandirectory": { @@ -24940,7 +24940,7 @@ "dependencies": { "async": { "version": "1.5.2", - "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" } } @@ -25025,7 +25025,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -25222,7 +25222,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "requires": { "inherits": "^2.0.1", @@ -25901,7 +25901,7 @@ }, "stream-browserify": { "version": "2.0.1", - "resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "requires": { "inherits": "~2.0.1", @@ -25933,7 +25933,7 @@ }, "stream-http": { "version": "2.8.1", - "resolved": "http://registry.npmjs.org/stream-http/-/stream-http-2.8.1.tgz", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.1.tgz", "integrity": "sha512-cQ0jo17BLca2r0GfRdZKYAGLU6JRoIWxqSOakUMuKOT6MOK7AAlE856L33QuDmAy/eeOrhLee3dZKX0Uadu93A==", "requires": { "builtin-status-codes": "^3.0.0", @@ -26107,7 +26107,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { "ansi-regex": "^2.0.0" @@ -26130,7 +26130,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-indent": { @@ -26948,7 +26948,7 @@ }, "through": { "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, @@ -27172,7 +27172,7 @@ "dependencies": { "progress": { "version": "1.1.8", - "resolved": "http://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=" } } @@ -27868,14 +27868,14 @@ "dependencies": { "semver": { "version": "5.3.0", - "resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" } } }, "util": { "version": "0.10.3", - "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "requires": { "inherits": "2.0.1" @@ -27930,7 +27930,7 @@ }, "valid-data-url": { "version": "0.1.6", - "resolved": "http://registry.npmjs.org/valid-data-url/-/valid-data-url-0.1.6.tgz", + "resolved": "https://registry.npmjs.org/valid-data-url/-/valid-data-url-0.1.6.tgz", "integrity": "sha512-FXg2qXMzfAhZc0y2HzELNfUeiOjPr+52hU1DNBWiJJ2luXD+dD1R9NA48Ug5aj0ibbxroeGDc/RJv6ThiGgkDw==" }, "validate-npm-package-license": { @@ -28503,7 +28503,7 @@ }, "whatwg-fetch": { "version": "2.0.4", - "resolved": "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" }, "whatwg-mimetype": { @@ -28650,7 +28650,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "requires": { "string-width": "^1.0.1", @@ -28737,7 +28737,7 @@ "dependencies": { "xmlbuilder": { "version": "9.0.7", - "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" } } @@ -28754,7 +28754,7 @@ }, "xolvio-ddp": { "version": "0.12.3", - "resolved": "http://registry.npmjs.org/xolvio-ddp/-/xolvio-ddp-0.12.3.tgz", + "resolved": "https://registry.npmjs.org/xolvio-ddp/-/xolvio-ddp-0.12.3.tgz", "integrity": "sha1-NqarlhKyQLWg0cCoNJCK8XwLjwI=", "dev": true, "requires": { @@ -28779,7 +28779,7 @@ }, "async": { "version": "0.9.2", - "resolved": "http://registry.npmjs.org/async/-/async-0.9.2.tgz", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", "dev": true }, @@ -28791,7 +28791,7 @@ }, "bl": { "version": "0.9.5", - "resolved": "http://registry.npmjs.org/bl/-/bl-0.9.5.tgz", + "resolved": "https://registry.npmjs.org/bl/-/bl-0.9.5.tgz", "integrity": "sha1-wGt5evCF6gC8Unr8jvzxHeIjIFQ=", "dev": true, "requires": { @@ -28800,7 +28800,7 @@ }, "bluebird": { "version": "2.11.0", - "resolved": "http://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=", "dev": true }, @@ -28812,7 +28812,7 @@ }, "combined-stream": { "version": "0.0.7", - "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", "dev": true, "requires": { @@ -28833,7 +28833,7 @@ }, "form-data": { "version": "0.2.0", - "resolved": "http://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", "integrity": "sha1-Jvi8JtpkQOKZy9z7aQNcT3em5GY=", "dev": true, "requires": { @@ -28873,13 +28873,13 @@ }, "mime-db": { "version": "1.12.0", - "resolved": "http://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz", "integrity": "sha1-PQxjGA9FjrENMlqqN9fFiuMS6dc=", "dev": true }, "mime-types": { "version": "2.0.14", - "resolved": "http://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", "integrity": "sha1-MQ4VnbI+B3+Lsit0jav6SVcUCqY=", "dev": true, "requires": { @@ -28906,7 +28906,7 @@ }, "readable-stream": { "version": "1.0.34", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { @@ -28918,7 +28918,7 @@ }, "request": { "version": "2.53.0", - "resolved": "http://registry.npmjs.org/request/-/request-2.53.0.tgz", + "resolved": "https://registry.npmjs.org/request/-/request-2.53.0.tgz", "integrity": "sha1-GAo66St7Y5gC5PlUXdj83rcddgw=", "dev": true, "requires": { @@ -28957,7 +28957,7 @@ }, "xolvio-fiber-utils": { "version": "2.0.3", - "resolved": "http://registry.npmjs.org/xolvio-fiber-utils/-/xolvio-fiber-utils-2.0.3.tgz", + "resolved": "https://registry.npmjs.org/xolvio-fiber-utils/-/xolvio-fiber-utils-2.0.3.tgz", "integrity": "sha1-vsjXDHQGGjFjFbun0w0lyz6C3FA=", "dev": true, "requires": { @@ -28975,7 +28975,7 @@ }, "xolvio-jasmine-expect": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/xolvio-jasmine-expect/-/xolvio-jasmine-expect-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/xolvio-jasmine-expect/-/xolvio-jasmine-expect-1.1.0.tgz", "integrity": "sha1-vCud1ghCMR8EV59agtzqaisxnH0=", "dev": true, "requires": { @@ -29051,7 +29051,7 @@ }, "yargs": { "version": "3.32.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", "requires": { "camelcase": "^2.0.1",