All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.xceptance.xlt.engine.resultbrowser.assets.js.jsonview.js Maven / Gradle / Ivy

Go to download

XLT (Xceptance LoadTest) is an extensive load and performance test tool developed and maintained by Xceptance.

There is a newer version: 8.1.0
Show newest version
/**
 * Inspired by the json-view library (https://github.com/pgrabovets/json-view)
 * created by Pavel Grabovets and published under ISC license.
 *
 * ISC License
 *
 * Copyright (c) 2018, Pavel Grabovets
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
!function(){"use strict";function TreeNode(){function findAndMarkMatches(value,elem,searchPhrase,searchState){var empty=0==searchPhrase.length,escapedSearchPhrase=function(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(searchPhrase),regex=searchState.ignoreCase?new RegExp(escapedSearchPhrase,"i"):new RegExp(escapedSearchPhrase),found=!empty&&-1!=value.search(regex),index=0;if(found){for(;elem.firstChild;)elem.removeChild(elem.lastChild);value.split(regex).forEach(function(part,i){if(0!=i){var span=createElement("span",{className:"json-match",content:value.substr(index,searchPhrase.length)});elem.appendChild(span),searchState.matches.push(span),index+=searchPhrase.length}var text=document.createTextNode(part);elem.appendChild(text),index+=part.length})}else elem.textContent=value;return empty||found}this.parent=null,this.key=null,this.value=null,this.type=null,this.expanded=!1,this.children=null,this.elem=null,this.depth=0,this.isLeaf=function(){return null!==this.value},this.hasChildren=function(){return null!==this.children&&0




© 2015 - 2024 Weber Informatics LLC | Privacy Policy