Skip to content

Commit c30210b

Browse files
author
Thomas Pollinger
committed
Upgrade Highlight to WSM-Level ;)
1 parent 1d04c78 commit c30210b

4 files changed

Lines changed: 109 additions & 0 deletions

File tree

demoRedDot.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<html>
2+
3+
<head>
4+
<script src='shCore.js' type='text/javascript'></script>
5+
<script src='shBrushRedDot.js' type='text/javascript'></script>
6+
<link href='shCore.css' rel='stylesheet' type='text/css' />
7+
<link href='shThemeDefault.css' rel='stylesheet' type='text/css' />
8+
<link href='shCoreRedDot.css' rel='stylesheet' type='text/css' />
9+
</head>
10+
11+
<body>
12+
<pre class="brush: RedDot">
13+
&lt;!IoRedDotOpenPage&gt;&lt;a href=&quot;&lt;%infoBackLink%&gt;&quot;&gt;BACK&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;
14+
&lt;hr/&gt;
15+
&lt;!IoRangeDynLink&gt;&lt;%anchorDymanic%&gt;&lt;br/&gt;&lt;!/IoRangeDynLink&gt;
16+
&lt;%!! Store:Get(test) !!%&gt;
17+
&lt;reddot:cms&gt;
18+
&lt;if&gt;
19+
&lt;query&gt;
20+
&lt;htmltext&gt;&lt;/htmltext&gt;
21+
&lt;/query&gt;
22+
&lt;query type=&quot;else&quot;&gt;
23+
&lt;xmltext&gt;&lt;/xmltext&gt;
24+
&lt;/query&gt;
25+
&lt;/if&gt;
26+
&lt;foreach&gt;&lt;/foreach&gt;
27+
&lt;/reddot:cms&gt;
28+
</pre>
29+
<script type='text/javascript'>
30+
SyntaxHighlighter.all();
31+
</script>
32+
</body>
33+
34+
</html>

demoWSM.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<html>
2+
3+
<head>
4+
<script src='shCore.js' type='text/javascript'></script>
5+
<script src='shBrushWSM.js' type='text/javascript'></script>
6+
<link href='shCore.css' rel='stylesheet' type='text/css' />
7+
<link href='shThemeDefault.css' rel='stylesheet' type='text/css' />
8+
<link href='shCoreWSM.css' rel='stylesheet' type='text/css' />
9+
</head>
10+
11+
<body>
12+
<pre class="brush: RedDot">
13+
&lt;!IoRedDotOpenPage&gt;&lt;a href=&quot;&lt;%infoBackLink%&gt;&quot;&gt;BACK&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;
14+
&lt;hr/&gt;
15+
&lt;!IoRangeDynLink&gt;&lt;%anchorDymanic%&gt;&lt;br/&gt;&lt;!/IoRangeDynLink&gt;
16+
&lt;%!! Store:Get(test) !!%&gt;
17+
&lt;reddot:cms&gt;
18+
&lt;if&gt;
19+
&lt;query&gt;
20+
&lt;htmltext&gt;&lt;/htmltext&gt;
21+
&lt;/query&gt;
22+
&lt;query type=&quot;else&quot;&gt;
23+
&lt;xmltext&gt;&lt;/xmltext&gt;
24+
&lt;/query&gt;
25+
&lt;/if&gt;
26+
&lt;foreach&gt;&lt;/foreach&gt;
27+
&lt;/reddot:cms&gt;
28+
</pre>
29+
<script type='text/javascript'>
30+
SyntaxHighlighter.all();
31+
</script>
32+
</body>
33+
34+
</html>

shBrushWSM.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
SyntaxHighlighter.brushes.Custom = function () {
2+
this.regexList = [
3+
{ regex: /&lt;%([^!])+?%&gt;/gm, css: 'placeholder' },
4+
{ regex: /&lt;!(\/?)IoRange(.+?)&gt;/gm, css: 'blockmark' },
5+
{ regex: /&lt;!IoRedDot(.+?)&gt;/gm, css: 'smartedit-reddot' },
6+
{ regex: /&lt;%!!(.+?)!!%&gt;/gm, css: 'rendertag-sn' },
7+
{ regex: /&lt;(\/?)reddot:cms&gt;/gm, css: 'rendertag' },
8+
{ regex: /&lt;navigation(.+?)&gt;/gm, css: 'rendertag' },
9+
{ regex: /&lt;(\/?)output(.+?)&gt;/gm, css: 'rendertag' },
10+
{ regex: /&lt;(\/?)foreach(.+?)&gt;/gm, css: 'rendertag' },
11+
{ regex: /&lt;(\/?)if&gt;/gm, css: 'rendertag' },
12+
{ regex: /&lt;query(.+?)&gt;/gm, css: 'rendertag' },
13+
{ regex: /&lt;(\/?)query&gt;/gm, css: 'rendertag' },
14+
{ regex: /&lt;(\/?)htmltext&gt;/gm, css: 'rendertag' },
15+
{ regex: /&lt;(\/?)xmltext&gt;/gm, css: 'rendertag' },
16+
{ regex: /&lt;(\/?)currentPageCommentCount&gt;/gm, css: 'rendertag' },
17+
{ regex: /&lt;(\/?)pagesMostCommented&gt;/gm, css: 'rendertag' }
18+
];
19+
};
20+
SyntaxHighlighter.brushes.Custom.prototype = new SyntaxHighlighter.Highlighter();
21+
SyntaxHighlighter.brushes.Custom.aliases = ['RedDot'];

shCoreWSM.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.syntaxhighlighter .placeholder {
2+
color: #000000 !important;
3+
background-color: #ffff80 !important;
4+
}
5+
.syntaxhighlighter .blockmark {
6+
color: #008800 !important;
7+
background-color: #ccffcc !important;
8+
}
9+
.syntaxhighlighter .smartedit-reddot {
10+
color: #ff0000 !important;
11+
background-color: #ffe5e5 !important;
12+
}
13+
.syntaxhighlighter .rendertag {
14+
color: #197674 !important;
15+
background-color: #ccf0ff !important;
16+
}
17+
.syntaxhighlighter .rendertag-sn {
18+
color: #000000 !important;
19+
background-color: #ccf0ff !important;
20+
}

0 commit comments

Comments
 (0)