oxjs/demos/syntax/js/syntax.js

50 lines
No EOL
1.4 KiB
JavaScript

Ox.load('UI', {
debug: true,
theme: 'classic'
}, function() {
Ox.Theme('classic');
var $body = $('body'),
$textarea = new Ox.Input({
height: 400,
type: 'textarea',
width: 400
})
.css({
fontFamily: 'Menlo, Monaco, Courier, Courier New'
})
.appendTo($body),
$button = new Ox.Button({
title: 'Run',
width: 40
})
.css({
position: 'absolute',
left: '8px',
top: '416px',
})
.bindEvent({
click: function() {
$div.empty();
new Ox.SyntaxHighlighter({
showLinebreaks: true,
showTabs: true,
showWhitespace: true,
source: $textarea.value(),
//stripComments: true,
//stripLinebreaks: true,
//stripWhitespace: true,
}).appendTo($div);
}
})
.appendTo($body),
$div = $('<div>')
.css({
position: 'absolute',
left: '416px',
top: '8px'
})
.appendTo($body);
});