remove new for all Ox.Elements, dont declare arguments again, add some semicolons

This commit is contained in:
j 2011-06-19 19:48:32 +02:00
commit b27ed00356
69 changed files with 430 additions and 440 deletions

View file

@ -18,7 +18,7 @@ Ox.SyntaxHighlighter <function> Syntax Highlighter
Ox.SyntaxHighlighter = function(options, self) {
self = self || {};
self = self || {};
var that = Ox.Element({}, self)
.defaults({
lineLength: 0,
@ -61,9 +61,9 @@ Ox.SyntaxHighlighter = function(options, self) {
classNames = 'Ox' + Ox.toTitleCase(token.type);
if (self.options.showWhitespace && token.type == 'whitespace') {
if (isAfterLinebreak() && hasIrregularSpaces()) {
classNames += ' OxLeading'
classNames += ' OxLeading';
} else if (isBeforeLinebreak()) {
classNames += ' OxTrailing'
classNames += ' OxTrailing';
}
}
source += '<span class="' + classNames + '">' +
@ -89,7 +89,7 @@ Ox.SyntaxHighlighter = function(options, self) {
lines = source.split('<br/>');
that.empty();
if (self.options.showLineNumbers) {
$lineNumbers = new Ox.Element()
$lineNumbers = Ox.Element()
.addClass('OxLineNumbers')
.html(
Ox.range(lines.length).map(function(line) {
@ -98,19 +98,19 @@ Ox.SyntaxHighlighter = function(options, self) {
)
.appendTo(that);
}
$source = new Ox.Element()
$source = Ox.Element()
.addClass('OxSourceCode')
.html(source)
.appendTo(that);
if (self.options.lineLength) {
$line = new Ox.Element()
$line = Ox.Element()
.css({
position: 'absolute',
top: '-1000px'
})
.html(Ox.repeat('&nbsp;', self.options.lineLength))
.appendTo(that),
width = $line.width() + 4; // add padding
.appendTo(that);
width = $line.width() + 4; // add padding
$line.removeElement();
['moz', 'webkit'].forEach(function(browser) {
$source.css({
@ -129,4 +129,4 @@ Ox.SyntaxHighlighter = function(options, self) {
return that;
};
};