1
0
Fork 0
forked from 0x2620/oxjs

use SyntaxHighlighter in readme

This commit is contained in:
rolux 2012-03-30 16:17:56 +02:00
commit 7294662868
4 changed files with 73 additions and 6 deletions

View file

@ -17,7 +17,7 @@ Ox.load('UI', function() {
function loadHTML(files, callback) {
files.forEach(function(file) {
Ox.get('html/' + file.name, function(html) {
var match = html.match(/<p class="title">(.+)<\/p>/);
var match = html.match(/<h1>(.+)<\/h1>/);
items.push({
date: file.date,
file: file.name,
@ -42,7 +42,7 @@ Ox.load('UI', function() {
.addClass('head')
.append($ui.logo)
.append($ui.title);
$ui.text = Ox.Element().addClass('text'),
$ui.text = Ox.Container().addClass('text'),
$ui.inner = Ox.SplitPanel({
elements: [
{
@ -121,6 +121,17 @@ Ox.load('UI', function() {
Ox.print(data)
if (data.ids.length) {
$ui.text.html(Ox.getObject(items, 'file', data.ids[0]).html);
$ui.text.find('.code').each(function() {
var $this = $(this);
$this.replaceWith(
Ox.SyntaxHighlighter({
source: $this.text()
})
.css({
border: '1px solid rgb(192, 192, 192)'
})
);
})
} else {
$ui.text.empty();
}