Revision 522
Added by Matthias almost 17 years ago
codepress.html | ||
---|---|---|
3 | 3 |
<head> |
4 | 4 |
<title>CodePress - Real Time Syntax Highlighting Editor written in JavaScript</title> |
5 | 5 |
<meta name="description" content="CodePress - source code editor window" /> |
6 |
|
|
6 |
|
|
7 | 7 |
<script type="text/javascript"> |
8 |
var L=location.href; |
|
9 |
var d=L.substring(L.indexOf("?")+1); |
|
10 |
var c=v=new Array(); c=d.split("&"); |
|
11 |
for(i=0;i<c.length&&c.length>0;i++) { |
|
12 |
v=c[i].split("="); if(v.length>1) |
|
13 |
eval(v[0]+"=unescape('"+v[1].replace(/\+/g," ")+"')");} |
|
8 |
var language = 'generic'; |
|
9 |
var engine = 'older'; |
|
10 |
var ua = navigator.userAgent; |
|
11 |
var ts = (new Date).getTime(); // timestamp to avoid cache |
|
12 |
var lh = location.href; |
|
14 | 13 |
|
15 |
if(language==null||language=='') language = 'generic'; |
|
16 |
|
|
17 |
ts = (new Date).getTime(); // timestamp to avoid cache |
|
14 |
if(ua.match('MSIE')) engine = 'msie'; |
|
15 |
else if(ua.match('KHTML')) engine = 'khtml'; |
|
16 |
else if(ua.match('Opera')) engine = 'opera'; |
|
17 |
else if(ua.match('Gecko')) engine = 'gecko'; |
|
18 |
|
|
19 |
if(lh.match('language=')) language = lh.replace(/.*language=(.*?)(&.*)?$/,'$1'); |
|
20 |
|
|
18 | 21 |
document.write('<link type="text/css" href="codepress.css?ts='+ts+'" rel="stylesheet" />'); |
19 | 22 |
document.write('<link type="text/css" href="languages/'+language+'.css?ts='+ts+'" rel="stylesheet" id="cp-lang-style" />'); |
20 | 23 |
document.write('<scr'+'ipt type="text/javascript" src="engines/'+engine+'.js?ts='+ts+'"></scr'+'ipt>'); |
... | ... | |
24 | 27 |
</head> |
25 | 28 |
|
26 | 29 |
<script type="text/javascript"> |
27 |
if (engine == "gecko") document.write('<body> </body>'); |
|
28 |
else if(engine == "msie") document.write('<body><pre></pre></body>'); |
|
30 |
if(engine == "msie" || engine == "gecko") document.write('<body><pre> </pre></body>'); |
|
31 |
else if(engine == "opera") document.write('<body></body>'); |
|
32 |
// else if(engine == "khtml") document.write('<body> </body>'); |
|
29 | 33 |
</script> |
30 | 34 |
|
31 | 35 |
</html> |
Also available in: Unified diff
- Update codepress to Version 0.9.6
- Update phplib to Version 7.4a