forked from kriszyp/xstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.js
26 lines (22 loc) · 748 Bytes
/
page.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
define(['xstyle/core/base', 'xstyle/core/Proxy', 'xstyle/core/parser', 'xstyle/main', 'dojo/domReady!'], function(base, Proxy, parse){
var contentText = document.getElementsByTagName('pre')[0].innerHTML,
body = document.body,
entities = {
'<': '<',
'>': '>',
'&': '&'
};
body._contentNode = body;
body.innerHTML = '';
contentText = contentText.replace(/&\w+;/g, function(entity){
return entities[entity];
});
var content = eval('(' + contentText + ')');
base.definitions['page-content'].setSource(content);
//(body['page-content'] || (body['page-content'] = new Proxy())).setSource(content);
/*base.newRule('content');
parse(contentRule, contentText, {
rules: [],
addRule: function(){}
});*/
});