update DocPage ('examples' property renamed to 'tests')
This commit is contained in:
parent
b4bb926c0c
commit
27b55e2b6e
1 changed files with 10 additions and 8 deletions
|
@ -93,7 +93,7 @@ Ox.DocPage = function(options, self) {
|
||||||
];
|
];
|
||||||
[
|
[
|
||||||
'description', 'usage', 'arguments', 'properties',
|
'description', 'usage', 'arguments', 'properties',
|
||||||
'events', 'examples', 'source'
|
'events', 'tests', 'source'
|
||||||
].forEach(function(section) {
|
].forEach(function(section) {
|
||||||
var className = 'OxLine' + Ox.uid();
|
var className = 'OxLine' + Ox.uid();
|
||||||
if (item[section]) {
|
if (item[section]) {
|
||||||
|
@ -151,26 +151,28 @@ Ox.DocPage = function(options, self) {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.append('<span class="OxSection">' + Ox.toTitleCase(section) + '</span>')
|
.append('<span class="OxSection">' + Ox.toTitleCase(
|
||||||
|
section == 'tests' ? 'examples' : section
|
||||||
|
) + '</span>')
|
||||||
);
|
);
|
||||||
if (section == 'examples') {
|
if (section == 'tests') {
|
||||||
item.examples.forEach(function(example) {
|
item.tests.forEach(function(test) {
|
||||||
$elements.push($('<div>')
|
$elements.push($('<div>')
|
||||||
.addClass(className)
|
.addClass(className)
|
||||||
.css({marginLeft: (level * 32 + 16) + 'px'})
|
.css({marginLeft: (level * 32 + 16) + 'px'})
|
||||||
.html(
|
.html(
|
||||||
'<code><b>> '
|
'<code><b>> '
|
||||||
+ Ox.encodeHTMLEntities(example.statement)
|
+ Ox.encodeHTMLEntities(test.statement)
|
||||||
.replace(/ /g, ' ')
|
.replace(/ /g, ' ')
|
||||||
.replace(/\n/g, '<br/>\n ')
|
.replace(/\n/g, '<br/>\n ')
|
||||||
+ '</b></code>'
|
+ '</b></code>'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
example.result && $elements.push($('<div>')
|
test.result && $elements.push($('<div>')
|
||||||
.addClass(className)
|
.addClass(className)
|
||||||
.css({marginLeft: (level * 32 + 16) + 'px'})
|
.css({marginLeft: (level * 32 + 16) + 'px'})
|
||||||
.html(
|
.html(
|
||||||
'<code>' + Ox.encodeHTMLEntities(example.result) + '</code>'
|
'<code>' + Ox.encodeHTMLEntities(test.result) + '</code>'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
@ -184,7 +186,7 @@ Ox.DocPage = function(options, self) {
|
||||||
+ '</b>:' + self.options.item.line + '</code>'
|
+ '</b>:' + self.options.item.line + '</code>'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
Ox.print('IS::', item.source);
|
//Ox.print('IS::', item.source);
|
||||||
$elements.push(
|
$elements.push(
|
||||||
Ox.SyntaxHighlighter({
|
Ox.SyntaxHighlighter({
|
||||||
replace: self.options.replace,
|
replace: self.options.replace,
|
||||||
|
|
Loading…
Reference in a new issue