@@ -473,15 +473,15 @@ function xpathHasClass(className) {
473
473
return this.current();
474
474
}
475
475
this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : 0;
476
-
476
+
477
477
return this.current();
478
478
},
479
479
previous: function () {
480
480
if (this.isEmpty()) {
481
481
return this.current();
482
482
}
483
483
this.idx = this.idx > 0 ? this.idx - 1 : (this.nodes.length - 1);
484
-
484
+
485
485
return this.current();
486
486
},
487
487
isEmpty: function () {
@@ -565,11 +565,11 @@ function showCurrent(state)
565
565
"sf-dump-protected",
566
566
"sf-dump-private",
567
567
].map(xpathHasClass).join(' or ');
568
-
568
+
569
569
var xpathResult = doc.evaluate('.//span[' + classMatches + '][contains(translate(child::text(), ' + xpathString(searchQuery.toUpperCase()) + ', ' + xpathString(searchQuery.toLowerCase()) + '), ' + xpathString(searchQuery.toLowerCase()) + ')]', root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
570
570
571
571
while (node = xpathResult.iterateNext()) state.nodes.push(node);
572
-
572
+
573
573
showCurrent(state);
574
574
}, 400);
575
575
});
@@ -596,7 +596,7 @@ function showCurrent(state)
596
596
*/
597
597
return;
598
598
}
599
-
599
+
600
600
e.preventDefault();
601
601
search.className = search.className.replace(/\bsf-dump-search-hidden\b/, '');
602
602
searchInput.focus();
@@ -792,6 +792,25 @@ function showCurrent(state)
792
792
return $ this ->dumpHeader = preg_replace ('/\s+/ ' , ' ' , $ line ).'</style> ' .$ this ->dumpHeader ;
793
793
}
794
794
795
+ /**
796
+ * {@inheritdoc}
797
+ */
798
+ public function dumpString (Cursor $ cursor , $ str , $ bin , $ cut )
799
+ {
800
+ if (isset ($ cursor ->attr ['img-data ' ], $ cursor ->attr ['content-type ' ])) {
801
+ $ this ->line .= '<span> ' ;
802
+ $ this ->dumpKey ($ cursor );
803
+ // we can not do fancy CSS here since we are in a <pre>
804
+ $ this ->line .= "\n" ;
805
+ $ this ->line .= str_repeat (' ' , $ cursor ->depth + \strlen ('image: ' ));
806
+ $ this ->line .= sprintf ('<img style="max-width:50em;max-height:50em;"src="data:%s;base64,%s" /> ' , $ cursor ->attr ['content-type ' ], base64_encode ($ cursor ->attr ['img-data ' ]));
807
+ $ this ->endValue ($ cursor );
808
+ $ this ->line .= '</span> ' ;
809
+ } else {
810
+ parent ::dumpString ($ cursor , $ str , $ bin , $ cut );
811
+ }
812
+ }
813
+
795
814
/**
796
815
* {@inheritdoc}
797
816
*/
0 commit comments