Revision e05d8d9c

View differences:

src/sunstone/public/css/application.css
372 372

  
373 373

  
374 374
.info_table td{
375
	border-bottom: 1px solid #CCCCCC;
376
	color: #353735;
377
	padding: 6px 8px;
378
	}
375
    border-bottom: 1px solid #CCCCCC;
376
    color: #353735;
377
    padding-top: 6px;
378
    padding-bottom: 6px;
379
    padding-left: 8px;
380
    padding-right: 8px;
381
    }
379 382

  
380 383

  
381 384
.info_table td.key_td{
src/sunstone/public/js/sunstone-util.js
190 190
// Returns an HTML string with the json keys and values in the form
191 191
// key: value<br />
192 192
// It recursively explores objects
193
function prettyPrintJSON(template_json,padding,weight, border_bottom){
193
function prettyPrintJSON(template_json,padding,weight, border_bottom,padding_top_bottom){
194 194
    var str = ""
195 195
    if (!padding) {padding=0};
196 196
    if (!weight) {weight="bold";}
197 197
    if (!border_bottom) {border_bottom = "1px solid #CCCCCC";}
198
    if (!padding_top_bottom) {padding_top_bottom=6;}
198 199

  
199 200
    for (field in template_json) {
200 201
        if (typeof template_json[field] == 'object'){
201
            str += '<tr><td class="key_td" style="padding-left:'+padding+'px;font-weight:'+weight+';border-bottom:'+border_bottom+'">'+field+'</td><td class="value_td" style="border-bottom:'+border_bottom+'"></td></tr>';
202
            str += prettyPrintJSON(template_json[field],padding+25,"normal","0") + '<tr><td class="key_td" style="padding-left:'+(padding+10)+'px"></td><td class="value_td"></td></tr>';
202
            //name of field row
203
            str += '<tr>\
204
                <td class="key_td" style=\
205
                    "padding-left:'+padding+'px;\
206
                    font-weight:'+weight+';\
207
                    border-bottom:'+border_bottom+';\
208
                    padding-top:'+padding_top_bottom+'px;\
209
                    padding-bottom:'+padding_top_bottom+'px;">'
210
                    +field+
211
                '</td>\
212
                <td class="value_td" style=\
213
                    "border-bottom:'+border_bottom+';\
214
                    padding-top:'+padding_top_bottom+'px;\
215
                    padding-bottom:'+padding_top_bottom+'px">\
216
                </td>\
217
                </tr>';
218
            //attributes rows
219
            //empty row - prettyprint - empty row
220
            str += '<tr>\
221
                <td class="key_td" style="border-bottom:0"></td>\
222
                <td class="value_td" style="border-bottom:0"></td>\
223
                </tr>' + 
224
                prettyPrintJSON(template_json[field],padding+25,"normal","0",1) + 
225
                '<tr>\
226
                    <td class="key_td"></td>\
227
                    <td class="value_td"></td>\
228
                </tr>';
203 229
        } else {
204
            str += '<tr><td class="key_td" style="padding-left:'+padding+'px;font-weight:'+weight+';border-bottom:'+border_bottom+'">'+field+'</td><td class="value_td" style="border-bottom:'+border_bottom+'">'+template_json[field]+'</td></tr>';
230
            str += '<tr>\
231
                <td class="key_td" style="\
232
                    padding-left:'+padding+'px;\
233
                    font-weight:'+weight+';\
234
                    border-bottom:'+border_bottom+';\
235
                    padding-top:'+padding_top_bottom+'px;\
236
                    padding-bottom:'+padding_top_bottom+'px">'+
237
                    field+
238
                '</td>\
239
                <td class="value_td" style="\
240
                    border-bottom:'+border_bottom+';\
241
                    padding-top:'+padding_top_bottom+'px;\
242
                    padding-bottom:'+padding_top_bottom+'px">'+
243
                    template_json[field]+
244
                '</td>\
245
            </tr>';
205 246
        };
206 247
    };
207 248
    return str;

Also available in: Unified diff