-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve rendering of large values in ValueEditor (#3675)
- Loading branch information
Showing
20 changed files
with
128 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file>fonts/OpenSans-Regular.ttf</file> | ||
<file>fonts/OpenSans.ttc</file> | ||
<file>fonts/Inconsolata-Regular.ttf</file> | ||
</qresource> | ||
</RCC> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
Based on: | ||
json-format v.1.1 | ||
http://github.com/phoboslab/json-format | ||
Released under MIT license: | ||
http://www.opensource.org/licenses/mit-license.php | ||
*/ | ||
|
||
var prettyPrint = function( json ) { | ||
var p = [] | ||
var out = "" | ||
var indent = 0; | ||
|
||
var push = function( m ) { return '\\' + p.push( m ) + '\\'; } | ||
var pop = function( m, i ) { return p[i-1] } | ||
var tabs = function( count ) { return new Array( count + 1 ).join( ' ' ); } | ||
|
||
// Extract backslashes and strings | ||
json = json | ||
.replace( /\\./g, push ) | ||
.replace( /(".*?"|'.*?')/g, push ) | ||
.replace( /\s+/, '' ); | ||
|
||
// Indent and insert newlines | ||
for( var i = 0; i < json.length; i++ ) { | ||
var c = json.charAt(i); | ||
|
||
switch(c) { | ||
case '{': | ||
case '[': | ||
out += c + "\n" + tabs(++indent); | ||
break; | ||
case '}': | ||
case ']': | ||
out += "\n" + tabs(--indent) + c; | ||
break; | ||
case ',': | ||
out += ",\n" + tabs(indent); | ||
break; | ||
case ':': | ||
out += ": "; | ||
break; | ||
default: | ||
out += c; | ||
break; | ||
} | ||
} | ||
|
||
// Strip whitespace from numeric arrays and put backslashes | ||
// and strings back in | ||
out = out | ||
.replace( /\[[\d,\s]+?\]/g, function(m){ return m.replace(/\s/g,''); } ) | ||
.replace( /\\(\d+)\\/g, pop ) // strings | ||
.replace( /\\(\d+)\\/g, pop ); // backslashes in strings | ||
|
||
return out; | ||
}; | ||
|
||
|
||
/*! | ||
Based on: | ||
* pretty-data - nodejs plugin to pretty-print or minify data in XML, JSON and CSS formats. | ||
* | ||
* Version - 0.40.0 | ||
* Copyright (c) 2012 Vadim Kiryukhin | ||
* vkiryukhin @ gmail.com | ||
* http://www.eslinstructor.net/pretty-data/ | ||
* Dual licensed under the MIT and GPL licenses | ||
*/ | ||
var minify = function(json) { | ||
|
||
return json.replace(/\s{0,}\{\s{0,}/g,"{") | ||
.replace(/\s{0,}\[$/g,"[") | ||
.replace(/\[\s{0,}/g,"[") | ||
.replace(/:\s{0,}\[/g,':[') | ||
.replace(/\s{0,}\}\s{0,}/g,"}") | ||
.replace(/\s{0,}\]\s{0,}/g,"]") | ||
.replace(/\"\s{0,}\,/g,'",') | ||
.replace(/\,\s{0,}\"/g,',"') | ||
.replace(/\"\s{0,}:/g,'":') | ||
.replace(/:\s{0,}\"/g,':"') | ||
.replace(/:\s{0,}\[/g,':[') | ||
.replace(/\,\s{0,}\[/g,',[') | ||
.replace(/\,\s{2,}/g,', ') | ||
.replace(/\]\s{0,},\s{0,}\[/g,'],['); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters