From 86c72506a42ae55da30dc6c90a10398587afdeeb Mon Sep 17 00:00:00 2001 From: Mahdi Pourismaiel Date: Fri, 12 Jun 2020 22:05:02 +0430 Subject: [PATCH 1/8] Prevent dropdown helper script from changing title in dropdown nav --- assets/js/index.js | 6 ++++-- assets/scripts/syna-contact.js | 2 +- assets/scripts/syna-graph.js | 26 +++++++++++++------------- assets/scripts/syna-main.js | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/assets/js/index.js b/assets/js/index.js index 476c367e..a65ed105 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -25,8 +25,10 @@ $(document) .on('click', '.dropdown-item', (e) => { const dropdown = e.target.parentElement; const button = $(dropdown.parentElement).$('.dropdown-toggle'); - button.text(e.target.innerText); - button.attr('data-value', e.target.dataset.value); + if (!button.$nodes[0].classList.contains('nav-link')) { + button.text(e.target.innerText); + button.attr('data-value', e.target.dataset.value); + } $(dropdown).removeClass('show'); $(dropdown.parentElement).removeClass('show'); }) diff --git a/assets/scripts/syna-contact.js b/assets/scripts/syna-contact.js index 5be93617..20188672 100644 --- a/assets/scripts/syna-contact.js +++ b/assets/scripts/syna-contact.js @@ -94,7 +94,7 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar _jqHelpers = __webpack_require__(/*! ./helpers/jq-helpers */ \"./assets/js/helpers/jq-helpers.js\");\n\nvar _jqHelpers2 = _interopRequireDefault(_jqHelpers);\n\nvar _formValidatorSimple = __webpack_require__(/*! form-validator-simple */ \"./node_modules/form-validator-simple/dist/bundle.js\");\n\nvar _formValidatorSimple2 = _interopRequireDefault(_formValidatorSimple);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n(function () {\n if ((0, _jqHelpers2.default)('.g-recaptcha')) {\n checkReCaptcha();\n }\n})();\n\nvar validatorConfig = {\n errorTemplate: '%s',\n onFormValidate: function onFormValidate(isFormValid, form) {\n form.querySelector('button.submit-btn').disabled = !isFormValid;\n },\n onError: function onError(e, form) {\n (0, _jqHelpers2.default)('form[id=' + form.getAttribute('id') + '] .generic-error').removeClass('d-none');\n },\n onSuccess: function onSuccess(e, form) {\n if (form.dataset.hasNetlify || form.dataset.hasFormspree) {\n return;\n }\n\n e.preventDefault();\n var id = form.getAttribute('id');\n var $form = (0, _jqHelpers2.default)('form[id=' + id + ']');\n var action = $form.attr('action');\n var genericSuccess = $form.$('.generic-success');\n var genericError = $form.$('.generic-error');\n genericSuccess.addClass('hidden');\n genericError.addClass('d-none');\n $form.removeClass('error').removeClass('success');\n\n var serializedForm = (0, _jqHelpers2.default)('#' + id).serialize();\n if (typeof grecaptcha !== 'undefined' && grecaptcha.getResponse() === '') {\n grecaptcha.execute();\n return false;\n }\n\n $form.$('button.submit-btn').attr('disabled', true).addClass('disabled');\n _jqHelpers2.default.post(action, serializedForm, {\n contentType: 'application/x-www-form-urlencoded'\n }).then(function () {\n genericSuccess.removeClass('hidden');\n $form.addClass('success');\n $form.$('button.submit-btn').removeAttr('disabled').removeClass('disabled');\n }).catch(function () {\n genericError.removeClass('d-none');\n $form.addClass('error');\n $form.$('button.submit-btn').removeAttr('disabled').removeClass('disabled');\n });\n\n return false;\n }\n};\n\ndocument.querySelectorAll('form.contact').forEach(function (form) {\n new _formValidatorSimple2.default(Object.assign(validatorConfig, { form: form }));\n (0, _jqHelpers2.default)(form).$('#generic-success [data-action=\"return-form\"]').on('click', function () {\n (0, _jqHelpers2.default)(form).$('#generic-success').addClass('hidden');\n (0, _jqHelpers2.default)(form).removeClass('success');\n });\n});\n\nfunction checkReCaptcha() {\n if (document.querySelector('.g-recaptcha-container') && typeof grecaptcha === 'undefined') {\n (0, _jqHelpers2.default)('.captcha-error').removeClass('d-none');\n setTimeout(checkReCaptcha, 200);\n } else {\n (0, _jqHelpers2.default)('.captcha-error').addClass('d-none');\n (0, _jqHelpers2.default)('.g-recaptcha-filler').addClass('d-none');\n (0, _jqHelpers2.default)('.g-recaptcha').attr('disabled', true);\n }\n}\n\nwindow.onContactCaptcha = function ($form) {\n var customEvent = document.createEvent('Event');\n customEvent.initEvent('submit', true, true);\n document.querySelector('form.contact').dispatchEvent(customEvent);\n};\n\nwindow.syna.stream.subscribe('contact:update', function (_ref) {\n var name = _ref.name,\n email = _ref.email,\n phone = _ref.phone,\n message = _ref.message;\n\n var form = (0, _jqHelpers2.default)('form.contact');\n form.$('input[name=name]').attr('value', name || null)[0].focus();\n // TODO: REVISIT: Remove the following line whenever firefox fixes center on focus\n form[0].scrollIntoView({ behavior: 'instant', block: 'center' });\n form.$('input[name=email]').attr('value', email || null);\n form.$('input[name=phone]').attr('value', phone || null);\n form.$('textarea[name=message]').$nodes.forEach(function (node) {\n node.innerHTML = '';\n node.appendChild(document.createTextNode(message || ''));\n });\n});\n\n//# sourceURL=webpack:///./assets/js/contact.js?"); +eval("\n\nvar _jqHelpers = __webpack_require__(/*! ./helpers/jq-helpers */ \"./assets/js/helpers/jq-helpers.js\");\n\nvar _jqHelpers2 = _interopRequireDefault(_jqHelpers);\n\nvar _formValidatorSimple = __webpack_require__(/*! form-validator-simple */ \"./node_modules/form-validator-simple/dist/bundle.js\");\n\nvar _formValidatorSimple2 = _interopRequireDefault(_formValidatorSimple);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n(function () {\n if ((0, _jqHelpers2.default)('.g-recaptcha')) {\n checkReCaptcha();\n }\n})();\n\nvar validatorConfig = {\n errorTemplate: '%s',\n onFormValidate: function onFormValidate(isFormValid, form) {\n form.querySelector('button.submit-btn').disabled = !isFormValid;\n },\n onError: function onError(e, form) {\n (0, _jqHelpers2.default)('form[id=' + form.getAttribute('id') + '] .generic-error').removeClass('d-none');\n },\n onSuccess: function onSuccess(e, form) {\n if (form.dataset.hasNetlify || form.dataset.hasFormspree) {\n return;\n }\n\n e.preventDefault();\n var id = form.getAttribute('id');\n var $form = (0, _jqHelpers2.default)('form[id=' + id + ']');\n var action = $form.attr('action');\n var genericSuccess = $form.$('.generic-success');\n var genericError = $form.$('.generic-error');\n genericSuccess.addClass('hidden');\n genericError.addClass('d-none');\n $form.removeClass('error').removeClass('success');\n\n var serializedForm = (0, _jqHelpers2.default)('#' + id).serialize();\n if (typeof grecaptcha !== 'undefined' && grecaptcha.getResponse() === '') {\n grecaptcha.execute();\n return false;\n }\n\n $form.$('button.submit-btn').attr('disabled', true).addClass('disabled');\n _jqHelpers2.default.post(action, serializedForm, {\n contentType: 'application/x-www-form-urlencoded'\n }).then(function () {\n genericSuccess.removeClass('hidden');\n $form.addClass('success');\n $form.$('button.submit-btn').removeAttr('disabled').removeClass('disabled');\n }).catch(function () {\n genericError.removeClass('d-none');\n $form.addClass('error');\n $form.$('button.submit-btn').removeAttr('disabled').removeClass('disabled');\n });\n\n return false;\n }\n};\n\ndocument.querySelectorAll('form.contact').forEach(function (form) {\n new _formValidatorSimple2.default(Object.assign(validatorConfig, { form: form }));\n (0, _jqHelpers2.default)(form).$('#generic-success [data-action=\"return-form\"]').on('click', function () {\n (0, _jqHelpers2.default)(form).$('#generic-success').addClass('hidden');\n (0, _jqHelpers2.default)(form).removeClass('success');\n });\n});\n\nfunction checkReCaptcha() {\n if (document.querySelector('.g-recaptcha-container') && typeof grecaptcha === 'undefined') {\n (0, _jqHelpers2.default)('.captcha-error').removeClass('d-none');\n setTimeout(checkReCaptcha, 200);\n } else if (document.querySelector('.g-recaptcha-container div div')) {\n (0, _jqHelpers2.default)('.captcha-error').addClass('d-none');\n (0, _jqHelpers2.default)('.g-recaptcha-filler').addClass('d-none');\n (0, _jqHelpers2.default)('.g-recaptcha').attr('disabled', true);\n }\n}\n\nwindow.onContactCaptcha = function ($form) {\n var customEvent = document.createEvent('Event');\n customEvent.initEvent('submit', true, true);\n document.querySelector('form.contact').dispatchEvent(customEvent);\n};\n\nwindow.syna.stream.subscribe('contact:update', function (_ref) {\n var name = _ref.name,\n email = _ref.email,\n phone = _ref.phone,\n message = _ref.message;\n\n var form = (0, _jqHelpers2.default)('form.contact');\n form.$('input[name=name]').attr('value', name || null)[0].focus();\n // TODO: REVISIT: Remove the following line whenever firefox fixes center on focus\n form[0].scrollIntoView({ behavior: 'instant', block: 'center' });\n form.$('input[name=email]').attr('value', email || null);\n form.$('input[name=phone]').attr('value', phone || null);\n form.$('textarea[name=message]').$nodes.forEach(function (node) {\n node.innerHTML = '';\n node.appendChild(document.createTextNode(message || ''));\n });\n});\n\n//# sourceURL=webpack:///./assets/js/contact.js?"); /***/ }), diff --git a/assets/scripts/syna-graph.js b/assets/scripts/syna-graph.js index 1746f603..b2c0c8db 100644 --- a/assets/scripts/syna-graph.js +++ b/assets/scripts/syna-graph.js @@ -2126,19 +2126,7 @@ eval("/* global window: false */\n\n\nvar moment = __webpack_require__(/*! momen /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("/* MIT license */\nvar colorNames = __webpack_require__(/*! color-name */ \"./node_modules/chartjs-color-string/node_modules/color-name/index.js\");\n\nmodule.exports = {\n getRgba: getRgba,\n getHsla: getHsla,\n getRgb: getRgb,\n getHsl: getHsl,\n getHwb: getHwb,\n getAlpha: getAlpha,\n\n hexString: hexString,\n rgbString: rgbString,\n rgbaString: rgbaString,\n percentString: percentString,\n percentaString: percentaString,\n hslString: hslString,\n hslaString: hslaString,\n hwbString: hwbString,\n keyword: keyword\n}\n\nfunction getRgba(string) {\n if (!string) {\n return;\n }\n var abbr = /^#([a-fA-F0-9]{3})$/i,\n hex = /^#([a-fA-F0-9]{6})$/i,\n rgba = /^rgba?\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\n per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\n keyword = /(\\w+)/;\n\n var rgb = [0, 0, 0],\n a = 1,\n match = string.match(abbr);\n if (match) {\n match = match[1];\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match[i] + match[i], 16);\n }\n }\n else if (match = string.match(hex)) {\n match = match[1];\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);\n }\n }\n else if (match = string.match(rgba)) {\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match[i + 1]);\n }\n a = parseFloat(match[4]);\n }\n else if (match = string.match(per)) {\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n }\n a = parseFloat(match[4]);\n }\n else if (match = string.match(keyword)) {\n if (match[1] == \"transparent\") {\n return [0, 0, 0, 0];\n }\n rgb = colorNames[match[1]];\n if (!rgb) {\n return;\n }\n }\n\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = scale(rgb[i], 0, 255);\n }\n if (!a && a != 0) {\n a = 1;\n }\n else {\n a = scale(a, 0, 1);\n }\n rgb[3] = a;\n return rgb;\n}\n\nfunction getHsla(string) {\n if (!string) {\n return;\n }\n var hsl = /^hsla?\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\n var match = string.match(hsl);\n if (match) {\n var alpha = parseFloat(match[4]);\n var h = scale(parseInt(match[1]), 0, 360),\n s = scale(parseFloat(match[2]), 0, 100),\n l = scale(parseFloat(match[3]), 0, 100),\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\n return [h, s, l, a];\n }\n}\n\nfunction getHwb(string) {\n if (!string) {\n return;\n }\n var hwb = /^hwb\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\n var match = string.match(hwb);\n if (match) {\n var alpha = parseFloat(match[4]);\n var h = scale(parseInt(match[1]), 0, 360),\n w = scale(parseFloat(match[2]), 0, 100),\n b = scale(parseFloat(match[3]), 0, 100),\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\n return [h, w, b, a];\n }\n}\n\nfunction getRgb(string) {\n var rgba = getRgba(string);\n return rgba && rgba.slice(0, 3);\n}\n\nfunction getHsl(string) {\n var hsla = getHsla(string);\n return hsla && hsla.slice(0, 3);\n}\n\nfunction getAlpha(string) {\n var vals = getRgba(string);\n if (vals) {\n return vals[3];\n }\n else if (vals = getHsla(string)) {\n return vals[3];\n }\n else if (vals = getHwb(string)) {\n return vals[3];\n }\n}\n\n// generators\nfunction hexString(rgb) {\n return \"#\" + hexDouble(rgb[0]) + hexDouble(rgb[1])\n + hexDouble(rgb[2]);\n}\n\nfunction rgbString(rgba, alpha) {\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\n return rgbaString(rgba, alpha);\n }\n return \"rgb(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2] + \")\";\n}\n\nfunction rgbaString(rgba, alpha) {\n if (alpha === undefined) {\n alpha = (rgba[3] !== undefined ? rgba[3] : 1);\n }\n return \"rgba(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2]\n + \", \" + alpha + \")\";\n}\n\nfunction percentString(rgba, alpha) {\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\n return percentaString(rgba, alpha);\n }\n var r = Math.round(rgba[0]/255 * 100),\n g = Math.round(rgba[1]/255 * 100),\n b = Math.round(rgba[2]/255 * 100);\n\n return \"rgb(\" + r + \"%, \" + g + \"%, \" + b + \"%)\";\n}\n\nfunction percentaString(rgba, alpha) {\n var r = Math.round(rgba[0]/255 * 100),\n g = Math.round(rgba[1]/255 * 100),\n b = Math.round(rgba[2]/255 * 100);\n return \"rgba(\" + r + \"%, \" + g + \"%, \" + b + \"%, \" + (alpha || rgba[3] || 1) + \")\";\n}\n\nfunction hslString(hsla, alpha) {\n if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {\n return hslaString(hsla, alpha);\n }\n return \"hsl(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%)\";\n}\n\nfunction hslaString(hsla, alpha) {\n if (alpha === undefined) {\n alpha = (hsla[3] !== undefined ? hsla[3] : 1);\n }\n return \"hsla(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%, \"\n + alpha + \")\";\n}\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\nfunction hwbString(hwb, alpha) {\n if (alpha === undefined) {\n alpha = (hwb[3] !== undefined ? hwb[3] : 1);\n }\n return \"hwb(\" + hwb[0] + \", \" + hwb[1] + \"%, \" + hwb[2] + \"%\"\n + (alpha !== undefined && alpha !== 1 ? \", \" + alpha : \"\") + \")\";\n}\n\nfunction keyword(rgb) {\n return reverseNames[rgb.slice(0, 3)];\n}\n\n// helpers\nfunction scale(num, min, max) {\n return Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n var str = num.toString(16).toUpperCase();\n return (str.length < 2) ? \"0\" + str : str;\n}\n\n\n//create a list of reverse color names\nvar reverseNames = {};\nfor (var name in colorNames) {\n reverseNames[colorNames[name]] = name;\n}\n\n\n//# sourceURL=webpack:///./node_modules/chartjs-color-string/color-string.js?"); - -/***/ }), - -/***/ "./node_modules/chartjs-color-string/node_modules/color-name/index.js": -/*!****************************************************************************!*\ - !*** ./node_modules/chartjs-color-string/node_modules/color-name/index.js ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/chartjs-color-string/node_modules/color-name/index.js?"); +eval("/* MIT license */\nvar colorNames = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\n\nmodule.exports = {\n getRgba: getRgba,\n getHsla: getHsla,\n getRgb: getRgb,\n getHsl: getHsl,\n getHwb: getHwb,\n getAlpha: getAlpha,\n\n hexString: hexString,\n rgbString: rgbString,\n rgbaString: rgbaString,\n percentString: percentString,\n percentaString: percentaString,\n hslString: hslString,\n hslaString: hslaString,\n hwbString: hwbString,\n keyword: keyword\n}\n\nfunction getRgba(string) {\n if (!string) {\n return;\n }\n var abbr = /^#([a-fA-F0-9]{3})$/i,\n hex = /^#([a-fA-F0-9]{6})$/i,\n rgba = /^rgba?\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\n per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\n keyword = /(\\w+)/;\n\n var rgb = [0, 0, 0],\n a = 1,\n match = string.match(abbr);\n if (match) {\n match = match[1];\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match[i] + match[i], 16);\n }\n }\n else if (match = string.match(hex)) {\n match = match[1];\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);\n }\n }\n else if (match = string.match(rgba)) {\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match[i + 1]);\n }\n a = parseFloat(match[4]);\n }\n else if (match = string.match(per)) {\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n }\n a = parseFloat(match[4]);\n }\n else if (match = string.match(keyword)) {\n if (match[1] == \"transparent\") {\n return [0, 0, 0, 0];\n }\n rgb = colorNames[match[1]];\n if (!rgb) {\n return;\n }\n }\n\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = scale(rgb[i], 0, 255);\n }\n if (!a && a != 0) {\n a = 1;\n }\n else {\n a = scale(a, 0, 1);\n }\n rgb[3] = a;\n return rgb;\n}\n\nfunction getHsla(string) {\n if (!string) {\n return;\n }\n var hsl = /^hsla?\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\n var match = string.match(hsl);\n if (match) {\n var alpha = parseFloat(match[4]);\n var h = scale(parseInt(match[1]), 0, 360),\n s = scale(parseFloat(match[2]), 0, 100),\n l = scale(parseFloat(match[3]), 0, 100),\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\n return [h, s, l, a];\n }\n}\n\nfunction getHwb(string) {\n if (!string) {\n return;\n }\n var hwb = /^hwb\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\n var match = string.match(hwb);\n if (match) {\n var alpha = parseFloat(match[4]);\n var h = scale(parseInt(match[1]), 0, 360),\n w = scale(parseFloat(match[2]), 0, 100),\n b = scale(parseFloat(match[3]), 0, 100),\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\n return [h, w, b, a];\n }\n}\n\nfunction getRgb(string) {\n var rgba = getRgba(string);\n return rgba && rgba.slice(0, 3);\n}\n\nfunction getHsl(string) {\n var hsla = getHsla(string);\n return hsla && hsla.slice(0, 3);\n}\n\nfunction getAlpha(string) {\n var vals = getRgba(string);\n if (vals) {\n return vals[3];\n }\n else if (vals = getHsla(string)) {\n return vals[3];\n }\n else if (vals = getHwb(string)) {\n return vals[3];\n }\n}\n\n// generators\nfunction hexString(rgb) {\n return \"#\" + hexDouble(rgb[0]) + hexDouble(rgb[1])\n + hexDouble(rgb[2]);\n}\n\nfunction rgbString(rgba, alpha) {\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\n return rgbaString(rgba, alpha);\n }\n return \"rgb(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2] + \")\";\n}\n\nfunction rgbaString(rgba, alpha) {\n if (alpha === undefined) {\n alpha = (rgba[3] !== undefined ? rgba[3] : 1);\n }\n return \"rgba(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2]\n + \", \" + alpha + \")\";\n}\n\nfunction percentString(rgba, alpha) {\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\n return percentaString(rgba, alpha);\n }\n var r = Math.round(rgba[0]/255 * 100),\n g = Math.round(rgba[1]/255 * 100),\n b = Math.round(rgba[2]/255 * 100);\n\n return \"rgb(\" + r + \"%, \" + g + \"%, \" + b + \"%)\";\n}\n\nfunction percentaString(rgba, alpha) {\n var r = Math.round(rgba[0]/255 * 100),\n g = Math.round(rgba[1]/255 * 100),\n b = Math.round(rgba[2]/255 * 100);\n return \"rgba(\" + r + \"%, \" + g + \"%, \" + b + \"%, \" + (alpha || rgba[3] || 1) + \")\";\n}\n\nfunction hslString(hsla, alpha) {\n if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {\n return hslaString(hsla, alpha);\n }\n return \"hsl(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%)\";\n}\n\nfunction hslaString(hsla, alpha) {\n if (alpha === undefined) {\n alpha = (hsla[3] !== undefined ? hsla[3] : 1);\n }\n return \"hsla(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%, \"\n + alpha + \")\";\n}\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\nfunction hwbString(hwb, alpha) {\n if (alpha === undefined) {\n alpha = (hwb[3] !== undefined ? hwb[3] : 1);\n }\n return \"hwb(\" + hwb[0] + \", \" + hwb[1] + \"%, \" + hwb[2] + \"%\"\n + (alpha !== undefined && alpha !== 1 ? \", \" + alpha : \"\") + \")\";\n}\n\nfunction keyword(rgb) {\n return reverseNames[rgb.slice(0, 3)];\n}\n\n// helpers\nfunction scale(num, min, max) {\n return Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n var str = num.toString(16).toUpperCase();\n return (str.length < 2) ? \"0\" + str : str;\n}\n\n\n//create a list of reverse color names\nvar reverseNames = {};\nfor (var name in colorNames) {\n reverseNames[colorNames[name]] = name;\n}\n\n\n//# sourceURL=webpack:///./node_modules/chartjs-color-string/color-string.js?"); /***/ }), @@ -2175,6 +2163,18 @@ eval("var conversions = __webpack_require__(/*! ./conversions */ \"./node_module /***/ }), +/***/ "./node_modules/color-name/index.js": +/*!******************************************!*\ + !*** ./node_modules/color-name/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/color-name/index.js?"); + +/***/ }), + /***/ "./node_modules/webpack/buildin/module.js": /*!***********************************!*\ !*** (webpack)/buildin/module.js ***! diff --git a/assets/scripts/syna-main.js b/assets/scripts/syna-main.js index d4889816..4ad2d946 100644 --- a/assets/scripts/syna-main.js +++ b/assets/scripts/syna-main.js @@ -130,7 +130,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\n__webpack_require__(/*! ./helpers/bootstrap-helper */ \"./assets/js/helpers/bootstrap-helper.js\");\n\n__webpack_require__(/*! ./scroll */ \"./assets/js/scroll.js\");\n\n__webpack_require__(/*! ./modal */ \"./assets/js/modal.js\");\n\nvar _jqHelpers = __webpack_require__(/*! ./helpers/jq-helpers */ \"./assets/js/helpers/jq-helpers.js\");\n\nvar _jqHelpers2 = _interopRequireDefault(_jqHelpers);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n(0, _jqHelpers2.default)(document).on('click', '.btn-group-toggle .btn', function (e) {\n (0, _jqHelpers2.default)(e.target.closest('.btn-group-toggle')).$('label.btn.active').removeClass('active');\n (0, _jqHelpers2.default)(e.target).addClass('active');\n}).on('click', '.dropdown-toggle', function (e) {\n var parent = e.target.parentElement;\n var dropdowns = (0, _jqHelpers2.default)(parent).$('.dropdown-menu');\n if (parent.classList.contains('show')) {\n parent.classList.remove('show');\n dropdowns.removeClass('show');\n } else {\n parent.classList.add('show');\n dropdowns.addClass('show');\n }\n}).on('click', '.dropdown-item', function (e) {\n var dropdown = e.target.parentElement;\n var button = (0, _jqHelpers2.default)(dropdown.parentElement).$('.dropdown-toggle');\n button.text(e.target.innerText);\n button.attr('data-value', e.target.dataset.value);\n (0, _jqHelpers2.default)(dropdown).removeClass('show');\n (0, _jqHelpers2.default)(dropdown.parentElement).removeClass('show');\n}).on('click', 'a[href*=\"event=\"], a[href*=\"e=\"]', function (e) {\n if (window.syna.stream._publishHashChange(e.target.href)) {\n e.preventDefault();\n return false;\n }\n});\n\n//# sourceURL=webpack:///./assets/js/index.js?"); +eval("\n\n__webpack_require__(/*! ./helpers/bootstrap-helper */ \"./assets/js/helpers/bootstrap-helper.js\");\n\n__webpack_require__(/*! ./scroll */ \"./assets/js/scroll.js\");\n\n__webpack_require__(/*! ./modal */ \"./assets/js/modal.js\");\n\nvar _jqHelpers = __webpack_require__(/*! ./helpers/jq-helpers */ \"./assets/js/helpers/jq-helpers.js\");\n\nvar _jqHelpers2 = _interopRequireDefault(_jqHelpers);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n(0, _jqHelpers2.default)(document).on('click', '.btn-group-toggle .btn', function (e) {\n (0, _jqHelpers2.default)(e.target.closest('.btn-group-toggle')).$('label.btn.active').removeClass('active');\n (0, _jqHelpers2.default)(e.target).addClass('active');\n}).on('click', '.dropdown-toggle', function (e) {\n var parent = e.target.parentElement;\n var dropdowns = (0, _jqHelpers2.default)(parent).$('.dropdown-menu');\n if (parent.classList.contains('show')) {\n parent.classList.remove('show');\n dropdowns.removeClass('show');\n } else {\n parent.classList.add('show');\n dropdowns.addClass('show');\n }\n}).on('click', '.dropdown-item', function (e) {\n var dropdown = e.target.parentElement;\n var button = (0, _jqHelpers2.default)(dropdown.parentElement).$('.dropdown-toggle');\n if (!button.$nodes[0].classList.contains('nav-link')) {\n button.text(e.target.innerText);\n button.attr('data-value', e.target.dataset.value);\n }\n (0, _jqHelpers2.default)(dropdown).removeClass('show');\n (0, _jqHelpers2.default)(dropdown.parentElement).removeClass('show');\n}).on('click', 'a[href*=\"event=\"], a[href*=\"e=\"]', function (e) {\n if (window.syna.stream._publishHashChange(e.target.href)) {\n e.preventDefault();\n return false;\n }\n});\n\n//# sourceURL=webpack:///./assets/js/index.js?"); /***/ }), From cb68b5a223346c632977466f0bbcf5d2ab487e9b Mon Sep 17 00:00:00 2001 From: Mahdi Pourismaiel Date: Fri, 12 Jun 2020 22:05:38 +0430 Subject: [PATCH 2/8] Add nested menus support to nav fragment --- layouts/partials/fragments/nav.html | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/layouts/partials/fragments/nav.html b/layouts/partials/fragments/nav.html index 6d5db276..d024becf 100644 --- a/layouts/partials/fragments/nav.html +++ b/layouts/partials/fragments/nav.html @@ -54,16 +54,33 @@ {{- end }} {{- if .Site.Menus.main -}} {{- range sort .Site.Menus.main }} - {{- $isMenuCurrent := or (eq $.root.Permalink .URL) (eq (printf "%s/" $.root.Permalink) .URL) (eq $.root.Permalink (printf "%s/" .URL)) -}} - {{- end -}} {{- end }} From dd188c32bf3e516670460a68f1e51245da96e2ec Mon Sep 17 00:00:00 2001 From: Mahdi Pourismaiel Date: Sun, 28 Jun 2020 22:00:32 +0430 Subject: [PATCH 3/8] Add documentation on nested menus --- exampleSite/content/fragments/nav/docs.md | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/exampleSite/content/fragments/nav/docs.md b/exampleSite/content/fragments/nav/docs.md index 963c09ba..d8f2ec15 100644 --- a/exampleSite/content/fragments/nav/docs.md +++ b/exampleSite/content/fragments/nav/docs.md @@ -16,6 +16,30 @@ Use one instance of this fragment per page. Running more might lead to unexpecte - .Site.Menus.main + **Note:** Menus displayed in the nav fragment can be nested, in which case the nested menus are displayed in a dropdown, adding a chevron to the parent menu. + + ``` + # config.toml + + [[menu.main]] + url = "/about" + name = "About" + weight = 10 + identifier = "about" + + [[menu.main]] + url = "/about/team" + name = "Our team" + weight = 10 + parent = "about" + + [[menu.main]] + url = "/about/office" + name = "Our office" + weight = 20 + parent = "about" + ``` + ### Variables #### search From 6fa0ddc2c651db755786ad44c1ba67bc657e0b9e Mon Sep 17 00:00:00 2001 From: Mahdi Pourismaiel Date: Mon, 29 Jun 2020 01:03:39 +0430 Subject: [PATCH 4/8] Remove unnecessary comment from nav's menus documentation --- exampleSite/content/fragments/nav/docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exampleSite/content/fragments/nav/docs.md b/exampleSite/content/fragments/nav/docs.md index d8f2ec15..c5e39e72 100644 --- a/exampleSite/content/fragments/nav/docs.md +++ b/exampleSite/content/fragments/nav/docs.md @@ -16,7 +16,7 @@ Use one instance of this fragment per page. Running more might lead to unexpecte - .Site.Menus.main - **Note:** Menus displayed in the nav fragment can be nested, in which case the nested menus are displayed in a dropdown, adding a chevron to the parent menu. + **Note:** Menus displayed in the nav fragment can be nested, in which case the nested menus are displayed in a dropdown. ``` # config.toml From 974ec3dca6e47fa7c61aab562c20a56769189d12 Mon Sep 17 00:00:00 2001 From: Mahdi Pourismaiel Date: Thu, 2 Jul 2020 21:36:34 +0430 Subject: [PATCH 5/8] Add parts of dev section to main menu --- exampleSite/config-dev.toml | 30 ++++++++++++++++++++++++++++++ exampleSite/config.toml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/exampleSite/config-dev.toml b/exampleSite/config-dev.toml index 493154ff..540556ce 100644 --- a/exampleSite/config-dev.toml +++ b/exampleSite/config-dev.toml @@ -88,6 +88,36 @@ lastmod = ["lastmod", ":git", "date"] name = "Docs" weight = 30 +[[menu.main]] + url = "/dev" + name = "Dev Section" + weight = 35 + identifier = "dev" + +[[menu.main]] + url = "/dev" + name = "Dev Section" + weight = 10 + parent = "dev" + +[[menu.main]] + url = "/dev/colors" + name = "Colors" + weight = 20 + parent = "dev" + +[[menu.main]] + url = "/dev/blog" + name = "Blog" + weight = 30 + parent = "dev" + +[[menu.main]] + url = "/dev/events" + name = "Events" + weight = 40 + parent = "dev" + [[menu.main]] url = "/about" name = "About" diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b7a25bb4..f30d0c57 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -86,6 +86,36 @@ lastmod = ["lastmod", ":git", "date"] name = "Docs" weight = 30 +[[menu.main]] + url = "/dev" + name = "Dev Section" + weight = 35 + identifier = "dev" + +[[menu.main]] + url = "/dev" + name = "Dev Section" + weight = 10 + parent = "dev" + +[[menu.main]] + url = "/dev/colors" + name = "Colors" + weight = 20 + parent = "dev" + +[[menu.main]] + url = "/dev/blog" + name = "Blog" + weight = 30 + parent = "dev" + +[[menu.main]] + url = "/dev/events" + name = "Events" + weight = 40 + parent = "dev" + [[menu.main]] url = "/about" name = "About" From af7629ddf075f123b389e250087f6fec906fedc5 Mon Sep 17 00:00:00 2001 From: Mahdi Pourismaiel Date: Thu, 2 Jul 2020 21:36:47 +0430 Subject: [PATCH 6/8] Add reference to nesting menus docs in nav fragment's doc --- exampleSite/content/fragments/nav/docs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exampleSite/content/fragments/nav/docs.md b/exampleSite/content/fragments/nav/docs.md index c5e39e72..5988209f 100644 --- a/exampleSite/content/fragments/nav/docs.md +++ b/exampleSite/content/fragments/nav/docs.md @@ -16,7 +16,7 @@ Use one instance of this fragment per page. Running more might lead to unexpecte - .Site.Menus.main - **Note:** Menus displayed in the nav fragment can be nested, in which case the nested menus are displayed in a dropdown. + **Note:** Menus displayed in the nav fragment can be nested, in which case the nested menus are displayed in a dropdown. Please see "[nesting](https://gohugo.io/content-management/menus/#nesting)" section of Menus documentation in Hugo documentation. ``` # config.toml From 2663ebcb731c1e4ed679b0051177dc89534c46fd Mon Sep 17 00:00:00 2001 From: Mahdi Pourismaiel Date: Fri, 3 Jul 2020 17:19:11 +0430 Subject: [PATCH 7/8] Fix multiple navbar test --- cypress/integration/navbar.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/integration/navbar.spec.js b/cypress/integration/navbar.spec.js index fa8f73ec..bd98d091 100644 --- a/cypress/integration/navbar.spec.js +++ b/cypress/integration/navbar.spec.js @@ -33,13 +33,13 @@ describe("Navbar", () => { cy.get('#nav-1 .search-container input').focus().type('nav'); cy.get('#nav-1 .search-results-container').should("be.visible"); cy.get('#nav-2 .search-results-container').should("be.hidden"); - cy.get('#nav-1').click(); + cy.get('body').click(); cy.get('#nav-1 .search-results-container').should("be.hidden"); cy.get('#nav-2 .search-container input').focus().type('nav'); cy.get('#nav-2 .search-results-container').should("be.visible"); cy.get('#nav-1 .search-results-container').should("be.hidden"); - cy.get('#nav-2').click(); + cy.get('body').click(); cy.get('#nav-2 .search-results-container').should("be.hidden"); }); }); From e04127787ecd3b67fbc672ff9131813aca2a0d69 Mon Sep 17 00:00:00 2001 From: Mahdi Pourismaiel Date: Fri, 10 Jul 2020 16:40:06 +0430 Subject: [PATCH 8/8] Remove dev menus from site main config --- exampleSite/config.toml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index f30d0c57..b7a25bb4 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -86,36 +86,6 @@ lastmod = ["lastmod", ":git", "date"] name = "Docs" weight = 30 -[[menu.main]] - url = "/dev" - name = "Dev Section" - weight = 35 - identifier = "dev" - -[[menu.main]] - url = "/dev" - name = "Dev Section" - weight = 10 - parent = "dev" - -[[menu.main]] - url = "/dev/colors" - name = "Colors" - weight = 20 - parent = "dev" - -[[menu.main]] - url = "/dev/blog" - name = "Blog" - weight = 30 - parent = "dev" - -[[menu.main]] - url = "/dev/events" - name = "Events" - weight = 40 - parent = "dev" - [[menu.main]] url = "/about" name = "About"