Skip to content

Commit 4dd1cb0

Browse files
committed
Fixing issue #19 - Changed to ?debug=raw
1 parent 2d4b461 commit 4dd1cb0

4 files changed

Lines changed: 11 additions & 63 deletions

File tree

assets/devkit.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -557,20 +557,6 @@
557557

558558
source.bind('sessionupdate', self.refresh);
559559
};
560-
561-
/*-----------------------------------------------------------------------------
562-
Type Viewer:
563-
-----------------------------------------------------------------------------*/
564-
565-
function TypeViewer(raw, source, session) {
566-
var typeSelect = jQuery('#type');
567-
typeSelect.bind('click',function() {
568-
var currentLink = $('#jump ul li a.active').attr('href');
569-
if(currentLink) {
570-
window.location.href= currentLink.replace('?debug','?xml');
571-
}
572-
});
573-
}
574560

575561
/*---------------------------------------------------------------------------*/
576562

@@ -583,7 +569,6 @@
583569
TagMatcher(source, session);
584570
XPathMatcher(source, session);
585571
LineHighlighter(source, session);
586-
TypeViewer(source, session);
587572

588573
session.refresh();
589574
}

content/content.debug.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ public function buildContent($wrapper) {
100100
} else if ($this->_view == 'result') {
101101
$this->appendSource($wrapper, $this->_output, 'xml');
102102

103+
} else if ($this->_view == 'raw') {
104+
header('Content-Type: application/xml');
105+
echo $this->_xml;
106+
die();
107+
103108
} else {
104109
if ($_GET['debug'] == $this->__relativePath($this->_pagedata['filelocation'])) {
105110
$this->appendSource($wrapper, @file_get_contents($this->_pagedata['filelocation']), 'xsl');
@@ -127,9 +132,12 @@ protected function appendSource($wrapper, $source, $language = 'xml') {
127132
$inner->setAttribute('id', 'source');
128133
$wrapper->appendChild($inner);
129134

130-
$viewXML = new XMLElement('div',null,array('id'=>'type','class'=>'raw'));
131-
$viewXML->appendChild(new XMLElement('span',__('View as XML')));
132-
$wrapper->appendChild($viewXML);
135+
if($this->_view == 'xml') {
136+
$viewRaw = Widget::Anchor('','?debug=raw');
137+
$viewRaw->setAttribute('id', 'type');
138+
$viewRaw->appendChild(new XMLElement('span',__('Plain XML')));
139+
$wrapper->appendChild($viewRaw);
140+
}
133141
}
134142

135143
protected function __buildParams($params) {

content/content.xml.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

extension.driver.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ public function frontendDevKitResolve($context) {
4242
$context['devkit'] = new Content_DebugDevKit_Debug();
4343
self::$active = true;
4444
}
45-
if (false or isset($_GET['xml'])) {
46-
require_once(EXTENSIONS . '/debugdevkit/content/content.xml.php');
47-
48-
$context['devkit'] = new Content_DebugDevKit_XML();
49-
self::$active = true;
50-
}
5145
}
5246

5347
public function manipulateDevKitNavigation($context) {

0 commit comments

Comments
 (0)