ohif-viewer/Packages/ohif-viewerbase/lib/helpers/prettyPrintStringify.js
Erik Ziegler ab4d4c9008 Work on refactoring measurements out of Lesion Tracker package
- Removed AssociatedStudies Collection
- Measurement API is generated from configuration files
- Data exchange methods are defined in configuration
2016-11-15 08:21:46 +01:00

20 lines
525 B
JavaScript

/**
* A global Blaze UI helper to Stringify a JavaScript object
*
* Credit to:
*
* http://stackoverflow.com/questions/1026069/capitalize-the-first-letter-of-string-in-javascript
*/
UI.registerHelper('prettyPrintStringify', function(context) {
if (!context) {
return;
}
var string = JSON.stringify(context, null, 2);
string = string.replace(/['"]+/g, '');
string = string.replace('{', '');
string = string.replace('}', '');
string = string.replace(',', '\n');
return string;
});