From 0fb1bb046294b6d1a302e6f0ff1bad0ac9369767 Mon Sep 17 00:00:00 2001
From: Timon Ostertun
Momentan kannst Du Dich leider nicht in der App registrieren.
').trim();
+ }
+ function createElem(type, className, css) {
+ if (!type) { return; }
+ var element = setCSS(document.createElement(type), css);
+ if (className) { element.className = options.baseClass + className; }
+ return setCSS(element, css);
+ }
+ function storeCommand(command) {
+ if (history) {
+ history.input.commands.push(encodeURI(command.trim()));
+ history.input.commandIdx = history.input.commands.length;
+ if (window.sessionStorage) { sessionStorage.setItem('mobileConsoleCommandHistory', JSON.stringify(history.input.commands)); }
+ }
+ }
+ function valBetween(val, min, max) {
+ return (Math.min(max, Math.max(min, val)));
+ }
+ function getMaxHeight() {
+ return valBetween(Math.floor((window.innerHeight || document.documentElement.clientHeight) * options.ratio), 55, 300);
+ }
+ function getClass(item) {
+ var returnVal = '';
+ if (item && item.constructor) {
+ returnVal = item.constructor.name;
+ } else {
+ returnVal = Object.prototype.toString.call(item);
+ }
+ return String(returnVal);
+ }
+
+ // elements
+ var elements = {
+ lines: [],
+ acItems: [],
+ base: createElem('div', 'base', {
+ boxSizing: 'border-box',
+ position: 'fixed',
+ resize: 'none',
+ fontSize: '12px',
+ lineHeight: '14px',
+ bottom: 0,
+ top: 'auto',
+ right: 0,
+ width: '100%',
+ zIndex: 10000,
+ padding: 0,
+ paddingBottom: options.browserinfo.isMobile ? '35px' : '25px',
+ margin: 0,
+ border: '0 none',
+ borderTop: '1px solid #808080',
+ backgroundColor: '#ffffff'
+ }),
+ topbar : createElem('div', 'topbar', {
+ boxSizing: 'border-box',
+ position: 'absolute',
+ height: '28px',
+ left: 0,
+ right: 0,
+ display: 'block',
+ padding: '0 2px',
+ overflow: 'hidden',
+ webkitOverflowScrolling: 'touch',
+ color: '#444444',
+ backgroundColor: '#f3f3f3',
+ border: '0 none',
+ borderTop: '1px solid #a3a3a3',
+ borderBottom: '1px solid #a3a3a3',
+ whiteSpace: 'nowrap',
+ overflowX: 'auto'
+ }),
+ scrollcontainer : createElem('div', 'scroller', {
+ boxSizing: 'border-box',
+ border: '0 none',
+ fontFamily: 'Consolas, monaco, monospace',
+ position: 'relative',
+ display: 'block',
+ height: getMaxHeight() + 'px',
+ overflow: 'auto',
+ webkitOverflowScrolling: 'touch',
+ '-webkit-transition': options.animParams,
+ '-moz-transition': options.animParams,
+ '-o-transition': options.animParams,
+ 'transition': options.animParams
+ }),
+ table : createElem('table', 'table', {
+ border: '0 none',
+ margin: 0,
+ position: 'relative',
+ tableLayout: 'auto',
+ width: '100%',
+ borderCollapse: 'collapse'
+ }),
+ stackTraceTable : createElem('table', 'stackTraceTable', {
+ border: '0 none',
+ margin: 0,
+ display: 'none',
+ marginLeft: '10px',
+ marginTop: options.browserinfo.isMobile ? '8px' : '4px',
+ tableLayout: 'auto',
+ maxWidth: '100%',
+ color: '#333333'
+ }),
+ tr : createElem('tr', 'table_row', {
+ verticalAlign: 'top'
+ }),
+ td : createElem('td', 'table_row', {
+ border: '0 none',
+ padding: '2px 4px',
+ verticalAlign: 'top'
+ }),
+ msgContainer : createElem('span', 'msgContainer', {
+ border: '0 none',
+ margin: 0,
+ display: 'inline',
+ overflow: 'hidden'
+ }),
+ tdLeft : createElem('td', 'table_row_data', {
+ border: '0 none',
+ textAlign: 'left',
+ padding: options.browserinfo.isMobile ? '8px 12px' : '4px 8px'
+ }),
+ tdRight : createElem('td', 'table_row_data', {
+ border: '0 none',
+ textAlign: 'left',
+ padding: options.browserinfo.isMobile ? '8px 12px' : '4px 8px',
+ whiteSpace: 'nowrap',
+ overflow: 'hidden'
+ }),
+ link : createElem('a', 'link', {
+ color: '#1155cc',
+ textDecoration: 'underline'
+ }),
+ dot : createElem('div', 'table_row_data_dot', {
+ display: 'inline',
+ borderRadius: '50%',
+ fontSize: '80%',
+ fontWeight: 'bold',
+ padding: '2px 5px',
+ textAlign: 'center',
+ marginRight: '5px',
+ backgroundColor: '#333333',
+ color: '#ffffff'
+ }),
+ button : createElem('button', 'button', {
+ display: 'inline-block',
+ fontFamily: '"Helvetica Neue",Helvetica,Arial,sans-serif',
+ fontWeight: 'normal',
+ textTransform: 'capitalize',
+ fontSize: '12px',
+ lineHeight: '26px',
+ height: '26px',
+ padding: '0 8px',
+ margin: 0,
+ textAlign: 'center',
+ marginRight: '5px',
+ border: '0 none',
+ backgroundColor: 'transparent',
+ color: 'inherit',
+ cursor: 'pointer'
+ }),
+ buttons : {
+ },
+ input : createElem('div', 'input', {
+ boxSizing: 'border-box',
+ height: options.browserinfo.isMobile ? '35px' : '29px',
+ fontFamily: 'Consolas, monaco, monospace',
+ position: 'absolute',
+ bottom: 0,
+ left: 0,
+ right: 0,
+ margin: 0,
+ border: '0 none',
+ borderTop: '1px solid #EEEEEE'
+ }),
+ gt : createElem('DIV', 'gt', {
+ position: 'absolute',
+ bottom: 0,
+ width: '25px',
+ lineHeight: options.browserinfo.isMobile ? '34px' : '28px',
+ height: options.browserinfo.isMobile ? '34px' : '28px',
+ textAlign: 'center',
+ fontSize: '16px',
+ fontFamily: 'Consolas, monaco, monospace',
+ fontWeight: 'bold',
+ color: '#3577B1',
+ zIndex: 2
+ }),
+ consoleinput : createElem('input', 'consoleinput', {
+ boxSizing: 'border-box',
+ position: 'absolute',
+ bottom: 0,
+ width : '100%',
+ fontSize: options.browserinfo.isMobile ? '16px' : 'inherit', //prevents ios safari's zoom on focus
+ fontFamily: 'Consolas, monaco, monospace',
+ paddingLeft: '25px',
+ margin: 0,
+ height: options.browserinfo.isMobile ? '35px' : '25px',
+ border: '0 none',
+ outline: 'none',
+ outlineWidth: 0,
+ boxShadow: 'none',
+ '-moz-appearance': 'none',
+ '-webkit-appearance': 'none',
+ backgroundColor: 'transparent',
+ color: '#000000',
+ zIndex: 1
+ }),
+ autocomplete : createElem('div', 'autocomplete', {
+ display: 'none',
+ position: 'absolute',
+ bottom: options.browserinfo.isMobile ? '35px' : '28px',
+ left: 0,
+ boxShadow: '1px 2px 5px rgba(0,0,0,0.1)',
+ color: '#000000',
+ backgroundColor: '#FFFFFF',
+ border: '1px solid #b5b5b5'
+ }),
+ autocompleteItem : createElem('a', 'autocompleteitem', {
+ display: 'block',
+ textDecoration: 'none',
+ fontSize: options.browserinfo.isMobile ? '16px' : 'inherit',
+ padding: '5px 8px',
+ wordWrap: 'break-word',
+ whiteSpace: 'nowrap'
+ }),
+ arrowUp: '',
+ arrowDown: '
',
+ arrowRight: '
'
+ };
+
+ //shared functions
+
+ var setLineStyle = (function () {
+ var lineStyles = function (style) {
+ switch (style) {
+ case 'log':
+ return {
+ text : {
+ borderBottom: '1px solid #DDDDDD',
+ color: '#000000'
+ },
+ dot : {
+ color: '#FFFFFF',
+ backgroundColor: '#8097bd'
+ }
+ };
+ case 'info':
+ return {
+ text : {
+ borderBottom: '1px solid #DDDDDD',
+ color: '#1f3dc4'
+ },
+ dot : {
+ color: '#FFFFFF',
+ backgroundColor: '#367AB4'
+ }
+ };
+ case 'warn':
+ return {
+ text : {
+ borderBottom: '1px solid #DDDDDD',
+ color: '#CE8724',
+ backgroundColor : '#fff6e0'
+ },
+ dot : {
+ color: '#FFFFFF',
+ backgroundColor: '#e8a400'
+ }
+ };
+ case 'error':
+ case 'table':
+ return {
+ text : {
+ borderBottom: '1px solid #DDDDDD',
+ color: '#FF0000',
+ backgroundColor : '#ffe5e5'
+ },
+ dot : {
+ color: '#FFFFFF',
+ backgroundColor: '#FF0000'
+ }
+ };
+ case 'assert':
+ return {
+ text : {
+ borderBottom: '1px solid #DDDDDD',
+ color: '#FF0000',
+ backgroundColor : '#ffe5e5'
+ },
+ dot : {
+ color: '#FFFFFF',
+ backgroundColor: '#FF0000'
+ }
+ };
+ case 'trace':
+ return {
+ text : {
+ borderBottom: '1px solid #DDDDDD',
+ color: '#000000'
+ },
+ dot : {
+ //will not happen
+ }
+ };
+ case 'time':
+ case 'timeEnd':
+ return {
+ text : {
+ borderBottom: '1px solid #DDDDDD',
+ color: '#0000ff'
+ },
+ dot : {
+ color: '#FFFFFF',
+ backgroundColor: '#0000ff'
+ }
+ };
+ default:
+ return {
+ text : {
+ borderBottom: '1px solid #DDDDDD',
+ color: '#000000'
+ },
+ dot : {
+ color: '#FFFFFF',
+ backgroundColor: '#8097bd'
+ }
+ };
+ }
+
+ };
+ var color, dot;
+
+ return function (element, type, msg) {
+ if (status.initialized) {
+ color = (typeof msg === 'undefined' || msg === htmlToString(messages.empty)) ? {color: '#808080'} : ((msg === htmlToString(messages.clear)) ? {color: '#808080', fontStyle: 'italic'} : (lineStyles(type) !== undefined ? lineStyles(type).text : lineStyles.log.text));
+ dot = typeof lineStyles(type) !== 'undefined' ? lineStyles(type).dot : lineStyles.log.dot;
+ setCSS(element, color);
+ //has dot?
+ if (element.childNodes[0].childNodes[0].className.indexOf('dot') !== -1) {
+ setCSS(element.childNodes[0].childNodes[0], lineStyles(type).dot);
+ }
+ }
+ };
+ }()),
+ getLink = function (href, textString) {
+ var HTMLurl = elements.link.cloneNode(false);
+ if (href) {
+ HTMLurl.setAttribute('href', href);
+ HTMLurl.setAttribute('target', '_blank');
+ }
+ HTMLurl.innerHTML = textString || href.split('\\').pop().split('/').filter(Boolean).pop();
+ return HTMLurl;
+ },
+ toggleHeight = function () {
+ if (status.initialized) {
+ var existingPadding = parseInt(document.body.style.paddingBottom, 10) - Math.abs(elements.base.offsetHeight + elements.topbar.offsetHeight);
+ var newHeight = (elements.base.minimized) ? getMaxHeight() + 'px' : '0px';
+ setCSS(elements.scrollcontainer, {
+ height: newHeight
+ });
+ setCSS(document.body, {
+ paddingBottom: existingPadding + Math.abs(parseInt(newHeight, 10) + elements.topbar.offsetHeight) + 'px'
+ });
+ elements.buttons.toggler.innerHTML = (elements.base.minimized) ? elements.arrowDown : elements.arrowUp;
+ elements.buttons.toggler.setAttribute('title', (elements.base.minimized) ? 'Minimize console' : 'Maximize console');
+ elements.base.minimized = !elements.base.minimized;
+ return elements.base.minimized;
+ }
+ return 'Not built!';
+ },
+ about = (function () {
+ return function () {
+ console.info(
+ '--==## Mobile Console ' + (status.initialized ? 'active' : 'inactive') + ' ##==--' + '\n' +
+ '--===============================--' + '\n' +
+ 'MobileConsole v' + options.version + ', running on ' + navigator.userAgent.toLowerCase()
+ );
+ };
+ }());
+
+ // --==** sub functions start here **==--
+
+ function displayConsole() {
+ elements.base.style.display = "block";
+ }
+
+ //initializes the console HTML element
+ function initConsoleElement() {
+ //reference
+ var ref;
+ //core
+ function toggleScroll() {
+ elements.scrollcontainer.scrollTop = elements.scrollcontainer.scrollHeight;
+ elements.scrollcontainer.scrollLeft = 0;
+ }
+ function destroyConsole() {
+ //conan the destroyer. Very basic; just removes the console element. mobileConsole will still 'pipe' console logging
+ //don't see any reason for now to reverse that.
+ /*elements.base.parentNode.removeChild(elements.base);
+ status.initialized = false;
+ console.warn(
+ '--==## Mobile Console DESTROYED ##==--' + '\n' +
+ 'To enable again: reload the page. Tip: use the minimize button instead of closing.'
+ );*/
+ elements.base.style.display = "none";
+ }
+ function assemble() {
+ var i = options.methods.length, key;
+
+ //add close button
+ elements.buttons.closer = elements.button.cloneNode(false);
+ elements.buttons.closer.innerHTML = '✕';
+ elements.buttons.closer.setAttribute('title', 'Close (destroy) console');
+ setCSS(elements.buttons.closer, { float: 'right', margin: '0'});
+ //add buttons
+ while (i--) {
+ elements.buttons[options.methods[i]] = elements.button.cloneNode(false);
+ elements.buttons[options.methods[i]].innerHTML = options.methods[i].charAt(0).toUpperCase() + options.methods[i].slice(1);
+ elements.buttons[options.methods[i]].setAttribute('title', (options.methods[i] !== 'clear') ? 'Toggle the display of ' + options.methods[i] + ' messages' : 'Clear the console');
+ }
+ //add min/maximize button
+ elements.buttons.toggler = elements.button.cloneNode(false);
+ elements.buttons.toggler.innerHTML = elements.arrowDown;
+ elements.buttons.toggler.setAttribute('title', 'Minimize console');
+
+ //assemble everything
+ for (key in elements.buttons) {
+ if (elements.buttons.hasOwnProperty(key)) {
+ elements.topbar.insertBefore(elements.buttons[key], elements.topbar.firstChild);
+ }
+ }
+ elements.scrollcontainer.appendChild(elements.table);
+
+ elements.base.appendChild(elements.topbar);
+ elements.base.appendChild(elements.scrollcontainer);
+
+ status.initialized = true;
+ return elements.base;
+ }
+ function attach(console) {
+ document.body.appendChild(console);
+ setCSS(elements.topbar, {
+ top: -Math.abs(elements.topbar.offsetHeight) + 'px'
+ });
+ var existingPadding = isNaN(parseInt(document.body.style.paddingBottom, 10)) ? 0 : parseInt(document.body.style.paddingBottom, 10);
+ setCSS(document.body, {
+ paddingBottom: existingPadding + Math.abs(console.offsetHeight + elements.topbar.offsetHeight) + 'px'
+ });
+ elements.scrollcontainer.scrollTop = elements.scrollcontainer.scrollHeight;
+
+ return elements.base;
+ }
+ function toggleLogType(e) {
+ var button = e.currentTarget || e.srcElement;
+ var logType = button.innerHTML.toLowerCase();
+ var elems = elements.lines[logType], i = elems.length;
+ button.toggled = (typeof button.toggled === 'undefined') ? true : !button.toggled;
+ setCSS(button, { opacity: (button.toggled) ? '0.5' : '' });
+ while (i--) {
+ setCSS(elems[i], { display: (button.toggled) ? 'none' : '' });
+ }
+ toggleScroll();
+ button.blur();
+ return button;
+ }
+ function setBinds() {
+ var methods = options.methods, i = methods.length;
+ while (i--) {
+ if (methods[i] !== 'clear') {
+ if (options.browserinfo.evtLstn) {
+ elements.buttons[methods[i]].addEventListener('click', toggleLogType, false);
+ } else {
+ elements.buttons[methods[i]].attachEvent('onclick', toggleLogType);
+ }
+ }
+ if (options.hideButtons.indexOf(methods[i]) !== -1) { //hide buttons that we don't want
+ setCSS(elements.buttons[methods[i]], { display: 'none' });
+ }
+ }
+ if (options.browserinfo.evtLstn) {
+ elements.buttons.toggler.addEventListener('click', toggleHeight, false);
+ elements.buttons.closer.addEventListener('click', destroyConsole, false);
+ elements.buttons.clear.addEventListener('click', console.clear, false);
+ } else {
+ elements.buttons.toggler.attachEvent('onclick', toggleHeight);
+ elements.buttons.closer.attachEvent('onclick', destroyConsole);
+ elements.buttons.clear.attachEvent('onclick', console.clear);
+ }
+ }
+ //init
+ function init() {
+ var element = assemble();
+ docReady(function () {
+ setBinds();
+ attach(element);
+ if (options.startMinimized) {
+ toggleHeight();
+ }
+ elements.base.style.display = "none";
+ });
+ //expose Public methods and variables
+ return {
+ toggleHeight : toggleHeight,
+ toggleScroll : toggleScroll,
+ destroy: destroyConsole
+ };
+ }
+ if (!ref) {
+ ref = init();
+ }
+ return ref;
+ }
+
+ //initializes the new console logger
+ function initConsole() {
+ //reference
+ var ref;
+ //sub helpers
+ function isEmpty(obj) {
+ for(var prop in obj) {
+ if(obj.hasOwnProperty(prop))
+ return false;
+ }
+ return JSON.stringify(obj) === JSON.stringify({});
+ }
+ function isElement(o) {
+ return (
+ typeof HTMLElement === 'object' ? o instanceof HTMLElement : //DOM2
+ o && typeof o === 'object' && o !== null && o.nodeType === 1 && typeof o.nodeName === 'string'
+ );
+ }
+ function objectToString(object) {
+ var prop, output = '';
+ if (!isElement(object)) {
+ for (prop in object) {
+ if (!object.hasOwnProperty(prop)) {
+ continue;
+ } else if (typeof (object[prop]) === 'object') {
+ output += prop + ((Array.isArray(object[prop])) ? ': Array(' + object[prop].length + ')' : ': {…}');
+ } else if (typeof (object[prop]) === 'function') {
+ output += 'func: f';
+ } else {
+ output += prop + ': "' + object[prop] + '"';
+ }
+ output += ', ';
+ }
+ return '{' + output.slice(0, -2) + '}'; // returns cleaned up JSON
+ }
+ return htmlToString(object.outerHTML);
+ }
+ function urlFromString(string) {
+ string = String(string);
+ //searches for url in string, returns url as string
+ var match, uriPattern = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/ig;
+ try {
+ match = string.match(uriPattern)[0];
+ return match;
+ } catch (e) {
+ return '';
+ }
+ }
+ function filterOut(array, match) {
+ return array.filter(function(item){
+ return typeof item === 'string' && item.indexOf(match) === -1;
+ });
+ }
+ function preFilterTrace(array) {
+ var newArray = array.split('\n').filter(Boolean), //filter cleans out empty values
+ isCommandLine = false, stealthThese, i;
+ if (newArray[0].indexOf('http') === -1) { newArray.shift(); } //remove first line if contains no 'http' (Chrome starts with 'Error', Firefox doesn't..)
+ if (newArray[0].indexOf('console.') !== -1 || newArray[0].indexOf('console[method]') !== -1) { newArray.shift(); }
+ if (newArray.length > 0) {
+ isCommandLine = newArray[newArray.length - 1].indexOf('keydown') !== -1;
+ newArray = newArray.filter(function(item){ return item !== ''; });
+
+ if (isCommandLine) {
+ stealthThese = ['submitCommand', 'eval', 'setBinds', 'interceptConsole', 'newConsole'];
+ newArray.pop(); //remove last index, as it is the keydown event.
+ i = stealthThese.length;
+ while(i--) {
+ newArray = filterOut(newArray, stealthThese[i]);
+ }
+ }
+ }
+ if (isCommandLine || newArray.length === 0) {
+ newArray.push('(anonymous function) console:1:1');
+ }
+ return newArray;
+ }
+ //core
+ function formatStackTrace(trace, origtrace) {
+ var callStack = [];
+ //original stack is hidden inside trace object, if specified
+ var stackTraceOrig = (typeof trace !== 'undefined' && typeof trace[4] !== 'undefined') ? trace[4].stack : undefined;
+ //if the first line contains this, skip it. Meant for browsers that begin the stack with the error message itself (already captured before formatStackTrace)
+ var traceToProcess = (origtrace && origtrace !== '') ? origtrace : stackTraceOrig,
+ i,
+ lines,
+ url,
+ txt,
+ thisLine,
+ lineAndColumn,
+ caller,
+ separator = options.browserinfo.ffox ? '@' : '()';
+
+ //stop if no source trace can be determined
+ if (!traceToProcess) { return; }
+
+ lines = preFilterTrace(traceToProcess); //pre filters all lines by filtering out all mobileConsole's own methods so mobileConsole runs Stealth and unobtrusive
+ i = lines.length;
+ while (i--) {
+ thisLine = lines[i].trim();
+ lineAndColumn = thisLine.match(/(?::)(\d+)(?::)(\d+)/);
+ url = urlFromString(thisLine).replace(lineAndColumn[0], '').split('#')[0] || '';
+ caller = htmlToString(thisLine.replace(urlFromString(thisLine), '').replace(separator, '').replace('at ', '').trim());
+ if (caller === '' || caller === lineAndColumn[0]) { continue; }
+ if (url[url.length - 1] === '/') {
+ txt = '(index)';
+ } else {
+ txt = url.split('\\').pop().split('/').filter(Boolean).pop() || caller;
+ }
+ callStack.push({
+ caller: caller,
+ url: url ? url.split(':')[0] + ':' + url.split(':')[1] : caller,
+ linkText: txt + lineAndColumn[0],
+ line: lineAndColumn[1],
+ col: lineAndColumn[2],
+ originalLine: thisLine
+ });
+ }
+ return callStack;
+ }
+ function traceToTable(table, trace) {
+ var i, tdLeft, tdRight, tr;
+ if (typeof trace === 'undefined') {
+ return;
+ }
+ trace.reverse(); //reverse order of trace, just like in a browser's console
+ i = trace.length;
+ while (i--) {
+ tdLeft = elements.td.cloneNode(false);
+ tdRight = elements.td.cloneNode(false);
+ tr = elements.tr.cloneNode(false);
+ tdLeft.innerHTML = trace[i].caller;
+ tdRight.innerHTML = ' @ ';
+ tdRight.appendChild(getLink((trace[i].url || ''), trace[i].linkText));
+ tr.appendChild(tdLeft);
+ tr.appendChild(tdRight);
+ table.insertBefore(tr, table.firstChild);
+ }
+ return table;
+ }
+ function colorizeData(key, value) {
+ var valueColor = '#3c53da', keyColor = '#ae33b7', classname = getClass(value);
+ if (value && classname.indexOf('HTML') !== -1) {
+ value = htmlToString(value.outerHTML);
+ valueColor = '#ad8200';
+ } else if (key === 'innerHTML' || key === 'outerHTML') {
+ value = htmlToString(value);
+ valueColor = '#ad8200';
+ }
+ if (typeof value === 'string') {
+ valueColor = '#c54300';
+ if (value.length > options.truncate) {
+ value = '"' + String(value).substring(0, options.truncate) + '" [...]
Note: string was truncated to ' + options.truncate + ' chars';
+ } else {
+ value = '"' + value + '"';
+ }
+ } else if (value === null) {
+ valueColor = '#808080';
+ value = 'null';
+ } else if (typeof value === 'undefined' || value === undefined) {
+ valueColor = '#808080';
+ value = 'undefined';
+ } else if (typeof value === 'object') {
+ if (isEmpty(value)) {
+ value = '{}';
+ } else {
+ valueColor = '';
+ //iterate over object to create another table inside
+ var tempTable = createElem('table', 'stackTraceSubTable', {
+ border: '0 none',
+ margin: 0,
+ display: 'none',
+ marginLeft: '10px',
+ marginTop: options.browserinfo.isMobile ? '8px' : '4px',
+ tableLayout: 'auto',
+ maxWidth: '100%',
+ color: '#333333'
+ }),
+ wrap = document.createElement('div');
+ wrap.appendChild(objectToTable(tempTable, value).cloneNode(true));
+ if (Array.isArray(value)) {
+ value = 'Array(' + value.length + ')' + wrap.innerHTML;
+ } else {
+ value = wrap.innerHTML;
+ }
+ }
+ }
+
+ return '' + key + ': ' + value + '';
+ }
+ function objectToTable(table, object) {
+ var i, tdLeft, tr;
+ if (isElement(object)){
+ tdLeft = elements.td.cloneNode(false); tr = elements.tr.cloneNode(false);
+ tdLeft.innerHTML = htmlToString(object.outerHTML);
+ tr.appendChild(tdLeft);
+ table.appendChild(tr);
+ } else {
+ for (i in object) {
+ if (object.hasOwnProperty(i)) {
+ tdLeft = elements.td.cloneNode(false); tr = elements.tr.cloneNode(false);
+ tdLeft.innerHTML = colorizeData(i, object[i]);
+ tr.appendChild(tdLeft);
+ table.appendChild(tr);
+ }
+ }
+ }
+ return table;
+ }
+ function toggleDetails(e) {
+ var button = e.currentTarget || e.srcElement, i, hidden;
+ if (button.getAttribute('toggles') === 'table') {
+ var tables = button.parentElement.getElementsByTagName('table');
+ i = tables.length;
+ while (i--) {
+ hidden = (tables[i].currentStyle ? tables[i].currentStyle.display : window.getComputedStyle(tables[i], null).display) === 'none';
+ button.innerHTML = button.innerHTML.replace((hidden ? elements.arrowRight : elements.arrowDown), (hidden ? elements.arrowDown : elements.arrowRight));
+ setCSS(tables[i], { display: hidden ? 'table' : 'none' });
+ }
+ }
+ }
+ function isRepeat(message, method) {
+ return (history.output.prevMsg === message && history.output.prevMethod === method) && (typeof message !== 'object') && (method !== 'trace') && (method !== 'group') && (method !== 'groupCollapsed') && (method !== 'groupEnd');
+ }
+ function newConsole() {
+ try {
+ //get arguments, set vars
+ var method = arguments[0], className, isHTMLElement,
+ message = (typeof arguments[1].newMessage !== 'undefined') ? arguments[1].newMessage : undefined,
+ stackTrace = (typeof arguments[1].newStackTrace !== 'undefined') ? arguments[1].newStackTrace : undefined;
+
+ //if message emtpy or undefined, show empty message-message
+ if (message === '' || typeof message === 'undefined' || message === undefined) { message = messages.empty; }
+
+ if (isRepeat(message, method) && method.indexOf('time') === -1) {
+ // up the counter and add the dot
+ history.output.counter = history.output.counter + 1;
+ elements.table.lastChild.countDot = elements.table.lastChild.countDot || elements.dot.cloneNode(false);
+ elements.table.lastChild.firstChild.insertBefore(elements.table.lastChild.countDot, elements.table.lastChild.firstChild.firstChild).innerHTML = history.output.counter;
+ setLineStyle(elements.table.lastChild, method, message);
+ } else {
+ history.output.prevMsg = message;
+ history.output.prevMethod = method;
+ history.output.counter = 1;
+
+ //an object requires some more handling
+ if (typeof message === 'object' && method !== 'assert' && method !== 'timeEnd') {
+ message = isElement(message) ?
+ htmlToString(message.outerHTML.match(/<(.*?)>/g)[0] + '...' + message.outerHTML.match(/<(.*?)>/g).pop()) : //gets e.g.
Das ist aber kein Problem, registriere Dich einfach kostenlos auf unserer Website!
-
Du kannst Dich danach in dieser App anmelden.
@@ -289,8 +294,8 @@Eine neue Version unserer App ist verfügbar. Keine Sorge, Du musst nichts machen. Wir aktuallisieren den Inhalt in wenigen Sekunden. -
+ UpdateDie App wird neu laden und das Update ist abgeschlossen.
- \ No newline at end of file + diff --git a/server/page/wrapper.php b/server/page/wrapper.php index 7eca108..352537b 100644 --- a/server/page/wrapper.php +++ b/server/page/wrapper.php @@ -1,7 +1,8 @@ - + + @@ -16,36 +17,36 @@ - + - +