Skip to content

Commit

Permalink
Fixed Issue #19 - Plain XML source
Browse files Browse the repository at this point in the history
  • Loading branch information
remie committed Sep 2, 2011
1 parent f8d21f9 commit 3b8b73d
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 2 deletions.
22 changes: 22 additions & 0 deletions assets/devkit.css
Expand Up @@ -53,6 +53,28 @@
#input input:focus {
background: hsl(210, 5%, 19%);
}

#type {
position: absolute;
background-color: #242628;
border-bottom: 1px solid #303335;
border-left: 1px solid #303335;
border-radius: 0 0 0 5px;
-moz-border-radius: 0 0 0 5px;
-webkit-border-radius: 0 0 0 5px;
text-align: center;
height: 25px;
top: 0;
right: 0;
width: 120px;
padding: 4px;
}

#type span {
color: #AEB2B6;
text-shadow: 2px 2px 3px #0C0C0D;
cursor: pointer;
}

#output {
background: hsl(80, 100%, 50%);
Expand Down
17 changes: 16 additions & 1 deletion assets/devkit.js
Expand Up @@ -558,6 +558,20 @@
source.bind('sessionupdate', self.refresh);
};

/*-----------------------------------------------------------------------------
Type Viewer:
-----------------------------------------------------------------------------*/

function TypeViewer(raw, source, session) {
var typeSelect = jQuery('#type');
typeSelect.bind('click',function() {
var currentLink = $('#jump ul li a.active').attr('href');
if(currentLink) {
window.location.href= currentLink.replace('?debug','?xml');
}
});
}

/*---------------------------------------------------------------------------*/

jQuery(document).ready(function() {
Expand All @@ -569,9 +583,10 @@
TagMatcher(source, session);
XPathMatcher(source, session);
LineHighlighter(source, session);
TypeViewer(source, session);

session.refresh();
}
});

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
5 changes: 4 additions & 1 deletion content/content.debug.php 100644 → 100755
Expand Up @@ -125,8 +125,11 @@ protected function appendSource($wrapper, $source, $language = 'xml') {
'div', $bitter->process($source)
);
$inner->setAttribute('id', 'source');

$wrapper->appendChild($inner);

$viewXML = new XMLElement('div',null,array('id'=>'type','class'=>'raw'));
$viewXML->appendChild(new XMLElement('span',__('View as XML')));
$wrapper->appendChild($viewXML);
}

protected function __buildParams($params) {
Expand Down
6 changes: 6 additions & 0 deletions extension.driver.php
Expand Up @@ -42,6 +42,12 @@ public function frontendDevKitResolve($context) {
$context['devkit'] = new Content_DebugDevKit_Debug();
self::$active = true;
}
if (false or isset($_GET['xml'])) {
require_once(EXTENSIONS . '/debugdevkit/content/content.xml.php');

$context['devkit'] = new Content_DebugDevKit_XML();
self::$active = true;
}
}

public function manipulateDevKitNavigation($context) {
Expand Down
Empty file modified lang/lang.de.php 100644 → 100755
Empty file.
Empty file modified lang/lang.nl.php 100644 → 100755
Empty file.
Empty file modified lang/lang.pt-br.php 100644 → 100755
Empty file.
Empty file modified lang/lang.ro.php 100644 → 100755
Empty file.
Empty file modified lang/lang.ru.php 100644 → 100755
Empty file.

0 comments on commit 3b8b73d

Please sign in to comment.