mongo-express-enhanced
Version:
Web-based admin interface for MongoDB
49 lines (39 loc) • 27.7 kB
JavaScript
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
(self["webpackChunkmongo_express"] = self["webpackChunkmongo_express"] || []).push([["collection"],{
/***/ "./lib/scripts/collection.js":
/*!***********************************!*\
!*** ./lib/scripts/collection.js ***!
\***********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var renderjson__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! renderjson */ \"./node_modules/renderjson/renderjson.js\");\n/* harmony import */ var renderjson__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(renderjson__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _codeMirrorLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./codeMirrorLoader */ \"./lib/scripts/codeMirrorLoader.js\");\n/* harmony import */ var _escapeHtml__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./escapeHtml */ \"./lib/scripts/escapeHtml.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n\n\n\nfunction getParameterByName(name) {\n name = name.replace(/\\[/, '\\\\[').replace(/[\\]]/, '\\\\]');\n var regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\n var results = regex.exec(window.location.search);\n return results === null ? '' : decodeURIComponent(results[1].replace(/\\+/g, ' '));\n}\n\njquery__WEBPACK_IMPORTED_MODULE_0___default()(function () {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#tabs').tab();\n\n if (document.location.href.indexOf('query=') >= 0 && getParameterByName('query') !== '') {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#tabs a[href=\"#advanced\"]').tab('show');\n }\n});\nvar addDoc = _codeMirrorLoader__WEBPACK_IMPORTED_MODULE_2__[\"default\"].fromTextArea(document.getElementById('document'), {\n mode: {\n name: 'javascript',\n json: true\n },\n indentUnit: 4,\n electricChars: true,\n matchBrackets: true,\n lineNumbers: true,\n theme: ME_SETTINGS.codeMirrorEditorTheme\n});\nvar addIndexDoc = _codeMirrorLoader__WEBPACK_IMPORTED_MODULE_2__[\"default\"].fromTextArea(document.getElementById('index'), {\n mode: {\n name: 'javascript',\n json: true\n },\n indentUnit: 4,\n electricChars: true,\n matchBrackets: true,\n lineNumbers: true,\n theme: ME_SETTINGS.codeMirrorEditorTheme\n});\n\nwindow.checkValidJSON = function () {\n jquery__WEBPACK_IMPORTED_MODULE_0___default().ajax({\n type: 'POST',\n url: \"\".concat(ME_SETTINGS.baseHref, \"checkValid\"),\n data: {\n document: addDoc.getValue()\n }\n }).done(function (data) {\n if (data === 'Valid') {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#documentInvalidJSON').remove();\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#addDocumentForm').submit();\n } else if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('#documentInvalidJSON').length === 0) {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#document-modal-body').parent().append('<div id=\"documentInvalidJSON\" class=\"alert alert-danger\"><strong>Invalid JSON</strong></div>');\n }\n });\n return false;\n};\n\nwindow.checkValidIndexJSON = function () {\n jquery__WEBPACK_IMPORTED_MODULE_0___default().ajax({\n type: 'POST',\n url: \"\".concat(ME_SETTINGS.baseHref, \"checkValid\"),\n data: {\n document: addIndexDoc.getValue()\n }\n }).done(function (data) {\n if (data === 'Valid') {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#indexInvalidJSON').remove();\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#addIndexForm').submit();\n } else if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('#indexInvalidJSON').length === 0) {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#index-modal-body').parent().append('<div id=\"indexInvalidJSON\" class=\"alert alert-danger\"><strong>Invalid JSON</strong></div>');\n }\n });\n return false;\n};\n\njquery__WEBPACK_IMPORTED_MODULE_0___default()('#addDocument').on('shown.bs.modal', function () {\n addDoc.refresh();\n addDoc.focus();\n});\njquery__WEBPACK_IMPORTED_MODULE_0___default()('#addIndex').on('shown.bs.modal', function () {\n addIndexDoc.refresh();\n addIndexDoc.focus();\n});\n\nif (ME_SETTINGS.collapsibleJSON) {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(function () {\n // convert all objects to renderjson elements\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('div.tableContent pre').each(function () {\n var $this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);\n var text = jquery__WEBPACK_IMPORTED_MODULE_0___default().trim($this.text());\n\n if (text) {\n $this.html(renderjson__WEBPACK_IMPORTED_MODULE_1___default()(JSON.parse(text)));\n }\n });\n });\n renderjson__WEBPACK_IMPORTED_MODULE_1___default().set_show_to_level(ME_SETTINGS.collapsibleJSONDefaultUnfold);\n}\n\nfunction makeCollectionUrl() {\n var st = ME_SETTINGS;\n return \"\".concat(st.baseHref, \"db/\").concat(encodeURIComponent(st.dbName), \"/\").concat(encodeURIComponent(st.collectionName), \"/\");\n}\n\nwindow.loadDocument = function (url) {\n var selection = window.getSelection().toString();\n\n if (selection === '') {\n window.location.href = url;\n }\n};\n\njquery__WEBPACK_IMPORTED_MODULE_0___default()(function () {\n var $tableWrapper = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.tableWrapper');\n\n if (jquery__WEBPACK_IMPORTED_MODULE_0___default()('.tableHeaderFooterBars').width() === $tableWrapper.width()) {\n // table wrapper is the same width as the table itself, so not overflowing, so remove the white gradient\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.fadeToWhite').remove();\n } else {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.fadeToWhite').height(jquery__WEBPACK_IMPORTED_MODULE_0___default()('.tableWrapper').height()); // limit the height only to the table div\n }\n\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.deleteButtonCollection').tooltip({\n title: 'Are you sure you want to delete this collection? All documents will be deleted.'\n });\n $tableWrapper.scroll(function () {\n var proximityToRightOfTable = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.tableWrapper table').width() - $tableWrapper.scrollLeft() - $tableWrapper.width();\n document.getElementById('fadeToWhiteID').style.opacity = Math.min(Math.max(proximityToRightOfTable - 50, 50) - 50, 100) / 100;\n });\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.tooDamnBig').on('click', function (e) {\n e.preventDefault();\n e.stopPropagation();\n var target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);\n\n var _id = target.attr('doc_id');\n\n var prop = target.attr('doc_prop');\n var spinner = \"<img src=\\\"\".concat(ME_SETTINGS.baseHref, \"public/img/gears.gif\\\" />\");\n var leftScroll = $tableWrapper.scrollLeft(); // Set the element with spinner for now\n\n target.html(spinner);\n\n function renderProp(input) {\n // Images inline\n if (typeof input === 'string' && (input.substr(0, 22) === 'data:image/png;base64,' || input.substr(0, 22) === 'data:image/gif;base64,' || input.substr(0, 22) === 'data:image/jpg;base64,' || input.substr(0, 23) === 'data:image/jpeg;base64,')) {\n return \"<img src=\\\"\".concat((0,_escapeHtml__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(input), \"\\\" style=\\\"max-height:100%; max-width:100%; \\\"/>\");\n } // Audio inline\n\n\n if (typeof input === 'string' && (input.substr(0, 22) === 'data:audio/ogg;base64,' || input.substr(0, 22) === 'data:audio/wav;base64,' || input.substr(0, 22) === 'data:audio/mp3;base64,')) {\n return \"<audio controls style=\\\"width:45px;\\\" src=\\\"\".concat((0,_escapeHtml__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(input), \"\\\">Your browser does not support the audio element.</audio>\");\n } // Video inline\n\n\n if (typeof input === 'string' && (input.substr(0, 23) === 'data:video/webm;base64,' || input.substr(0, 22) === 'data:video/mp4;base64,' || input.substr(0, 22) === 'data:video/ogv;base64,')) {\n var videoFormat = input.match(/^data:(.*);base64/)[1];\n return \"<video controls><source type=\\\"\".concat((0,_escapeHtml__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(videoFormat), \"\\\" src=\\\"\").concat((0,_escapeHtml__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(input), \"\\\"/>\\n + 'Your browser does not support the video element.</video>\");\n }\n\n if (_typeof(input) === 'object' && (input.toString() === '[object Object]' || input.toString().substr(0, 7) === '[object')) {\n return renderjson__WEBPACK_IMPORTED_MODULE_1___default()(input);\n } // treat unknown data as escaped string\n\n\n return (0,_escapeHtml__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(input.toString());\n }\n\n jquery__WEBPACK_IMPORTED_MODULE_0___default().get(\"\".concat(makeCollectionUrl()).concat(encodeURIComponent(_id), \"/\").concat(prop), function (prop) {\n prop = renderProp(prop); // Set the element with gotten datas\n\n target.parent().html(prop); // Set original scroll position\n\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.tableWrapper').scrollLeft(leftScroll);\n });\n });\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.deleteButtonDocument').on('click', function (e) {\n var $form = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).closest('form');\n e.stopPropagation();\n e.preventDefault();\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#confirm-deletion-document').modal({\n backdrop: 'static',\n keyboard: false\n }).one('click', '#delete', function () {\n $form.trigger('submit'); // submit the form\n });\n });\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#deleteListConfirmButton').on('click', function () {\n // we just need to POST the form, as all the query parameters are already embedded in the form action\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#deleteListForm').trigger('submit');\n });\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.deleteButtonCollection').on('click', function (event) {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.deleteButtonCollection').tooltip('hide');\n event.preventDefault();\n var $target = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);\n var $parentForm = $target.parent();\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#confirmation-input').attr('shouldbe', $target.attr('collection-name'));\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#modal-collection-name').text($target.attr('collection-name'));\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#confirm-deletion-collection').modal({\n backdrop: 'static',\n keyboard: false\n }).one('shown.bs.modal', function () {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('#confirmation-input').focus();\n }).one('click', '#delete', function () {\n var $input = jquery__WEBPACK_IMPORTED_MODULE_0___default()('#confirmation-input');\n\n if ($input.val().toLowerCase() === $input.attr('shouldbe').toLowerCase()) {\n $parentForm.trigger('submit');\n }\n });\n });\n var nextSort = {\n 1: -1,\n '-1': 0,\n 0: 1,\n undefined: 1\n };\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('.sorting-button').on('click', function () {\n var $this = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);\n var column = $this.data('column');\n var direction = nextSort[$this.data('direction')];\n jquery__WEBPACK_IMPORTED_MODULE_0___default()('input.sort-' + column).val(direction).prop('checked', direction !== 0);\n var $form = jquery__WEBPACK_IMPORTED_MODULE_0___default()(jquery__WEBPACK_IMPORTED_MODULE_0___default()('#tabs li.active a').attr('href') + ' form');\n $form.find('button[type=\"submit\"]').click();\n });\n var $importInputsFile = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.import-input-file');\n var $importFileLinks = jquery__WEBPACK_IMPORTED_MODULE_0___default()('.import-file-link'); // Trigger onClick event on hidden input file\n\n jquery__WEBPACK_IMPORTED_MODULE_0___default().each($importFileLinks, function (key, link) {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()(link).on('click', function () {\n jquery__WEBPACK_IMPORTED_MODULE_0___default()($importInputsFile[key]).trigger('click');\n });\n }); // When file is add in input, send it to the server\n\n $importInputsFile.on('change', function (event) {\n var files = event.target.files;\n var collection = jquery__WEBPACK_IMPORTED_MODULE_0___default()(event.target).attr('collection-name');\n var data = new FormData();\n jquery__WEBPACK_IMPORTED_MODULE_0___default().each(files, function (key, value) {\n data.append(\"file_\".concat(key), value);\n });\n jquery__WEBPACK_IMPORTED_MODULE_0___default().ajax({\n type: 'POST',\n url: \"\".concat(ME_SETTINGS.baseHref, \"db/\").concat(ME_SETTINGS.dbName, \"/import/\").concat(collection),\n data: data,\n cache: false,\n dataType: 'json',\n processData: false,\n // Don't process the files\n contentType: false // Set content type to false as jQuery will tell the server its a query string request\n\n });\n });\n});\n\n//# sourceURL=webpack://mongo-express/./lib/scripts/collection.js?");
/***/ }),
/***/ "./lib/scripts/escapeHtml.js":
/*!***********************************!*\
!*** ./lib/scripts/escapeHtml.js ***!
\***********************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }\n/* harmony export */ });\n/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(html) {\n // Turn < ? > into HTML entities, so data doesn't get interpreted by the browser\n return html.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\"/g, '"').replace(/'/g, ''');\n}\n\n//# sourceURL=webpack://mongo-express/./lib/scripts/escapeHtml.js?");
/***/ }),
/***/ "./node_modules/renderjson/renderjson.js":
/*!***********************************************!*\
!*** ./node_modules/renderjson/renderjson.js ***!
\***********************************************/
/***/ (function(module, exports, __webpack_require__) {
eval("var __WEBPACK_AMD_DEFINE_RESULT__;// Copyright © 2013-2017 David Caldwell <david@porkrind.org>\n//\n// Permission to use, copy, modify, and/or distribute this software for any\n// purpose with or without fee is hereby granted, provided that the above\n// copyright notice and this permission notice appear in all copies.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\n// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION\n// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n\n// Usage\n// -----\n// The module exports one entry point, the `renderjson()` function. It takes in\n// the JSON you want to render as a single argument and returns an HTML\n// element.\n//\n// Options\n// -------\n// renderjson.set_icons(\"+\", \"-\")\n// This Allows you to override the disclosure icons.\n//\n// renderjson.set_show_to_level(level)\n// Pass the number of levels to expand when rendering. The default is 0, which\n// starts with everything collapsed. As a special case, if level is the string\n// \"all\" then it will start with everything expanded.\n//\n// renderjson.set_max_string_length(length)\n// Strings will be truncated and made expandable if they are longer than\n// `length`. As a special case, if `length` is the string \"none\" then\n// there will be no truncation. The default is \"none\".\n//\n// renderjson.set_sort_objects(sort_bool)\n// Sort objects by key (default: false)\n//\n// renderjson.set_replacer(replacer_function)\n// Equivalent of JSON.stringify() `replacer` argument when it's a function\n//\n// renderjson.set_property_list(property_list)\n// Equivalent of JSON.stringify() `replacer` argument when it's an array\n//\n// Theming\n// -------\n// The HTML output uses a number of classes so that you can theme it the way\n// you'd like:\n// .disclosure (\"⊕\", \"⊖\")\n// .syntax (\",\", \":\", \"{\", \"}\", \"[\", \"]\")\n// .string (includes quotes)\n// .number\n// .boolean\n// .key (object key)\n// .keyword (\"null\", \"undefined\")\n// .object.syntax (\"{\", \"}\")\n// .array.syntax (\"[\", \"]\")\n\n(function (root, factory) {\n if(true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n return (root.renderjson = factory());\n }).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function() {\n var themetext = function(/* [class, text]+ */) {\n var spans = [];\n while (arguments.length)\n spans.push(append(span(Array.prototype.shift.call(arguments)),\n text(Array.prototype.shift.call(arguments))));\n return spans;\n };\n var append = function(/* el, ... */) {\n var el = Array.prototype.shift.call(arguments);\n for (var a=0; a<arguments.length; a++)\n if (arguments[a].constructor == Array)\n append.apply(this, [el].concat(arguments[a]));\n else\n el.appendChild(arguments[a]);\n return el;\n };\n var prepend = function(el, child) {\n el.insertBefore(child, el.firstChild);\n return el;\n }\n var isempty = function(obj, pl) { var keys = pl || Object.keys(obj);\n for (var i in keys) if (Object.hasOwnProperty.call(obj, keys[i])) return false;\n return true; }\n var text = function(txt) { return document.createTextNode(txt) };\n var div = function() { return document.createElement(\"div\") };\n var span = function(classname) { var s = document.createElement(\"span\");\n if (classname) s.className = classname;\n return s; };\n var A = function A(txt, classname, callback) { var a = document.createElement(\"a\");\n if (classname) a.className = classname;\n a.appendChild(text(txt));\n a.href = '#';\n a.onclick = function(e) { callback(); if (e) e.stopPropagation(); return false; };\n return a; };\n\n function _renderjson(json, indent, dont_indent, show_level, options) {\n var my_indent = dont_indent ? \"\" : indent;\n\n var disclosure = function(open, placeholder, close, type, builder) {\n var content;\n var empty = span(type);\n var show = function() { if (!content) append(empty.parentNode,\n content = prepend(builder(),\n A(options.hide, \"disclosure\",\n function() { content.style.display=\"none\";\n empty.style.display=\"inline\"; } )));\n content.style.display=\"inline\";\n empty.style.display=\"none\"; };\n append(empty,\n A(options.show, \"disclosure\", show),\n themetext(type+ \" syntax\", open),\n A(placeholder, null, show),\n themetext(type+ \" syntax\", close));\n\n var el = append(span(), text(my_indent.slice(0,-1)), empty);\n if (show_level > 0)\n show();\n return el;\n };\n\n if (json === null) return themetext(null, my_indent, \"keyword\", \"null\");\n if (json === void 0) return themetext(null, my_indent, \"keyword\", \"undefined\");\n\n if (typeof(json) == \"string\" && json.length > options.max_string_length)\n return disclosure('\"', json.substr(0,options.max_string_length)+\" ...\", '\"', \"string\", function () {\n return append(span(\"string\"), themetext(null, my_indent, \"string\", JSON.stringify(json)));\n });\n\n if (typeof(json) != \"object\" || [Number, String, Boolean, Date].indexOf(json.constructor) >= 0) // Strings, numbers and bools\n return themetext(null, my_indent, typeof(json), JSON.stringify(json));\n\n if (json.constructor == Array) {\n if (json.length == 0) return themetext(null, my_indent, \"array syntax\", \"[]\");\n\n return disclosure(\"[\", \" ... \", \"]\", \"array\", function () {\n var as = append(span(\"array\"), themetext(\"array syntax\", \"[\", null, \"\\n\"));\n for (var i=0; i<json.length; i++)\n append(as,\n _renderjson(options.replacer.call(json, i, json[i]), indent+\" \", false, show_level-1, options),\n i != json.length-1 ? themetext(\"syntax\", \",\") : [],\n text(\"\\n\"));\n append(as, themetext(null, indent, \"array syntax\", \"]\"));\n return as;\n });\n }\n\n // object\n if (isempty(json, options.property_list))\n return themetext(null, my_indent, \"object syntax\", \"{}\");\n\n return disclosure(\"{\", \"...\", \"}\", \"object\", function () {\n var os = append(span(\"object\"), themetext(\"object syntax\", \"{\", null, \"\\n\"));\n for (var k in json) var last = k;\n var keys = options.property_list || Object.keys(json);\n if (options.sort_objects)\n keys = keys.sort();\n for (var i in keys) {\n var k = keys[i];\n if (!(k in json)) continue;\n append(os, themetext(null, indent+\" \", \"key\", '\"'+k+'\"', \"object syntax\", ': '),\n _renderjson(options.replacer.call(json, k, json[k]), indent+\" \", true, show_level-1, options),\n k != last ? themetext(\"syntax\", \",\") : [],\n text(\"\\n\"));\n }\n append(os, themetext(null, indent, \"object syntax\", \"}\"));\n return os;\n });\n }\n\n var renderjson = function renderjson(json)\n {\n var options = Object.assign({}, renderjson.options);\n options.replacer = typeof(options.replacer) == \"function\" ? options.replacer : function(k,v) { return v; };\n var pre = append(document.createElement(\"pre\"), _renderjson(json, \"\", false, options.show_to_level, options));\n pre.className = \"renderjson\";\n return pre;\n }\n renderjson.set_icons = function(show, hide) { renderjson.options.show = show;\n renderjson.options.hide = hide;\n return renderjson; };\n renderjson.set_show_to_level = function(level) { renderjson.options.show_to_level = typeof level == \"string\" &&\n level.toLowerCase() === \"all\" ? Number.MAX_VALUE\n : level;\n return renderjson; };\n renderjson.set_max_string_length = function(length) { renderjson.options.max_string_length = typeof length == \"string\" &&\n length.toLowerCase() === \"none\" ? Number.MAX_VALUE\n : length;\n return renderjson; };\n renderjson.set_sort_objects = function(sort_bool) { renderjson.options.sort_objects = sort_bool;\n return renderjson; };\n renderjson.set_replacer = function(replacer) { renderjson.options.replacer = replacer;\n return renderjson; };\n renderjson.set_property_list = function(prop_list) { renderjson.options.property_list = prop_list;\n return renderjson; };\n // Backwards compatiblity. Use set_show_to_level() for new code.\n renderjson.set_show_by_default = function(show) { renderjson.options.show_to_level = show ? Number.MAX_VALUE : 0;\n return renderjson; };\n renderjson.options = {};\n renderjson.set_icons('⊕', '⊖');\n renderjson.set_show_by_default(false);\n renderjson.set_sort_objects(false);\n renderjson.set_max_string_length(\"none\");\n renderjson.set_replacer(void 0);\n renderjson.set_property_list(void 0);\n return renderjson;\n}));\n\n\n//# sourceURL=webpack://mongo-express/./node_modules/renderjson/renderjson.js?");
/***/ })
},
/******/ function(__webpack_require__) { // webpackRuntimeModules
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
/******/ __webpack_require__.O(0, ["codemirror"], function() { return __webpack_exec__("./lib/scripts/collection.js"); });
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ }
]);