Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/var-dumper/Dumper/HtmlDumper.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children | c2387f117808 |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
371 len = t.length; | 371 len = t.length; |
372 | 372 |
373 for (i = 0; i < len; ++i) { | 373 for (i = 0; i < len; ++i) { |
374 elt = t[i]; | 374 elt = t[i]; |
375 if ('SAMP' == elt.tagName) { | 375 if ('SAMP' == elt.tagName) { |
376 elt.className = 'sf-dump-expanded'; | |
377 a = elt.previousSibling || {}; | 376 a = elt.previousSibling || {}; |
378 if ('A' != a.tagName) { | 377 if ('A' != a.tagName) { |
379 a = doc.createElement('A'); | 378 a = doc.createElement('A'); |
380 a.className = 'sf-dump-ref'; | 379 a.className = 'sf-dump-ref'; |
381 elt.parentNode.insertBefore(a, elt); | 380 elt.parentNode.insertBefore(a, elt); |
389 x = 1; | 388 x = 1; |
390 if ('sf-dump' != elt.parentNode.className) { | 389 if ('sf-dump' != elt.parentNode.className) { |
391 x += elt.parentNode.getAttribute('data-depth')/1; | 390 x += elt.parentNode.getAttribute('data-depth')/1; |
392 } | 391 } |
393 elt.setAttribute('data-depth', x); | 392 elt.setAttribute('data-depth', x); |
394 if (x > options.maxDepth) { | 393 var className = elt.className; |
394 elt.className = 'sf-dump-expanded'; | |
395 if (className ? 'sf-dump-expanded' !== className : (x > options.maxDepth)) { | |
395 toggle(a); | 396 toggle(a); |
396 } | 397 } |
397 } else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) { | 398 } else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) { |
398 a = a.substr(1); | 399 a = a.substr(1); |
399 elt.className += ' '+a; | 400 elt.className += ' '+a; |
431 SearchState.prototype = { | 432 SearchState.prototype = { |
432 next: function () { | 433 next: function () { |
433 if (this.isEmpty()) { | 434 if (this.isEmpty()) { |
434 return this.current(); | 435 return this.current(); |
435 } | 436 } |
436 this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : this.idx; | 437 this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : 0; |
437 | 438 |
438 return this.current(); | 439 return this.current(); |
439 }, | 440 }, |
440 previous: function () { | 441 previous: function () { |
441 if (this.isEmpty()) { | 442 if (this.isEmpty()) { |
442 return this.current(); | 443 return this.current(); |
443 } | 444 } |
444 this.idx = this.idx > 0 ? this.idx - 1 : this.idx; | 445 this.idx = this.idx > 0 ? this.idx - 1 : (this.nodes.length - 1); |
445 | 446 |
446 return this.current(); | 447 return this.current(); |
447 }, | 448 }, |
448 isEmpty: function () { | 449 isEmpty: function () { |
449 return 0 === this.count(); | 450 return 0 === this.count(); |
513 counter.textContent = '0 of 0'; | 514 counter.textContent = '0 of 0'; |
514 | 515 |
515 return; | 516 return; |
516 } | 517 } |
517 | 518 |
518 var xpathResult = doc.evaluate('//pre[@id="' + root.id + '"]//span[@class="sf-dump-str" or @class="sf-dump-key" or @class="sf-dump-public" or @class="sf-dump-protected" or @class="sf-dump-private"][contains(child::text(), ' + xpathString(searchQuery) + ')]', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); | 519 var xpathResult = doc.evaluate('//pre[@id="' + root.id + '"]//span[@class="sf-dump-str" or @class="sf-dump-key" or @class="sf-dump-public" or @class="sf-dump-protected" or @class="sf-dump-private"][contains(translate(child::text(), ' + xpathString(searchQuery.toUpperCase()) + ', ' + xpathString(searchQuery.toLowerCase()) + '), ' + xpathString(searchQuery.toLowerCase()) + ')]', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); |
519 | 520 |
520 while (node = xpathResult.iterateNext()) state.nodes.push(node); | 521 while (node = xpathResult.iterateNext()) state.nodes.push(node); |
521 | 522 |
522 showCurrent(state); | 523 showCurrent(state); |
523 }, 400); | 524 }, 400); |
733 */ | 734 */ |
734 public function enterHash(Cursor $cursor, $type, $class, $hasChild) | 735 public function enterHash(Cursor $cursor, $type, $class, $hasChild) |
735 { | 736 { |
736 parent::enterHash($cursor, $type, $class, false); | 737 parent::enterHash($cursor, $type, $class, false); |
737 | 738 |
739 if ($cursor->skipChildren) { | |
740 $cursor->skipChildren = false; | |
741 $eol = ' class=sf-dump-compact>'; | |
742 } elseif ($this->expandNextHash) { | |
743 $this->expandNextHash = false; | |
744 $eol = ' class=sf-dump-expanded>'; | |
745 } else { | |
746 $eol = '>'; | |
747 } | |
748 | |
738 if ($hasChild) { | 749 if ($hasChild) { |
750 $this->line .= '<samp'; | |
739 if ($cursor->refIndex) { | 751 if ($cursor->refIndex) { |
740 $r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2; | 752 $r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2; |
741 $r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex; | 753 $r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex; |
742 | 754 |
743 $this->line .= sprintf('<samp id=%s-ref%s>', $this->dumpId, $r); | 755 $this->line .= sprintf(' id=%s-ref%s', $this->dumpId, $r); |
744 } else { | 756 } |
745 $this->line .= '<samp>'; | 757 $this->line .= $eol; |
746 } | |
747 $this->dumpLine($cursor->depth); | 758 $this->dumpLine($cursor->depth); |
748 } | 759 } |
749 } | 760 } |
750 | 761 |
751 /** | 762 /** |
826 | 837 |
827 if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], isset($attr['line']) ? $attr['line'] : 0)) { | 838 if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], isset($attr['line']) ? $attr['line'] : 0)) { |
828 $attr['href'] = $href; | 839 $attr['href'] = $href; |
829 } | 840 } |
830 if (isset($attr['href'])) { | 841 if (isset($attr['href'])) { |
831 $v = sprintf('<a href="%s" target="_blank" rel="noopener noreferrer">%s</a>', esc($this->utf8Encode($attr['href'])), $v); | 842 $target = isset($attr['file']) ? '' : ' target="_blank"'; |
843 $v = sprintf('<a href="%s"%s rel="noopener noreferrer">%s</a>', esc($this->utf8Encode($attr['href'])), $target, $v); | |
832 } | 844 } |
833 if (isset($attr['lang'])) { | 845 if (isset($attr['lang'])) { |
834 $v = sprintf('<code class="%s">%s</code>', esc($attr['lang']), $v); | 846 $v = sprintf('<code class="%s">%s</code>', esc($attr['lang']), $v); |
835 } | 847 } |
836 | 848 |