update API dialog (first pass)
This commit is contained in:
parent
c8e0866093
commit
094dc97236
1 changed files with 12 additions and 21 deletions
|
@ -169,35 +169,26 @@ pandora.ui.apiDialog = function() {
|
||||||
if (id && actions[id]) {
|
if (id && actions[id]) {
|
||||||
$text.html('<h1><b>' + id + '</b><h1><br>');
|
$text.html('<h1><b>' + id + '</b><h1><br>');
|
||||||
var code = actions[id].code[1],
|
var code = actions[id].code[1],
|
||||||
f = actions[id].code[0],
|
source = actions[id].code[0],
|
||||||
line = Math.round(Ox.last(f.split(':')) || 0),
|
line = Math.round(Ox.last(source.split(':')) || 0),
|
||||||
doc = actions[id].doc.replace('/\n/<br>\n/g'),
|
doc = actions[id].doc.replace('/\n/<br>\n/g'),
|
||||||
$code, $doc;
|
$code, $doc;
|
||||||
|
|
||||||
$doc = Ox.SyntaxHighlighter({
|
$doc = Ox.SyntaxHighlighter({
|
||||||
source: doc,
|
source: doc,
|
||||||
})
|
})
|
||||||
.appendTo($text);
|
.appendTo($text);
|
||||||
|
$('<div>')
|
||||||
Ox.Button({
|
.html('<tt>' + source + '</tt>')
|
||||||
title: Ox._('Source ({0})', [f]),
|
|
||||||
}).bindEvent({
|
|
||||||
click: function() {
|
|
||||||
$code.toggle();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.css({
|
|
||||||
margin: '4px'
|
|
||||||
})
|
|
||||||
.appendTo($text);
|
.appendTo($text);
|
||||||
$code = Ox.SyntaxHighlighter({
|
$code = Ox.SyntaxHighlighter({
|
||||||
showLineNumbers: true,
|
showLineNumbers: true,
|
||||||
source: code,
|
source: code.replace(/\s+?'''.+?'''\n/g, ''),
|
||||||
offset: line
|
offset: line
|
||||||
})
|
})
|
||||||
.css({
|
.css({
|
||||||
borderWidth: '1px',
|
borderWidth: '1px',
|
||||||
}).appendTo($text);
|
})
|
||||||
|
.appendTo($text);
|
||||||
} else {
|
} else {
|
||||||
$text.empty().append(getIndex());
|
$text.empty().append(getIndex());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue