Initial commit - Begun rewrite of website generator
This commit is contained in:
Binary file not shown.
BIN
src/Averia-Regular.ttf
Normal file
BIN
src/Averia-Regular.ttf
Normal file
Binary file not shown.
4
src/averia-cufon.all-nokern.js
Normal file
4
src/averia-cufon.all-nokern.js
Normal file
File diff suppressed because one or more lines are too long
19
src/blankwin.js
Normal file
19
src/blankwin.js
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
this.blankwin = function(){
|
||||
var hostname = window.location.hostname;
|
||||
hostname = hostname.replace("www","").toLowerCase();
|
||||
var a = document.getElementsByTagName("a");
|
||||
this.check = function(obj){
|
||||
var href = obj.href.toLowerCase();
|
||||
return ((href.indexOf("http://")!=-1 || href.indexOf("https://")!=-1) && href.indexOf(hostname)==-1) ? true : false;
|
||||
};
|
||||
this.set = function(obj){
|
||||
obj.target = "_blank";
|
||||
obj.className = "external";
|
||||
};
|
||||
for (var i=0; i<a.length; i++) {
|
||||
if(check(a[i])) set(a[i]);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
96
src/codestyle.css
Normal file
96
src/codestyle.css
Normal file
@@ -0,0 +1,96 @@
|
||||
/* Text */
|
||||
.codehilite .t { color: #586e75 }
|
||||
|
||||
/* Whitespace */
|
||||
.codehilite .w { color: #073642 }
|
||||
|
||||
/* Error */
|
||||
.codehilite .err { color: #cb4b16; }
|
||||
|
||||
/* Keyword */
|
||||
.codehilite .k { color: #859900 }
|
||||
.codehilite .kc { color: #2aa198 } /* Keyword.Constant */
|
||||
.codehilite .kd { color: #268bd2 } /* Keyword.Declaration */
|
||||
.codehilite .kn { color: #b58900 } /* Keyword.Namespace */
|
||||
.codehilite .kp { color: #859900 } /* Keyword.Pseudo */
|
||||
.codehilite .kr { color: #073642 } /* Keyword.Reserved */
|
||||
.codehilite .kt { color: #b58900 } /* Keyword.Type */
|
||||
|
||||
/* Name */
|
||||
.codehilite .n { color: #586e75 }
|
||||
.codehilite .na { color: #2aa198 } /* Name.Attribute */
|
||||
.codehilite .nb { color: #268bd2 } /* Name.Builtin */
|
||||
.codehilite .nc { color: #268bd2 } /* Name.Class */
|
||||
.codehilite .ne { color: #cb4b16 } /* Name.Error */
|
||||
.codehilite .no { color: #2aa198 } /* Name.Constant */
|
||||
.codehilite .nd { color: #2aa198 } /* Name.Decorator */
|
||||
.codehilite .ni { color: #2aa198; font-weight: bold } /* Name.Entity */
|
||||
.codehilite .nf { color: #268bd2 } /* Name.Function */
|
||||
.codehilite .nn { color: #586e75; } /* Name.Namespace */
|
||||
.codehilite .nt { color: #2aa198; font-weight: bold } /* Name.Tag */
|
||||
.codehilite .nv { color: #cb4b16 } /* Name.Variable */
|
||||
|
||||
/* Builtin */
|
||||
.codehilite .b { color: #859900 }
|
||||
.codehilite .bp { color: #586e75 } /* Name.Builtin.Pseudo */
|
||||
|
||||
/* Variable */
|
||||
.codehilite .v { color: #586e75 }
|
||||
.codehilite .vc { color: #586e75 } /* Name.Variable.Class */
|
||||
.codehilite .vg { color: #268bd2 } /* Name.Variable.Global */
|
||||
.codehilite .vi { color: #268bd2 } /* Name.Variable.Instance */
|
||||
|
||||
/* Literal */
|
||||
|
||||
/* Literal.Number */
|
||||
.codehilite .m { color: #268bd2 } /* Literal.Number */
|
||||
.codehilite .mf { color: #268bd2 } /* Literal.Number.Float */
|
||||
.codehilite .mh { color: #268bd2 } /* Literal.Number.Hex */
|
||||
.codehilite .mi { color: #268bd2 } /* Literal.Number.Integer */
|
||||
.codehilite .mo { color: #268bd2 } /* Literal.Number.Oct */
|
||||
|
||||
/* Literal.String */
|
||||
.codehilite .s { color: #2aa198 }
|
||||
.codehilite .sb { color: #2aa198 } /* Literal.String.Backtick */
|
||||
.codehilite .sc { color: #2aa198 } /* Literal.String.Char */
|
||||
.codehilite .sd { color: #2aa198 } /* Literal.String.Doc */
|
||||
.codehilite .s2 { color: #2aa198 } /* Literal.String.Double */
|
||||
.codehilite .se { color: #cb4b16 } /* Literal.String.Escape */
|
||||
.codehilite .sh { color: #2aa198 } /* Literal.String.Heredoc */
|
||||
.codehilite .si { color: #cb4b16 } /* Literal.String.Interpol */
|
||||
.codehilite .sx { color: #2aa198 } /* Literal.String.Other */
|
||||
.codehilite .sr { color: #cb4b16 } /* Literal.String.Regex */
|
||||
.codehilite .s1 { color: #2aa198 } /* Literal.String.Single */
|
||||
.codehilite .ss { color: #cb4b16 } /* Literal.String.Symbol */
|
||||
|
||||
/* Literal.Integer */
|
||||
.codehilite .il { color: #268bd2 } /* Literal.Number.Integer.Long */
|
||||
|
||||
/* Operator */
|
||||
.codehilite .o { color: #586e75 }
|
||||
.codehilite .ow { color: #859900 } /* Operator.Word */
|
||||
|
||||
/* Punctuation */
|
||||
.codehilite .p { color: #586e75 }
|
||||
|
||||
/* Comment */
|
||||
.codehilite .c { color: #93a1a1; font-style: italic }
|
||||
.codehilite .cm { color: #93a1a1; } /* Comment.Multiline */
|
||||
.codehilite .cp { color: #93a1a1 } /* Comment.Preproc */
|
||||
.codehilite .c1 { color: #93a1a1; } /* Comment.Single */
|
||||
.codehilite .cs { color: #93a1a1; } /* Comment.Special */
|
||||
|
||||
.codehilite .hll { background-color: #dc322f }
|
||||
|
||||
/* Generic */
|
||||
.codehilite .g { color: #586e75 }
|
||||
.codehilite .gd { color: #586e75 } /* Generic.Deleted */
|
||||
.codehilite .ge { font-style: italic } /* Generic.Emph */
|
||||
.codehilite .gr { color: #586e75 } /* Generic.Error */
|
||||
.codehilite .gh { color: #586e75; font-weight: bold } /* Generic.Heading */
|
||||
.codehilite .gi { color: #586e75 } /* Generic.Inserted */
|
||||
.codehilite .go { color: #586e75 } /* Generic.Output */
|
||||
.codehilite .gp { color: #586e75 } /* Generic.Prompt */
|
||||
.codehilite .gs { font-weight: 586e75 } /* Generic.Strong */
|
||||
.codehilite .gu { color: #586e75; font-weight: bold } /* Generic.Subheading */
|
||||
.codehilite .gt { color: #586e75 } /* Generic.Traceback */
|
||||
1498
src/cufon-yui.js
Normal file
1498
src/cufon-yui.js
Normal file
File diff suppressed because it is too large
Load Diff
7
src/cufon-yui2.js
Normal file
7
src/cufon-yui2.js
Normal file
File diff suppressed because one or more lines are too long
34
src/desert.css
Normal file
34
src/desert.css
Normal file
@@ -0,0 +1,34 @@
|
||||
* desert scheme ported from vim to google prettify */
|
||||
pre { display: block; background-color: #333 }
|
||||
pre .nocode { background-color: none; color: #000 }
|
||||
pre .str { color: #ffa0a0 } /* string - pink */
|
||||
pre .kwd { color: #f0e68c; font-weight: bold }
|
||||
pre .com { color: #87ceeb } /* comment - skyblue */
|
||||
pre .typ { color: #98fb98 } /* type - lightgreen */
|
||||
pre .lit { color: #cd5c5c } /* literal - darkred */
|
||||
pre .pun { color: #fff } /* punctuation */
|
||||
pre .pln { color: #fff } /* plaintext */
|
||||
pre .tag { color: #f0e68c; font-weight: bold } /* html/xml tag - lightyellow */
|
||||
pre .atn { color: #bdb76b; font-weight: bold } /* attribute name - khaki */
|
||||
pre .atv { color: #ffa0a0 } /* attribute value - pink */
|
||||
pre .dec { color: #98fb98 } /* decimal - lightgreen */
|
||||
|
||||
/* Specify class=linenums on a pre to get line numbering */
|
||||
ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE } /* IE indents via margin-left */
|
||||
li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
|
||||
/* Alternate shading for lines */
|
||||
li.L1,li.L3,li.L5,li.L7,li.L9 { }
|
||||
|
||||
@media print {
|
||||
pre { background-color: none }
|
||||
pre .str, code .str { color: #060 }
|
||||
pre .kwd, code .kwd { color: #006; font-weight: bold }
|
||||
pre .com, code .com { color: #600; font-style: italic }
|
||||
pre .typ, code .typ { color: #404; font-weight: bold }
|
||||
pre .lit, code .lit { color: #044 }
|
||||
pre .pun, code .pun { color: #440 }
|
||||
pre .pln, code .pln { color: #000 }
|
||||
pre .tag, code .tag { color: #006; font-weight: bold }
|
||||
pre .atn, code .atn { color: #404 }
|
||||
pre .atv, code .atv { color: #060 }
|
||||
}
|
||||
BIN
src/favicon.ico
Normal file
BIN
src/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
364
src/fonts/dejavuserif/DejaVuSerif-demo.html
Executable file
364
src/fonts/dejavuserif/DejaVuSerif-demo.html
Executable file
@@ -0,0 +1,364 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="specimen_files/easytabs.js" type="text/javascript" charset="utf-8"></script>
|
||||
<link rel="stylesheet" href="specimen_files/specimen_stylesheet.css" type="text/css" charset="utf-8" />
|
||||
<link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" />
|
||||
|
||||
<style type="text/css">
|
||||
body{
|
||||
font-family: 'dejavu_serifbook';
|
||||
}
|
||||
</style>
|
||||
|
||||
<title>DejaVu Serif Book Specimen</title>
|
||||
|
||||
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function() {
|
||||
$('#container').easyTabs({defaultContent:1});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="header">
|
||||
DejaVu Serif Book </div>
|
||||
<ul class="tabs">
|
||||
<li><a href="#specimen">Specimen</a></li>
|
||||
<li><a href="#layout">Sample Layout</a></li>
|
||||
<li><a href="#installing">Installing Webfonts</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div id="main_content">
|
||||
|
||||
|
||||
<div id="specimen">
|
||||
|
||||
<div class="section">
|
||||
<div class="grid12 firstcol">
|
||||
<div class="huge">AaBb</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<div class="glyph_range">A​B​C​D​E​F​G​H​I​J​K​L​M​N​O​P​Q​R​S​T​U​V​W​X​Y​Z​a​b​c​d​e​f​g​h​i​j​k​l​m​n​o​p​q​r​s​t​u​v​w​x​y​z​1​2​3​4​5​6​7​8​9​0​&​.​,​?​!​@​(​)​#​$​%​*​+​-​=​:​;</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="grid12 firstcol">
|
||||
<table class="sample_table">
|
||||
<tr><td>10</td><td class="size10">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>11</td><td class="size11">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>12</td><td class="size12">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>13</td><td class="size13">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>14</td><td class="size14">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>16</td><td class="size16">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>18</td><td class="size18">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>20</td><td class="size20">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>24</td><td class="size24">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>30</td><td class="size30">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>36</td><td class="size36">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>48</td><td class="size48">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>60</td><td class="size60">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>72</td><td class="size72">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
<tr><td>90</td><td class="size90">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</td></tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="section" id="bodycomparison">
|
||||
|
||||
|
||||
<div id="xheight">
|
||||
<div class="fontbody">◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼◼body</div><div class="arialbody">body</div><div class="verdanabody">body</div><div class="georgiabody">body</div></div>
|
||||
<div class="fontbody" style="z-index:1">
|
||||
body<span>DejaVu Serif Book</span>
|
||||
</div>
|
||||
<div class="arialbody" style="z-index:1">
|
||||
body<span>Arial</span>
|
||||
</div>
|
||||
<div class="verdanabody" style="z-index:1">
|
||||
body<span>Verdana</span>
|
||||
</div>
|
||||
<div class="georgiabody" style="z-index:1">
|
||||
body<span>Georgia</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="section psample psample_row1" id="">
|
||||
|
||||
<div class="grid2 firstcol">
|
||||
<p class="size10"><span>10.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="grid3">
|
||||
<p class="size11"><span>11.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="grid3">
|
||||
<p class="size12"><span>12.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="grid4">
|
||||
<p class="size13"><span>13.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="white_blend"></div>
|
||||
|
||||
</div>
|
||||
<div class="section psample psample_row2" id="">
|
||||
<div class="grid3 firstcol">
|
||||
<p class="size14"><span>14.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="grid4">
|
||||
<p class="size16"><span>16.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="grid5">
|
||||
<p class="size18"><span>18.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="white_blend"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="section psample psample_row3" id="">
|
||||
<div class="grid5 firstcol">
|
||||
<p class="size20"><span>20.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
</div>
|
||||
<div class="grid7">
|
||||
<p class="size24"><span>24.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
</div>
|
||||
|
||||
<div class="white_blend"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="section psample psample_row4" id="">
|
||||
<div class="grid12 firstcol">
|
||||
<p class="size30"><span>30.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
</div>
|
||||
<div class="white_blend"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="section psample psample_row1 fullreverse">
|
||||
<div class="grid2 firstcol">
|
||||
<p class="size10"><span>10.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="grid3">
|
||||
<p class="size11"><span>11.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="grid3">
|
||||
<p class="size12"><span>12.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="grid4">
|
||||
<p class="size13"><span>13.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="black_blend"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="section psample psample_row2 fullreverse">
|
||||
<div class="grid3 firstcol">
|
||||
<p class="size14"><span>14.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="grid4">
|
||||
<p class="size16"><span>16.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="grid5">
|
||||
<p class="size18"><span>18.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
|
||||
</div>
|
||||
<div class="black_blend"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="section psample fullreverse psample_row3" id="">
|
||||
<div class="grid5 firstcol">
|
||||
<p class="size20"><span>20.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
</div>
|
||||
<div class="grid7">
|
||||
<p class="size24"><span>24.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
</div>
|
||||
|
||||
<div class="black_blend"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="section psample fullreverse psample_row4" id="" style="border-bottom: 20px #000 solid;">
|
||||
<div class="grid12 firstcol">
|
||||
<p class="size30"><span>30.</span>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
</div>
|
||||
<div class="black_blend"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="layout">
|
||||
|
||||
<div class="section">
|
||||
|
||||
<div class="grid12 firstcol">
|
||||
<h1>Lorem Ipsum Dolor</h1>
|
||||
<h2>Etiam porta sem malesuada magna mollis euismod</h2>
|
||||
|
||||
<p class="byline">By <a href="#link">Aenean Lacinia</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="grid8 firstcol">
|
||||
<p class="large">Donec sed odio dui. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
|
||||
|
||||
|
||||
<h3>Pellentesque ornare sem</h3>
|
||||
|
||||
<p>Maecenas sed diam eget risus varius blandit sit amet non magna. Maecenas faucibus mollis interdum. Donec ullamcorper nulla non metus auctor fringilla. Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam id dolor id nibh ultricies vehicula ut id elit. </p>
|
||||
|
||||
<p>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. </p>
|
||||
|
||||
<p>Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Aenean lacinia bibendum nulla sed consectetur. </p>
|
||||
|
||||
<p>Nullam quis risus eget urna mollis ornare vel eu leo. Nullam quis risus eget urna mollis ornare vel eu leo. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. </p>
|
||||
|
||||
<h3>Cras mattis consectetur</h3>
|
||||
|
||||
<p>Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Aenean lacinia bibendum nulla sed consectetur. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cras mattis consectetur purus sit amet fermentum. </p>
|
||||
|
||||
<p>Nullam id dolor id nibh ultricies vehicula ut id elit. Nullam quis risus eget urna mollis ornare vel eu leo. Cras mattis consectetur purus sit amet fermentum.</p>
|
||||
</div>
|
||||
|
||||
<div class="grid4 sidebar">
|
||||
|
||||
<div class="box reverse">
|
||||
<p class="last">Nullam quis risus eget urna mollis ornare vel eu leo. Donec ullamcorper nulla non metus auctor fringilla. Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
|
||||
</div>
|
||||
|
||||
<p class="caption">Maecenas sed diam eget risus varius.</p>
|
||||
|
||||
<p>Vestibulum id ligula porta felis euismod semper. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Vestibulum id ligula porta felis euismod semper. Sed posuere consectetur est at lobortis. Maecenas sed diam eget risus varius blandit sit amet non magna. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
|
||||
|
||||
|
||||
|
||||
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Aenean lacinia bibendum nulla sed consectetur. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Nullam quis risus eget urna mollis ornare vel eu leo. </p>
|
||||
|
||||
<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec ullamcorper nulla non metus auctor fringilla. Maecenas faucibus mollis interdum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="specs">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="installing">
|
||||
<div class="section">
|
||||
<div class="grid7 firstcol">
|
||||
<h1>Installing Webfonts</h1>
|
||||
|
||||
<p>Webfonts are supported by all major browser platforms but not all in the same way. There are currently four different font formats that must be included in order to target all browsers. This includes TTF, WOFF, EOT and SVG.</p>
|
||||
|
||||
<h2>1. Upload your webfonts</h2>
|
||||
<p>You must upload your webfont kit to your website. They should be in or near the same directory as your CSS files.</p>
|
||||
|
||||
<h2>2. Include the webfont stylesheet</h2>
|
||||
<p>A special CSS @font-face declaration helps the various browsers select the appropriate font it needs without causing you a bunch of headaches. Learn more about this syntax by reading the <a href="http://www.fontspring.com/blog/further-hardening-of-the-bulletproof-syntax">Fontspring blog post</a> about it. The code for it is as follows:</p>
|
||||
|
||||
|
||||
<code>
|
||||
@font-face{
|
||||
font-family: 'MyWebFont';
|
||||
src: url('WebFont.eot');
|
||||
src: url('WebFont.eot?iefix') format('eot'),
|
||||
url('WebFont.woff') format('woff'),
|
||||
url('WebFont.ttf') format('truetype'),
|
||||
url('WebFont.svg#webfont') format('svg');
|
||||
}
|
||||
</code>
|
||||
|
||||
<p>We've already gone ahead and generated the code for you. All you have to do is link to the stylesheet in your HTML, like this:</p>
|
||||
<code><link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" /></code>
|
||||
|
||||
<h2>3. Modify your own stylesheet</h2>
|
||||
<p>To take advantage of your new fonts, you must tell your stylesheet to use them. Look at the original @font-face declaration above and find the property called "font-family." The name linked there will be what you use to reference the font. Prepend that webfont name to the font stack in the "font-family" property, inside the selector you want to change. For example:</p>
|
||||
<code>p { font-family: 'MyWebFont', Arial, sans-serif; }</code>
|
||||
|
||||
<h2>4. Test</h2>
|
||||
<p>Getting webfonts to work cross-browser <em>can</em> be tricky. Use the information in the sidebar to help you if you find that fonts aren't loading in a particular browser.</p>
|
||||
</div>
|
||||
|
||||
<div class="grid5 sidebar">
|
||||
<div class="box">
|
||||
<h2>Troubleshooting<br />Font-Face Problems</h2>
|
||||
<p>Having trouble getting your webfonts to load in your new website? Here are some tips to sort out what might be the problem.</p>
|
||||
|
||||
<h3>Fonts not showing in any browser</h3>
|
||||
|
||||
<p>This sounds like you need to work on the plumbing. You either did not upload the fonts to the correct directory, or you did not link the fonts properly in the CSS. If you've confirmed that all this is correct and you still have a problem, take a look at your .htaccess file and see if requests are getting intercepted.</p>
|
||||
|
||||
<h3>Fonts not loading in iPhone or iPad</h3>
|
||||
|
||||
<p>The most common problem here is that you are serving the fonts from an IIS server. IIS refuses to serve files that have unknown MIME types. If that is the case, you must set the MIME type for SVG to "image/svg+xml" in the server settings. Follow these instructions from Microsoft if you need help.</p>
|
||||
|
||||
<h3>Fonts not loading in Firefox</h3>
|
||||
|
||||
<p>The primary reason for this failure? You are still using a version Firefox older than 3.5. So upgrade already! If that isn't it, then you are very likely serving fonts from a different domain. Firefox requires that all font assets be served from the same domain. Lastly it is possible that you need to add WOFF to your list of MIME types (if you are serving via IIS.)</p>
|
||||
|
||||
<h3>Fonts not loading in IE</h3>
|
||||
|
||||
<p>Are you looking at Internet Explorer on an actual Windows machine or are you cheating by using a service like Adobe BrowserLab? Many of these screenshot services do not render @font-face for IE. Best to test it on a real machine.</p>
|
||||
|
||||
<h3>Fonts not loading in IE9</h3>
|
||||
|
||||
<p>IE9, like Firefox, requires that fonts be served from the same domain as the website. Make sure that is the case.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p>©2010-2011 Fontspring. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
src/fonts/dejavuserif/DejaVuSerif-webfont.eot
Executable file
BIN
src/fonts/dejavuserif/DejaVuSerif-webfont.eot
Executable file
Binary file not shown.
3404
src/fonts/dejavuserif/DejaVuSerif-webfont.svg
Executable file
3404
src/fonts/dejavuserif/DejaVuSerif-webfont.svg
Executable file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 969 KiB |
BIN
src/fonts/dejavuserif/DejaVuSerif-webfont.ttf
Executable file
BIN
src/fonts/dejavuserif/DejaVuSerif-webfont.ttf
Executable file
Binary file not shown.
BIN
src/fonts/dejavuserif/DejaVuSerif-webfont.woff
Executable file
BIN
src/fonts/dejavuserif/DejaVuSerif-webfont.woff
Executable file
Binary file not shown.
BIN
src/fonts/dejavuserif/specimen_files/DejaVuSerif-cleartype.png
Executable file
BIN
src/fonts/dejavuserif/specimen_files/DejaVuSerif-cleartype.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 85 KiB |
7
src/fonts/dejavuserif/specimen_files/easytabs.js
Executable file
7
src/fonts/dejavuserif/specimen_files/easytabs.js
Executable file
@@ -0,0 +1,7 @@
|
||||
(function($){$.fn.easyTabs=function(option){var param=jQuery.extend({fadeSpeed:"fast",defaultContent:1,activeClass:'active'},option);$(this).each(function(){var thisId="#"+this.id;if(param.defaultContent==''){param.defaultContent=1;}
|
||||
if(typeof param.defaultContent=="number")
|
||||
{var defaultTab=$(thisId+" .tabs li:eq("+(param.defaultContent-1)+") a").attr('href').substr(1);}else{var defaultTab=param.defaultContent;}
|
||||
$(thisId+" .tabs li a").each(function(){var tabToHide=$(this).attr('href').substr(1);$("#"+tabToHide).addClass('easytabs-tab-content');});hideAll();changeContent(defaultTab);function hideAll(){$(thisId+" .easytabs-tab-content").hide();}
|
||||
function changeContent(tabId){hideAll();$(thisId+" .tabs li").removeClass(param.activeClass);$(thisId+" .tabs li a[href=#"+tabId+"]").closest('li').addClass(param.activeClass);if(param.fadeSpeed!="none")
|
||||
{$(thisId+" #"+tabId).fadeIn(param.fadeSpeed);}else{$(thisId+" #"+tabId).show();}}
|
||||
$(thisId+" .tabs li").click(function(){var tabId=$(this).find('a').attr('href').substr(1);changeContent(tabId);return false;});});}})(jQuery);
|
||||
129
src/fonts/dejavuserif/specimen_files/grid_12-825-55-15.css
Executable file
129
src/fonts/dejavuserif/specimen_files/grid_12-825-55-15.css
Executable file
@@ -0,0 +1,129 @@
|
||||
/*Notes about grid:
|
||||
Columns: 12
|
||||
Grid Width: 825px
|
||||
Column Width: 55px
|
||||
Gutter Width: 15px
|
||||
-------------------------------*/
|
||||
|
||||
|
||||
|
||||
.section {margin-bottom: 18px;
|
||||
}
|
||||
.section:after {content: ".";display: block;height: 0;clear: both;visibility: hidden;}
|
||||
.section {*zoom: 1;}
|
||||
|
||||
.section .firstcolumn,
|
||||
.section .firstcol {margin-left: 0;}
|
||||
|
||||
|
||||
/* Border on left hand side of a column. */
|
||||
.border {
|
||||
padding-left: 7px;
|
||||
margin-left: 7px;
|
||||
border-left: 1px solid #eee;
|
||||
}
|
||||
|
||||
/* Border with more whitespace, spans one column. */
|
||||
.colborder {
|
||||
padding-left: 42px;
|
||||
margin-left: 42px;
|
||||
border-left: 1px solid #eee;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* The Grid Classes */
|
||||
.grid1, .grid1_2cols, .grid1_3cols, .grid1_4cols, .grid2, .grid2_3cols, .grid2_4cols, .grid3, .grid3_2cols, .grid3_4cols, .grid4, .grid4_3cols, .grid5, .grid5_2cols, .grid5_3cols, .grid5_4cols, .grid6, .grid6_4cols, .grid7, .grid7_2cols, .grid7_3cols, .grid7_4cols, .grid8, .grid8_3cols, .grid9, .grid9_2cols, .grid9_4cols, .grid10, .grid10_3cols, .grid10_4cols, .grid11, .grid11_2cols, .grid11_3cols, .grid11_4cols, .grid12
|
||||
{margin-left: 15px;float: left;display: inline; overflow: hidden;}
|
||||
|
||||
|
||||
.width1, .grid1, .span-1 {width: 55px;}
|
||||
.width1_2cols,.grid1_2cols {width: 20px;}
|
||||
.width1_3cols,.grid1_3cols {width: 8px;}
|
||||
.width1_4cols,.grid1_4cols {width: 2px;}
|
||||
.input_width1 {width: 49px;}
|
||||
|
||||
.width2, .grid2, .span-2 {width: 125px;}
|
||||
.width2_3cols,.grid2_3cols {width: 31px;}
|
||||
.width2_4cols,.grid2_4cols {width: 20px;}
|
||||
.input_width2 {width: 119px;}
|
||||
|
||||
.width3, .grid3, .span-3 {width: 195px;}
|
||||
.width3_2cols,.grid3_2cols {width: 90px;}
|
||||
.width3_4cols,.grid3_4cols {width: 37px;}
|
||||
.input_width3 {width: 189px;}
|
||||
|
||||
.width4, .grid4, .span-4 {width: 265px;}
|
||||
.width4_3cols,.grid4_3cols {width: 78px;}
|
||||
.input_width4 {width: 259px;}
|
||||
|
||||
.width5, .grid5, .span-5 {width: 335px;}
|
||||
.width5_2cols,.grid5_2cols {width: 160px;}
|
||||
.width5_3cols,.grid5_3cols {width: 101px;}
|
||||
.width5_4cols,.grid5_4cols {width: 72px;}
|
||||
.input_width5 {width: 329px;}
|
||||
|
||||
.width6, .grid6, .span-6 {width: 405px;}
|
||||
.width6_4cols,.grid6_4cols {width: 90px;}
|
||||
.input_width6 {width: 399px;}
|
||||
|
||||
.width7, .grid7, .span-7 {width: 475px;}
|
||||
.width7_2cols,.grid7_2cols {width: 230px;}
|
||||
.width7_3cols,.grid7_3cols {width: 148px;}
|
||||
.width7_4cols,.grid7_4cols {width: 107px;}
|
||||
.input_width7 {width: 469px;}
|
||||
|
||||
.width8, .grid8, .span-8 {width: 545px;}
|
||||
.width8_3cols,.grid8_3cols {width: 171px;}
|
||||
.input_width8 {width: 539px;}
|
||||
|
||||
.width9, .grid9, .span-9 {width: 615px;}
|
||||
.width9_2cols,.grid9_2cols {width: 300px;}
|
||||
.width9_4cols,.grid9_4cols {width: 142px;}
|
||||
.input_width9 {width: 609px;}
|
||||
|
||||
.width10, .grid10, .span-10 {width: 685px;}
|
||||
.width10_3cols,.grid10_3cols {width: 218px;}
|
||||
.width10_4cols,.grid10_4cols {width: 160px;}
|
||||
.input_width10 {width: 679px;}
|
||||
|
||||
.width11, .grid11, .span-11 {width: 755px;}
|
||||
.width11_2cols,.grid11_2cols {width: 370px;}
|
||||
.width11_3cols,.grid11_3cols {width: 241px;}
|
||||
.width11_4cols,.grid11_4cols {width: 177px;}
|
||||
.input_width11 {width: 749px;}
|
||||
|
||||
.width12, .grid12, .span-12 {width: 825px;}
|
||||
.input_width12 {width: 819px;}
|
||||
|
||||
/* Subdivided grid spaces */
|
||||
.emptycols_left1, .prepend-1 {padding-left: 70px;}
|
||||
.emptycols_right1, .append-1 {padding-right: 70px;}
|
||||
.emptycols_left2, .prepend-2 {padding-left: 140px;}
|
||||
.emptycols_right2, .append-2 {padding-right: 140px;}
|
||||
.emptycols_left3, .prepend-3 {padding-left: 210px;}
|
||||
.emptycols_right3, .append-3 {padding-right: 210px;}
|
||||
.emptycols_left4, .prepend-4 {padding-left: 280px;}
|
||||
.emptycols_right4, .append-4 {padding-right: 280px;}
|
||||
.emptycols_left5, .prepend-5 {padding-left: 350px;}
|
||||
.emptycols_right5, .append-5 {padding-right: 350px;}
|
||||
.emptycols_left6, .prepend-6 {padding-left: 420px;}
|
||||
.emptycols_right6, .append-6 {padding-right: 420px;}
|
||||
.emptycols_left7, .prepend-7 {padding-left: 490px;}
|
||||
.emptycols_right7, .append-7 {padding-right: 490px;}
|
||||
.emptycols_left8, .prepend-8 {padding-left: 560px;}
|
||||
.emptycols_right8, .append-8 {padding-right: 560px;}
|
||||
.emptycols_left9, .prepend-9 {padding-left: 630px;}
|
||||
.emptycols_right9, .append-9 {padding-right: 630px;}
|
||||
.emptycols_left10, .prepend-10 {padding-left: 700px;}
|
||||
.emptycols_right10, .append-10 {padding-right: 700px;}
|
||||
.emptycols_left11, .prepend-11 {padding-left: 770px;}
|
||||
.emptycols_right11, .append-11 {padding-right: 770px;}
|
||||
.pull-1 {margin-left: -70px;}
|
||||
.push-1 {margin-right: -70px;margin-left: 18px;float: right;}
|
||||
.pull-2 {margin-left: -140px;}
|
||||
.push-2 {margin-right: -140px;margin-left: 18px;float: right;}
|
||||
.pull-3 {margin-left: -210px;}
|
||||
.push-3 {margin-right: -210px;margin-left: 18px;float: right;}
|
||||
.pull-4 {margin-left: -280px;}
|
||||
.push-4 {margin-right: -280px;margin-left: 18px;float: right;}
|
||||
396
src/fonts/dejavuserif/specimen_files/specimen_stylesheet.css
Executable file
396
src/fonts/dejavuserif/specimen_files/specimen_stylesheet.css
Executable file
@@ -0,0 +1,396 @@
|
||||
@import url('grid_12-825-55-15.css');
|
||||
|
||||
/*
|
||||
CSS Reset by Eric Meyer - Released under Public Domain
|
||||
http://meyerweb.com/eric/tools/css/reset/
|
||||
*/
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center, dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend, table,
|
||||
caption, tbody, tfoot, thead, tr, th, td
|
||||
{margin: 0;padding: 0;border: 0;outline: 0;
|
||||
font-size: 100%;vertical-align: baseline;
|
||||
background: transparent;}
|
||||
body {line-height: 1;}
|
||||
ol, ul {list-style: none;}
|
||||
blockquote, q {quotes: none;}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {content: ''; content: none;}
|
||||
:focus {outline: 0;}
|
||||
ins {text-decoration: none;}
|
||||
del {text-decoration: line-through;}
|
||||
table {border-collapse: collapse;border-spacing: 0;}
|
||||
|
||||
|
||||
|
||||
|
||||
body {
|
||||
color: #000;
|
||||
background-color: #dcdcdc;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #1883ba;
|
||||
}
|
||||
|
||||
h1{
|
||||
font-size: 32px;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
h2{
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#container {
|
||||
width: 865px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
|
||||
#header {
|
||||
padding: 20px;
|
||||
font-size: 36px;
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#header span {
|
||||
color: #666;
|
||||
}
|
||||
#main_content {
|
||||
background-color: #fff;
|
||||
padding: 60px 20px 20px;
|
||||
}
|
||||
|
||||
|
||||
#footer p {
|
||||
margin: 0;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 50px;
|
||||
color: #333;
|
||||
font: 10px Arial, sans-serif;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
width: 100%;
|
||||
height: 31px;
|
||||
background-color: #444;
|
||||
}
|
||||
.tabs li {
|
||||
float: left;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
background-color: #444;
|
||||
}
|
||||
.tabs li a {
|
||||
display: block;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
font: bold 11px/11px 'Arial';
|
||||
text-transform: uppercase;
|
||||
padding: 10px 15px;
|
||||
border-right: 1px solid #fff;
|
||||
}
|
||||
|
||||
.tabs li a:hover {
|
||||
background-color: #00b3ff;
|
||||
|
||||
}
|
||||
|
||||
.tabs li.active a {
|
||||
color: #000;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
div.huge {
|
||||
|
||||
font-size: 300px;
|
||||
line-height: 1em;
|
||||
padding: 0;
|
||||
letter-spacing: -.02em;
|
||||
overflow: hidden;
|
||||
}
|
||||
div.glyph_range {
|
||||
font-size: 72px;
|
||||
line-height: 1.1em;
|
||||
}
|
||||
|
||||
.size10{ font-size: 10px; }
|
||||
.size11{ font-size: 11px; }
|
||||
.size12{ font-size: 12px; }
|
||||
.size13{ font-size: 13px; }
|
||||
.size14{ font-size: 14px; }
|
||||
.size16{ font-size: 16px; }
|
||||
.size18{ font-size: 18px; }
|
||||
.size20{ font-size: 20px; }
|
||||
.size24{ font-size: 24px; }
|
||||
.size30{ font-size: 30px; }
|
||||
.size36{ font-size: 36px; }
|
||||
.size48{ font-size: 48px; }
|
||||
.size60{ font-size: 60px; }
|
||||
.size72{ font-size: 72px; }
|
||||
.size90{ font-size: 90px; }
|
||||
|
||||
|
||||
.psample_row1 { height: 120px;}
|
||||
.psample_row1 { height: 120px;}
|
||||
.psample_row2 { height: 160px;}
|
||||
.psample_row3 { height: 160px;}
|
||||
.psample_row4 { height: 160px;}
|
||||
|
||||
.psample {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.psample p {
|
||||
line-height: 1.3em;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.psample span {
|
||||
margin-right: .5em;
|
||||
}
|
||||
|
||||
.white_blend {
|
||||
width: 100%;
|
||||
height: 61px;
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVkAAAA9CAYAAAAH4BojAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAO1JREFUeNrs3TsKgFAMRUE/eer+NxztxMYuEWQG3ECKwwUF58ycAKixOAGAyAKILAAiCyCyACILgMgCiCyAyAIgsgAiCyCyAIgsgMgCiCwAIgsgsgAiC4DIAogsACIL0CWuZ3UGgLrIhjMA1EV2OAOAJQtgyQLwjOzmDAAiCyCyAIgsQFtkd2cAEFkAkQVAZAHaIns4A4AlC2DJAiCyACILILIAiCzAV5H1dQGAJQsgsgCILIDIAvwisl58AViyAJYsACILILIAIgvAe2T9EhxAZAFEFgCRBeiL7HAGgLrIhjMAWLIAliwAt1OAAQDwygTBulLIlQAAAABJRU5ErkJggg==);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
.black_blend {
|
||||
width: 100%;
|
||||
height: 61px;
|
||||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVkAAAA9CAYAAAAH4BojAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPJJREFUeNrs3TEKhTAQRVGjibr/9QoxhY2N3Ywo50A28IrLwP9g6b1PAMSYTQAgsgAiC4DIAogsgMgCILIAIgsgsgCILIDIAogsACILILIAIguAyAKILIDIAiCyACILgMgCZCnjLWYAiFGvB0BQZJsZAFyyAC5ZAO6RXc0AILIAIguAyAKkRXYzA4DIAogsACILkBbZ3QwALlkAlywAIgsgsgAiC4DIArwVWf8uAHDJAogsACILILIAv4isH74AXLIALlkARBZAZAFEFoDnyPokOIDIAogsACILkBfZZgaAuMhWMwC4ZAE+p4x3mAEgxinAAJ+XBbPWGkwAAAAAAElFTkSuQmCC);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
.fullreverse {
|
||||
background: #000 !important;
|
||||
color: #fff !important;
|
||||
margin-left: -20px;
|
||||
padding-left: 20px;
|
||||
margin-right: -20px;
|
||||
padding-right: 20px;
|
||||
padding: 20px;
|
||||
margin-bottom:0;
|
||||
}
|
||||
|
||||
|
||||
.sample_table td {
|
||||
padding-top: 3px;
|
||||
padding-bottom:5px;
|
||||
padding-left: 5px;
|
||||
vertical-align: middle;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
.sample_table td:first-child {
|
||||
background-color: #eee;
|
||||
text-align: right;
|
||||
padding-right: 5px;
|
||||
padding-left: 0;
|
||||
padding: 5px;
|
||||
font: 11px/12px "Courier New", Courier, mono;
|
||||
}
|
||||
|
||||
code {
|
||||
white-space: pre;
|
||||
background-color: #eee;
|
||||
display: block;
|
||||
padding: 10px;
|
||||
margin-bottom: 18px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
||||
.bottom,.last {margin-bottom:0 !important; padding-bottom:0 !important;}
|
||||
|
||||
.box {
|
||||
padding: 18px;
|
||||
margin-bottom: 18px;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.reverse,.reversed { background: #000 !important;color: #fff !important; border: none !important;}
|
||||
|
||||
#bodycomparison {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
font-size: 72px;
|
||||
height: 90px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#bodycomparison div{
|
||||
font-size: 72px;
|
||||
line-height: 90px;
|
||||
display: inline;
|
||||
margin: 0 15px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#bodycomparison div span{
|
||||
font: 10px Arial;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
}
|
||||
#xheight {
|
||||
float: none;
|
||||
position: absolute;
|
||||
color: #d9f3ff;
|
||||
font-size: 72px;
|
||||
line-height: 90px;
|
||||
}
|
||||
|
||||
.fontbody {
|
||||
position: relative;
|
||||
}
|
||||
.arialbody{
|
||||
font-family: Arial;
|
||||
position: relative;
|
||||
}
|
||||
.verdanabody{
|
||||
font-family: Verdana;
|
||||
position: relative;
|
||||
}
|
||||
.georgiabody{
|
||||
font-family: Georgia;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* @group Layout page
|
||||
*/
|
||||
|
||||
#layout h1 {
|
||||
font-size: 36px;
|
||||
line-height: 42px;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
#layout h2 {
|
||||
font-size: 24px;
|
||||
line-height: 23px;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
#layout h3 {
|
||||
font-size: 22px;
|
||||
line-height: 1.4em;
|
||||
margin-top: 1em;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
|
||||
#layout p.byline {
|
||||
font-size: 12px;
|
||||
margin-top: 18px;
|
||||
line-height: 12px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
#layout p {
|
||||
font-size: 14px;
|
||||
line-height: 21px;
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
|
||||
#layout p.large{
|
||||
font-size: 18px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
#layout .sidebar p{
|
||||
font-size: 12px;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
#layout p.caption {
|
||||
font-size: 10px;
|
||||
margin-top: -16px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
/* @end */
|
||||
|
||||
/* @group Glyphs */
|
||||
|
||||
#glyph_chart div{
|
||||
background-color: #d9f3ff;
|
||||
color: black;
|
||||
float: left;
|
||||
font-size: 36px;
|
||||
height: 1.2em;
|
||||
line-height: 1.2em;
|
||||
margin-bottom: 1px;
|
||||
margin-right: 1px;
|
||||
text-align: center;
|
||||
width: 1.2em;
|
||||
position: relative;
|
||||
padding: .6em .2em .2em;
|
||||
}
|
||||
|
||||
#glyph_chart div p {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: block;
|
||||
text-align: center;
|
||||
font: bold 9px Arial, sans-serif;
|
||||
background-color: #3a768f;
|
||||
width: 100%;
|
||||
color: #fff;
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
|
||||
#glyphs h1 {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
/* @end */
|
||||
|
||||
/* @group Installing */
|
||||
|
||||
#installing {
|
||||
font: 13px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#installing p,
|
||||
#glyphs p{
|
||||
line-height: 1.2em;
|
||||
margin-bottom: 18px;
|
||||
font: 13px Arial, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#installing h3{
|
||||
font-size: 15px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
/* @end */
|
||||
|
||||
#rendering h1 {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
.render_table td {
|
||||
font: 11px "Courier New", Courier, mono;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
12
src/fonts/dejavuserif/stylesheet.css
Executable file
12
src/fonts/dejavuserif/stylesheet.css
Executable file
@@ -0,0 +1,12 @@
|
||||
@font-face {
|
||||
font-family: 'dejavu_serifbook';
|
||||
src: url('/src/fonts/dejavuserif/DejaVuSerif-webfont.eot');
|
||||
src: url('/src/fonts/dejavuserif/DejaVuSerif-webfont.eot?#iefix') format('embedded-opentype'),
|
||||
url('/src/fonts/dejavuserif/DejaVuSerif-webfont.woff') format('woff'),
|
||||
url('/src/fonts/dejavuserif/DejaVuSerif-webfont.ttf') format('truetype'),
|
||||
url('/src/fonts/dejavuserif/DejaVuSerif-webfont.svg#dejavu_serifbook') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
|
||||
}
|
||||
|
||||
51
src/lang-apollo.js
Normal file
51
src/lang-apollo.js
Normal file
@@ -0,0 +1,51 @@
|
||||
// Copyright (C) 2009 Onno Hommes.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for the AGC/AEA Assembly Language as described
|
||||
* at http://virtualagc.googlecode.com
|
||||
* <p>
|
||||
* This file could be used by goodle code to allow syntax highlight for
|
||||
* Virtual AGC SVN repository or if you don't want to commonize
|
||||
* the header for the agc/aea html assembly listing.
|
||||
*
|
||||
* @author ohommes@alumni.cmu.edu
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// A line comment that starts with ;
|
||||
[PR.PR_COMMENT, /^#[^\r\n]*/, null, '#'],
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
||||
// A double quoted, possibly multi-line, string.
|
||||
[PR.PR_STRING, /^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"']
|
||||
],
|
||||
[
|
||||
[PR.PR_KEYWORD, /^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,null],
|
||||
[PR.PR_TYPE, /^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],
|
||||
// A single quote possibly followed by a word that optionally ends with
|
||||
// = ! or ?.
|
||||
[PR.PR_LITERAL,
|
||||
/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],
|
||||
// Any word including labels that optionally ends with = ! or ?.
|
||||
[PR.PR_PLAIN,
|
||||
/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],
|
||||
// A printable non-space non-special character
|
||||
[PR.PR_PUNCTUATION, /^[^\w\t\n\r \xA0()\"\\\';]+/]
|
||||
]),
|
||||
['apollo', 'agc', 'aea']);
|
||||
20
src/lang-betyg.js
Normal file
20
src/lang-betyg.js
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// A line comment that starts with ;
|
||||
[PR.PR_COMMENT, /^;[^\r\n]*/, null, ';'],
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0']
|
||||
],
|
||||
[
|
||||
[PR.PR_KEYWORD, /^\[[\w\s]+\]/],
|
||||
[PR.PR_KEYWORD, /^\%\w+/],
|
||||
[PR.PR_KEYWORD,
|
||||
/[0-9]+(,5)?hp/],
|
||||
[PR.PR_TYPE,
|
||||
/^[A-Z]{3,4}[0-9]{2,3}/],
|
||||
[PR.PR_LITERAL, /^0x[0-9A-F]*/]
|
||||
|
||||
]),
|
||||
['betyg']);
|
||||
78
src/lang-css.js
Normal file
78
src/lang-css.js
Normal file
@@ -0,0 +1,78 @@
|
||||
// Copyright (C) 2009 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for CSS.
|
||||
*
|
||||
*
|
||||
* To use, include prettify.js and this file in your HTML page.
|
||||
* Then put your code in an HTML tag like
|
||||
* <pre class="prettyprint lang-css"></pre>
|
||||
*
|
||||
*
|
||||
* http://www.w3.org/TR/CSS21/grammar.html Section G2 defines the lexical
|
||||
* grammar. This scheme does not recognize keywords containing escapes.
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// The space production <s>
|
||||
[PR.PR_PLAIN, /^[ \t\r\n\f]+/, null, ' \t\r\n\f']
|
||||
],
|
||||
[
|
||||
// Quoted strings. <string1> and <string2>
|
||||
[PR.PR_STRING,
|
||||
/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/, null],
|
||||
[PR.PR_STRING,
|
||||
/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/, null],
|
||||
['lang-css-str', /^url\(([^\)\"\']*)\)/i],
|
||||
[PR.PR_KEYWORD,
|
||||
/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,
|
||||
null],
|
||||
// A property name -- an identifier followed by a colon.
|
||||
['lang-css-kw', /^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],
|
||||
// A C style block comment. The <comment> production.
|
||||
[PR.PR_COMMENT, /^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],
|
||||
// Escaping text spans
|
||||
[PR.PR_COMMENT, /^(?:<!--|-->)/],
|
||||
// A number possibly containing a suffix.
|
||||
[PR.PR_LITERAL, /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],
|
||||
// A hex color
|
||||
[PR.PR_LITERAL, /^#(?:[0-9a-f]{3}){1,2}/i],
|
||||
// An identifier
|
||||
[PR.PR_PLAIN,
|
||||
/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],
|
||||
// A run of punctuation
|
||||
[PR.PR_PUNCTUATION, /^[^\s\w\'\"]+/]
|
||||
]),
|
||||
['css']);
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer([],
|
||||
[
|
||||
[PR.PR_KEYWORD,
|
||||
/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]
|
||||
]),
|
||||
['css-kw']);
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer([],
|
||||
[
|
||||
[PR.PR_STRING, /^[^\)\"\']+/]
|
||||
]),
|
||||
['css-str']);
|
||||
101
src/lang-hs.js
Normal file
101
src/lang-hs.js
Normal file
@@ -0,0 +1,101 @@
|
||||
// Copyright (C) 2009 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for Haskell.
|
||||
*
|
||||
*
|
||||
* To use, include prettify.js and this file in your HTML page.
|
||||
* Then put your code in an HTML tag like
|
||||
* <pre class="prettyprint lang-hs">(my lisp code)</pre>
|
||||
* The lang-cl class identifies the language as common lisp.
|
||||
* This file supports the following language extensions:
|
||||
* lang-cl - Common Lisp
|
||||
* lang-el - Emacs Lisp
|
||||
* lang-lisp - Lisp
|
||||
* lang-scm - Scheme
|
||||
*
|
||||
*
|
||||
* I used http://www.informatik.uni-freiburg.de/~thiemann/haskell/haskell98-report-html/syntax-iso.html
|
||||
* as the basis, but ignore the way the ncomment production nests since this
|
||||
* makes the lexical grammar irregular. It might be possible to support
|
||||
* ncomments using the lookbehind filter.
|
||||
*
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// Whitespace
|
||||
// whitechar -> newline | vertab | space | tab | uniWhite
|
||||
// newline -> return linefeed | return | linefeed | formfeed
|
||||
[PR.PR_PLAIN, /^[\t\n\x0B\x0C\r ]+/, null, '\t\n\x0B\x0C\r '],
|
||||
// Single line double and single-quoted strings.
|
||||
// char -> ' (graphic<' | \> | space | escape<\&>) '
|
||||
// string -> " {graphic<" | \> | space | escape | gap}"
|
||||
// escape -> \ ( charesc | ascii | decimal | o octal
|
||||
// | x hexadecimal )
|
||||
// charesc -> a | b | f | n | r | t | v | \ | " | ' | &
|
||||
[PR.PR_STRING, /^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,
|
||||
null, '"'],
|
||||
[PR.PR_STRING, /^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,
|
||||
null, "'"],
|
||||
// decimal -> digit{digit}
|
||||
// octal -> octit{octit}
|
||||
// hexadecimal -> hexit{hexit}
|
||||
// integer -> decimal
|
||||
// | 0o octal | 0O octal
|
||||
// | 0x hexadecimal | 0X hexadecimal
|
||||
// float -> decimal . decimal [exponent]
|
||||
// | decimal exponent
|
||||
// exponent -> (e | E) [+ | -] decimal
|
||||
[PR.PR_LITERAL,
|
||||
/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,
|
||||
null, '0123456789']
|
||||
],
|
||||
[
|
||||
// Haskell does not have a regular lexical grammar due to the nested
|
||||
// ncomment.
|
||||
// comment -> dashes [ any<symbol> {any}] newline
|
||||
// ncomment -> opencom ANYseq {ncomment ANYseq}closecom
|
||||
// dashes -> '--' {'-'}
|
||||
// opencom -> '{-'
|
||||
// closecom -> '-}'
|
||||
[PR.PR_COMMENT, /^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],
|
||||
// reservedid -> case | class | data | default | deriving | do
|
||||
// | else | if | import | in | infix | infixl | infixr
|
||||
// | instance | let | module | newtype | of | then
|
||||
// | type | where | _
|
||||
[PR.PR_KEYWORD, /^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/, null],
|
||||
// qvarid -> [ modid . ] varid
|
||||
// qconid -> [ modid . ] conid
|
||||
// varid -> (small {small | large | digit | ' })<reservedid>
|
||||
// conid -> large {small | large | digit | ' }
|
||||
// modid -> conid
|
||||
// small -> ascSmall | uniSmall | _
|
||||
// ascSmall -> a | b | ... | z
|
||||
// uniSmall -> any Unicode lowercase letter
|
||||
// large -> ascLarge | uniLarge
|
||||
// ascLarge -> A | B | ... | Z
|
||||
// uniLarge -> any uppercase or titlecase Unicode letter
|
||||
[PR.PR_PLAIN, /^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],
|
||||
// matches the symbol production
|
||||
[PR.PR_PUNCTUATION, /^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]
|
||||
]),
|
||||
['hs']);
|
||||
93
src/lang-lisp.js
Normal file
93
src/lang-lisp.js
Normal file
@@ -0,0 +1,93 @@
|
||||
// Copyright (C) 2008 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for Common Lisp and related languages.
|
||||
*
|
||||
*
|
||||
* To use, include prettify.js and this file in your HTML page.
|
||||
* Then put your code in an HTML tag like
|
||||
* <pre class="prettyprint lang-lisp">(my lisp code)</pre>
|
||||
* The lang-cl class identifies the language as common lisp.
|
||||
* This file supports the following language extensions:
|
||||
* lang-cl - Common Lisp
|
||||
* lang-el - Emacs Lisp
|
||||
* lang-lisp - Lisp
|
||||
* lang-scm - Scheme
|
||||
*
|
||||
*
|
||||
* I used http://www.devincook.com/goldparser/doc/meta-language/grammar-LISP.htm
|
||||
* as the basis, but added line comments that start with ; and changed the atom
|
||||
* production to disallow unquoted semicolons.
|
||||
*
|
||||
* "Name" = 'LISP'
|
||||
* "Author" = 'John McCarthy'
|
||||
* "Version" = 'Minimal'
|
||||
* "About" = 'LISP is an abstract language that organizes ALL'
|
||||
* | 'data around "lists".'
|
||||
*
|
||||
* "Start Symbol" = [s-Expression]
|
||||
*
|
||||
* {Atom Char} = {Printable} - {Whitespace} - [()"\'']
|
||||
*
|
||||
* Atom = ( {Atom Char} | '\'{Printable} )+
|
||||
*
|
||||
* [s-Expression] ::= [Quote] Atom
|
||||
* | [Quote] '(' [Series] ')'
|
||||
* | [Quote] '(' [s-Expression] '.' [s-Expression] ')'
|
||||
*
|
||||
* [Series] ::= [s-Expression] [Series]
|
||||
* |
|
||||
*
|
||||
* [Quote] ::= '' !Quote = do not evaluate
|
||||
* |
|
||||
*
|
||||
*
|
||||
* I used <a href="http://gigamonkeys.com/book/">Practical Common Lisp</a> as
|
||||
* the basis for the reserved word list.
|
||||
*
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
['opn', /^\(/, null, '('],
|
||||
['clo', /^\)/, null, ')'],
|
||||
// A line comment that starts with ;
|
||||
[PR.PR_COMMENT, /^;[^\r\n]*/, null, ';'],
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
||||
// A double quoted, possibly multi-line, string.
|
||||
[PR.PR_STRING, /^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/, null, '"']
|
||||
],
|
||||
[
|
||||
[PR.PR_KEYWORD, /^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, null],
|
||||
[PR.PR_LITERAL,
|
||||
/^[+\-]?(?:0x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],
|
||||
// A single quote possibly followed by a word that optionally ends with
|
||||
// = ! or ?.
|
||||
[PR.PR_LITERAL,
|
||||
/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],
|
||||
// A word that optionally ends with = ! or ?.
|
||||
[PR.PR_PLAIN,
|
||||
/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],
|
||||
// A printable non-space non-special character
|
||||
[PR.PR_PUNCTUATION, /^[^\w\t\n\r \xA0()\"\\\';]+/]
|
||||
]),
|
||||
['cl', 'el', 'lisp', 'scm']);
|
||||
59
src/lang-lua.js
Normal file
59
src/lang-lua.js
Normal file
@@ -0,0 +1,59 @@
|
||||
// Copyright (C) 2008 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for Lua.
|
||||
*
|
||||
*
|
||||
* To use, include prettify.js and this file in your HTML page.
|
||||
* Then put your code in an HTML tag like
|
||||
* <pre class="prettyprint lang-lua">(my Lua code)</pre>
|
||||
*
|
||||
*
|
||||
* I used http://www.lua.org/manual/5.1/manual.html#2.1
|
||||
* Because of the long-bracket concept used in strings and comments, Lua does
|
||||
* not have a regular lexical grammar, but luckily it fits within the space
|
||||
* of irregular grammars supported by javascript regular expressions.
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
||||
// A double or single quoted, possibly multi-line, string.
|
||||
[PR.PR_STRING, /^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/, null, '"\'']
|
||||
],
|
||||
[
|
||||
// A comment is either a line comment that starts with two dashes, or
|
||||
// two dashes preceding a long bracketed block.
|
||||
[PR.PR_COMMENT, /^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],
|
||||
// A long bracketed block not preceded by -- is a string.
|
||||
[PR.PR_STRING, /^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],
|
||||
[PR.PR_KEYWORD, /^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/, null],
|
||||
// A number is a hex integer literal, a decimal real literal, or in
|
||||
// scientific notation.
|
||||
[PR.PR_LITERAL,
|
||||
/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],
|
||||
// An identifier
|
||||
[PR.PR_PLAIN, /^[a-z_]\w*/i],
|
||||
// A run of punctuation
|
||||
[PR.PR_PUNCTUATION, /^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]
|
||||
]),
|
||||
['lua']);
|
||||
56
src/lang-ml.js
Normal file
56
src/lang-ml.js
Normal file
@@ -0,0 +1,56 @@
|
||||
// Copyright (C) 2008 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for OCaml, SML, F# and similar languages.
|
||||
*
|
||||
* Based on the lexical grammar at
|
||||
* http://research.microsoft.com/fsharp/manual/spec2.aspx#_Toc202383715
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// Whitespace is made up of spaces, tabs and newline characters.
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
||||
// #if ident/#else/#endif directives delimit conditional compilation
|
||||
// sections
|
||||
[PR.PR_COMMENT,
|
||||
/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,
|
||||
null, '#'],
|
||||
// A double or single quoted, possibly multi-line, string.
|
||||
// F# allows escaped newlines in strings.
|
||||
[PR.PR_STRING, /^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/, null, '"\'']
|
||||
],
|
||||
[
|
||||
// Block comments are delimited by (* and *) and may be
|
||||
// nested. Single-line comments begin with // and extend to
|
||||
// the end of a line.
|
||||
// TODO: (*...*) comments can be nested. This does not handle that.
|
||||
[PR.PR_COMMENT, /^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],
|
||||
[PR.PR_KEYWORD, /^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/],
|
||||
// A number is a hex integer literal, a decimal real literal, or in
|
||||
// scientific notation.
|
||||
[PR.PR_LITERAL,
|
||||
/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],
|
||||
[PR.PR_PLAIN, /^(?:[a-z_]\w*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],
|
||||
// A printable non-space non-special character
|
||||
[PR.PR_PUNCTUATION, /^[^\t\n\r \xA0\"\'\w]+/]
|
||||
]),
|
||||
['fs', 'ml']);
|
||||
48
src/lang-nasm.js
Normal file
48
src/lang-nasm.js
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright (C) 2009 Onno Hommes.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for the AGC/AEA Assembly Language as described
|
||||
* at http://virtualagc.googlecode.com
|
||||
* <p>
|
||||
* This file could be used by goodle code to allow syntax highlight for
|
||||
* Virtual AGC SVN repository or if you don't want to commonize
|
||||
* the header for the agc/aea html assembly listing.
|
||||
*
|
||||
* @author ohommes@alumni.cmu.edu
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// A line comment that starts with ;
|
||||
[PR.PR_COMMENT, /^;[^\r\n]*/, null, ';'],
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0']
|
||||
],
|
||||
[
|
||||
[PR.PR_KEYWORD, /^\[[\w\s]+\]/],
|
||||
[PR.PR_KEYWORD, /^\%\w+/],
|
||||
[PR.PR_KEYWORD,
|
||||
/^\b(align|cli|sti|mov|equ|dd|dw|times|or|lgdt|xor|invlpg|add|pusha|push|call|jmp|popa|pop|int|ret)\b/],
|
||||
[PR.PR_TYPE,
|
||||
/^\b(eax|ax|ah|al|ebx|bx|bh|bl|ecx|cx|ch|cl|edx|dx|dh|dl|esi|edi|ebp|eip|esp|eflags|cs|ds|es|fs|gs|ss|cr0|cr1|cr2|cr3|cr4)\b/],
|
||||
[PR.PR_DECLARATION, /^#.*/, null, '#'],
|
||||
[PR.PR_LITERAL, /^0x[0-9A-F]*/],
|
||||
[PR.PR_LITERAL, /^\d+/]
|
||||
|
||||
]),
|
||||
['nasm', 'asm', 'as', 's']);
|
||||
35
src/lang-proto.js
Normal file
35
src/lang-proto.js
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright (C) 2006 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for Protocol Buffers as described at
|
||||
* http://code.google.com/p/protobuf/.
|
||||
*
|
||||
* Based on the lexical grammar at
|
||||
* http://research.microsoft.com/fsharp/manual/spec2.aspx#_Toc202383715
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(PR.sourceDecorator({
|
||||
keywords: (
|
||||
'bool bytes default double enum extend extensions false fixed32 '
|
||||
+ 'fixed64 float group import int32 int64 max message option '
|
||||
+ 'optional package repeated required returns rpc service '
|
||||
+ 'sfixed32 sfixed64 sint32 sint64 string syntax to true uint32 '
|
||||
+ 'uint64'),
|
||||
cStyleComments: true
|
||||
}), ['proto']);
|
||||
54
src/lang-scala.js
Normal file
54
src/lang-scala.js
Normal file
@@ -0,0 +1,54 @@
|
||||
// Copyright (C) 2010 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for Scala.
|
||||
*
|
||||
* Derived from http://lampsvn.epfl.ch/svn-repos/scala/scala-documentation/trunk/src/reference/SyntaxSummary.tex
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
||||
// A double or single quoted string
|
||||
// or a triple double-quoted multi-line string.
|
||||
[PR.PR_STRING,
|
||||
/^(?:"(?:(?:""(?:""?(?!")|[^\\"]|\\.)*"{0,3})|(?:[^"\r\n\\]|\\.)*"?))/,
|
||||
null, '"'],
|
||||
[PR.PR_LITERAL, /^`(?:[^\r\n\\`]|\\.)*`?/, null, '`'],
|
||||
[PR.PR_PUNCTUATION, /^[!#%&()*+,\-:;<=>?@\[\\\]^{|}~]+/, null,
|
||||
'!#%&()*+,-:;<=>?@[\\]^{|}~']
|
||||
],
|
||||
[
|
||||
// A symbol literal is a single quote followed by an identifier with no
|
||||
// single quote following
|
||||
// A character literal has single quotes on either side
|
||||
[PR.PR_STRING, /^'(?:[^\r\n\\']|\\(?:'|[^\r\n']+))'/],
|
||||
[PR.PR_LITERAL, /^'[a-zA-Z_$][\w$]*(?!['$\w])/],
|
||||
[PR.PR_KEYWORD, /^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/],
|
||||
[PR.PR_LITERAL, /^(?:true|false|null|this)\b/],
|
||||
[PR.PR_LITERAL, /^(?:(?:0(?:[0-7]+|X[0-9A-F]+))L?|(?:(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)?(?:E[+\-]?[0-9]+)?F?|L?))|\\.[0-9]+(?:E[+\-]?[0-9]+)?F?)/i],
|
||||
// Treat upper camel case identifiers as types.
|
||||
[PR.PR_TYPE, /^[$_]*[A-Z][_$A-Z0-9]*[a-z][\w$]*/],
|
||||
[PR.PR_PLAIN, /^[$a-zA-Z_][\w$]*/],
|
||||
[PR.PR_COMMENT, /^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],
|
||||
[PR.PR_PUNCTUATION, /^(?:\.+|\/)/]
|
||||
]),
|
||||
['scala']);
|
||||
57
src/lang-sql.js
Normal file
57
src/lang-sql.js
Normal file
@@ -0,0 +1,57 @@
|
||||
// Copyright (C) 2008 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for SQL.
|
||||
*
|
||||
*
|
||||
* To use, include prettify.js and this file in your HTML page.
|
||||
* Then put your code in an HTML tag like
|
||||
* <pre class="prettyprint lang-sql">(my SQL code)</pre>
|
||||
*
|
||||
*
|
||||
* http://savage.net.au/SQL/sql-99.bnf.html is the basis for the grammar, and
|
||||
* http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx as the basis
|
||||
* for the keyword list.
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
||||
// A double or single quoted, possibly multi-line, string.
|
||||
[PR.PR_STRING, /^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/, null,
|
||||
'"\'']
|
||||
],
|
||||
[
|
||||
// A comment is either a line comment that starts with two dashes, or
|
||||
// two dashes preceding a long bracketed block.
|
||||
[PR.PR_COMMENT, /^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],
|
||||
[PR.PR_KEYWORD, /^(?:ADD|ALL|ALTER|AND|ANY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|NATIONAL|NOCHECK|NONCLUSTERED|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PERCENT|PLAN|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNION|UNIQUE|UPDATE|UPDATETEXT|USE|USER|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WRITETEXT)(?=[^\w-]|$)/i, null],
|
||||
// A number is a hex integer literal, a decimal real literal, or in
|
||||
// scientific notation.
|
||||
[PR.PR_LITERAL,
|
||||
/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],
|
||||
// An identifier
|
||||
[PR.PR_PLAIN, /^[a-z_][\w-]*/i],
|
||||
// A run of punctuation
|
||||
[PR.PR_PUNCTUATION, /^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]
|
||||
]),
|
||||
['sql']);
|
||||
46
src/lang-tex.js
Normal file
46
src/lang-tex.js
Normal file
@@ -0,0 +1,46 @@
|
||||
// Copyright (C) 2011 Martin S.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Support for tex highlighting as discussed on
|
||||
* <a href="http://meta.tex.stackexchange.com/questions/872/text-immediate-following-double-backslashes-is-highlighted-as-macro-inside-a-code/876#876">meta.tex.stackexchange.com</a>.
|
||||
*
|
||||
* @author Martin S.
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0'],
|
||||
// all comments begin with '%'
|
||||
[PR.PR_COMMENT, /^%[^\r\n]*/, null, '%']
|
||||
],
|
||||
[
|
||||
//[PR.PR_DECLARATION, /^\\([egx]?def|(new|renew|provide)(command|environment))\b/],
|
||||
// any command starting with a \ and contains
|
||||
// either only letters (a-z,A-Z), '@' (internal macros)
|
||||
[PR.PR_KEYWORD, /^\\[a-zA-Z@]+/],
|
||||
// or contains only one character
|
||||
[PR.PR_KEYWORD, /^\\./],
|
||||
// Highlight dollar for math mode and ampersam for tabular
|
||||
[PR.PR_TYPE, /^[$&]/],
|
||||
// numeric measurement values with attached units
|
||||
[PR.PR_LITERAL,
|
||||
/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],
|
||||
// punctuation usually occurring within commands
|
||||
[PR.PR_PUNCTUATION, /^[{}()\[\]=]+/]
|
||||
]),
|
||||
['latex', 'tex']);
|
||||
61
src/lang-vb.js
Normal file
61
src/lang-vb.js
Normal file
@@ -0,0 +1,61 @@
|
||||
// Copyright (C) 2009 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for various flavors of basic.
|
||||
*
|
||||
*
|
||||
* To use, include prettify.js and this file in your HTML page.
|
||||
* Then put your code in an HTML tag like
|
||||
* <pre class="prettyprint lang-vb"></pre>
|
||||
*
|
||||
*
|
||||
* http://msdn.microsoft.com/en-us/library/aa711638(VS.71).aspx defines the
|
||||
* visual basic grammar lexical grammar.
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0\u2028\u2029]+/, null, '\t\n\r \xA0\u2028\u2029'],
|
||||
// A double quoted string with quotes escaped by doubling them.
|
||||
// A single character can be suffixed with C.
|
||||
[PR.PR_STRING, /^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i, null,
|
||||
'"\u201C\u201D'],
|
||||
// A comment starts with a single quote and runs until the end of the
|
||||
// line.
|
||||
[PR.PR_COMMENT, /^[\'\u2018\u2019][^\r\n\u2028\u2029]*/, null, '\'\u2018\u2019']
|
||||
],
|
||||
[
|
||||
[PR.PR_KEYWORD, /^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i, null],
|
||||
// A second comment form
|
||||
[PR.PR_COMMENT, /^REM[^\r\n\u2028\u2029]*/i],
|
||||
// A boolean, numeric, or date literal.
|
||||
[PR.PR_LITERAL,
|
||||
/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],
|
||||
// An identifier?
|
||||
[PR.PR_PLAIN, /^(?:(?:[a-z]|_\w)\w*|\[(?:[a-z]|_\w)\w*\])/i],
|
||||
// A run of punctuation
|
||||
[PR.PR_PUNCTUATION,
|
||||
/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],
|
||||
// Square brackets
|
||||
[PR.PR_PUNCTUATION, /^(?:\[|\])/]
|
||||
]),
|
||||
['vb', 'vbs']);
|
||||
34
src/lang-vhdl.js
Normal file
34
src/lang-vhdl.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for VHDL '93.
|
||||
*
|
||||
* Based on the lexical grammar and keywords at
|
||||
* http://www.iis.ee.ethz.ch/~zimmi/download/vhdl93_syntax.html
|
||||
*
|
||||
* @author benoit@ryder.fr
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t\n\r \xA0]+/, null, '\t\n\r \xA0']
|
||||
],
|
||||
[
|
||||
// String, character or bit string
|
||||
[PR.PR_STRING, /^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],
|
||||
// Comment, from two dashes until end of line.
|
||||
[PR.PR_COMMENT, /^--[^\r\n]*/],
|
||||
[PR.PR_KEYWORD, /^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, null],
|
||||
// Type, predefined or standard
|
||||
[PR.PR_TYPE, /^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i, null],
|
||||
// Predefined attributes
|
||||
[PR.PR_TYPE, /^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i, null],
|
||||
// Number, decimal or based literal
|
||||
[PR.PR_LITERAL, /^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i],
|
||||
// Identifier, basic or extended
|
||||
[PR.PR_PLAIN, /^(?:[a-z]\w*|\\[^\\]*\\)/i],
|
||||
// Punctuation
|
||||
[PR.PR_PUNCTUATION, /^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]
|
||||
]),
|
||||
['vhdl', 'vhd']);
|
||||
53
src/lang-wiki.js
Normal file
53
src/lang-wiki.js
Normal file
@@ -0,0 +1,53 @@
|
||||
// Copyright (C) 2009 Google Inc.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for Wiki pages.
|
||||
*
|
||||
* Based on WikiSyntax at http://code.google.com/p/support/wiki/WikiSyntax
|
||||
*
|
||||
* @author mikesamuel@gmail.com
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
// Whitespace
|
||||
[PR.PR_PLAIN, /^[\t \xA0a-gi-z0-9]+/, null,
|
||||
'\t \xA0abcdefgijklmnopqrstuvwxyz0123456789'],
|
||||
// Wiki formatting
|
||||
[PR.PR_PUNCTUATION, /^[=*~\^\[\]]+/, null, '=*~^[]']
|
||||
],
|
||||
[
|
||||
// Meta-info like #summary, #labels, etc.
|
||||
['lang-wiki.meta', /(?:^^|\r\n?|\n)(#[a-z]+)\b/],
|
||||
// A WikiWord
|
||||
[PR.PR_LITERAL, /^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/
|
||||
],
|
||||
// A preformatted block in an unknown language
|
||||
['lang-', /^\{\{\{([\s\S]+?)\}\}\}/],
|
||||
// A block of source code in an unknown language
|
||||
['lang-', /^`([^\r\n`]+)`/],
|
||||
// An inline URL.
|
||||
[PR.PR_STRING,
|
||||
/^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],
|
||||
[PR.PR_PLAIN, /^(?:\r\n|[\s\S])[^#=*~^A-Zh\{`\[\r\n]*/]
|
||||
]),
|
||||
['wiki']);
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer([[PR.PR_KEYWORD, /^#[a-z]+/i, null, '#']], []),
|
||||
['wiki.meta']);
|
||||
27
src/lang-yaml.js
Normal file
27
src/lang-yaml.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// Contributed by ribrdb @ code.google.com
|
||||
|
||||
/**
|
||||
* @fileoverview
|
||||
* Registers a language handler for YAML.
|
||||
*
|
||||
* @author ribrdb
|
||||
*/
|
||||
|
||||
PR.registerLangHandler(
|
||||
PR.createSimpleLexer(
|
||||
[
|
||||
[PR.PR_PUNCTUATION, /^[:|>?]+/, null, ':|>?'],
|
||||
[PR.PR_DECLARATION, /^%(?:YAML|TAG)[^#\r\n]+/, null, '%'],
|
||||
[PR.PR_TYPE, /^[&]\S+/, null, '&'],
|
||||
[PR.PR_TYPE, /^!\S*/, null, '!'],
|
||||
[PR.PR_STRING, /^"(?:[^\\"]|\\.)*(?:"|$)/, null, '"'],
|
||||
[PR.PR_STRING, /^'(?:[^']|'')*(?:'|$)/, null, "'"],
|
||||
[PR.PR_COMMENT, /^#[^\r\n]*/, null, '#'],
|
||||
[PR.PR_PLAIN, /^\s+/, null, ' \t\r\n']
|
||||
],
|
||||
[
|
||||
[PR.PR_DECLARATION, /^(?:---|\.\.\.)(?:[\r\n]|$)/],
|
||||
[PR.PR_PUNCTUATION, /^-/],
|
||||
[PR.PR_KEYWORD, /^\w+:[ \r\n]/],
|
||||
[PR.PR_PLAIN, /^\w+/]
|
||||
]), ['yaml', 'yml']);
|
||||
765
src/openid.php
Normal file
765
src/openid.php
Normal file
@@ -0,0 +1,765 @@
|
||||
<?php
|
||||
/**
|
||||
* This class provides a simple interface for OpenID (1.1 and 2.0) authentication.
|
||||
* Supports Yadis discovery.
|
||||
* The authentication process is stateless/dumb.
|
||||
*
|
||||
* Usage:
|
||||
* Sign-on with OpenID is a two step process:
|
||||
* Step one is authentication with the provider:
|
||||
* <code>
|
||||
* $openid = new LightOpenID;
|
||||
* $openid->identity = 'ID supplied by user';
|
||||
* header('Location: ' . $openid->authUrl());
|
||||
* </code>
|
||||
* The provider then sends various parameters via GET, one of them is openid_mode.
|
||||
* Step two is verification:
|
||||
* <code>
|
||||
* if ($this->data['openid_mode']) {
|
||||
* $openid = new LightOpenID;
|
||||
* echo $openid->validate() ? 'Logged in.' : 'Failed';
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* Optionally, you can set $returnUrl and $realm (or $trustRoot, which is an alias).
|
||||
* The default values for those are:
|
||||
* $openid->realm = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
|
||||
* $openid->returnUrl = $openid->realm . $_SERVER['REQUEST_URI'];
|
||||
* If you don't know their meaning, refer to any openid tutorial, or specification. Or just guess.
|
||||
*
|
||||
* AX and SREG extensions are supported.
|
||||
* To use them, specify $openid->required and/or $openid->optional before calling $openid->authUrl().
|
||||
* These are arrays, with values being AX schema paths (the 'path' part of the URL).
|
||||
* For example:
|
||||
* $openid->required = array('namePerson/friendly', 'contact/email');
|
||||
* $openid->optional = array('namePerson/first');
|
||||
* If the server supports only SREG or OpenID 1.1, these are automaticaly
|
||||
* mapped to SREG names, so that user doesn't have to know anything about the server.
|
||||
*
|
||||
* To get the values, use $openid->getAttributes().
|
||||
*
|
||||
*
|
||||
* The library requires PHP >= 5.1.2 with curl or http/https stream wrappers enabled.
|
||||
* @author Mewp
|
||||
* @copyright Copyright (c) 2010, Mewp
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT
|
||||
*/
|
||||
class LightOpenID
|
||||
{
|
||||
public $returnUrl
|
||||
, $required = array()
|
||||
, $optional = array()
|
||||
, $verify_peer = null
|
||||
, $capath = null
|
||||
, $cainfo = null;
|
||||
private $identity, $claimed_id;
|
||||
protected $server, $version, $trustRoot, $aliases, $identifier_select = false
|
||||
, $ax = false, $sreg = false, $data, $setup_url = null;
|
||||
static protected $ax_to_sreg = array(
|
||||
'namePerson/friendly' => 'nickname',
|
||||
'contact/email' => 'email',
|
||||
'namePerson' => 'fullname',
|
||||
'birthDate' => 'dob',
|
||||
'person/gender' => 'gender',
|
||||
'contact/postalCode/home' => 'postcode',
|
||||
'contact/country/home' => 'country',
|
||||
'pref/language' => 'language',
|
||||
'pref/timezone' => 'timezone',
|
||||
'namePerson/first' => 'firstname',
|
||||
'namePerson/last' => 'lastname',
|
||||
);
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->trustRoot = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
|
||||
$uri = rtrim(preg_replace('#((?<=\?)|&)openid\.[^&]+#', '', $_SERVER['REQUEST_URI']), '?');
|
||||
$this->returnUrl = $this->trustRoot . $uri;
|
||||
|
||||
$this->data = $_POST + $_GET; # OPs may send data as POST or GET.
|
||||
|
||||
if(!function_exists('curl_init') && !in_array('https', stream_get_wrappers())) {
|
||||
throw new ErrorException('You must have either https wrappers or curl enabled.');
|
||||
}
|
||||
}
|
||||
|
||||
function __set($name, $value)
|
||||
{
|
||||
switch ($name) {
|
||||
case 'identity':
|
||||
if (strlen($value = trim((String) $value))) {
|
||||
if (preg_match('#^xri:/*#i', $value, $m)) {
|
||||
$value = substr($value, strlen($m[0]));
|
||||
} elseif (!preg_match('/^(?:[=@+\$!\(]|https?:)/i', $value)) {
|
||||
$value = "http://$value";
|
||||
}
|
||||
if (preg_match('#^https?://[^/]+$#i', $value, $m)) {
|
||||
$value .= '/';
|
||||
}
|
||||
}
|
||||
$this->$name = $this->claimed_id = $value;
|
||||
break;
|
||||
case 'trustRoot':
|
||||
case 'realm':
|
||||
$this->trustRoot = trim($value);
|
||||
}
|
||||
}
|
||||
|
||||
function __get($name)
|
||||
{
|
||||
switch ($name) {
|
||||
case 'identity':
|
||||
# We return claimed_id instead of identity,
|
||||
# because the developer should see the claimed identifier,
|
||||
# i.e. what he set as identity, not the op-local identifier (which is what we verify)
|
||||
return $this->claimed_id;
|
||||
case 'trustRoot':
|
||||
case 'realm':
|
||||
return $this->trustRoot;
|
||||
case 'mode':
|
||||
return empty($this->data['openid_mode']) ? null : $this->data['openid_mode'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the server specified in the url exists.
|
||||
*
|
||||
* @param $url url to check
|
||||
* @return true, if the server exists; false otherwise
|
||||
*/
|
||||
function hostExists($url)
|
||||
{
|
||||
if (strpos($url, '/') === false) {
|
||||
$server = $url;
|
||||
} else {
|
||||
$server = @parse_url($url, PHP_URL_HOST);
|
||||
}
|
||||
|
||||
if (!$server) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !!gethostbynamel($server);
|
||||
}
|
||||
|
||||
protected function request_curl($url, $method='GET', $params=array())
|
||||
{
|
||||
$params = http_build_query($params, '', '&');
|
||||
$curl = curl_init($url . ($method == 'GET' && $params ? '?' . $params : ''));
|
||||
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/xrds+xml, */*'));
|
||||
|
||||
if($this->verify_peer !== null) {
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
|
||||
if($this->capath) {
|
||||
curl_setopt($curl, CURLOPT_CAPATH, $this->capath);
|
||||
}
|
||||
|
||||
if($this->cainfo) {
|
||||
curl_setopt($curl, CURLOPT_CAINFO, $this->cainfo);
|
||||
}
|
||||
}
|
||||
|
||||
if ($method == 'POST') {
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
|
||||
} elseif ($method == 'HEAD') {
|
||||
curl_setopt($curl, CURLOPT_HEADER, true);
|
||||
curl_setopt($curl, CURLOPT_NOBODY, true);
|
||||
} else {
|
||||
curl_setopt($curl, CURLOPT_HTTPGET, true);
|
||||
}
|
||||
$response = curl_exec($curl);
|
||||
|
||||
if($method == 'HEAD') {
|
||||
$headers = array();
|
||||
foreach(explode("\n", $response) as $header) {
|
||||
$pos = strpos($header,':');
|
||||
$name = strtolower(trim(substr($header, 0, $pos)));
|
||||
$headers[$name] = trim(substr($header, $pos+1));
|
||||
}
|
||||
|
||||
# Updating claimed_id in case of redirections.
|
||||
$effective_url = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL);
|
||||
if($effective_url != $url) {
|
||||
$this->identity = $this->claimed_id = $effective_url;
|
||||
}
|
||||
|
||||
return $headers;
|
||||
}
|
||||
|
||||
if (curl_errno($curl)) {
|
||||
throw new ErrorException(curl_error($curl), curl_errno($curl));
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
protected function request_streams($url, $method='GET', $params=array())
|
||||
{
|
||||
if(!$this->hostExists($url)) {
|
||||
throw new ErrorException('Invalid request.');
|
||||
}
|
||||
|
||||
$params = http_build_query($params, '', '&');
|
||||
switch($method) {
|
||||
case 'GET':
|
||||
$opts = array(
|
||||
'http' => array(
|
||||
'method' => 'GET',
|
||||
'header' => 'Accept: application/xrds+xml, */*',
|
||||
'ignore_errors' => true,
|
||||
)
|
||||
);
|
||||
$url = $url . ($params ? '?' . $params : '');
|
||||
break;
|
||||
case 'POST':
|
||||
$opts = array(
|
||||
'http' => array(
|
||||
'method' => 'POST',
|
||||
'header' => 'Content-type: application/x-www-form-urlencoded',
|
||||
'content' => $params,
|
||||
'ignore_errors' => true,
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'HEAD':
|
||||
# We want to send a HEAD request,
|
||||
# but since get_headers doesn't accept $context parameter,
|
||||
# we have to change the defaults.
|
||||
$default = stream_context_get_options(stream_context_get_default());
|
||||
stream_context_get_default(
|
||||
array('http' => array(
|
||||
'method' => 'HEAD',
|
||||
'header' => 'Accept: application/xrds+xml, */*',
|
||||
'ignore_errors' => true,
|
||||
))
|
||||
);
|
||||
|
||||
$url = $url . ($params ? '?' . $params : '');
|
||||
$headers_tmp = get_headers ($url);
|
||||
if(!$headers_tmp) {
|
||||
return array();
|
||||
}
|
||||
|
||||
# Parsing headers.
|
||||
$headers = array();
|
||||
foreach($headers_tmp as $header) {
|
||||
$pos = strpos($header,':');
|
||||
$name = strtolower(trim(substr($header, 0, $pos)));
|
||||
$headers[$name] = trim(substr($header, $pos+1));
|
||||
|
||||
# Following possible redirections. The point is just to have
|
||||
# claimed_id change with them, because get_headers() will
|
||||
# follow redirections automatically.
|
||||
# We ignore redirections with relative paths.
|
||||
# If any known provider uses them, file a bug report.
|
||||
if($name == 'location') {
|
||||
if(strpos($headers[$name], 'http') === 0) {
|
||||
$this->identity = $this->claimed_id = $headers[$name];
|
||||
} elseif($headers[$name][0] == '/') {
|
||||
$parsed_url = parse_url($this->claimed_id);
|
||||
$this->identity =
|
||||
$this->claimed_id = $parsed_url['scheme'] . '://'
|
||||
. $parsed_url['host']
|
||||
. $headers[$name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# And restore them.
|
||||
stream_context_get_default($default);
|
||||
return $headers;
|
||||
}
|
||||
|
||||
if($this->verify_peer) {
|
||||
$opts += array('ssl' => array(
|
||||
'verify_peer' => true,
|
||||
'capath' => $this->capath,
|
||||
'cafile' => $this->cainfo,
|
||||
));
|
||||
}
|
||||
|
||||
$context = stream_context_create ($opts);
|
||||
|
||||
return file_get_contents($url, false, $context);
|
||||
}
|
||||
|
||||
protected function request($url, $method='GET', $params=array())
|
||||
{
|
||||
if(function_exists('curl_init') && !ini_get('safe_mode') && !ini_get('open_basedir')) {
|
||||
return $this->request_curl($url, $method, $params);
|
||||
}
|
||||
return $this->request_streams($url, $method, $params);
|
||||
}
|
||||
|
||||
protected function build_url($url, $parts)
|
||||
{
|
||||
if (isset($url['query'], $parts['query'])) {
|
||||
$parts['query'] = $url['query'] . '&' . $parts['query'];
|
||||
}
|
||||
|
||||
$url = $parts + $url;
|
||||
$url = $url['scheme'] . '://'
|
||||
. (empty($url['username'])?''
|
||||
:(empty($url['password'])? "{$url['username']}@"
|
||||
:"{$url['username']}:{$url['password']}@"))
|
||||
. $url['host']
|
||||
. (empty($url['port'])?'':":{$url['port']}")
|
||||
. (empty($url['path'])?'':$url['path'])
|
||||
. (empty($url['query'])?'':"?{$url['query']}")
|
||||
. (empty($url['fragment'])?'':"#{$url['fragment']}");
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function used to scan for <meta>/<link> tags and extract information
|
||||
* from them
|
||||
*/
|
||||
protected function htmlTag($content, $tag, $attrName, $attrValue, $valueName)
|
||||
{
|
||||
preg_match_all("#<{$tag}[^>]*$attrName=['\"].*?$attrValue.*?['\"][^>]*$valueName=['\"](.+?)['\"][^>]*/?>#i", $content, $matches1);
|
||||
preg_match_all("#<{$tag}[^>]*$valueName=['\"](.+?)['\"][^>]*$attrName=['\"].*?$attrValue.*?['\"][^>]*/?>#i", $content, $matches2);
|
||||
|
||||
$result = array_merge($matches1[1], $matches2[1]);
|
||||
return empty($result)?false:$result[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs Yadis and HTML discovery. Normally not used.
|
||||
* @param $url Identity URL.
|
||||
* @return String OP Endpoint (i.e. OpenID provider address).
|
||||
* @throws ErrorException
|
||||
*/
|
||||
function discover($url)
|
||||
{
|
||||
if (!$url) throw new ErrorException('No identity supplied.');
|
||||
# Use xri.net proxy to resolve i-name identities
|
||||
if (!preg_match('#^https?:#', $url)) {
|
||||
$url = "https://xri.net/$url";
|
||||
}
|
||||
|
||||
# We save the original url in case of Yadis discovery failure.
|
||||
# It can happen when we'll be lead to an XRDS document
|
||||
# which does not have any OpenID2 services.
|
||||
$originalUrl = $url;
|
||||
|
||||
# A flag to disable yadis discovery in case of failure in headers.
|
||||
$yadis = true;
|
||||
|
||||
# We'll jump a maximum of 5 times, to avoid endless redirections.
|
||||
for ($i = 0; $i < 5; $i ++) {
|
||||
if ($yadis) {
|
||||
$headers = $this->request($url, 'HEAD');
|
||||
|
||||
$next = false;
|
||||
if (isset($headers['x-xrds-location'])) {
|
||||
$url = $this->build_url(parse_url($url), parse_url(trim($headers['x-xrds-location'])));
|
||||
$next = true;
|
||||
}
|
||||
|
||||
if (isset($headers['content-type'])
|
||||
&& (strpos($headers['content-type'], 'application/xrds+xml') !== false
|
||||
|| strpos($headers['content-type'], 'text/xml') !== false)
|
||||
) {
|
||||
# Apparently, some providers return XRDS documents as text/html.
|
||||
# While it is against the spec, allowing this here shouldn't break
|
||||
# compatibility with anything.
|
||||
# ---
|
||||
# Found an XRDS document, now let's find the server, and optionally delegate.
|
||||
$content = $this->request($url, 'GET');
|
||||
|
||||
preg_match_all('#<Service.*?>(.*?)</Service>#s', $content, $m);
|
||||
foreach($m[1] as $content) {
|
||||
$content = ' ' . $content; # The space is added, so that strpos doesn't return 0.
|
||||
|
||||
# OpenID 2
|
||||
$ns = preg_quote('http://specs.openid.net/auth/2.0/');
|
||||
if(preg_match('#<Type>\s*'.$ns.'(server|signon)\s*</Type>#s', $content, $type)) {
|
||||
if ($type[1] == 'server') $this->identifier_select = true;
|
||||
|
||||
preg_match('#<URI.*?>(.*)</URI>#', $content, $server);
|
||||
preg_match('#<(Local|Canonical)ID>(.*)</\1ID>#', $content, $delegate);
|
||||
if (empty($server)) {
|
||||
return false;
|
||||
}
|
||||
# Does the server advertise support for either AX or SREG?
|
||||
$this->ax = (bool) strpos($content, '<Type>http://openid.net/srv/ax/1.0</Type>');
|
||||
$this->sreg = strpos($content, '<Type>http://openid.net/sreg/1.0</Type>')
|
||||
|| strpos($content, '<Type>http://openid.net/extensions/sreg/1.1</Type>');
|
||||
|
||||
$server = $server[1];
|
||||
if (isset($delegate[2])) $this->identity = trim($delegate[2]);
|
||||
$this->version = 2;
|
||||
|
||||
$this->server = $server;
|
||||
return $server;
|
||||
}
|
||||
|
||||
# OpenID 1.1
|
||||
$ns = preg_quote('http://openid.net/signon/1.1');
|
||||
if (preg_match('#<Type>\s*'.$ns.'\s*</Type>#s', $content)) {
|
||||
|
||||
preg_match('#<URI.*?>(.*)</URI>#', $content, $server);
|
||||
preg_match('#<.*?Delegate>(.*)</.*?Delegate>#', $content, $delegate);
|
||||
if (empty($server)) {
|
||||
return false;
|
||||
}
|
||||
# AX can be used only with OpenID 2.0, so checking only SREG
|
||||
$this->sreg = strpos($content, '<Type>http://openid.net/sreg/1.0</Type>')
|
||||
|| strpos($content, '<Type>http://openid.net/extensions/sreg/1.1</Type>');
|
||||
|
||||
$server = $server[1];
|
||||
if (isset($delegate[1])) $this->identity = $delegate[1];
|
||||
$this->version = 1;
|
||||
|
||||
$this->server = $server;
|
||||
return $server;
|
||||
}
|
||||
}
|
||||
|
||||
$next = true;
|
||||
$yadis = false;
|
||||
$url = $originalUrl;
|
||||
$content = null;
|
||||
break;
|
||||
}
|
||||
if ($next) continue;
|
||||
|
||||
# There are no relevant information in headers, so we search the body.
|
||||
$content = $this->request($url, 'GET');
|
||||
$location = $this->htmlTag($content, 'meta', 'http-equiv', 'X-XRDS-Location', 'content');
|
||||
if ($location) {
|
||||
$url = $this->build_url(parse_url($url), parse_url($location));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$content) $content = $this->request($url, 'GET');
|
||||
|
||||
# At this point, the YADIS Discovery has failed, so we'll switch
|
||||
# to openid2 HTML discovery, then fallback to openid 1.1 discovery.
|
||||
$server = $this->htmlTag($content, 'link', 'rel', 'openid2.provider', 'href');
|
||||
$delegate = $this->htmlTag($content, 'link', 'rel', 'openid2.local_id', 'href');
|
||||
$this->version = 2;
|
||||
|
||||
if (!$server) {
|
||||
# The same with openid 1.1
|
||||
$server = $this->htmlTag($content, 'link', 'rel', 'openid.server', 'href');
|
||||
$delegate = $this->htmlTag($content, 'link', 'rel', 'openid.delegate', 'href');
|
||||
$this->version = 1;
|
||||
}
|
||||
|
||||
if ($server) {
|
||||
# We found an OpenID2 OP Endpoint
|
||||
if ($delegate) {
|
||||
# We have also found an OP-Local ID.
|
||||
$this->identity = $delegate;
|
||||
}
|
||||
$this->server = $server;
|
||||
return $server;
|
||||
}
|
||||
|
||||
throw new ErrorException('No servers found!');
|
||||
}
|
||||
throw new ErrorException('Endless redirection!');
|
||||
}
|
||||
|
||||
protected function papeParams()
|
||||
{
|
||||
$params = array();
|
||||
$params['openid.ns.pape'] = 'http://specs.openid.net/extensions/pape/1.0';
|
||||
$params['openid.pape.max_auth_age'] = '0';
|
||||
$params['openid.ns.ui'] = 'http://specs.openid.net/extensions/ui/1.0';
|
||||
$params['openid.ui.mode'] = 'popup';
|
||||
return $params;
|
||||
}
|
||||
protected function sregParams()
|
||||
{
|
||||
$params = array();
|
||||
# We always use SREG 1.1, even if the server is advertising only support for 1.0.
|
||||
# That's because it's fully backwards compatibile with 1.0, and some providers
|
||||
# advertise 1.0 even if they accept only 1.1. One such provider is myopenid.com
|
||||
$params['openid.ns.sreg'] = 'http://openid.net/extensions/sreg/1.1';
|
||||
if ($this->required) {
|
||||
$params['openid.sreg.required'] = array();
|
||||
foreach ($this->required as $required) {
|
||||
if (!isset(self::$ax_to_sreg[$required])) continue;
|
||||
$params['openid.sreg.required'][] = self::$ax_to_sreg[$required];
|
||||
}
|
||||
$params['openid.sreg.required'] = implode(',', $params['openid.sreg.required']);
|
||||
}
|
||||
|
||||
if ($this->optional) {
|
||||
$params['openid.sreg.optional'] = array();
|
||||
foreach ($this->optional as $optional) {
|
||||
if (!isset(self::$ax_to_sreg[$optional])) continue;
|
||||
$params['openid.sreg.optional'][] = self::$ax_to_sreg[$optional];
|
||||
}
|
||||
$params['openid.sreg.optional'] = implode(',', $params['openid.sreg.optional']);
|
||||
}
|
||||
return $params;
|
||||
}
|
||||
|
||||
protected function axParams()
|
||||
{
|
||||
$params = array();
|
||||
if ($this->required || $this->optional) {
|
||||
$params['openid.ns.ax'] = 'http://openid.net/srv/ax/1.0';
|
||||
$params['openid.ax.mode'] = 'fetch_request';
|
||||
$this->aliases = array();
|
||||
$counts = array();
|
||||
$required = array();
|
||||
$optional = array();
|
||||
foreach (array('required','optional') as $type) {
|
||||
foreach ($this->$type as $alias => $field) {
|
||||
if (is_int($alias)) $alias = strtr($field, '/', '_');
|
||||
$this->aliases[$alias] = 'http://axschema.org/' . $field;
|
||||
if (empty($counts[$alias])) $counts[$alias] = 0;
|
||||
$counts[$alias] += 1;
|
||||
${$type}[] = $alias;
|
||||
}
|
||||
}
|
||||
foreach ($this->aliases as $alias => $ns) {
|
||||
$params['openid.ax.type.' . $alias] = $ns;
|
||||
}
|
||||
foreach ($counts as $alias => $count) {
|
||||
if ($count == 1) continue;
|
||||
$params['openid.ax.count.' . $alias] = $count;
|
||||
}
|
||||
|
||||
# Don't send empty ax.requied and ax.if_available.
|
||||
# Google and possibly other providers refuse to support ax when one of these is empty.
|
||||
if($required) {
|
||||
$params['openid.ax.required'] = implode(',', $required);
|
||||
}
|
||||
if($optional) {
|
||||
$params['openid.ax.if_available'] = implode(',', $optional);
|
||||
}
|
||||
}
|
||||
return $params;
|
||||
}
|
||||
|
||||
protected function authUrl_v1($immediate)
|
||||
{
|
||||
$returnUrl = $this->returnUrl;
|
||||
# If we have an openid.delegate that is different from our claimed id,
|
||||
# we need to somehow preserve the claimed id between requests.
|
||||
# The simplest way is to just send it along with the return_to url.
|
||||
if($this->identity != $this->claimed_id) {
|
||||
$returnUrl .= (strpos($returnUrl, '?') ? '&' : '?') . 'openid.claimed_id=' . $this->claimed_id;
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'openid.return_to' => $returnUrl,
|
||||
'openid.mode' => $immediate ? 'checkid_immediate' : 'checkid_setup',
|
||||
'openid.identity' => $this->identity,
|
||||
'openid.trust_root' => $this->trustRoot,
|
||||
) + $this->sregParams() + $this->papeParams();
|
||||
|
||||
return $this->build_url(parse_url($this->server)
|
||||
, array('query' => http_build_query($params, '', '&')));
|
||||
}
|
||||
|
||||
protected function authUrl_v2($immediate)
|
||||
{
|
||||
$params = array(
|
||||
'openid.ns' => 'http://specs.openid.net/auth/2.0',
|
||||
'openid.mode' => $immediate ? 'checkid_immediate' : 'checkid_setup',
|
||||
'openid.return_to' => $this->returnUrl,
|
||||
'openid.realm' => $this->trustRoot,
|
||||
);
|
||||
if ($this->ax) {
|
||||
$params += $this->axParams();
|
||||
}
|
||||
if ($this->sreg) {
|
||||
$params += $this->sregParams();
|
||||
}
|
||||
if (!$this->ax && !$this->sreg) {
|
||||
# If OP doesn't advertise either SREG, nor AX, let's send them both
|
||||
# in worst case we don't get anything in return.
|
||||
$params += $this->axParams() + $this->sregParams();
|
||||
}
|
||||
$params = $params + $this->papeParams();
|
||||
if ($this->identifier_select) {
|
||||
$params['openid.identity'] = $params['openid.claimed_id']
|
||||
= 'http://specs.openid.net/auth/2.0/identifier_select';
|
||||
} else {
|
||||
$params['openid.identity'] = $this->identity;
|
||||
$params['openid.claimed_id'] = $this->claimed_id;
|
||||
}
|
||||
|
||||
return $this->build_url(parse_url($this->server)
|
||||
, array('query' => http_build_query($params, '', '&')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns authentication url. Usually, you want to redirect your user to it.
|
||||
* @return String The authentication url.
|
||||
* @param String $select_identifier Whether to request OP to select identity for an user in OpenID 2. Does not affect OpenID 1.
|
||||
* @throws ErrorException
|
||||
*/
|
||||
function authUrl($immediate = false)
|
||||
{
|
||||
if ($this->setup_url && !$immediate) return $this->setup_url;
|
||||
if (!$this->server) $this->discover($this->identity);
|
||||
|
||||
if ($this->version == 2) {
|
||||
return $this->authUrl_v2($immediate);
|
||||
}
|
||||
return $this->authUrl_v1($immediate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs OpenID verification with the OP.
|
||||
* @return Bool Whether the verification was successful.
|
||||
* @throws ErrorException
|
||||
*/
|
||||
function validate()
|
||||
{
|
||||
# If the request was using immediate mode, a failure may be reported
|
||||
# by presenting user_setup_url (for 1.1) or reporting
|
||||
# mode 'setup_needed' (for 2.0). Also catching all modes other than
|
||||
# id_res, in order to avoid throwing errors.
|
||||
if(isset($this->data['openid_user_setup_url'])) {
|
||||
$this->setup_url = $this->data['openid_user_setup_url'];
|
||||
return false;
|
||||
}
|
||||
if($this->mode != 'id_res') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->claimed_id = isset($this->data['openid_claimed_id'])?$this->data['openid_claimed_id']:$this->data['openid_identity'];
|
||||
$params = array(
|
||||
'openid.assoc_handle' => $this->data['openid_assoc_handle'],
|
||||
'openid.signed' => $this->data['openid_signed'],
|
||||
'openid.sig' => $this->data['openid_sig'],
|
||||
);
|
||||
|
||||
if (isset($this->data['openid_ns'])) {
|
||||
# We're dealing with an OpenID 2.0 server, so let's set an ns
|
||||
# Even though we should know location of the endpoint,
|
||||
# we still need to verify it by discovery, so $server is not set here
|
||||
$params['openid.ns'] = 'http://specs.openid.net/auth/2.0';
|
||||
} elseif (isset($this->data['openid_claimed_id'])
|
||||
&& $this->data['openid_claimed_id'] != $this->data['openid_identity']
|
||||
) {
|
||||
# If it's an OpenID 1 provider, and we've got claimed_id,
|
||||
# we have to append it to the returnUrl, like authUrl_v1 does.
|
||||
$this->returnUrl .= (strpos($this->returnUrl, '?') ? '&' : '?')
|
||||
. 'openid.claimed_id=' . $this->claimed_id;
|
||||
}
|
||||
|
||||
if ($this->data['openid_return_to'] != $this->returnUrl) {
|
||||
# The return_to url must match the url of current request.
|
||||
# I'm assuing that noone will set the returnUrl to something that doesn't make sense.
|
||||
return false;
|
||||
}
|
||||
|
||||
$server = $this->discover($this->claimed_id);
|
||||
|
||||
foreach (explode(',', $this->data['openid_signed']) as $item) {
|
||||
# Checking whether magic_quotes_gpc is turned on, because
|
||||
# the function may fail if it is. For example, when fetching
|
||||
# AX namePerson, it might containg an apostrophe, which will be escaped.
|
||||
# In such case, validation would fail, since we'd send different data than OP
|
||||
# wants to verify. stripslashes() should solve that problem, but we can't
|
||||
# use it when magic_quotes is off.
|
||||
$value = $this->data['openid_' . str_replace('.','_',$item)];
|
||||
$params['openid.' . $item] = get_magic_quotes_gpc() ? stripslashes($value) : $value;
|
||||
|
||||
}
|
||||
|
||||
$params['openid.mode'] = 'check_authentication';
|
||||
|
||||
$response = $this->request($server, 'POST', $params);
|
||||
|
||||
return preg_match('/is_valid\s*:\s*true/i', $response);
|
||||
}
|
||||
|
||||
protected function getAxAttributes()
|
||||
{
|
||||
$alias = null;
|
||||
if (isset($this->data['openid_ns_ax'])
|
||||
&& $this->data['openid_ns_ax'] != 'http://openid.net/srv/ax/1.0'
|
||||
) { # It's the most likely case, so we'll check it before
|
||||
$alias = 'ax';
|
||||
} else {
|
||||
# 'ax' prefix is either undefined, or points to another extension,
|
||||
# so we search for another prefix
|
||||
foreach ($this->data as $key => $val) {
|
||||
if (substr($key, 0, strlen('openid_ns_')) == 'openid_ns_'
|
||||
&& $val == 'http://openid.net/srv/ax/1.0'
|
||||
) {
|
||||
$alias = substr($key, strlen('openid_ns_'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$alias) {
|
||||
# An alias for AX schema has not been found,
|
||||
# so there is no AX data in the OP's response
|
||||
return array();
|
||||
}
|
||||
|
||||
$attributes = array();
|
||||
foreach ($this->data as $key => $value) {
|
||||
$keyMatch = 'openid_' . $alias . '_value_';
|
||||
if (substr($key, 0, strlen($keyMatch)) != $keyMatch) {
|
||||
continue;
|
||||
}
|
||||
$key = substr($key, strlen($keyMatch));
|
||||
if (!isset($this->data['openid_' . $alias . '_type_' . $key])) {
|
||||
# OP is breaking the spec by returning a field without
|
||||
# associated ns. This shouldn't happen, but it's better
|
||||
# to check, than cause an E_NOTICE.
|
||||
continue;
|
||||
}
|
||||
$key = substr($this->data['openid_' . $alias . '_type_' . $key],
|
||||
strlen('http://axschema.org/'));
|
||||
$attributes[$key] = $value;
|
||||
}
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
protected function getSregAttributes()
|
||||
{
|
||||
$attributes = array();
|
||||
$sreg_to_ax = array_flip(self::$ax_to_sreg);
|
||||
foreach ($this->data as $key => $value) {
|
||||
$keyMatch = 'openid_sreg_';
|
||||
if (substr($key, 0, strlen($keyMatch)) != $keyMatch) {
|
||||
continue;
|
||||
}
|
||||
$key = substr($key, strlen($keyMatch));
|
||||
if (!isset($sreg_to_ax[$key])) {
|
||||
# The field name isn't part of the SREG spec, so we ignore it.
|
||||
continue;
|
||||
}
|
||||
$attributes[$sreg_to_ax[$key]] = $value;
|
||||
}
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets AX/SREG attributes provided by OP. should be used only after successful validaton.
|
||||
* Note that it does not guarantee that any of the required/optional parameters will be present,
|
||||
* or that there will be no other attributes besides those specified.
|
||||
* In other words. OP may provide whatever information it wants to.
|
||||
* * SREG names will be mapped to AX names.
|
||||
* * @return Array Array of attributes with keys being the AX schema names, e.g. 'contact/email'
|
||||
* @see http://www.axschema.org/types/
|
||||
*/
|
||||
function getAttributes()
|
||||
{
|
||||
if (isset($this->data['openid_ns'])
|
||||
&& $this->data['openid_ns'] == 'http://specs.openid.net/auth/2.0'
|
||||
) { # OpenID 2.0
|
||||
# We search for both AX and SREG attributes, with AX taking precedence.
|
||||
return $this->getAxAttributes() + $this->getSregAttributes();
|
||||
}
|
||||
return $this->getSregAttributes();
|
||||
}
|
||||
}
|
||||
44
src/prettify.css
Normal file
44
src/prettify.css
Normal file
@@ -0,0 +1,44 @@
|
||||
/* Pretty printing styles. Used with prettify.js. */
|
||||
|
||||
.str { color: #080; }
|
||||
.kwd { color: #008; }
|
||||
.com { color: #800; }
|
||||
.typ { color: #606; }
|
||||
.lit { color: #066; }
|
||||
.pun { color: #660; }
|
||||
.pln { color: #000; }
|
||||
.tag { color: #008; }
|
||||
.atn { color: #606; }
|
||||
.atv { color: #080; }
|
||||
.dec { color: #606; }
|
||||
pre.prettyprint { padding: 0px; border: 1px solid #888; clear: both; }
|
||||
|
||||
/* Specify class=linenums on a pre to get line numbering */
|
||||
ol.linenums { margin-top: 0; margin-bottom: 0; margin-left: 30px} /* IE indents via margin-left */
|
||||
li.L0,
|
||||
li.L1,
|
||||
li.L2,
|
||||
li.L3,
|
||||
li.L5,
|
||||
li.L6,
|
||||
li.L7,
|
||||
li.L8 { list-style-type: none }
|
||||
/* Alternate shading for lines */
|
||||
li.L1,
|
||||
li.L3,
|
||||
li.L5,
|
||||
li.L7,
|
||||
li.L9 { background: #eee }
|
||||
|
||||
@media print {
|
||||
.str { color: #060; }
|
||||
.kwd { color: #006; font-weight: bold; }
|
||||
.com { color: #600; font-style: italic; }
|
||||
.typ { color: #404; font-weight: bold; }
|
||||
.lit { color: #044; }
|
||||
.pun { color: #440; }
|
||||
.pln { color: #000; }
|
||||
.tag { color: #006; font-weight: bold; }
|
||||
.atn { color: #404; }
|
||||
.atv { color: #060; }
|
||||
}
|
||||
1408
src/prettify.js
Normal file
1408
src/prettify.js
Normal file
File diff suppressed because it is too large
Load Diff
46
src/site-solarized.css
Normal file
46
src/site-solarized.css
Normal file
@@ -0,0 +1,46 @@
|
||||
/*Note to self: Look up sass to get this running if needed*/
|
||||
/* light is default mode, so pair with general html definition */
|
||||
html, .light {
|
||||
/*background-color:$rebase03;*/
|
||||
color: #657b83; }
|
||||
html *, .light * {
|
||||
color: #657b83; }
|
||||
html *, .light code {
|
||||
color: #93a1a1; }
|
||||
html *, .kwd {
|
||||
color: #cb4b16; }
|
||||
html h1, html h2, html h3, html h4, html h5, html h6, .light h1, .light h2, .light h3, .light h4, .light h5, .light h6 {
|
||||
color: #586e75;
|
||||
border-color: #657b83; }
|
||||
html a, html a:active, html a:visited, .light a, .light a:active, .light a:visited {
|
||||
color: #586e75; }
|
||||
html body #wrap, .light body #wrap {
|
||||
background-color: #fdf6e3; }
|
||||
|
||||
.dark {
|
||||
/*background-color:$rebase03;*/
|
||||
color: #839496; }
|
||||
.dark * {
|
||||
color: #839496; }
|
||||
.dark h1, .dark h2, .dark h3, .dark h4, .dark h5, .dark h6 {
|
||||
color: #93a1a1;
|
||||
border-color: #839496; }
|
||||
.dark a, .dark a:active, .dark a:visited {
|
||||
color: #93a1a1; }
|
||||
.dark body #wrap {
|
||||
background-color: #002b36; }
|
||||
|
||||
html.red a, html.red a:active, html.red a:visited, html.red code.url, .red a, .red a:active, .red a:visited, .red code.url {
|
||||
color: #268bd2; }
|
||||
html.red h1, html.red h2, html.red h3, html.red h4, html.red h5, html.red h6, .red h1, .red h2, .red h3, .red h4, .red h5, .red h6 {
|
||||
color: #cb4b16; }
|
||||
html.red strong, .red strong {
|
||||
color: #6c71c4; }
|
||||
html.red em, .red em {
|
||||
color: #2aa198; }
|
||||
html.red p code, html.red li code, .red p code, .red li code {
|
||||
color: #2aa198; }
|
||||
|
||||
html * {
|
||||
color-profile: sRGB;
|
||||
rendering-intent: auto; }
|
||||
45
src/site-solarized.scss
Normal file
45
src/site-solarized.scss
Normal file
@@ -0,0 +1,45 @@
|
||||
/*Note to self: Look up sass to get this running if needed*/
|
||||
$base03: #002b36;
|
||||
$base02: #073642;
|
||||
$base01: #586e75;
|
||||
$base00: #657b83;
|
||||
$base0: #839496;
|
||||
$base1: #93a1a1;
|
||||
$base2: #eee8d5;
|
||||
$base3: #fdf6e3;
|
||||
$yellow: #b58900;
|
||||
$orange: #cb4b16;
|
||||
$red: #dc322f;
|
||||
$magenta: #d33682;
|
||||
$violet: #6c71c4;
|
||||
$blue: #268bd2;
|
||||
$cyan: #2aa198;
|
||||
$green: #859900;
|
||||
|
||||
@mixin rebase($rebase03,$rebase02,$rebase01,$rebase00,$rebase0,$rebase1,$rebase2,$rebase3)
|
||||
{
|
||||
/*background-color:$rebase03;*/
|
||||
color:$rebase0;
|
||||
* { color:$rebase0; }
|
||||
h1,h2,h3,h4,h5,h6 { color:$rebase1; border-color: $rebase0; }
|
||||
a, a:active, a:visited { color: $rebase1; }
|
||||
body #wrap { background-color: $rebase03; }
|
||||
}
|
||||
|
||||
@mixin accentize($accent1, $accent2, $accent3, $accent4) {
|
||||
a, a:active, a:visited, code.url { color: $accent2; }
|
||||
h1,h2,h3,h4,h5,h6 {color:$accent1}
|
||||
strong { color: $accent3 }
|
||||
em { color: $accent4 }
|
||||
p code, li code { color: $accent4 }
|
||||
}
|
||||
|
||||
/* light is default mode, so pair with general html definition */
|
||||
html, .light{ @include rebase($base3,$base2,$base1,$base0,$base00,$base01,$base02,$base03)}
|
||||
|
||||
.dark { @include rebase($base03,$base02,$base01,$base00,$base0,$base1,$base2,$base3)}
|
||||
html.red, .red { @include accentize($orange, $blue, $violet, $cyan); }
|
||||
html * {
|
||||
color-profile: sRGB;
|
||||
rendering-intent: auto;
|
||||
}
|
||||
53
src/solarized.css
Normal file
53
src/solarized.css
Normal file
@@ -0,0 +1,53 @@
|
||||
div pre , .prettyprint {
|
||||
color: #839496;
|
||||
background-color: #002b36;
|
||||
}
|
||||
|
||||
.prettyprint .pln {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.prettyprint .str,
|
||||
.prettyprint .lit,
|
||||
.prettyprint .atv {
|
||||
color: #2aa198;
|
||||
}
|
||||
|
||||
.prettyprint .kwd {
|
||||
/* color: #268bd2; */
|
||||
color: #859900;
|
||||
}
|
||||
|
||||
.prettyprint .com {
|
||||
color: #586e75;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.prettyprint .dec {
|
||||
color: #cb4b16;
|
||||
}
|
||||
|
||||
.prettyprint .typ {
|
||||
color: #b58900;
|
||||
}
|
||||
|
||||
.prettyprint .pun {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.prettyprint .opn {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.prettyprint .clo {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.prettyprint .tag {
|
||||
color: #268bd2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.prettyprint .atn {
|
||||
color: inherit;
|
||||
}
|
||||
211
src/style.css
Normal file
211
src/style.css
Normal file
@@ -0,0 +1,211 @@
|
||||
@font-face {
|
||||
font-family: "Averia";
|
||||
/*src: url('Averia-Regular.ttf');*/
|
||||
src: local('Averia Gruesa Libre'), local('AveriaGruesaLibre-Regular'), url(http://themes.googleusercontent.com/static/fonts/averiagruesalibre/v1/10vbZTOoN6T8D-nvDzwRF52VtiXDaDJux1YX1Y0t1wM.ttf) format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
|
||||
html
|
||||
{
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
margin: 0;
|
||||
margin-top: 0;
|
||||
font-size: 16px;
|
||||
line-height: 25px;
|
||||
font-family: "dejavu_serifbook", consolas, "Averia","Georgia", "Helvetica Neue", "Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
|
||||
background: #002b36;
|
||||
background-color: #002b36;
|
||||
}
|
||||
|
||||
html
|
||||
{
|
||||
background-color: #002b36;
|
||||
}
|
||||
|
||||
|
||||
body #wrap {
|
||||
width: 712px;
|
||||
margin: auto;
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
padding: 10px;
|
||||
padding-top: 10px;
|
||||
border: 1px solid #000;
|
||||
border-top: 0px;
|
||||
}
|
||||
|
||||
body #wrap #header {
|
||||
border-bottom: solid 1px black;
|
||||
}
|
||||
|
||||
body #wrap #header::after {
|
||||
content:".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
body #wrap #header #title {
|
||||
float: left;
|
||||
}
|
||||
|
||||
body #wrap #header #title h2 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body #wrap #header #links {
|
||||
float: right;
|
||||
}
|
||||
|
||||
body #bottom {
|
||||
margin: auto;
|
||||
width: 712px;
|
||||
}
|
||||
|
||||
body #wrap #categories {
|
||||
border-bottom: solid 1px black;
|
||||
|
||||
}
|
||||
|
||||
em {
|
||||
color: #006;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #800;
|
||||
text-decoration: none;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
a.external {
|
||||
padding-right: 12px;
|
||||
background: url(/media/img/ico_external.gif) no-repeat 100% 50%;
|
||||
}
|
||||
|
||||
cufontext:hover, a:hover {
|
||||
text-decoration: underline;
|
||||
color: green;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 45px;
|
||||
line-height 50px;
|
||||
margin: 25px, 0;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
img.left {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
img.right {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
img.center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
img.noborder {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
#subtitle p {
|
||||
color: #666;
|
||||
margin-top: -22px;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
|
||||
|
||||
div pre {
|
||||
border: 1px solid #000;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
pre, pre.prettyprint {
|
||||
width: 80%;
|
||||
border: 1px solid #888;
|
||||
font-size: 14px;
|
||||
white-space: pre-wrap;
|
||||
line-height: 18px;
|
||||
padding: 5px;
|
||||
margin-right: 50px;
|
||||
margin-left: 50px;
|
||||
tab-size: 2;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: inconsolata, Consolas, Courier;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-style: italic;
|
||||
border-left: 4px solid #CCC;
|
||||
margin-left: 0px;
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
|
||||
.content {
|
||||
}
|
||||
|
||||
.content .contentItem {
|
||||
margin: auto;
|
||||
width: 400px;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
.content .contentItem:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.content ol {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.content li.content {
|
||||
float: left;
|
||||
width: 330px;
|
||||
text-align: center;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.content-list::after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.post-text::first-letter {
|
||||
font-size: 45px;
|
||||
}
|
||||
.content-list .content .postTitle,
|
||||
.content-list .content .postDate,
|
||||
.content-list .content .postSubTitle {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.postSubTitle {
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.content-list .content .postDate {
|
||||
color: #666;
|
||||
}
|
||||
51
src/sunburst.css
Normal file
51
src/sunburst.css
Normal file
@@ -0,0 +1,51 @@
|
||||
/* Pretty printing styles. Used with prettify.js. */
|
||||
/* Vim sunburst theme by David Leibovic */
|
||||
|
||||
pre .str, code .str { color: #65B042; } /* string - green */
|
||||
pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */
|
||||
pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */
|
||||
pre .typ, code .typ { color: #89bdff; } /* type - light blue */
|
||||
pre .lit, code .lit { color: #3387CC; } /* literal - blue */
|
||||
pre .pun, code .pun { color: #fff; } /* punctuation - white */
|
||||
pre .pln, code .pln { color: #fff; } /* plaintext - white */
|
||||
pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */
|
||||
pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */
|
||||
pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */
|
||||
pre .dec, code .dec { color: #3387CC; } /* decimal - blue */
|
||||
|
||||
pre.prettyprint, code.prettyprint{
|
||||
background-color: #000;
|
||||
-moz-border-radius: 8px;
|
||||
-webkit-border-radius: 8px;
|
||||
-o-border-radius: 8px;
|
||||
-ms-border-radius: 8px;
|
||||
-khtml-border-radius: 8px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
pre.prettyprint {
|
||||
width: 95%;
|
||||
margin: 1em auto;
|
||||
padding: 1em;
|
||||
clear: both
|
||||
}
|
||||
|
||||
|
||||
/* Specify class=linenums on a pre to get line numbering */
|
||||
ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */
|
||||
li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
|
||||
/* Alternate shading for lines */
|
||||
li.L1,li.L3,li.L5,li.L7,li.L9 { }
|
||||
|
||||
@media print {
|
||||
pre .str, code .str { color: #060; }
|
||||
pre .kwd, code .kwd { color: #006; font-weight: bold; }
|
||||
pre .com, code .com { color: #600; font-style: italic; }
|
||||
pre .typ, code .typ { color: #404; font-weight: bold; }
|
||||
pre .lit, code .lit { color: #044; }
|
||||
pre .pun, code .pun { color: #440; }
|
||||
pre .pln, code .pln { color: #000; }
|
||||
pre .tag, code .tag { color: #006; font-weight: bold; }
|
||||
pre .atn, code .atn { color: #404; }
|
||||
pre .atv, code .atv { color: #060; }
|
||||
}
|
||||
Reference in New Issue
Block a user