1
0
Fork 0
forked from 0x2620/oxjs

allow for stripping comments in doc panel (which implies hiding line numbers)

This commit is contained in:
rolux 2012-06-23 20:44:13 +02:00
commit a071d541de
3 changed files with 13 additions and 6 deletions

View file

@ -7,6 +7,7 @@ Ox.DocPage <f> DocPage
options <o> Options object
item <o> doc item
replace <[[]]|[]> See Ox.SyntaxHighlighter
stripComments <b|false> If true, strip comments in source code
self <o> Shared private variable
@*/
Ox.DocPage = function(options, self) {
@ -242,8 +243,9 @@ Ox.DocPage = function(options, self) {
$elements.push(
Ox.SyntaxHighlighter({
replace: self.options.replace,
showLineNumbers: true,
showLineNumbers: !self.options.stripComments,
source: item.source,
stripComments: self.options.stripComments,
offset: self.options.item.line
})
.addClass(className)

View file

@ -26,6 +26,7 @@ Ox.DocPanel <f> Documentation Panel
showTests <b|false> If true, show test results in list
showTooltips <b|false> If true, show test result tooltips in list
size <s|256> Default list size
stripComments <b|false> If true, strip comments in source code
self <o> Shared private variable
@*/
@ -58,6 +59,7 @@ Ox.DocPanel = function(options, self) {
showTests: false,
showTooltips: false,
size: 256,
stripComments: false
})
.options(options || {})
.update({
@ -332,7 +334,8 @@ Ox.DocPanel = function(options, self) {
});
self.$page = Ox.DocPage({
item: item,
replace: self.options.replace
replace: self.options.replace,
stripComments: self.options.stripComments
})
.bindEvent({
close: function() {