form-cheatsheet/js/index.min.js.map

1 line
42 KiB
Plaintext
Raw Normal View History

2016-10-10 12:02:31 -04:00
{"version":3,"file":null,"sources":["../src/functions.js","../src/DlHighlight/highlight-xml-html.js","../src/doc.js","../src/format.js","../src/form-elements-each.js","../src/index.js"],"sourcesContent":["/**\n * Helper functions\n */\n\nimport DlHighlight from './DlHighlight/highlight-xml-html';\n\n/**\n * Returns the final segment of a string split by the specified\n * separator character(s)\n *\n * @param {string} str\n * @param {string} separator\n * @returns {string}\n */\nexport function basename(str, separator=\"/\") {\n\treturn str.substr(str.lastIndexOf(separator) + 1);\n}\n\n/**\n * Do multiple string replacements with a mapping array\n *\n * @param {string} str - The string to modify\n * @param {string[][]} replacements - map [search, replacement]\n * @return {string}\n */\nexport function replaceMultiple(str, replacements) {\n\tlet output = str;\n\n\treplacements.forEach(pair => {\n\t\toutput = output.replace(pair[0], pair[1]);\n\t});\n\n\treturn output;\n}\n\n/**\n * Highlight HTML code\n *\n * @param {string} html\n * @return {string}\n */\nexport function highlightHtml(html) {\n\treturn (new DlHighlight({lang: 'html'})).doItNow(html);\n}\n\n/**\n * Function : dump()\n * Arguments: The data - array,hash(associative array),object\n * The level - OPTIONAL\n * Returns : The textual representation of the array.\n * This function was inspired by the print_r function of PHP.\n * This will accept some data as the argument and return a\n * text that will be a more readable version of the\n * array/hash/object that is given.\n * Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php\n */\nexport function dump(arr, level = 0) {\n\tlet dumped_text = \"\";\n\n\t//The padding given at the beginning of the line.\n\tlet level_padding = \"\";\n\tfor(let j=0;j<level+1;j++) level_padding += \" \";\n\n\tif(typeof(arr) == 'object') { //Array/Hashes/Objects\n\t\tfor(let item in arr) {\n\t\t\tconst value = arr[item];\n\n\t\t\tif(typeof(value) == 'object') { //If it is an array,\n\t\t\t\tdumped_text += level_padding + \"'\" + item + \"' ...\\n\";\n\t\t\t\tdumped_text += dump(value,level+1);\n\t\t\t} else {\n\t\t\t\tdumped_text += level_padding + \"'\" + item + \"' => \\\"\" + value + \"\\\"\\n\";\n\t\t\t}\n\t\t}\n\t} else { //Stings/Chars/Numbers etc.\n\t\tdumped_text = \"===>\"+arr+\"<===(\"+typeof(arr)+\")\";\n\t}\n\treturn dumped_text;\n}\n\n/**\n * Default export map\n */\nexport default {\n\tbasename: basename,\n\tdump: dump,\n\thighlightHtml: highlightHtml,\n\treplaceMultiple: replaceMultiple\n};","/**************\\\n * ____ _____\n * DlHighlight -- a JavaScript-based syntax highlighting engine. \\ /_ / /\n * \\ / / /\n * Author: Mihai Bazon, http://mihai.bazon.net/blog \\/ /_ /\n * Copyright: (c) Dynarch.com 2007. All rights reserved. \\ / /\n * http://www.dynarch.com/ / /\n * \\/\n *\n * This program is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License as published by the Free\n * Software Foundation; either version 2 of the License, or (at your option)\n * any later version.\n *\n * This program is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n * more details.\n *\n * You should have received a copy of the GNU General Public License along\n * with this program; if not, write to the Free Software Foundation, Inc., 51\n * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n *\n \\******************************************************************************/\n\n\n/*\n *\n * This thing only cares to colorize a piece of text. It has nothing to do\n * with the DOM, with reading existing text fr