mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-19 16:54:24 +01:00
Porting over all Blueprint styles to new Baseline repo
This commit is contained in:
commit
eb81782cdb
BIN
img/baseline-20px.png
Normal file
BIN
img/baseline-20px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 127 B |
BIN
img/blueprint-icon.png
Normal file
BIN
img/blueprint-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 189 KiB |
BIN
img/grid-20px.png
Normal file
BIN
img/grid-20px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 324 B |
BIN
img/grid-940px.png
Normal file
BIN
img/grid-940px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 160 B |
BIN
img/tablesorter-indicators.png
Normal file
BIN
img/tablesorter-indicators.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 451 B |
BIN
img/twitter-logo-no-bird.png
Normal file
BIN
img/twitter-logo-no-bird.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
1011
index.html
Normal file
1011
index.html
Normal file
@ -0,0 +1,1011 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Baseline</title>
|
||||
|
||||
<!-- // Less.js at the ready! -->
|
||||
<link rel="stylesheet/less" type="text/css" media="all" href="less/baseline.less" />
|
||||
<script type="text/javascript" src="js/less-1.0.41.min.js"></script>
|
||||
|
||||
<!-- // jQuery! -->
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
|
||||
<script type="text/javascript" src="http://tablesorter.com/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
// Active state in top nav
|
||||
$('div.topbar ul a').click(function() {
|
||||
if ($(this).parents('li').hasClass('active')) {
|
||||
$(this).parents('li').removeClass('active');
|
||||
} else {
|
||||
$(this).parents('li').siblings().removeClass('active');
|
||||
$(this).parents('li').addClass('active');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Code Highlighting -->
|
||||
<script type="text/javascript" src="js/jquery/chili/jquery.chili-2.2.js"></script>
|
||||
<script type="text/javascript" src="js/jquery/chili/recipes.js"></script>
|
||||
<script id="setup" type="text/javascript">
|
||||
ChiliBook.lineNumbers = true;
|
||||
</script>
|
||||
|
||||
<!-- Debug line-height -->
|
||||
<!--
|
||||
<style>
|
||||
body {
|
||||
background: url(img/baseline-20px.png) repeat 0 0, url(img/grid-940px.png) repeat-y top center;
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
-->
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<div class="topbar">
|
||||
<div class="container fixed">
|
||||
<h3><a id="logo" href="index.html">
|
||||
<img src="img/twitter-logo-no-bird.png" alt="Twitter" /> <span>baseline</span>
|
||||
</a></h3>
|
||||
<ul>
|
||||
<li class="active"><a href="#">Getting Started</a></li>
|
||||
<li><a href="#typography">Typography</a></li>
|
||||
<li><a href="#tables">Tables</a></li>
|
||||
<li><a href="#forms">Forms</a></li>
|
||||
<li><a href="#navigation">Navigation</a></li>
|
||||
<li><a href="#alerts">Alerts</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section id="masthead">
|
||||
<div class="inner">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="span11 columns">
|
||||
<h1>Twitter Baseline</h1>
|
||||
<p>Baseline is Twitter's toolkit for kickstarting CSS for websites, apps, and more. It includes base CSS styles for typography, forms, buttons, tables, grids, navigation, alerts, and more.</p>
|
||||
</div>
|
||||
<div class="span5 columns">
|
||||
<a href="" class="btn large primary">Download Zip »</a>
|
||||
<small>
|
||||
<a href="">Visit project page on Github »</a><br />
|
||||
(Current version: 1.0.0)
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<div class="page-header">
|
||||
<h1>Getting Started</h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span4 columns">
|
||||
<p>You can use Twitter Baseline in one of two ways: just drop the compiled CSS into any new project and start cranking, or run LESS on your site and compile on the fly like a boss.</p>
|
||||
</div>
|
||||
<div class="span12 columns">
|
||||
<h3>1. Compiled CSS</h3>
|
||||
<p>Use this option if you want all the styles of Baseline, but none of the extra power of LESS.</p>
|
||||
<pre class="html"><link type="text/css" href="css/Baseline.css" media="all" /></pre>
|
||||
<h3>2. Run with LESS.js</h3>
|
||||
<p>Use this option to make full use of Baseline's LESS variables, mixins, and nesting in CSS.</p>
|
||||
<pre class="html">
|
||||
<link rel="stylesheet/less" type="text/css" href="less/Baseline.less" media="all" />
|
||||
<script type="text/javascript" src="js/less-1.0.41.min.js"></script></pre>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section>
|
||||
<div class="page-header">
|
||||
<h1>Fully Bootstrapped <small>Supercharged CSS with variables, mixins, and functions</small></h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span4 columns">
|
||||
<p><a href="http://markdotto.com/bootstrap/">Bootstrap</a> is a super awesome pack of mixins and variables to be used in conjunction with LESS, a CSS preprocessor for faster and easier web development.</p>
|
||||
</div>
|
||||
<div class="span12 columns">
|
||||
<h2>What's included</h2>
|
||||
<p>Here's a rundown of what's included in Twitter Baseline as part of Bootstrap. Head over to the Bootstrap website or Github project page to download and learn more.</p>
|
||||
<h3>Color variables</h3>
|
||||
<p>Variables in LESS are perfect for maintaining and updating your CSS. When you want to change a color value, update it in one spot and you're set.</p>
|
||||
<pre class="css">
|
||||
// Links
|
||||
@link-color: #0069d6;
|
||||
@link-hover-color: darken(@link-color, 10);
|
||||
|
||||
// Grays
|
||||
@white: #fff;
|
||||
@gray-lighter: #ccc;
|
||||
@gray-light: #777;
|
||||
@gray: #555;
|
||||
@gray-dark: #333;
|
||||
@black: #000;
|
||||
|
||||
// Accent Colors
|
||||
@blue: #08b5fb;
|
||||
@blue-dark: #0069d6;
|
||||
@green: #46a546;
|
||||
@red: #9d261d;
|
||||
@yellow: #ffc40d;
|
||||
@orange: #f89406;
|
||||
@pink: #c3325f;
|
||||
@purple: #7a43b6;
|
||||
</pre>
|
||||
|
||||
<h3>Two Comment Styles</h3>
|
||||
<pre class="css">
|
||||
// This is a comment
|
||||
/* No, this is a comment */
|
||||
</pre>
|
||||
|
||||
<h3>Mixins up the wazoo</h3>
|
||||
<pre class="css">
|
||||
// Font Stacks
|
||||
.font(@weight: normal, @size: 14px, @lineheight: 20px) {
|
||||
font-size: @size;
|
||||
font-weight: @weight;
|
||||
line-height: @lineheight;
|
||||
}
|
||||
.sans-serif(@weight: normal, @size: 14px, @lineheight: 20px) {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: @size;
|
||||
font-weight: @weight;
|
||||
line-height: @lineheight;
|
||||
}
|
||||
|
||||
// Drop shadows
|
||||
.box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) {
|
||||
-webkit-box-shadow: @shadow;
|
||||
-moz-box-shadow: @shadow;
|
||||
box-shadow: @shadow;
|
||||
}
|
||||
|
||||
// Gradients
|
||||
#gradient {
|
||||
.horizontal(@startColor: #555, @endColor: #333) {
|
||||
background-color: @endColor;
|
||||
background-repeat: no-repeat;
|
||||
background-image: -webkit-gradient(linear, left top, right top, from(@startColor), to(@endColor));
|
||||
background-image: -webkit-linear-gradient(right center, @startColor, @endColor);
|
||||
background-image: -moz-linear-gradient(right center, @startColor, @endColor);
|
||||
background-image: -o-linear-gradient(left, @startColor, @endColor);
|
||||
background-image: -khtml-gradient(linear, left top, right top, from(@startColor), to(@endColor));
|
||||
filter: e(%("progid:DXImageTransform.Microsoft.Gradient(StartColorStr='%d', EndColorStr='%d', GradientType=1)",@startColor,@endColor));
|
||||
-ms-filter: %("progid:DXImageTransform.Microsoft.gradient(startColorStr='%d', EndColorStr='%d', GradientType=1))",@startColor,@endColor);
|
||||
}
|
||||
.vertical(@startColor: #555, @endColor: #333) {
|
||||
background-color: @endColor;
|
||||
background-repeat: no-repeat;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(@startColor), to(@endColor));
|
||||
background-image: -webkit-linear-gradient(@startColor, @endColor);
|
||||
background-image: -moz-linear-gradient(@startColor, @endColor);
|
||||
background-image: -o-linear-gradient(top, @startColor, @endColor);
|
||||
background-image: -khtml-gradient(linear, left top, left bottom, from(@startColor), to(@endColor));
|
||||
filter: e(%("progid:DXImageTransform.Microsoft.Gradient(StartColorStr='%d', EndColorStr='%d', GradientType=0)",@startColor,@endColor));
|
||||
-ms-filter: %("progid:DXImageTransform.Microsoft.gradient(startColorStr='%d', EndColorStr='%d', GradientType=0))",@startColor,@endColor);
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3>Operations and grid system</h4>
|
||||
<pre class="css">
|
||||
@grid_columns: 16;
|
||||
@grid_column_width: 40px;
|
||||
@grid_gutter_width: 20px;
|
||||
.columns(@column_span: 1) {
|
||||
display: inline;
|
||||
float: left;
|
||||
width: (@grid_column_width * @column_span) + (@grid_gutter_width * (@column_span - 1));
|
||||
margin-left: @grid_gutter_width;
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<div class="page-header">
|
||||
<h1>Customizable Grid System <small>Rock the standard 940px or roll your own</small></h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span4 columns">
|
||||
<h2>Default Grid</h2>
|
||||
<p>The default grid system provided as part of Baseline is a 940px wide 16-column grid. It's a flavor of the popular 960 grid system, but without the additional margin/padding on the left and right sides.</p>
|
||||
</div>
|
||||
<div class="span12 columns">
|
||||
<h3>Example grid markup</h3>
|
||||
<p>As shown here, a basic layout can be created with two "columns," each spanning a number of the 16 foundational columns we defined as part of our grid system. See the examples below for more variations.</p>
|
||||
<pre class="html">
|
||||
<div class="row">
|
||||
<div class="span6 columns">
|
||||
...
|
||||
</div>
|
||||
<div class="span10 columns">
|
||||
...
|
||||
</div>
|
||||
</div>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-grid" title="16 column layout">
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
<div class="span1 column">1</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-grid" title="8 column layout">
|
||||
<div class="span2 columns">2</div>
|
||||
<div class="span2 columns">2</div>
|
||||
<div class="span2 columns">2</div>
|
||||
<div class="span2 columns">2</div>
|
||||
<div class="span2 columns">2</div>
|
||||
<div class="span2 columns">2</div>
|
||||
<div class="span2 columns">2</div>
|
||||
<div class="span2 columns">2</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-grid" title="Example uncommon layout">
|
||||
<div class="span3 columns">3</div>
|
||||
<div class="span3 columns">3</div>
|
||||
<div class="span3 columns">3</div>
|
||||
<div class="span3 columns">3</div>
|
||||
<div class="span3 columns">3</div>
|
||||
<div class="span1 column">1</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-grid" title="Four column layout">
|
||||
<div class="span4 columns">4</div>
|
||||
<div class="span4 columns">4</div>
|
||||
<div class="span4 columns">4</div>
|
||||
<div class="span4 columns">4</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-grid" title="Irregular three column layout">
|
||||
<div class="span4 columns">4</div>
|
||||
<div class="span6 columns">6</div>
|
||||
<div class="span6 columns">6</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-grid" title="Half and half">
|
||||
<div class="span8 columns">8</div>
|
||||
<div class="span8 columns">8</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-grid" title="Example uncommon two-column layout">
|
||||
<div class="span5 columns">5</div>
|
||||
<div class="span11 columns">11</div>
|
||||
</div>
|
||||
|
||||
<div class="row show-grid" title="Unnecessary single column layout">
|
||||
<div class="span16 columns">16</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<div class="page-header" id="typography">
|
||||
<h1>Typography <small>Headings, paragraphs, lists, and other inline type elements</small></h1>
|
||||
</div>
|
||||
<h2>Headings and paragraphs</h2>
|
||||
<p>A standard typographic hierarchy for structuring your webpages.</p>
|
||||
<div class="row">
|
||||
<div class="span6 columns">
|
||||
<h1>h1. Heading 1</h1>
|
||||
<h2>h2. Heading 2</h2>
|
||||
<h3>h3. Heading 3</h3>
|
||||
<h4>h4. Heading 4</h4>
|
||||
<h5>h5. Heading 5</h5>
|
||||
<h6>h6. Heading 6</h6>
|
||||
</div>
|
||||
<div class="span6 columns">
|
||||
<h3>Example paragraph (body text)</h3>
|
||||
<p>Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Emphasis, addresses, & abbreviations</h2>
|
||||
<p>
|
||||
<code><strong></code>
|
||||
<code><em></code>
|
||||
<code><address></code>
|
||||
<code><abbr></code>
|
||||
</p>
|
||||
<h4>When to use</h4>
|
||||
<p>Emphasis tags (<code><strong></code> and <code><em></code>) should be used to add visual distinction between a word or phrase and its surrounding copy. Use <code><strong></code> for plain old attention and <code><em></code> for <em>slick</em> attention and titles.</p>
|
||||
<h3>Emphasis in a paragraph</h3>
|
||||
<p><a href="">Fusce dapibus</a>, <strong>tellus ac cursus commodo</strong>, <em>tortor mauris condimentum nibh</em>, ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue.</p>
|
||||
<h3>Addresses</h3>
|
||||
<p>The <code>address</code> element is used for—you guessed it!—addresses. Here's how it looks:</p>
|
||||
<address>
|
||||
<strong>Twitter, Inc.</strong><br />
|
||||
795 Folsom Ave, Suite 600<br />
|
||||
San Francisco, CA 94107<br />
|
||||
<abbr title="Phone">P:</abbr> (123) 456-7890
|
||||
</address>
|
||||
<p><strong>Note:</strong> Each line in an <code>address</code> must end with a line-break (<code><br /></code>) to properly structure the content as it is read in real life without any styles applied.</p>
|
||||
<h3>Abbreviations</h3>
|
||||
<p>For abbreviations and acronyms, use the <code>abbr</code> tag (<code>acronym</code> is deprecated in <abbr title="HyperText Markup Langugage 5">HTML5</abbr>). Put the shorthand form within the tag and set a title for the complete name.</p>
|
||||
|
||||
<h2>Blockquotes</h2>
|
||||
<p>
|
||||
<code><blockquote></code>
|
||||
<code><p></code>
|
||||
<code><cite></code>
|
||||
</p>
|
||||
<p>Be sure to wrap your <code>blockquote</code> around <code>paragraph</code> and <code>cite</code> tags. When citing a source, use the <code>cite</code> element. The CSS will automatically preface a name with an em dash (&mdash;).</p>
|
||||
<blockquote>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua...</p>
|
||||
<cite>Dr. Julius Hibbert</cite>
|
||||
</blockquote>
|
||||
|
||||
<h2>Lists</h2>
|
||||
<div class="row">
|
||||
<div class="span4 columns">
|
||||
<h4>Unordered <code><ul></code></h4>
|
||||
<ul>
|
||||
<li>Jeremy Bixby</li>
|
||||
<li>Robert Dezure</li>
|
||||
<li>Josh Washington</li>
|
||||
<li>Anton Capresi</li>
|
||||
<li>My Team Mates
|
||||
<ul>
|
||||
<li>George Castanza</li>
|
||||
<li>Jerry Seinfeld</li>
|
||||
<li>Cosmo Kramer</li>
|
||||
<li>Elaine Bennis</li>
|
||||
<li>Newman</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>John Jacob</li>
|
||||
<li>Paul Pierce</li>
|
||||
<li>Kevin Garnett</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="span4 columns">
|
||||
<h4>Unstyled <code><ul.unstyled></code></h4>
|
||||
<ul class="unstyled">
|
||||
<li>Jeremy Bixby</li>
|
||||
<li>Robert Dezure</li>
|
||||
<li>Josh Washington</li>
|
||||
<li>Anton Capresi</li>
|
||||
<li>My Team Mates
|
||||
<ul>
|
||||
<li>George Castanza</li>
|
||||
<li>Jerry Seinfeld</li>
|
||||
<li>Cosmo Kramer</li>
|
||||
<li>Elaine Bennis</li>
|
||||
<li>Newman</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>John Jacob</li>
|
||||
<li>Paul Pierce</li>
|
||||
<li>Kevin Garnett</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="span4 columns">
|
||||
<h4>Ordered lists <code><ol></code></h4>
|
||||
<ol>
|
||||
<li>Jeremy Bixby</li>
|
||||
<li>Robert Dezure</li>
|
||||
<li>Josh Washington</li>
|
||||
<li>Anton Capresi</li>
|
||||
<li>My Team Mates
|
||||
<ol>
|
||||
<li>George Castanza</li>
|
||||
<li>Jerry Seinfeld</li>
|
||||
<li>Cosmo Kramer</li>
|
||||
<li>Elaine Bennis</li>
|
||||
<li>Newman</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li>John Jacob</li>
|
||||
<li>Paul Pierce</li>
|
||||
<li>Kevin Garnett</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="span4 columns">
|
||||
<h4>Description lists <code>dl</code></h4>
|
||||
<dl>
|
||||
<dt>Description lists</dt>
|
||||
<dd>A description list is perfect for defining terms.</dd>
|
||||
<dt>Your mom</dt>
|
||||
<dd>Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.</dd>
|
||||
<dd>Donec id elit non mi porta gravida at eget metus.</dd>
|
||||
<dt>And your dad</dt>
|
||||
<dd>Etiam porta sem malesuada magna mollis euismod.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<div class="page-header" id="tables">
|
||||
<h1>Tables <small>For, you guessed it, tabular data</small></h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="span4 columns">
|
||||
<h2>Building tables</h2>
|
||||
<p>
|
||||
<code><table></code>
|
||||
<code><thead></code>
|
||||
<code><tbody></code>
|
||||
<code><tr></code>
|
||||
<code><th></code>
|
||||
<code><td></code>
|
||||
<code><colspan></code>
|
||||
<code><caption></code>
|
||||
</p>
|
||||
<p>Tables are great—for a lot of things. Great tables, however, need a bit of markup love to be useful, scalable, and readable (at the code level). Here are a few tips to help.</p>
|
||||
<p>Always wrap your column headers in a <code>thead</code> such that hierarchy is <code>thead</code> > <code>tr</code> > <code>th</code>.</p>
|
||||
<p>Similar to the column headers, all your table's body content should be wrapped in a <code>tbody</code> so your hierarchy is <code>tbody</code> > <code>tr</code> > <code>td</code>.</p>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="span12 columns">
|
||||
<h3>Example: Default table styles</h3>
|
||||
<p>All tables will be automatically styled with only the essential borders to ensure readability and maintain structure. No need to add extra classes or attributes.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Language</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Your</td>
|
||||
<td>Mom</td>
|
||||
<td>English</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Joe</td>
|
||||
<td>Sixpack</td>
|
||||
<td>English</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Stu</td>
|
||||
<td>Dent</td>
|
||||
<td>Code</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<pre class="html">
|
||||
<table class="common-table">
|
||||
...
|
||||
</table></pre>
|
||||
|
||||
<h3>Example: Zebra-striped</h3>
|
||||
<p>Get a little fancy with your tables by adding zebra-striping—just add the <code>.zebra-striped</code> class.</p>
|
||||
<table class="zebra-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Language</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Your</td>
|
||||
<td>Mom</td>
|
||||
<td>English</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Joe</td>
|
||||
<td>Sixpack</td>
|
||||
<td>English</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Stu</td>
|
||||
<td>Dent</td>
|
||||
<td>Code</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<pre class="html">
|
||||
<table class="common-table zebra-striped">
|
||||
...
|
||||
</table></pre>
|
||||
|
||||
<h3>Example: Zebra-striped w/ TableSorter.js</h3>
|
||||
<p>Taking the previous example, we improve the usefulness of our tables by providing sorting functionality via <a href="http://jquery.com">jQuery</a> and the <a href="http://tablesorter.com/docs/">Tablesorter</a> plugin. <strong>Click any column's header to change the sort.</strong></p>
|
||||
<script type="text/javascript" src="http://tablesorter.com/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("table#sortTableExample").tablesorter( {sortList: [[1,0]]} );
|
||||
});
|
||||
</script>
|
||||
<table class="zebra-striped" id="sortTableExample">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th class="yellow">First Name</th>
|
||||
<th class="blue">Last Name</th>
|
||||
<th class="green">Language</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>Your</td>
|
||||
<td>Mom</td>
|
||||
<td>English</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>Joe</td>
|
||||
<td>Sixpack</td>
|
||||
<td>English</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>3</td>
|
||||
<td>Stu</td>
|
||||
<td>Dent</td>
|
||||
<td>Code</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<pre class="html">
|
||||
<script type="text/javascript" src="js/jquery/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("table#sortTableExample").tablesorter( {sortList: [[1,0]]} );
|
||||
});
|
||||
</script>
|
||||
<table class="common-table zebra-striped">
|
||||
...
|
||||
</table></pre>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<! -- JS for the prepend and append boxes -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('.add-on :checkbox').click(function() {
|
||||
if ($(this).attr('checked')) {
|
||||
$(this).parents('.add-on').addClass('active');
|
||||
} else {
|
||||
$(this).parents('.add-on').removeClass('active');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="page-header" id="forms">
|
||||
<h1>Forms and buttons</h1>
|
||||
</div>
|
||||
<p>All forms are given default styles to present them in a readable and scalable way.</p>
|
||||
<form>
|
||||
<fieldset>
|
||||
<legend>Example form legend</legend>
|
||||
<div class="clearfix">
|
||||
<label for="">X-Large Input</label>
|
||||
<div class="input">
|
||||
<input class="xlarge" id="xlInput" name="xlInput" size="30" type="text" />
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix">
|
||||
<label for="">Select</label>
|
||||
<div class="input">
|
||||
<select>
|
||||
<option>1</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>4</option>
|
||||
<option>5</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix">
|
||||
<label for="">Select</label>
|
||||
<div class="input">
|
||||
<select class="medium">
|
||||
<option>1</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>4</option>
|
||||
<option>5</option>
|
||||
</select>
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix">
|
||||
<label>Uneditable Input</label>
|
||||
<div class="input">
|
||||
<span class="uneditable-input">Some Value Here</span>
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix">
|
||||
<label for="disabledInput">Disabled Input</label>
|
||||
<div class="input">
|
||||
<input class="xlarge disabled" id="disabledInput" name="disabledInput" size="30" type="text" placeholder="Disabled input here... carry on." disabled />
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix error">
|
||||
<label for="xlInput">X-Large Input</label>
|
||||
<div class="input">
|
||||
<input class="xlarge error" id="xlInput" name="xlInput" size="30" type="text" />
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Example form legend</legend>
|
||||
<div class="clearfix">
|
||||
<label for="prependedInput">Prepended Text</label>
|
||||
<div class="input">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">@</span>
|
||||
<input class="medium" id="prependedInput" name="prependedInput" size="16" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix">
|
||||
<label for="prependedInput2">Prepended Checkbox</label>
|
||||
<div class="input">
|
||||
<div class="input-prepend">
|
||||
<label class="add-on"><input type="checkbox" name="" id="" value="" /></label>
|
||||
<input class="mini" id="prependedInput2" name="prependedInput2" size="16" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix">
|
||||
<label for="appendedInput">Appended Checkbox</label>
|
||||
<div class="input">
|
||||
<div class="input-append">
|
||||
<input class="mini" id="appendedInput" name="appendedInput" size="16" type="text" />
|
||||
<label class="add-on active"><input type="checkbox" name="" id="" value="" checked="checked" /></label>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix">
|
||||
<label for="xlInput">File Input</label>
|
||||
<div class="input">
|
||||
<input class="input-file" id="fileInput" name="fileInput" type="file" />
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Example form legend</legend>
|
||||
<div class="clearfix">
|
||||
<label id="optionsCheckboxes">List of Options</label>
|
||||
<div class="input">
|
||||
<ul class="inputs-list">
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="optionsCheckboxes" value="option1" />
|
||||
<span>Option one is this and that—be sure to include why it's great</span>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="optionsCheckboxes" value="option2" />
|
||||
<span>Option two can also be checked and included in form results</span>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="optionsCheckboxes" value="option2" />
|
||||
<span>Option three can—yes, you guessed it—also be checked and included in form results</span>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="disabled">
|
||||
<input type="checkbox" name="optionsCheckboxes" value="option2" disabled />
|
||||
<span>Option four cannot be checked as it is disabled.</span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
<span class="help-block">
|
||||
<strong>Note:</strong> Labels surround all the options for much larger click areas and a more usable form.
|
||||
</span>
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix">
|
||||
<label>Date Range</label>
|
||||
<div class="input">
|
||||
<div class="inline-inputs">
|
||||
<input class="small" type="text" value="May 1, 2011" />
|
||||
<input class="mini" type="text" value="12:00am" />
|
||||
to
|
||||
<input class="small" type="text" value="May 8, 2011" />
|
||||
<input class="mini" type="text" value="11:59pm" />
|
||||
<span class="help-inline">All times are shown as Pacific Standard Time (GMT -08:00).</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix">
|
||||
<label for="textarea">Textarea</label>
|
||||
<div class="input">
|
||||
<textarea class="xxlarge" id="textarea" name="textarea"></textarea>
|
||||
<span class="help-block">
|
||||
Block of help text to describe the field above if need be.
|
||||
</span>
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="clearfix">
|
||||
<label id="optionsRadio">List of Options</label>
|
||||
<div class="input">
|
||||
<ul class="inputs-list">
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="optionsCheckboxes" value="option1" />
|
||||
<span>Option one is this and that—be sure to include why it's great</span>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label>
|
||||
<input type="checkbox" name="optionsCheckboxes" value="option2" />
|
||||
<span>Option two can also be checked and included in form results</span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> <!-- /clearfix -->
|
||||
<div class="actions">
|
||||
<button type="submit" class="btn primary">Save Changes</button>
|
||||
<button type="reset" class="btn">Cancel</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<div class="row">
|
||||
<div class="span4 columns">
|
||||
<h2>Buttons</h2>
|
||||
<p>As a convention, buttons are used for actions while links are used for objects. For instance, "Download" could be a button and "recent activity" could be a link.</p>
|
||||
<p>All buttons default to a light gray style, but a blue <code>.primary</code> class is available. Plus, rolling your own styles is easy peasy.</p>
|
||||
</div>
|
||||
<div class="span12 columns">
|
||||
<h3>Example buttons</h3>
|
||||
<p>Button styles can be applied to anything with the <code>.btn</code> applied. Typically you'll want to apply these to only <code>a</code>, <code>button</code>, and select <code>input</code> elements. Here's how it looks:</p>
|
||||
<div class="well" style="padding: 14px 19px;">
|
||||
<button type="submit" class="btn primary">Submit</button>
|
||||
<button type="submit" class="btn">Cancel</button>
|
||||
</div>
|
||||
<h3>Alternate sizes</h3>
|
||||
<p>Fancy larger or smaller buttons? Have at it!</p>
|
||||
<div class="well">
|
||||
<a href="#" class="btn large primary">Primary action</a>
|
||||
<a href="#" class="btn large">Action</a>
|
||||
</div>
|
||||
<div class="well" style="padding: 16px 19px;">
|
||||
<a href="#" class="btn small primary">Primary action</a>
|
||||
<a href="#" class="btn small">Action</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<div class="page-header" id="navigation">
|
||||
<h1>Navigation</h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="span4 columns">
|
||||
<h3>Tabs or pills?</h3>
|
||||
<p>Create simple secondary navigation with a <code>ul</code>. Swap between tabs or pills by adding the appropriate class.</p>
|
||||
<p>Great for sub-sections of content like our account settings pages and user timelines for toggling between pages of like content. Available in tabbed or pill styles.</p>
|
||||
</div>
|
||||
<div class="span12 columns">
|
||||
<ul class="tabs">
|
||||
<li class="active"><a href="">Home</a></li>
|
||||
<li><a href="">Profile</a></li>
|
||||
<li><a href="">Messages</a></li>
|
||||
<li><a href="">Settings</a></li>
|
||||
<li><a href="">Contact</a></li>
|
||||
</ul>
|
||||
<pre class="html">
|
||||
<ul class="tabs">
|
||||
<li class="active"><a href="">Home</a></li>
|
||||
<li><a href="">Profile</a></li>
|
||||
<li><a href="">Messages</a></li>
|
||||
<li><a href="">Settings</a></li>
|
||||
<li><a href="">Contact</a></li>
|
||||
</ul>
|
||||
</pre>
|
||||
<ul class="pills">
|
||||
<li class="active"><a href="">Home</a></li>
|
||||
<li><a href="">Profile</a></li>
|
||||
<li><a href="">Messages</a></li>
|
||||
<li><a href="">Settings</a></li>
|
||||
<li><a href="">Contact</a></li>
|
||||
</ul>
|
||||
<pre class="html">
|
||||
<ul class="pills">
|
||||
<li class="active"><a href="">Home</a></li>
|
||||
<li><a href="">Profile</a></li>
|
||||
<li><a href="">Messages</a></li>
|
||||
<li><a href="">Settings</a></li>
|
||||
<li><a href="">Contact</a></li>
|
||||
</ul>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="span4 columns">
|
||||
<h3>Pagination</h3>
|
||||
<p>Ultra simplistic and minimally styled pagination inspired by Rdio. The large block is hard to miss, easily scalable, and provides large click areas.</p>
|
||||
</div>
|
||||
<div class="span12 columns">
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<li class="prev disabled"><a href="">← Previous</a></li>
|
||||
<li class="active"><a href="">1</a></li>
|
||||
<li><a href="">2</a></li>
|
||||
<li><a href="">3</a></li>
|
||||
<li><a href="">4</a></li>
|
||||
<li><a href="">5</a></li>
|
||||
<li class="next"><a href="">Next →</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<li class="prev"><a href="">← Previous</a></li>
|
||||
<li class="active"><a href="">10</a></li>
|
||||
<li><a href="">11</a></li>
|
||||
<li><a href="">12</a></li>
|
||||
<li class="disabled"><a href="">...</a></li>
|
||||
<li><a href="">19</a></li>
|
||||
<li><a href="">20</a></li>
|
||||
<li><a href="">21</a></li>
|
||||
<li class="next"><a href="">Next →</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<li class="prev"><a href="">← Previous</a></li>
|
||||
<li><a href="">10</a></li>
|
||||
<li><a href="">11</a></li>
|
||||
<li><a href="">12</a></li>
|
||||
<li><a href="">13</a></li>
|
||||
<li><a href="">14</a></li>
|
||||
<li class="active"><a href="">15</a></li>
|
||||
<li><a href="">16</a></li>
|
||||
<li><a href="">17</a></li>
|
||||
<li><a href="">18</a></li>
|
||||
<li><a href="">19</a></li>
|
||||
<li><a href="">20</a></li>
|
||||
<li class="next"><a href="">Next →</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<pre class="html">
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<li class="prev disabled"><a href="">&larr; Previous</a></li>
|
||||
<li class="active"><a href="">1</a></li>
|
||||
<li><a href="">2</a></li>
|
||||
<li><a href="">3</a></li>
|
||||
<li><a href="">4</a></li>
|
||||
<li><a href="">5</a></li>
|
||||
<li class="next"><a href="">Next &rarr;</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<div class="page-header" id="alerts">
|
||||
<h1>Alerts & Errors <small>Styles for success, warning, and error messages or alerts</small></h1>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span4 columns">
|
||||
<h2>Basic alerts</h2>
|
||||
<p>One-line messages for highlighting the failure, possible failure, or success of an action. Particularly useful for forms.</p>
|
||||
</div>
|
||||
<div class="span12 columns">
|
||||
<div class="alert-message error">
|
||||
<a class="close" href="#">×</a>
|
||||
<p><strong>Oh snap!</strong> Change this and that and try again.</p>
|
||||
</div>
|
||||
<div class="alert-message warning">
|
||||
<a class="close" href="#">×</a>
|
||||
<p><strong>Holy gaucamole!</strong> Best check yo self, you're not looking too good.</p>
|
||||
</div>
|
||||
<div class="alert-message success">
|
||||
<a class="close" href="#">×</a>
|
||||
<p><strong>Well done!</strong> You successfully read this alert message.</p>
|
||||
</div>
|
||||
<div class="alert-message info">
|
||||
<a class="close" href="#">×</a>
|
||||
<p><strong>Heads up!</strong> This is an alert that needs your attention, but it's not a huge priority just yet.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="span4 columns">
|
||||
<h2>Block messages</h2>
|
||||
<p>For messages that require a bit of explanation, we have paragraph style alerts. These are perfect for bubbling up longer error messages, warning a user of a pending action, or just presenting information for more emphasis on the page.</p>
|
||||
</div>
|
||||
<div class="span12 columns">
|
||||
<div class="alert-message block-message error">
|
||||
<a class="close" href="#">×</a>
|
||||
<p><strong>Oh snap! You got an error!</strong> Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.</p>
|
||||
<p><a class="btn small" href="#">Take This Action</a> <a class="btn small" href="#">Or Do This</a></p>
|
||||
</div>
|
||||
<div class="alert-message block-message warning">
|
||||
<a class="close" href="#">×</a>
|
||||
<p><strong>Holy gaucamole! This is a warning!</strong> Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>
|
||||
<p><a class="btn small" href="#">Take This Action</a> <a class="btn small" href="#">Or Do This</a></p>
|
||||
</div>
|
||||
<div class="alert-message block-message success">
|
||||
<a class="close" href="#">×</a>
|
||||
<p><strong>Well done!</strong> You successfully read this alert message. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Maecenas faucibus mollis interdum.</p>
|
||||
<p><a class="btn small" href="#">Take This Action</a> <a class="btn small" href="#">Or Do This</a></p>
|
||||
</div>
|
||||
<div class="alert-message block-message info">
|
||||
<a class="close" href="#">×</a>
|
||||
<p><strong>Heads up!</strong> This is an alert that needs your attention, but it's not a huge priority just yet.</p>
|
||||
<p><a class="btn small" href="#">Take This Action</a> <a class="btn small" href="#">Or Do This</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
<p></p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
75
js/global.js
Normal file
75
js/global.js
Normal file
@ -0,0 +1,75 @@
|
||||
$(document).ready(function(){
|
||||
// Get Heights
|
||||
windowHeight = $(window).height();
|
||||
documentHeight = $(document).height();
|
||||
sidebarHeight = windowHeight - 40;
|
||||
containerHeight = windowHeight - 40;
|
||||
|
||||
// Get Widths
|
||||
windowWidth = $(window).width();
|
||||
containerWidth = windowWidth - 200;
|
||||
|
||||
if (windowHeight < containerHeight) {
|
||||
|
||||
// Set Dimensions for default state (before resize)
|
||||
$('div#sidebar').css({
|
||||
height: sidebarHeight
|
||||
});
|
||||
$('div#container').css({
|
||||
width: containerWidth,
|
||||
height: containerHeight
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
// During resize, set widths
|
||||
$(window).resize(function() {
|
||||
console.log('Window Height: ' + $(window).height() + ', Sidebar Height:' + ($(window).height() - 40));
|
||||
|
||||
// Get Heights
|
||||
windowHeight = $(window).height();
|
||||
sidebarHeight = windowHeight - 40;
|
||||
containerHeight = windowHeight - 40;
|
||||
|
||||
// Get Widths
|
||||
windowWidth = $(window).width();
|
||||
containerWidth = windowWidth - 200;
|
||||
|
||||
// Set Dimensions for default state (before resize)
|
||||
$('div#sidebar').css({
|
||||
height: sidebarHeight
|
||||
});
|
||||
$('div#container').css({
|
||||
width: containerWidth,
|
||||
height: containerHeight
|
||||
});
|
||||
});
|
||||
// console.log('omgz window is less than container so... fuck.');
|
||||
$('div#sidebar').css({
|
||||
height: documentHeight - 40
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
// Toggle Calendars
|
||||
$('div#sidebar ul li a').click(function() {
|
||||
if ($(this).is('#toggleMonthView')) {
|
||||
console.log('toggle month');
|
||||
$(this).addClass('active');
|
||||
$('#toggleListView').removeClass('active');
|
||||
$('table#monthView').show();
|
||||
$('table#listView').hide();
|
||||
} else {
|
||||
console.log('toggle list');
|
||||
$(this).addClass('active');
|
||||
$('#toggleMonthView').removeClass('active');
|
||||
$('table#listView').show();
|
||||
$('table#monthView').hide();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
*/
|
||||
});
|
85
js/jquery/chili/css.js
vendored
Executable file
85
js/jquery/chili/css.js
vendored
Executable file
@ -0,0 +1,85 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: 'css'
|
||||
, _case: true
|
||||
, _main: {
|
||||
comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: "color: olive;"
|
||||
}
|
||||
, directive: {
|
||||
_match: /@\w+/
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, url: {
|
||||
_match: /\b(url\s*\()([^)]+)(\))/
|
||||
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, block: {
|
||||
_match: /\{([\w\W]*?)\}/
|
||||
, _replace: function( all, pairs ) {
|
||||
return '{' + this.x( pairs, '/definition' ) + '}';
|
||||
}
|
||||
}
|
||||
, 'class': {
|
||||
_match: /\.\w+/
|
||||
, _style: "color: #CC0066;"
|
||||
}
|
||||
, id: {
|
||||
_match: /#\w+/
|
||||
, _style: "color: IndianRed;"
|
||||
}
|
||||
, pseudo: {
|
||||
_match: /:\w+/
|
||||
, _style: "color: #CC9900;"
|
||||
}
|
||||
, element: {
|
||||
_match: /\w+/
|
||||
, _style: "color: Purple;"
|
||||
}
|
||||
}
|
||||
, definition: {
|
||||
comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
}
|
||||
, property: {
|
||||
_match: /\b(?:zoom|z-index|writing-mode|word-wrap|word-spacing|word-break|width|widows|white-space|volume|voice-family|visibility|vertical-align|unicode-bidi|top|text-underline-position|text-transform|text-shadow|text-overflow|text-kashida-space|text-justify|text-indent|text-decoration|text-autospace|text-align-last|text-align|table-layout|stress|speech-rate|speak-punctuation|speak-numeral|speak-header|speak|size|scrollbar-track-color|scrollbar-shadow-color|scrollbar-highlight-color|scrollbar-face-color|scrollbar-dark-shadow-color|scrollbar-base-color|scrollbar-arrow-color|scrollbar-3d-light-color|ruby-position|ruby-overhang|ruby-align|right|richness|quotes|position|play-during|pitch-range|pitch|pause-before|pause-after|pause|page-break-inside|page-break-before|page-break-after|page|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-Y|overflow-X|overflow|outline-width|outline-style|outline-color|outline|orphans|min-width|min-height|max-width|max-height|marks|marker-offset|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|line-break|letter-spacing|left|layout-grid-type|layout-grid-mode|layout-grid-line|layout-grid-char-spacing|layout-grid-char|layout-grid|layout-flow|layer-background-image|layer-background-color|include-source|ime-mode|height|font-weight|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-family|font|float|filter|empty-cells|elevation|display|direction|cursor|cue-before|cue-after|cue|counter-reset|counter-increment|content|color|clip|clear|caption-side|bottom|border-width|border-top-width|border-top-style|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-left-width|border-left-style|border-left-color|border-left|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-color|border-bottom|border|behavior|background-repeat|background-position-y|background-position-x|background-position|background-image|background-color|background-attachment|background|azimuth|accelerator)\s*:/
|
||||
, _style: "color: #330066;"
|
||||
}
|
||||
, special: {
|
||||
_match: /\b(?:-use-link-source|-set-link-source|-replace|-moz-user-select|-moz-user-modify|-moz-user-input|-moz-user-focus|-moz-outline-width|-moz-outline-style|-moz-outline-color|-moz-outline|-moz-opacity|-moz-border-top-colors|-moz-border-right-colors|-moz-border-radius-topright|-moz-border-radius-topleft|-moz-border-radius-bottomright|-moz-border-radius-bottomleft|-moz-border-radius|-moz-border-left-colors|-moz-border-bottom-colors|-moz-binding)\s*:/
|
||||
, _style: "color: #330066; text-decoration: underline;"
|
||||
}
|
||||
, url: {
|
||||
_match: /\b(url\s*\()([^)]+)(\))/
|
||||
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
|
||||
}
|
||||
, value: {
|
||||
_match: /\b(?:xx-small|xx-large|x-soft|x-small|x-slow|x-low|x-loud|x-large|x-high|x-fast|wider|wait|w-resize|visible|url|uppercase|upper-roman|upper-latin|upper-alpha|underline|ultra-expanded|ultra-condensed|tv|tty|transparent|top|thin|thick|text-top|text-bottom|table-row-group|table-row|table-header-group|table-footer-group|table-column-group|table-column|table-cell|table-caption|sw-resize|super|sub|status-bar|static|square|spell-out|speech|solid|soft|smaller|small-caption|small-caps|small|slower|slow|silent|show|separate|semi-expanded|semi-condensed|se-resize|scroll|screen|s-resize|run-in|rtl|rightwards|right-side|right|ridge|rgb|repeat-y|repeat-x|repeat|relative|projection|print|pre|portrait|pointer|overline|outside|outset|open-quote|once|oblique|nw-resize|nowrap|normal|none|no-repeat|no-open-quote|no-close-quote|ne-resize|narrower|n-resize|move|mix|middle|message-box|medium|marker|ltr|lowercase|lower-roman|lower-latin|lower-greek|lower-alpha|lower|low|loud|local|list-item|line-through|lighter|level|leftwards|left-side|left|larger|large|landscape|justify|italic|invert|inside|inset|inline-table|inline|icon|higher|high|hide|hidden|help|hebrew|handheld|groove|format|fixed|faster|fast|far-right|far-left|fantasy|extra-expanded|extra-condensed|expanded|embossed|embed|e-resize|double|dotted|disc|digits|default|decimal-leading-zero|decimal|dashed|cursive|crosshair|cross|crop|counters|counter|continuous|condensed|compact|collapse|code|close-quote|circle|center-right|center-left|center|caption|capitalize|braille|bottom|both|bolder|bold|block|blink|bidi-override|below|behind|baseline|avoid|auto|aural|attr|armenian|always|all|absolute|above)\b/
|
||||
, _style: "color: #3366FF;"
|
||||
}
|
||||
, string: {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: "color: teal;"
|
||||
}
|
||||
, number: {
|
||||
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, color : {
|
||||
_match: /(?:\#[a-fA-F0-9]{3,6})|\b(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua|YellowGreen|Yellow|WhiteSmoke|White|Wheat|Violet|Turquoise|Tomato|Thistle|Teal|Tan|SteelBlue|SpringGreen|Snow|SlateGrey|SlateGray|SlateBlue|SkyBlue|Silver|Sienna|SeaShell|SeaGreen|SandyBrown|Salmon|SaddleBrown|RoyalBlue|RosyBrown|Red|Purple|PowderBlue|Plum|Pink|Peru|PeachPuff|PapayaWhip|PaleVioletRed|PaleTurquoise|PaleGreen|PaleGoldenRod|Orchid|OrangeRed|Orange|OliveDrab|Olive|OldLace|Navy|NavajoWhite|Moccasin|MistyRose|MintCream|MidnightBlue|MediumVioletRed|MediumTurquoise|MediumSpringGreen|MediumSlateBlue|MediumSeaGreen|MediumPurple|MediumOrchid|MediumBlue|MediumAquaMarine|Maroon|Magenta|Linen|LimeGreen|Lime|LightYellow|LightSteelBlue|LightSlateGrey|LightSlateGray|LightSkyBlue|LightSeaGreen|LightSalmon|LightPink|LightGrey|LightGreen|LightGray|LightGoldenRodYellow|LightCyan|LightCoral|LightBlue|LemonChiffon|LawnGreen|LavenderBlush|Lavender|Khaki|Ivory|Indigo|IndianRed|HotPink|HoneyDew|Grey|GreenYellow|Green|Gray|GoldenRod|Gold|GhostWhite|Gainsboro|Fuchsia|ForestGreen|FloralWhite|FireBrick|DodgerBlue|DimGrey|DimGray|DeepSkyBlue|DeepPink|Darkorange|DarkViolet|DarkTurquoise|DarkSlateGrey|DarkSlateGray|DarkSlateBlue|DarkSeaGreen|DarkSalmon|DarkRed|DarkOrchid|DarkOliveGreen|DarkMagenta|DarkKhaki|DarkGrey|DarkGreen|DarkGray|DarkGoldenRod|DarkCyan|DarkBlue|Cyan|Crimson|Cornsilk|CornflowerBlue|Coral|Chocolate|Chartreuse|CadetBlue|BurlyWood|Brown|BlueViolet|Blue|BlanchedAlmond|Black|Bisque|Beige|Azure|Aquamarine|Aqua|AntiqueWhite|AliceBlue)\b/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
}
|
||||
}
|
80
js/jquery/chili/html.js
vendored
Executable file
80
js/jquery/chili/html.js
vendored
Executable file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: 'html'
|
||||
, _case: false
|
||||
, _main: {
|
||||
doctype: {
|
||||
_match: /<!DOCTYPE\b[\w\W]*?>/
|
||||
, _style: "color: #CC6600;"
|
||||
}
|
||||
, ie_style: {
|
||||
_match: /(<!--\[[^\]]*\]>)([\w\W]*?)(<!\[[^\]]*\]-->)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return "<span class='ie_style'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content, '//style' )
|
||||
+ "<span class='ie_style'>" + this.x( close ) + "</span>";
|
||||
}
|
||||
, _style: "color: DarkSlateGray; font-weight: bold;"
|
||||
}
|
||||
, comment: {
|
||||
_match: /<!--[\w\W]*?-->/
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, script: {
|
||||
_match: /(<script\s+[^>]*>)([\w\W]*?)(<\/script\s*>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return this.x( open, '//tag_start' )
|
||||
+ this.x( content, 'js' )
|
||||
+ this.x( close, '//tag_end' );
|
||||
}
|
||||
}
|
||||
, style: {
|
||||
_match: /(<style\s+[^>]*>)([\w\W]*?)(<\/style\s*>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return this.x( open, '//tag_start' )
|
||||
+ this.x( content, 'css' )
|
||||
+ this.x( close, '//tag_end' );
|
||||
}
|
||||
}
|
||||
// matches a starting tag of an element (with attrs)
|
||||
// like "<div ... >" or "<img ... />"
|
||||
, tag_start: {
|
||||
_match: /(<\w+)((?:[?%]>|[\w\W])*?)(\/>|>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return "<span class='tag_start'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content, '/tag_attrs' )
|
||||
+ "<span class='tag_start'>" + this.x( close ) + "</span>";
|
||||
}
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
// matches an ending tag
|
||||
// like "</div>"
|
||||
, tag_end: {
|
||||
_match: /<\/\w+\s*>|\/>/
|
||||
, _style: "color: navy;"
|
||||
}
|
||||
, entity: {
|
||||
_match: /&\w+?;/
|
||||
, _style: "color: blue;"
|
||||
}
|
||||
}
|
||||
, tag_attrs: {
|
||||
// matches a name/value pair
|
||||
attr: {
|
||||
// before in $1, name in $2, between in $3, value in $4
|
||||
_match: /(\W*?)([\w-]+)(\s*=\s*)((?:\'[^\']*(?:\\.[^\']*)*\')|(?:\"[^\"]*(?:\\.[^\"]*)*\"))/
|
||||
, _replace: "$1<span class='attr_name'>$2</span>$3<span class='attr_value'>$4</span>"
|
||||
, _style: { attr_name: "color: green;", attr_value: "color: maroon;" }
|
||||
}
|
||||
}
|
||||
}
|
704
js/jquery/chili/jquery.chili-2.2.js
Executable file
704
js/jquery/chili/jquery.chili-2.2.js
Executable file
@ -0,0 +1,704 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
||||
( function($) {
|
||||
|
||||
ChiliBook = { //implied global
|
||||
|
||||
version: "2.2" // 2008-07-06
|
||||
|
||||
// options --------------------------------------------------------------------
|
||||
|
||||
, automatic: true
|
||||
, automaticSelector: "pre"
|
||||
|
||||
, lineNumbers: !true
|
||||
|
||||
, codeLanguage: function( el ) {
|
||||
var recipeName = $( el ).attr( "class" );
|
||||
return recipeName ? recipeName : '';
|
||||
}
|
||||
|
||||
, recipeLoading: true
|
||||
, recipeFolder: "" // used like: recipeFolder + recipeName + '.js'
|
||||
|
||||
// IE and FF convert   to " ", Safari and Opera do not
|
||||
, replaceSpace: " "
|
||||
, replaceTab: "    "
|
||||
, replaceNewLine: " <br/>"
|
||||
|
||||
, selectionStyle: [ "position:absolute; z-index:3000; overflow:scroll;"
|
||||
, "width:16em;"
|
||||
, "height:9em;"
|
||||
, "border:1px solid gray;"
|
||||
, "padding:15px;"
|
||||
, "background-color:yellow;"
|
||||
].join( ' ' )
|
||||
|
||||
// ------------------------------------------------------------- end of options
|
||||
|
||||
, defaultReplacement: '<span class="$0">$$</span>' // TODO: make this an option again
|
||||
, recipes: {} //repository
|
||||
, queue: {} //registry
|
||||
|
||||
, unique: function() {
|
||||
return (new Date()).valueOf();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
$.fn.chili = function( options ) {
|
||||
var book = $.extend( {}, ChiliBook, options || {} );
|
||||
|
||||
function cook( ingredients, recipe, blockName ) {
|
||||
|
||||
function prepareBlock( recipe, blockName ) {
|
||||
var steps = [];
|
||||
for( var stepName in recipe[ blockName ] ) {
|
||||
steps.push( prepareStep( recipe, blockName, stepName ) );
|
||||
}
|
||||
return steps;
|
||||
} // prepareBlock
|
||||
|
||||
function prepareStep( recipe, blockName, stepName ) {
|
||||
var step = recipe[ blockName ][ stepName ];
|
||||
var exp = ( typeof step._match == "string" ) ? step._match : step._match.source;
|
||||
return {
|
||||
recipe: recipe
|
||||
, blockName: blockName
|
||||
, stepName: stepName
|
||||
, exp: "(" + exp + ")"
|
||||
, length: 1 // add 1 to account for the newly added parentheses
|
||||
+ (exp // count number of submatches in here
|
||||
.replace( /\\./g, "%" ) // disable any escaped character
|
||||
.replace( /\[.*?\]/g, "%" ) // disable any character class
|
||||
.match( /\((?!\?)/g ) // match any open parenthesis, not followed by a ?
|
||||
|| [] // make sure it is an empty array if there are no matches
|
||||
).length // get the number of matches
|
||||
, replacement: step._replace ? step._replace : book.defaultReplacement
|
||||
};
|
||||
} // prepareStep
|
||||
|
||||
function knowHow( steps ) {
|
||||
var prevLength = 1;
|
||||
var exps = [];
|
||||
for (var i = 0; i < steps.length; i++) {
|
||||
var exp = steps[ i ].exp;
|
||||
// adjust backreferences
|
||||
exp = exp.replace( /\\\\|\\(\d+)/g, function( m, aNum ) {
|
||||
return !aNum ? m : "\\" + ( prevLength + 1 + parseInt( aNum, 10 ) );
|
||||
} );
|
||||
exps.push( exp );
|
||||
prevLength += steps[ i ].length;
|
||||
}
|
||||
var prolog = '((?:\\s|\\S)*?)';
|
||||
var epilog = '((?:\\s|\\S)+)';
|
||||
var source = '(?:' + exps.join( "|" ) + ')';
|
||||
source = prolog + source + '|' + epilog;
|
||||
return new RegExp( source, recipe._case ? "g" : "gi" );
|
||||
} // knowHow
|
||||
|
||||
function escapeHTML( str ) {
|
||||
return str.replace( /&/g, "&" ).replace( /</g, "<" );
|
||||
} // escapeHTML
|
||||
|
||||
function replaceSpaces( str ) {
|
||||
return str.replace( / +/g, function( spaces ) {
|
||||
return spaces.replace( / /g, replaceSpace );
|
||||
} );
|
||||
} // replaceSpaces
|
||||
|
||||
function filter( str ) {
|
||||
str = escapeHTML( str );
|
||||
if( replaceSpace ) {
|
||||
str = replaceSpaces( str );
|
||||
}
|
||||
return str;
|
||||
} // filter
|
||||
|
||||
function applyRecipe( subject, recipe ) {
|
||||
return cook( subject, recipe );
|
||||
} // applyRecipe
|
||||
|
||||
function applyBlock( subject, recipe, blockName ) {
|
||||
return cook( subject, recipe, blockName );
|
||||
} // applyBlock
|
||||
|
||||
function applyStep( subject, recipe, blockName, stepName ) {
|
||||
var replaceSpace = book.replaceSpace;
|
||||
|
||||
var step = prepareStep( recipe, blockName, stepName );
|
||||
var steps = [step];
|
||||
|
||||
var perfect = subject.replace( knowHow( steps ), function() {
|
||||
return chef.apply( { steps: steps }, arguments );
|
||||
} );
|
||||
return perfect;
|
||||
} // applyStep
|
||||
|
||||
function applyModule( subject, module, context ) {
|
||||
if( ! module ) {
|
||||
return filter( subject );
|
||||
}
|
||||
|
||||
var sub = module.split( '/' );
|
||||
var recipeName = '';
|
||||
var blockName = '';
|
||||
var stepName = '';
|
||||
switch( sub.length ) {
|
||||
case 1:
|
||||
recipeName = sub[0];
|
||||
break;
|
||||
case 2:
|
||||
recipeName = sub[0]; blockName = sub[1];
|
||||
break;
|
||||
case 3:
|
||||
recipeName = sub[0]; blockName = sub[1]; stepName = sub[2];
|
||||
break;
|
||||
default:
|
||||
return filter( subject );
|
||||
}
|
||||
|
||||
function getRecipe( recipeName ) {
|
||||
var path = getPath( recipeName );
|
||||
var recipe = book.recipes[ path ];
|
||||
if( ! recipe ) {
|
||||
throw {msg:"recipe not available"};
|
||||
}
|
||||
return recipe;
|
||||
}
|
||||
|
||||
try {
|
||||
var recipe;
|
||||
if ( '' == stepName ) {
|
||||
if ( '' == blockName ) {
|
||||
if ( '' == recipeName ) {
|
||||
//nothing to do
|
||||
}
|
||||
else { // ( '' != recipeName )
|
||||
recipe = getRecipe( recipeName );
|
||||
return applyRecipe( subject, recipe );
|
||||
}
|
||||
}
|
||||
else { // ( '' != blockName )
|
||||
if( '' == recipeName ) {
|
||||
recipe = context.recipe;
|
||||
}
|
||||
else {
|
||||
recipe = getRecipe( recipeName );
|
||||
}
|
||||
if( ! (blockName in recipe) ) {
|
||||
return filter( subject );
|
||||
}
|
||||
return applyBlock( subject, recipe, blockName );
|
||||
}
|
||||
}
|
||||
else { // ( '' != stepName )
|
||||
if( '' == recipeName ) {
|
||||
recipe = context.recipe;
|
||||
}
|
||||
else {
|
||||
recipe = getRecipe( recipeName );
|
||||
}
|
||||
if( '' == blockName ) {
|
||||
blockName = context.blockName;
|
||||
}
|
||||
if( ! (blockName in recipe) ) {
|
||||
return filter( subject );
|
||||
}
|
||||
if( ! (stepName in recipe[blockName]) ) {
|
||||
return filter( subject );
|
||||
}
|
||||
return applyStep( subject, recipe, blockName, stepName );
|
||||
}
|
||||
}
|
||||
catch( e ) {
|
||||
if (e.msg && e.msg == "recipe not available") {
|
||||
var cue = 'chili_' + book.unique();
|
||||
if( book.recipeLoading ) {
|
||||
var path = getPath( recipeName );
|
||||
if( ! book.queue[ path ] ) {
|
||||
/* this is a new recipe to download */
|
||||
try {
|
||||
book.queue[ path ] = [ {cue: cue, subject: subject, module: module, context: context} ];
|
||||
$.getJSON( path, function( recipeLoaded ) {
|
||||
book.recipes[ path ] = recipeLoaded;
|
||||
var q = book.queue[ path ];
|
||||
for( var i = 0, iTop = q.length; i < iTop; i++ ) {
|
||||
var replacement = applyModule( q[ i ].subject, q[ i ].module, q[ i ].context );
|
||||
if( book.replaceTab ) {
|
||||
replacement = replacement.replace( /\t/g, book.replaceTab );
|
||||
}
|
||||
if( book.replaceNewLine ) {
|
||||
replacement = replacement.replace( /\n/g, book.replaceNewLine );
|
||||
}
|
||||
$( '#' + q[ i ].cue ).replaceWith( replacement );
|
||||
}
|
||||
} );
|
||||
}
|
||||
catch( recipeNotAvailable ) {
|
||||
alert( "the recipe for '" + recipeName + "' was not found in '" + path + "'" );
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* not a new recipe, so just enqueue this element */
|
||||
book.queue[ path ].push( {cue: cue, subject: subject, module: module, context: context} );
|
||||
}
|
||||
return '<span id="' + cue + '">' + filter( subject ) + '</span>';
|
||||
}
|
||||
return filter( subject );
|
||||
}
|
||||
else {
|
||||
return filter( subject );
|
||||
}
|
||||
}
|
||||
} // applyModule
|
||||
|
||||
function addPrefix( prefix, replacement ) {
|
||||
var aux = replacement.replace( /(<span\s+class\s*=\s*(["']))((?:(?!__)\w)+\2\s*>)/ig, "$1" + prefix + "__$3" );
|
||||
return aux;
|
||||
} // addPrefix
|
||||
|
||||
function chef() {
|
||||
if (! arguments[ 0 ]) {
|
||||
return '';
|
||||
}
|
||||
var steps = this.steps;
|
||||
var i = 0; // iterate steps
|
||||
var j = 2; // iterate chef's arguments
|
||||
var prolog = arguments[ 1 ];
|
||||
var epilog = arguments[ arguments.length - 3 ];
|
||||
if (! epilog) {
|
||||
var step;
|
||||
while( step = steps[ i++ ] ) {
|
||||
var aux = arguments; // this unmasks chef's arguments inside the next function
|
||||
if( aux[ j ] ) {
|
||||
var replacement = '';
|
||||
if( $.isFunction( step.replacement ) ) {
|
||||
var matches = []; //Array.slice.call( aux, j, step.length );
|
||||
for (var k = 0, kTop = step.length; k < kTop; k++) {
|
||||
matches.push( aux[ j + k ] );
|
||||
}
|
||||
matches.push( aux[ aux.length - 2 ] );
|
||||
matches.push( aux[ aux.length - 1 ] );
|
||||
replacement = step.replacement
|
||||
.apply( {
|
||||
x: function() {
|
||||
var subject = arguments[0];
|
||||
var module = arguments[1];
|
||||
var context = {
|
||||
recipe: step.recipe
|
||||
, blockName: step.blockName
|
||||
};
|
||||
return applyModule( subject, module, context );
|
||||
}
|
||||
}, matches );
|
||||
}
|
||||
else { //we expect step.replacement to be a string
|
||||
replacement = step.replacement
|
||||
.replace( /(\\\$)|(?:\$\$)|(?:\$(\d+))/g, function( m, escaped, K ) {
|
||||
if( escaped ) { /* \$ */
|
||||
return "$";
|
||||
}
|
||||
else if( !K ) { /* $$ */
|
||||
return filter( aux[ j ] );
|
||||
}
|
||||
else if( K == "0" ) { /* $0 */
|
||||
return step.stepName;
|
||||
}
|
||||
else { /* $K */
|
||||
return filter( aux[ j + parseInt( K, 10 ) ] );
|
||||
}
|
||||
} );
|
||||
}
|
||||
replacement = addPrefix( step.recipe._name, replacement );
|
||||
return filter( prolog ) + replacement;
|
||||
}
|
||||
else {
|
||||
j+= step.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
return filter( epilog );
|
||||
}
|
||||
} // chef
|
||||
|
||||
if( ! blockName ) {
|
||||
blockName = '_main';
|
||||
checkSpices( recipe );
|
||||
}
|
||||
if( ! (blockName in recipe) ) {
|
||||
return filter( ingredients );
|
||||
}
|
||||
var replaceSpace = book.replaceSpace;
|
||||
var steps = prepareBlock( recipe, blockName );
|
||||
var kh = knowHow( steps );
|
||||
var perfect = ingredients.replace( kh, function() {
|
||||
return chef.apply( { steps: steps }, arguments );
|
||||
} );
|
||||
return perfect;
|
||||
|
||||
} // cook
|
||||
|
||||
function loadStylesheetInline( sourceCode ) {
|
||||
if( document.createElement ) {
|
||||
var e = document.createElement( "style" );
|
||||
e.type = "text/css";
|
||||
if( e.styleSheet ) { // IE
|
||||
e.styleSheet.cssText = sourceCode;
|
||||
}
|
||||
else {
|
||||
var t = document.createTextNode( sourceCode );
|
||||
e.appendChild( t );
|
||||
}
|
||||
document.getElementsByTagName( "head" )[0].appendChild( e );
|
||||
}
|
||||
} // loadStylesheetInline
|
||||
|
||||
function checkSpices( recipe ) {
|
||||
var name = recipe._name;
|
||||
if( ! book.queue[ name ] ) {
|
||||
|
||||
var content = ['/* Chili -- ' + name + ' */'];
|
||||
for (var blockName in recipe) {
|
||||
if( blockName.search( /^_(?!main\b)/ ) < 0 ) {
|
||||
for (var stepName in recipe[ blockName ]) {
|
||||
var step = recipe[ blockName ][ stepName ];
|
||||
if( '_style' in step ) {
|
||||
if( step[ '_style' ].constructor == String ) {
|
||||
content.push( '.' + name + '__' + stepName + ' { ' + step[ '_style' ] + ' }' );
|
||||
}
|
||||
else {
|
||||
for (var className in step[ '_style' ]) {
|
||||
content.push( '.' + name + '__' + className + ' { ' + step[ '_style' ][ className ] + ' }' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
content = content.join('\n');
|
||||
|
||||
loadStylesheetInline( content );
|
||||
|
||||
book.queue[ name ] = true;
|
||||
}
|
||||
} // checkSpices
|
||||
|
||||
function askDish( el ) {
|
||||
var recipeName = book.codeLanguage( el );
|
||||
if( '' != recipeName ) {
|
||||
var path = getPath( recipeName );
|
||||
if( book.recipeLoading ) {
|
||||
/* dynamic setups come here */
|
||||
if( ! book.queue[ path ] ) {
|
||||
/* this is a new recipe to download */
|
||||
try {
|
||||
book.queue[ path ] = [ el ];
|
||||
$.getJSON( path, function( recipeLoaded ) {
|
||||
book.recipes[ path ] = recipeLoaded;
|
||||
var q = book.queue[ path ];
|
||||
for( var i = 0, iTop = q.length; i < iTop; i++ ) {
|
||||
makeDish( q[ i ], path );
|
||||
}
|
||||
} );
|
||||
}
|
||||
catch( recipeNotAvailable ) {
|
||||
alert( "the recipe for '" + recipeName + "' was not found in '" + path + "'" );
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* not a new recipe, so just enqueue this element */
|
||||
book.queue[ path ].push( el );
|
||||
}
|
||||
/* a recipe could have been already downloaded */
|
||||
makeDish( el, path );
|
||||
}
|
||||
else {
|
||||
/* static setups come here */
|
||||
makeDish( el, path );
|
||||
}
|
||||
}
|
||||
} // askDish
|
||||
|
||||
function makeDish( el, recipePath ) {
|
||||
var recipe = book.recipes[ recipePath ];
|
||||
if( ! recipe ) {
|
||||
return;
|
||||
}
|
||||
var $el = $( el );
|
||||
var ingredients = $el.text();
|
||||
if( ! ingredients ) {
|
||||
return;
|
||||
}
|
||||
|
||||
//fix for msie: \r (13) is used instead of \n (10)
|
||||
//fix for opera: \r\n is used instead of \n
|
||||
ingredients = ingredients.replace(/\r\n?/g, "\n");
|
||||
|
||||
//reverse fix for safari: msie, mozilla and opera render the initial \n
|
||||
if( $el.parent().is('pre') ) {
|
||||
if( ! $.browser.safari ) {
|
||||
ingredients = ingredients.replace(/^\n/g, "");
|
||||
}
|
||||
}
|
||||
|
||||
var dish = cook( ingredients, recipe ); // all happens here
|
||||
|
||||
if( book.replaceTab ) {
|
||||
dish = dish.replace( /\t/g, book.replaceTab );
|
||||
}
|
||||
if( book.replaceNewLine ) {
|
||||
dish = dish.replace( /\n/g, book.replaceNewLine );
|
||||
}
|
||||
|
||||
el.innerHTML = dish; //much faster than $el.html( dish );
|
||||
//tried also the function replaceHtml from http://blog.stevenlevithan.com/archives/faster-than-innerhtml
|
||||
//but it was not faster nor without sideffects (it was not possible to count spans into el)
|
||||
|
||||
//opera and safari select PRE text correctly
|
||||
if( $.browser.msie || $.browser.mozilla ) {
|
||||
enableSelectionHelper( el );
|
||||
}
|
||||
|
||||
var $that = $el.parent();
|
||||
var classes = $that.attr( 'class' );
|
||||
var ln = /ln-(\d+)-([\w][\w\-]*)|ln-(\d+)|ln-/.exec( classes );
|
||||
if( ln ) {
|
||||
addLineNumbers( el );
|
||||
var start = 0;
|
||||
if( ln[1] ) {
|
||||
start = parseInt( ln[1], 10 );
|
||||
var $pieces = $( '.ln-' + ln[1] + '-' + ln[2] );
|
||||
var pos = $pieces.index( $that[0] );
|
||||
$pieces.slice( 0, pos ).each( function() {
|
||||
start += $( this ).find( 'li' ).length;
|
||||
} );
|
||||
}
|
||||
else if( ln[3] ) {
|
||||
start = parseInt( ln[3], 10 );
|
||||
}
|
||||
else {
|
||||
start = 1;
|
||||
}
|
||||
$el.find( 'ol' )[0].start = start;
|
||||
$('body').width( $('body').width() - 1 ).width( $('body').width() + 1 );
|
||||
}
|
||||
else if( book.lineNumbers ) {
|
||||
addLineNumbers( el );
|
||||
}
|
||||
|
||||
} // makeDish
|
||||
|
||||
function enableSelectionHelper( el ) {
|
||||
var element = null;
|
||||
$( el )
|
||||
.parents()
|
||||
.filter( "pre" )
|
||||
.bind( "mousedown", function() {
|
||||
element = this;
|
||||
if( $.browser.msie ) {
|
||||
document.selection.empty();
|
||||
}
|
||||
else {
|
||||
window.getSelection().removeAllRanges();
|
||||
}
|
||||
} )
|
||||
.bind( "mouseup", function( event ) {
|
||||
if( element && (element == this) ) {
|
||||
element = null;
|
||||
var selected = '';
|
||||
if( $.browser.msie ) {
|
||||
selected = document.selection.createRange().htmlText;
|
||||
if( '' == selected ) {
|
||||
return;
|
||||
}
|
||||
selected = preserveNewLines( selected );
|
||||
var container_tag = '<textarea style="STYLE">';
|
||||
}
|
||||
else {
|
||||
selected = window.getSelection().toString(); //opera doesn't select new lines
|
||||
if( '' == selected ) {
|
||||
return;
|
||||
}
|
||||
selected = selected
|
||||
.replace( /\r/g, '' )
|
||||
.replace( /^# ?/g, '' )
|
||||
.replace( /\n# ?/g, '\n' )
|
||||
;
|
||||
var container_tag = '<pre style="STYLE">';
|
||||
}
|
||||
var $container = $( container_tag.replace( /\bSTYLE\b/, ChiliBook.selectionStyle ) )
|
||||
.appendTo( 'body' )
|
||||
.text( selected )
|
||||
.attr( 'id', 'chili_selection' )
|
||||
.click( function() { $(this).remove(); } )
|
||||
;
|
||||
var top = event.pageY - Math.round( $container.height() / 2 ) + "px";
|
||||
var left = event.pageX - Math.round( $container.width() / 2 ) + "px";
|
||||
$container.css( { top: top, left: left } );
|
||||
if( $.browser.msie ) {
|
||||
// window.clipboardData.setData( 'Text', selected ); //I couldn't find anything similar for Mozilla
|
||||
$container[0].focus();
|
||||
$container[0].select();
|
||||
}
|
||||
else {
|
||||
var s = window.getSelection();
|
||||
s.removeAllRanges();
|
||||
var r = document.createRange();
|
||||
r.selectNodeContents( $container[0] );
|
||||
s.addRange( r );
|
||||
}
|
||||
}
|
||||
} )
|
||||
;
|
||||
} // enableSelectionHelper
|
||||
|
||||
function getPath( recipeName ) {
|
||||
return book.recipeFolder + recipeName + ".js";
|
||||
} // getPath
|
||||
|
||||
function getSelectedText() {
|
||||
var text = '';
|
||||
if( $.browser.msie ) {
|
||||
text = document.selection.createRange().htmlText;
|
||||
}
|
||||
else {
|
||||
text = window.getSelection().toString();
|
||||
}
|
||||
return text;
|
||||
} // getSelectedText
|
||||
|
||||
function preserveNewLines( html ) {
|
||||
do {
|
||||
var newline_flag = ChiliBook.unique();
|
||||
}
|
||||
while( html.indexOf( newline_flag ) > -1 );
|
||||
var text = '';
|
||||
if (/<br/i.test(html) || /<li/i.test(html)) {
|
||||
if (/<br/i.test(html)) {
|
||||
html = html.replace( /\<br[^>]*?\>/ig, newline_flag );
|
||||
}
|
||||
else if (/<li/i.test(html)) {
|
||||
html = html.replace( /<ol[^>]*?>|<\/ol>|<li[^>]*?>/ig, '' ).replace( /<\/li>/ig, newline_flag );
|
||||
}
|
||||
var el = $( '<pre>' ).appendTo( 'body' ).hide()[0];
|
||||
el.innerHTML = html;
|
||||
text = $( el ).text().replace( new RegExp( newline_flag, "g" ), '\r\n' );
|
||||
$( el ).remove();
|
||||
}
|
||||
return text;
|
||||
} // preserveNewLines
|
||||
|
||||
function addLineNumbers( el ) {
|
||||
|
||||
function makeListItem1( not_last_line, not_last, last, open ) {
|
||||
var close = open ? '</span>' : '';
|
||||
var aux = '';
|
||||
if( not_last_line ) {
|
||||
aux = '<li>' + open + not_last + close + '</li>';
|
||||
}
|
||||
else if( last ) {
|
||||
aux = '<li>' + open + last + close + '</li>';
|
||||
}
|
||||
return aux;
|
||||
} // makeListItem1
|
||||
|
||||
function makeListItem2( not_last_line, not_last, last, prev_li ) {
|
||||
var aux = '';
|
||||
if( prev_li ) {
|
||||
aux = prev_li;
|
||||
}
|
||||
else {
|
||||
aux = makeListItem1( not_last_line, not_last, last, '' )
|
||||
}
|
||||
return aux;
|
||||
} // makeListItem2
|
||||
|
||||
var html = $( el ).html();
|
||||
var br = /<br>/.test(html) ? '<br>' : '<BR>';
|
||||
var empty_line = '<li>' + book.replaceSpace + '</li>';
|
||||
var list_items = html
|
||||
//extract newlines at the beginning of a span
|
||||
.replace( /(<span [^>]+>)((?:(?: |\xA0)<br>)+)(.*?)(<\/span>)/ig, '$2$1$3$4' ) // I don't know why <span .*?> does not work here
|
||||
//transform newlines inside of a span
|
||||
.replace( /(.*?)(<span .*?>)(.*?)(?:<\/span>(?: |\xA0)<br>|<\/span>)/ig, // but here it does
|
||||
function( all, before, open, content ) {
|
||||
if (/<br>/i.test(content)) {
|
||||
var pieces = before.split( br );
|
||||
var lastPiece = pieces.pop();
|
||||
before = pieces.join( br );
|
||||
var aux = (before ? before + br : '') //+ replace1( lastPiece + content, open );
|
||||
+ (lastPiece + content).replace( /((.*?)(?: |\xA0)<br>)|(.*)/ig,
|
||||
function( tmp, not_last_line, not_last, last ) {
|
||||
var aux2 = makeListItem1( not_last_line, not_last, last, open );
|
||||
return aux2;
|
||||
}
|
||||
);
|
||||
return aux;
|
||||
}
|
||||
else {
|
||||
return all;
|
||||
}
|
||||
}
|
||||
)
|
||||
//transform newlines outside of a span
|
||||
.replace( /(<li>.*?<\/li>)|((.*?)(?: |\xA0)<br>)|(.+)/ig,
|
||||
function( tmp, prev_li, not_last_line, not_last, last ) {
|
||||
var aux2 = makeListItem2( not_last_line, not_last, last, prev_li );
|
||||
return aux2;
|
||||
}
|
||||
)
|
||||
//fix empty lines for Opera
|
||||
.replace( /<li><\/li>/ig, empty_line )
|
||||
;
|
||||
|
||||
el.innerHTML = '<ol>' + list_items + '</ol>';
|
||||
} // addLineNumbers
|
||||
|
||||
function revealChars( tmp ) {
|
||||
return $
|
||||
.map( tmp.split(''),
|
||||
function(n, i) {
|
||||
return ' ' + n + ' ' + n.charCodeAt( 0 ) + ' ';
|
||||
} )
|
||||
.join(' ');
|
||||
} // revealChars
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// the coloring starts here
|
||||
this
|
||||
.each( function() {
|
||||
var $this = $( this );
|
||||
$this.trigger( 'chili.before_coloring' );
|
||||
askDish( this );
|
||||
$this.trigger( 'chili.after_coloring' );
|
||||
} );
|
||||
|
||||
return this;
|
||||
//-----------------------------------------------------------------------------
|
||||
};
|
||||
|
||||
|
||||
|
||||
//main
|
||||
$( function() {
|
||||
|
||||
if( ChiliBook.automatic ) {
|
||||
$( ChiliBook.automaticSelector ).chili();
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
} ) ( jQuery );
|
75
js/jquery/chili/js.js
vendored
Executable file
75
js/jquery/chili/js.js
vendored
Executable file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
_name: 'js'
|
||||
, _case: true
|
||||
, _main: {
|
||||
ml_comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: 'color: gray;'
|
||||
}
|
||||
, sl_comment: {
|
||||
_match: /\/\/.*/
|
||||
, _style: 'color: green;'
|
||||
}
|
||||
, string: {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: 'color: teal;'
|
||||
}
|
||||
, num: {
|
||||
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
|
||||
, _style: 'color: red;'
|
||||
}
|
||||
, reg_not: { //this prevents "a / b / c" to be interpreted as a reg_exp
|
||||
_match: /(?:\w+\s*)\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*(?:\s*\w+)/
|
||||
, _replace: function( all ) {
|
||||
return this.x( all, '//num' );
|
||||
}
|
||||
}
|
||||
, reg_exp: {
|
||||
_match: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/
|
||||
, _style: 'color: maroon;'
|
||||
}
|
||||
, brace: {
|
||||
_match: /[\{\}]/
|
||||
, _style: 'color: red; font-weight: bold;'
|
||||
}
|
||||
, statement: {
|
||||
_match: /\b(with|while|var|try|throw|switch|return|if|for|finally|else|do|default|continue|const|catch|case|break)\b/
|
||||
, _style: 'color: navy; font-weight: bold;'
|
||||
}
|
||||
, error: {
|
||||
_match: /\b(URIError|TypeError|SyntaxError|ReferenceError|RangeError|EvalError|Error)\b/
|
||||
, _style: 'color: Coral;'
|
||||
}
|
||||
, object: {
|
||||
_match: /\b(String|RegExp|Object|Number|Math|Function|Date|Boolean|Array)\b/
|
||||
, _style: 'color: DeepPink;'
|
||||
}
|
||||
, property: {
|
||||
_match: /\b(undefined|arguments|NaN|Infinity)\b/
|
||||
, _style: 'color: Purple; font-weight: bold;'
|
||||
}
|
||||
, 'function': {
|
||||
_match: /\b(parseInt|parseFloat|isNaN|isFinite|eval|encodeURIComponent|encodeURI|decodeURIComponent|decodeURI)\b/
|
||||
, _style: 'color: olive;'
|
||||
}
|
||||
, operator: {
|
||||
_match: /\b(void|typeof|this|new|instanceof|in|function|delete)\b/
|
||||
, _style: 'color: RoyalBlue; font-weight: bold;'
|
||||
}
|
||||
, liveconnect: {
|
||||
_match: /\b(sun|netscape|java|Packages|JavaPackage|JavaObject|JavaClass|JavaArray|JSObject|JSException)\b/
|
||||
, _style: 'text-decoration: overline;'
|
||||
}
|
||||
}
|
||||
}
|
142
js/jquery/chili/php-f.js
vendored
Executable file
142
js/jquery/chili/php-f.js
vendored
Executable file
File diff suppressed because one or more lines are too long
138
js/jquery/chili/php.js
vendored
Executable file
138
js/jquery/chili/php.js
vendored
Executable file
@ -0,0 +1,138 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* this recipe uses a little trick for highlighting php code
|
||||
* 1: replace each php snippet with a placeholder
|
||||
* 2: highlight html without php and php snippets apart
|
||||
* 3: replace each placeholder with its highlighted php snippet
|
||||
*
|
||||
* the trick is not perfect only if the html without php is broken
|
||||
* however, in such a case many highlighters get fooled but Chili does not
|
||||
*
|
||||
* ---
|
||||
* this recipe has been adapted for working with Safari
|
||||
* in fact, Safari cannot match more than 101236 characters with a lazy star
|
||||
* --------------------------------------------------------------------------*/
|
||||
{
|
||||
_name: "php"
|
||||
, _case: true
|
||||
, _main: {
|
||||
all: {
|
||||
_match: /[\w\W]*/
|
||||
, _replace: function( all ) {
|
||||
var placeholder = String.fromCharCode(0);
|
||||
var blocks = [];
|
||||
var that = this;
|
||||
var no_php_1 = all.replace( /<\?[^?]*\?+(?:[^>][^?]*\?+)*>/g, function( block ) {
|
||||
blocks.push( that.x( block, '/block/php_1' ) );
|
||||
return placeholder;
|
||||
} );
|
||||
var no_php_2 = no_php_1.replace( /^[^?]*\?+(?:[^>][^?]*\?+)*>|<\?[\w\W]*$/g, function( block ) {
|
||||
blocks.push( that.x( block, '/block/php_2' ) );
|
||||
return placeholder;
|
||||
} );
|
||||
if( blocks.length ) {
|
||||
var html = this.x( no_php_2, 'html' );
|
||||
var count = 0;
|
||||
return html.replace( new RegExp( placeholder, "g" ), function() {
|
||||
return blocks[ count++ ];
|
||||
} );
|
||||
}
|
||||
else {
|
||||
return this.x( all, '/php' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
, block: {
|
||||
php_1: { // --- <? +++ ?> ---
|
||||
_match: /(<\?(?:php\b)?)([^?]*\?+(?:[^>][^?]*\?+)*>)/
|
||||
, _replace: function( all, open, content ) {
|
||||
return "<span class='start'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content.replace( /\?>$/, '' ), '/php' )
|
||||
+ "<span class='end'>" + this.x( '?>' ) + "</span>";
|
||||
}
|
||||
, _style: {
|
||||
start: "color: red; font-weight: bold"
|
||||
, end: "color: red;"
|
||||
}
|
||||
}
|
||||
, php_2: { // +++ ?> --- <? +++
|
||||
_match: /([^?]*\?+(?:[^>][^?]*\?+)*>)|(<\?(?:php\b)?)([\w\W]*)/
|
||||
, _replace: function( all, content, open2, content2 ) {
|
||||
if( open2 ) {
|
||||
return "<span class='start'>" + this.x( open2 ) + "</span>"
|
||||
+ this.x( content2, '/php' );
|
||||
}
|
||||
else {
|
||||
return this.x( content.replace( /\?>$/, '' ), '/php' )
|
||||
+ "<span class='end'>" + this.x( '?>' ) + "</span>";
|
||||
}
|
||||
}
|
||||
, _style: {
|
||||
start: "color: red; font-weight: bold"
|
||||
, end: "color: red;"
|
||||
}
|
||||
}
|
||||
}
|
||||
, php: {
|
||||
mlcom: {
|
||||
_match: /\/\*[^*]*\*+([^\/][^*]*\*+)*\//
|
||||
, _style: "color: gray;"
|
||||
}
|
||||
, com: {
|
||||
_match: /(?:\/\/.*)|(?:[^\\]\#.*)/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
, string1: {
|
||||
_match: /\'[^\'\\]*(?:\\.[^\'\\]*)*\'/
|
||||
, _style: "color: purple;"
|
||||
}
|
||||
, string2: {
|
||||
_match: /\"[^\"\\]*(?:\\.[^\"\\]*)*\"/
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, value: {
|
||||
_match: /\b(?:[Nn][Uu][Ll][Ll]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\b/
|
||||
, _style: "color: gray; font-weight: bold;"
|
||||
}
|
||||
, number: {
|
||||
_match: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, const1: {
|
||||
_match: /\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, const2: {
|
||||
_match: /\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR))\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, global: {
|
||||
_match: /(?:\$GLOBALS|\$_COOKIE|\$_ENV|\$_FILES|\$_GET|\$_POST|\$_REQUEST|\$_SERVER|\$_SESSION|\$php_errormsg)\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, keyword: {
|
||||
_match: /\b(?:__CLASS__|__FILE__|__FUNCTION__|__LINE__|__METHOD__|abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exception|exit|extends|extends|final|for|foreach|function|global|if|implements|include|include_once|interface|isset|list|new|old_function|or|php_user_filter|print|private|protected|public|require|require_once|return|static|switch|this|throw|try|unset|use|var|while|xor)\b/
|
||||
, _style: "color: navy; font-weight: bold;"
|
||||
}
|
||||
, variable: {
|
||||
_match: /\$(\w+)/
|
||||
, _replace: '<span class="keyword">$</span><span class="variable">$1</span>'
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, heredoc: {
|
||||
_match: /(\<\<\<\s*)(\w+)((?:(?!\2).*\n)+)(\2)\b/
|
||||
, _replace: '<span class="keyword">$1</span><span class="string1">$2</span><span class="string2">$3</span><span class="string1">$4</span>'
|
||||
}
|
||||
}
|
||||
}
|
364
js/jquery/chili/recipes.js
vendored
Executable file
364
js/jquery/chili/recipes.js
vendored
Executable file
@ -0,0 +1,364 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
|
||||
Copyright 2008 / Andrea Ercolino
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
ChiliBook.recipeLoading = false;
|
||||
|
||||
|
||||
|
||||
ChiliBook.recipes[ "php.js" ] =
|
||||
/* ----------------------------------------------------------------------------
|
||||
* this recipe uses a little trick for highlighting php code
|
||||
* 1: replace each php snippet with a placeholder
|
||||
* 2: highlight html without php and php snippets apart
|
||||
* 3: replace each placeholder with its highlighted php snippet
|
||||
*
|
||||
* the trick is not perfect only if the html without php is broken
|
||||
* however, in such a case many highlighters get fooled but Chili does not
|
||||
*
|
||||
* ---
|
||||
* this recipe has been adapted for working with Safari
|
||||
* in fact, Safari cannot match more than 101236 characters with a lazy star
|
||||
* --------------------------------------------------------------------------*/
|
||||
{
|
||||
_name: "php"
|
||||
, _case: true
|
||||
, _main: {
|
||||
all: {
|
||||
_match: /[\w\W]*/
|
||||
, _replace: function( all ) {
|
||||
var placeholder = String.fromCharCode(0);
|
||||
var blocks = [];
|
||||
var that = this;
|
||||
var no_php_1 = all.replace( /<\?[^?]*\?+(?:[^>][^?]*\?+)*>/g, function( block ) {
|
||||
blocks.push( that.x( block, '/block/php_1' ) );
|
||||
return placeholder;
|
||||
} );
|
||||
var no_php_2 = no_php_1.replace( /^[^?]*\?+(?:[^>][^?]*\?+)*>|<\?[\w\W]*$/g, function( block ) {
|
||||
blocks.push( that.x( block, '/block/php_2' ) );
|
||||
return placeholder;
|
||||
} );
|
||||
if( blocks.length ) {
|
||||
var html = this.x( no_php_2, 'html' );
|
||||
var count = 0;
|
||||
return html.replace( new RegExp( placeholder, "g" ), function() {
|
||||
return blocks[ count++ ];
|
||||
} );
|
||||
}
|
||||
else {
|
||||
return this.x( all, '/php' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
, block: {
|
||||
php_1: { // --- <? +++ ?> ---
|
||||
_match: /(<\?(?:php\b)?)([^?]*\?+(?:[^>][^?]*\?+)*>)/
|
||||
, _replace: function( all, open, content ) {
|
||||
return "<span class='start'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content.replace( /\?>$/, '' ), '/php' )
|
||||
+ "<span class='end'>" + this.x( '?>' ) + "</span>";
|
||||
}
|
||||
, _style: {
|
||||
start: "color: red; font-weight: bold"
|
||||
, end: "color: red;"
|
||||
}
|
||||
}
|
||||
, php_2: { // +++ ?> --- <? +++
|
||||
_match: /([^?]*\?+(?:[^>][^?]*\?+)*>)|(<\?(?:php\b)?)([\w\W]*)/
|
||||
, _replace: function( all, content, open2, content2 ) {
|
||||
if( open2 ) {
|
||||
return "<span class='start'>" + this.x( open2 ) + "</span>"
|
||||
+ this.x( content2, '/php' );
|
||||
}
|
||||
else {
|
||||
return this.x( content.replace( /\?>$/, '' ), '/php' )
|
||||
+ "<span class='end'>" + this.x( '?>' ) + "</span>";
|
||||
}
|
||||
}
|
||||
, _style: {
|
||||
start: "color: red; font-weight: bold"
|
||||
, end: "color: red;"
|
||||
}
|
||||
}
|
||||
}
|
||||
, php: {
|
||||
mlcom: {
|
||||
_match: /\/\*[^*]*\*+([^\/][^*]*\*+)*\//
|
||||
, _style: "color: gray;"
|
||||
}
|
||||
, com: {
|
||||
_match: /(?:\/\/.*)|(?:[^\\]\#.*)/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
, string1: {
|
||||
_match: /\'[^\'\\]*(?:\\.[^\'\\]*)*\'/
|
||||
, _style: "color: purple;"
|
||||
}
|
||||
, string2: {
|
||||
_match: /\"[^\"\\]*(?:\\.[^\"\\]*)*\"/
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, value: {
|
||||
_match: /\b(?:[Nn][Uu][Ll][Ll]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\b/
|
||||
, _style: "color: gray;"
|
||||
}
|
||||
, number: {
|
||||
_match: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, const1: {
|
||||
_match: /\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, const2: {
|
||||
_match: /\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR))\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, global: {
|
||||
_match: /(?:\$GLOBALS|\$_COOKIE|\$_ENV|\$_FILES|\$_GET|\$_POST|\$_REQUEST|\$_SERVER|\$_SESSION|\$php_errormsg)\b/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, keyword: {
|
||||
_match: /\b(?:__CLASS__|__FILE__|__FUNCTION__|__LINE__|__METHOD__|abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exception|exit|extends|extends|final|for|foreach|function|global|if|implements|include|include_once|interface|isset|list|new|old_function|or|php_user_filter|print|private|protected|public|require|require_once|return|static|switch|this|throw|try|unset|use|var|while|xor)\b/
|
||||
, _style: "color: navy;"
|
||||
}
|
||||
, variable: {
|
||||
_match: /\$(\w+)/
|
||||
, _replace: '<span class="keyword">$</span><span class="variable">$1</span>'
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, heredoc: {
|
||||
_match: /(\<\<\<\s*)(\w+)((?:(?!\2).*\n)+)(\2)\b/
|
||||
, _replace: '<span class="keyword">$1</span><span class="string1">$2</span><span class="string2">$3</span><span class="string1">$4</span>'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ChiliBook.recipes[ "html.js" ] =
|
||||
{
|
||||
_name: 'html'
|
||||
, _case: false
|
||||
, _main: {
|
||||
doctype: {
|
||||
_match: /<!DOCTYPE\b[\w\W]*?>/
|
||||
, _style: "color: #CC6600;"
|
||||
}
|
||||
, ie_style: {
|
||||
_match: /(<!--\[[^\]]*\]>)([\w\W]*?)(<!\[[^\]]*\]-->)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return "<span class='ie_style'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content, '//style' )
|
||||
+ "<span class='ie_style'>" + this.x( close ) + "</span>";
|
||||
}
|
||||
, _style: "color: DarkSlateGray;"
|
||||
}
|
||||
, comment: {
|
||||
_match: /<!--[\w\W]*?-->/
|
||||
, _style: "color: #4040c2;"
|
||||
}
|
||||
, script: {
|
||||
_match: /(<script\s+[^>]*>)([\w\W]*?)(<\/script\s*>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return this.x( open, '//tag_start' )
|
||||
+ this.x( content, 'js' )
|
||||
+ this.x( close, '//tag_end' );
|
||||
}
|
||||
}
|
||||
, style: {
|
||||
_match: /(<style\s+[^>]*>)([\w\W]*?)(<\/style\s*>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return this.x( open, '//tag_start' )
|
||||
+ this.x( content, 'css' )
|
||||
+ this.x( close, '//tag_end' );
|
||||
}
|
||||
}
|
||||
// matches a starting tag of an element (with attrs)
|
||||
// like "<div ... >" or "<img ... />"
|
||||
, tag_start: {
|
||||
_match: /(<\w+)((?:[?%]>|[\w\W])*?)(\/>|>)/
|
||||
, _replace: function( all, open, content, close ) {
|
||||
return "<span class='tag_start'>" + this.x( open ) + "</span>"
|
||||
+ this.x( content, '/tag_attrs' )
|
||||
+ "<span class='tag_start'>" + this.x( close ) + "</span>";
|
||||
}
|
||||
, _style: "color: navy;"
|
||||
}
|
||||
// matches an ending tag
|
||||
// like "</div>"
|
||||
, tag_end: {
|
||||
_match: /<\/\w+\s*>|\/>/
|
||||
, _style: "color: navy;"
|
||||
}
|
||||
, entity: {
|
||||
_match: /&\w+?;/
|
||||
, _style: "color: blue;"
|
||||
}
|
||||
}
|
||||
, tag_attrs: {
|
||||
// matches a name/value pair
|
||||
attr: {
|
||||
// before in $1, name in $2, between in $3, value in $4
|
||||
_match: /(\W*?)([\w-]+)(\s*=\s*)((?:\'[^\']*(?:\\.[^\']*)*\')|(?:\"[^\"]*(?:\\.[^\"]*)*\"))/
|
||||
, _replace: "$1<span class='attr_name'>$2</span>$3<span class='attr_value'>$4</span>"
|
||||
, _style: { attr_name: "color: green;", attr_value: "color: maroon;" }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
ChiliBook.recipes[ "js.js" ] =
|
||||
{
|
||||
_name: 'js'
|
||||
, _case: true
|
||||
, _main: {
|
||||
ml_comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: 'color: gray;'
|
||||
}
|
||||
, sl_comment: {
|
||||
_match: /\/\/.*/
|
||||
, _style: 'color: green;'
|
||||
}
|
||||
, string: {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: 'color: teal;'
|
||||
}
|
||||
, num: {
|
||||
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
|
||||
, _style: 'color: red;'
|
||||
}
|
||||
, reg_not: { //this prevents "a / b / c" to be interpreted as a reg_exp
|
||||
_match: /(?:\w+\s*)\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*(?:\s*\w+)/
|
||||
, _replace: function( all ) {
|
||||
return this.x( all, '//num' );
|
||||
}
|
||||
}
|
||||
, reg_exp: {
|
||||
_match: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/
|
||||
, _style: 'color: maroon;'
|
||||
}
|
||||
, brace: {
|
||||
_match: /[\{\}]/
|
||||
, _style: 'color: red;'
|
||||
}
|
||||
, statement: {
|
||||
_match: /\b(with|while|var|try|throw|switch|return|if|for|finally|else|do|default|continue|const|catch|case|break)\b/
|
||||
, _style: 'color: navy;'
|
||||
}
|
||||
, error: {
|
||||
_match: /\b(URIError|TypeError|SyntaxError|ReferenceError|RangeError|EvalError|Error)\b/
|
||||
, _style: 'color: Coral;'
|
||||
}
|
||||
, object: {
|
||||
_match: /\b(String|RegExp|Object|Number|Math|Function|Date|Boolean|Array)\b/
|
||||
, _style: 'color: DeepPink;'
|
||||
}
|
||||
, property: {
|
||||
_match: /\b(undefined|arguments|NaN|Infinity)\b/
|
||||
, _style: 'color: Purple;'
|
||||
}
|
||||
, 'function': {
|
||||
_match: /\b(parseInt|parseFloat|isNaN|isFinite|eval|encodeURIComponent|encodeURI|decodeURIComponent|decodeURI)\b/
|
||||
, _style: 'color: olive;'
|
||||
}
|
||||
, operator: {
|
||||
_match: /\b(void|typeof|this|new|instanceof|in|function|delete)\b/
|
||||
, _style: 'color: RoyalBlue;'
|
||||
}
|
||||
, liveconnect: {
|
||||
_match: /\b(sun|netscape|java|Packages|JavaPackage|JavaObject|JavaClass|JavaArray|JSObject|JSException)\b/
|
||||
, _style: 'text-decoration: overline;'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
ChiliBook.recipes[ "css.js" ] =
|
||||
{
|
||||
_name: 'css'
|
||||
, _case: true
|
||||
, _main: {
|
||||
comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
, _style: "color: olive;"
|
||||
}
|
||||
, directive: {
|
||||
_match: /@\w+/
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, url: {
|
||||
_match: /\b(url\s*\()([^)]+)(\))/
|
||||
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
|
||||
, _style: "color: fuchsia;"
|
||||
}
|
||||
, block: {
|
||||
_match: /\{([\w\W]*?)\}/
|
||||
, _replace: function( all, pairs ) {
|
||||
return '{' + this.x( pairs, '/definition' ) + '}';
|
||||
}
|
||||
}
|
||||
, 'class': {
|
||||
_match: /\.\w+/
|
||||
, _style: "color: #CC0066;"
|
||||
}
|
||||
, id: {
|
||||
_match: /#\w+/
|
||||
, _style: "color: IndianRed;"
|
||||
}
|
||||
, pseudo: {
|
||||
_match: /:\w+/
|
||||
, _style: "color: #CC9900;"
|
||||
}
|
||||
, element: {
|
||||
_match: /\w+/
|
||||
, _style: "color: Purple;"
|
||||
}
|
||||
}
|
||||
, definition: {
|
||||
comment: {
|
||||
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
|
||||
}
|
||||
, property: {
|
||||
_match: /\b(?:zoom|z-index|writing-mode|word-wrap|word-spacing|word-break|width|widows|white-space|volume|voice-family|visibility|vertical-align|unicode-bidi|top|text-underline-position|text-transform|text-shadow|text-overflow|text-kashida-space|text-justify|text-indent|text-decoration|text-autospace|text-align-last|text-align|table-layout|stress|speech-rate|speak-punctuation|speak-numeral|speak-header|speak|size|scrollbar-track-color|scrollbar-shadow-color|scrollbar-highlight-color|scrollbar-face-color|scrollbar-dark-shadow-color|scrollbar-base-color|scrollbar-arrow-color|scrollbar-3d-light-color|ruby-position|ruby-overhang|ruby-align|right|richness|quotes|position|play-during|pitch-range|pitch|pause-before|pause-after|pause|page-break-inside|page-break-before|page-break-after|page|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-Y|overflow-X|overflow|outline-width|outline-style|outline-color|outline|orphans|min-width|min-height|max-width|max-height|marks|marker-offset|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|line-break|letter-spacing|left|layout-grid-type|layout-grid-mode|layout-grid-line|layout-grid-char-spacing|layout-grid-char|layout-grid|layout-flow|layer-background-image|layer-background-color|include-source|ime-mode|height|font-weight|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-family|font|float|filter|empty-cells|elevation|display|direction|cursor|cue-before|cue-after|cue|counter-reset|counter-increment|content|color|clip|clear|caption-side|bottom|border-width|border-top-width|border-top-style|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-left-width|border-left-style|border-left-color|border-left|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-color|border-bottom|border|behavior|background-repeat|background-position-y|background-position-x|background-position|background-image|background-color|background-attachment|background|azimuth|accelerator)\s*:/
|
||||
, _style: "color: #330066;"
|
||||
}
|
||||
, special: {
|
||||
_match: /\b(?:-use-link-source|-set-link-source|-replace|-moz-user-select|-moz-user-modify|-moz-user-input|-moz-user-focus|-moz-outline-width|-moz-outline-style|-moz-outline-color|-moz-outline|-moz-opacity|-moz-border-top-colors|-moz-border-right-colors|-moz-border-radius-topright|-moz-border-radius-topleft|-moz-border-radius-bottomright|-moz-border-radius-bottomleft|-moz-border-radius|-moz-border-left-colors|-moz-border-bottom-colors|-moz-binding)\s*:/
|
||||
, _style: "color: #330066; text-decoration: underline;"
|
||||
}
|
||||
, url: {
|
||||
_match: /\b(url\s*\()([^)]+)(\))/
|
||||
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
|
||||
}
|
||||
, value: {
|
||||
_match: /\b(?:xx-small|xx-large|x-soft|x-small|x-slow|x-low|x-loud|x-large|x-high|x-fast|wider|wait|w-resize|visible|url|uppercase|upper-roman|upper-latin|upper-alpha|underline|ultra-expanded|ultra-condensed|tv|tty|transparent|top|thin|thick|text-top|text-bottom|table-row-group|table-row|table-header-group|table-footer-group|table-column-group|table-column|table-cell|table-caption|sw-resize|super|sub|status-bar|static|square|spell-out|speech|solid|soft|smaller|small-caption|small-caps|small|slower|slow|silent|show|separate|semi-expanded|semi-condensed|se-resize|scroll|screen|s-resize|run-in|rtl|rightwards|right-side|right|ridge|rgb|repeat-y|repeat-x|repeat|relative|projection|print|pre|portrait|pointer|overline|outside|outset|open-quote|once|oblique|nw-resize|nowrap|normal|none|no-repeat|no-open-quote|no-close-quote|ne-resize|narrower|n-resize|move|mix|middle|message-box|medium|marker|ltr|lowercase|lower-roman|lower-latin|lower-greek|lower-alpha|lower|low|loud|local|list-item|line-through|lighter|level|leftwards|left-side|left|larger|large|landscape|justify|italic|invert|inside|inset|inline-table|inline|icon|higher|high|hide|hidden|help|hebrew|handheld|groove|format|fixed|faster|fast|far-right|far-left|fantasy|extra-expanded|extra-condensed|expanded|embossed|embed|e-resize|double|dotted|disc|digits|default|decimal-leading-zero|decimal|dashed|cursive|crosshair|cross|crop|counters|counter|continuous|condensed|compact|collapse|code|close-quote|circle|center-right|center-left|center|caption|capitalize|braille|bottom|both|bolder|bold|block|blink|bidi-override|below|behind|baseline|avoid|auto|aural|attr|armenian|always|all|absolute|above)\b/
|
||||
, _style: "color: #3366FF;"
|
||||
}
|
||||
, string: {
|
||||
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
|
||||
, _style: "color: teal;"
|
||||
}
|
||||
, number: {
|
||||
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/
|
||||
, _style: "color: red;"
|
||||
}
|
||||
, color : {
|
||||
_match: /(?:\#[a-fA-F0-9]{3,6})|\b(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua|YellowGreen|Yellow|WhiteSmoke|White|Wheat|Violet|Turquoise|Tomato|Thistle|Teal|Tan|SteelBlue|SpringGreen|Snow|SlateGrey|SlateGray|SlateBlue|SkyBlue|Silver|Sienna|SeaShell|SeaGreen|SandyBrown|Salmon|SaddleBrown|RoyalBlue|RosyBrown|Red|Purple|PowderBlue|Plum|Pink|Peru|PeachPuff|PapayaWhip|PaleVioletRed|PaleTurquoise|PaleGreen|PaleGoldenRod|Orchid|OrangeRed|Orange|OliveDrab|Olive|OldLace|Navy|NavajoWhite|Moccasin|MistyRose|MintCream|MidnightBlue|MediumVioletRed|MediumTurquoise|MediumSpringGreen|MediumSlateBlue|MediumSeaGreen|MediumPurple|MediumOrchid|MediumBlue|MediumAquaMarine|Maroon|Magenta|Linen|LimeGreen|Lime|LightYellow|LightSteelBlue|LightSlateGrey|LightSlateGray|LightSkyBlue|LightSeaGreen|LightSalmon|LightPink|LightGrey|LightGreen|LightGray|LightGoldenRodYellow|LightCyan|LightCoral|LightBlue|LemonChiffon|LawnGreen|LavenderBlush|Lavender|Khaki|Ivory|Indigo|IndianRed|HotPink|HoneyDew|Grey|GreenYellow|Green|Gray|GoldenRod|Gold|GhostWhite|Gainsboro|Fuchsia|ForestGreen|FloralWhite|FireBrick|DodgerBlue|DimGrey|DimGray|DeepSkyBlue|DeepPink|Darkorange|DarkViolet|DarkTurquoise|DarkSlateGrey|DarkSlateGray|DarkSlateBlue|DarkSeaGreen|DarkSalmon|DarkRed|DarkOrchid|DarkOliveGreen|DarkMagenta|DarkKhaki|DarkGrey|DarkGreen|DarkGray|DarkGoldenRod|DarkCyan|DarkBlue|Cyan|Crimson|Cornsilk|CornflowerBlue|Coral|Chocolate|Chartreuse|CadetBlue|BurlyWood|Brown|BlueViolet|Blue|BlanchedAlmond|Black|Bisque|Beige|Azure|Aquamarine|Aqua|AntiqueWhite|AliceBlue)\b/
|
||||
, _style: "color: green;"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
104
js/jquery/jquery.tipsy.js
Normal file
104
js/jquery/jquery.tipsy.js
Normal file
@ -0,0 +1,104 @@
|
||||
(function($) {
|
||||
$.fn.tipsy = function(options) {
|
||||
|
||||
options = $.extend({}, $.fn.tipsy.defaults, options);
|
||||
|
||||
return this.each(function() {
|
||||
|
||||
var opts = $.fn.tipsy.elementOptions(this, options);
|
||||
|
||||
$(this).hover(function() {
|
||||
|
||||
$.data(this, 'cancel.tipsy', true);
|
||||
|
||||
var tip = $.data(this, 'active.tipsy');
|
||||
if (!tip) {
|
||||
tip = $('<div class="tipsy"><div class="tipsy-inner"/></div>');
|
||||
tip.css({position: 'absolute', zIndex: 100000});
|
||||
$.data(this, 'active.tipsy', tip);
|
||||
}
|
||||
|
||||
if ($(this).attr('title') || typeof($(this).attr('original-title')) != 'string') {
|
||||
$(this).attr('original-title', $(this).attr('title') || '').removeAttr('title');
|
||||
}
|
||||
|
||||
var title;
|
||||
if (typeof opts.title == 'string') {
|
||||
title = $(this).attr(opts.title == 'title' ? 'original-title' : opts.title);
|
||||
} else if (typeof opts.title == 'function') {
|
||||
title = opts.title.call(this);
|
||||
}
|
||||
|
||||
tip.find('.tipsy-inner')[opts.html ? 'html' : 'text'](title || opts.fallback);
|
||||
|
||||
var pos = $.extend({}, $(this).offset(), {width: this.offsetWidth, height: this.offsetHeight});
|
||||
tip.get(0).className = 'tipsy'; // reset classname in case of dynamic gravity
|
||||
tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
|
||||
var actualWidth = tip[0].offsetWidth, actualHeight = tip[0].offsetHeight;
|
||||
var gravity = (typeof opts.gravity == 'function') ? opts.gravity.call(this) : opts.gravity;
|
||||
|
||||
switch (gravity.charAt(0)) {
|
||||
case 'n':
|
||||
tip.css({top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-north');
|
||||
break;
|
||||
case 's':
|
||||
tip.css({top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-south');
|
||||
break;
|
||||
case 'e':
|
||||
tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}).addClass('tipsy-east');
|
||||
break;
|
||||
case 'w':
|
||||
tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}).addClass('tipsy-west');
|
||||
break;
|
||||
}
|
||||
|
||||
if (opts.fade) {
|
||||
tip.css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: 0.8});
|
||||
} else {
|
||||
tip.css({visibility: 'visible'});
|
||||
}
|
||||
|
||||
}, function() {
|
||||
$.data(this, 'cancel.tipsy', false);
|
||||
var self = this;
|
||||
setTimeout(function() {
|
||||
if ($.data(this, 'cancel.tipsy')) return;
|
||||
var tip = $.data(self, 'active.tipsy');
|
||||
if (opts.fade) {
|
||||
tip.stop().fadeOut(function() { $(this).remove(); });
|
||||
} else {
|
||||
tip.remove();
|
||||
}
|
||||
}, 100);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Overwrite this method to provide options on a per-element basis.
|
||||
// For example, you could store the gravity in a 'tipsy-gravity' attribute:
|
||||
// return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
|
||||
// (remember - do not modify 'options' in place!)
|
||||
$.fn.tipsy.elementOptions = function(ele, options) {
|
||||
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
|
||||
};
|
||||
|
||||
$.fn.tipsy.defaults = {
|
||||
fade: false,
|
||||
fallback: '',
|
||||
gravity: 'n',
|
||||
html: false,
|
||||
title: 'title'
|
||||
};
|
||||
|
||||
$.fn.tipsy.autoNS = function() {
|
||||
return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
|
||||
};
|
||||
|
||||
$.fn.tipsy.autoWE = function() {
|
||||
return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
|
||||
};
|
||||
|
||||
})(jQuery);
|
69
js/less-1.0.41.min.js
vendored
Normal file
69
js/less-1.0.41.min.js
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
//
|
||||
// LESS - Leaner CSS v1.0.41
|
||||
// http://lesscss.org
|
||||
//
|
||||
// Copyright (c) 2010, Alexis Sellier
|
||||
// Licensed under the Apache 2.0 License.
|
||||
//
|
||||
(function(z){function s(d){return z.less[d.split("/")[1]]}function U(){for(var d=document.getElementsByTagName("style"),b=0;b<d.length;b++)if(d[b].type.match(V))(new o.Parser).parse(d[b].innerHTML||"",function(a,g){d[b].type="text/css";d[b].innerHTML=g.toCSS()})}function W(d,b){for(var a=0;a<o.sheets.length;a++)X(o.sheets[a],d,b,o.sheets.length-(a+1))}function X(d,b,a,g){var e=z.location.href.replace(/[#?].*$/,""),h=d.href.replace(/\?.*$/,""),i=B&&B.getItem(h),k=B&&B.getItem(h+":timestamp"),n={css:i,
|
||||
timestamp:k};/^(https?|file):/.test(h)||(h=e.slice(0,e.lastIndexOf("/")+1)+h);Z(d.href,d.type,function(r,p){if(!a&&n&&p&&(new Date(p)).valueOf()===(new Date(n.timestamp)).valueOf()){N(n.css,d);b(null,d,{local:true,remaining:g})}else try{(new o.Parser({optimization:o.optimization,paths:[h.replace(/[\w\.-]+$/,"")],mime:d.type})).parse(r,function(K,O){if(K)return Q(K,h);try{b(O,d,{local:false,lastModified:p,remaining:g});var F=document.getElementById("less-error-message:"+R(h));F&&F.parentNode.removeChild(F)}catch(f){Q(f,
|
||||
h)}})}catch(t){Q(t,h)}},function(r,p){throw Error("Couldn't load "+p+" ("+r+")");})}function R(d){return d.replace(/^[a-z]+:\/\/?[^\/]+/,"").replace(/^\//,"").replace(/\?.*$/,"").replace(/\.[^\.\/]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function N(d,b,a){var g,e=b.href?b.href.replace(/\?.*$/,""):"",h="less:"+(b.title||R(e));if((g=document.getElementById(h))===null){g=document.createElement("style");g.type="text/css";g.media=b.media||"screen";g.id=h;document.getElementsByTagName("head")[0].appendChild(g)}if(g.styleSheet)try{g.styleSheet.cssText=
|
||||
d}catch(i){throw Error("Couldn't reassign styleSheet.cssText.");}else(function(k){if(g.childNodes.length>0)g.firstChild.nodeValue!==k.nodeValue&&g.replaceChild(k,g.firstChild);else g.appendChild(k)})(document.createTextNode(d));if(a&&B){H("saving "+e+" to cache.");B.setItem(e,d);B.setItem(e+":timestamp",a)}}function Z(d,b,a,g){function e(k,n,r){if(k.status>=200&&k.status<300)n(k.responseText,k.getResponseHeader("Last-Modified"));else typeof r==="function"&&r(k.status,d)}var h=$(),i=P?false:o.async;
|
||||
typeof h.overrideMimeType==="function"&&h.overrideMimeType("text/css");h.open("GET",d,i);h.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5");h.send(null);if(P)h.status===0?a(h.responseText):g(h.status,d);else if(i)h.onreadystatechange=function(){h.readyState==4&&e(h,a,g)};else e(h,a,g)}function $(){if(z.XMLHttpRequest)return new XMLHttpRequest;else try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(d){H("browser doesn't support AJAX.");return null}}function H(d){o.env==
|
||||
"development"&&typeof console!=="undefined"&&console.log("less: "+d)}function Q(d,b){var a="less-error-message:"+R(b),g=document.createElement("div"),e,h;g.id=a;g.className="less-error-message";h="<h3>"+(d.message||"There is an error in your .less file")+'</h3><p><a href="'+b+'">'+b+"</a> ";if(d.extract)h+="on line "+d.line+", column "+(d.column+1)+":</p>"+'<ul>\n<li><label>[-1]</label><pre class="ctx">{0}</pre></li>\n<li><label>[0]</label><pre>{current}</pre></li>\n<li><label>[1]</label><pre class="ctx">{2}</pre></li>\n</ul>'.replace(/\[(-?\d)\]/g,
|
||||
function(i,k){return parseInt(d.line)+parseInt(k)||""}).replace(/\{(\d)\}/g,function(i,k){return d.extract[parseInt(k)]||""}).replace(/\{current\}/,d.extract[1].slice(0,d.column)+'<span class="error">'+d.extract[1].slice(d.column)+"</span>");g.innerHTML=h;N(".less-error-message ul, .less-error-message li {\nlist-style-type: none;\nmargin-right: 15px;\npadding: 4px 0;\nmargin: 0;\n}\n.less-error-message label {\nfont-size: 12px;\nmargin-right: 15px;\npadding: 4px 0;\ncolor: #cc7777;\n}\n.less-error-message pre {\ncolor: #ee4444;\npadding: 4px 0;\nmargin: 0;\ndisplay: inline-block;\n}\n.less-error-message pre.ctx {\ncolor: #dd4444;\n}\n.less-error-message h3 {\nfont-size: 20px;\nfont-weight: bold;\npadding: 15px 0 5px 0;\nmargin: 0;\n}\n.less-error-message a {\ncolor: #10a\n}\n.less-error-message .error {\ncolor: red;\nfont-weight: bold;\npadding-bottom: 2px;\nborder-bottom: 1px dashed red;\n}",
|
||||
{title:"error-message"});g.style.cssText="font-family: Arial, sans-serif;border: 1px solid #e00;background-color: #eee;border-radius: 5px;-webkit-border-radius: 5px;-moz-border-radius: 5px;color: #e00;padding: 15px;margin-bottom: 15px";if(o.env=="development")e=setInterval(function(){if(document.body){document.getElementById(a)?document.body.replaceChild(g,document.getElementById(a)):document.body.insertBefore(g,document.body.firstChild);clearInterval(e)}},10)}if(!Array.isArray)Array.isArray=function(d){return Object.prototype.toString.call(d)===
|
||||
"[object Array]"||d instanceof Array};if(!Array.prototype.forEach)Array.prototype.forEach=function(d,b){for(var a=this.length>>>0,g=0;g<a;g++)g in this&&d.call(b,this[g],g,this)};if(!Array.prototype.map)Array.prototype.map=function(d,b){for(var a=this.length>>>0,g=Array(a),e=0;e<a;e++)if(e in this)g[e]=d.call(b,this[e],e,this);return g};if(!Array.prototype.filter)Array.prototype.filter=function(d,b){for(var a=[],g=0;g<this.length;g++)d.call(b,this[g])&&a.push(this[g]);return a};if(!Array.prototype.reduce)Array.prototype.reduce=
|
||||
function(d){var b=this.length>>>0,a=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var g=arguments[1];else{do{if(a in this){g=this[a++];break}if(++a>=b)throw new TypeError;}while(1)}for(;a<b;a++)if(a in this)g=d.call(null,g,this[a],a,this);return g};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(d,b){var a=this.length,g=b||0;if(!a)return-1;if(g>=a)return-1;if(g<0)g+=a;for(;g<a;g++)if(Object.prototype.hasOwnProperty.call(this,g))if(d===this[g])return g;return-1};
|
||||
if(!Object.keys)Object.keys=function(d){var b=[],a;for(a in d)Object.prototype.hasOwnProperty.call(d,a)&&b.push(a);return b};if(!String.prototype.trim)String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var o,m;if(typeof z==="undefined"){o=exports;m=s("less/tree")}else{if(typeof z.less==="undefined")z.less={};o=z.less;m=z.less.tree={}}o.Parser=function(d){function b(){if(h>t){p[i]=p[i].slice(h-t);t=h}}function a(f){var j,l,q;if(f instanceof Function)return f.call(K.parsers);
|
||||
else if(typeof f==="string"){f=e.charAt(h)===f?f:null;j=1;b()}else{b();if(f=f.exec(p[i]))j=f[0].length;else return null}if(f){mem=h+=j;for(q=h+p[i].length-j;h<q;){l=e.charCodeAt(h);if(!(l===32||l===10||l===9))break;h++}p[i]=p[i].slice(j+(h-mem));t=h;p[i].length===0&&i<p.length-1&&i++;return typeof f==="string"?f:f.length===1?f[0]:f}}function g(f){return typeof f==="string"?e.charAt(h)===f:f.test(p[i])?true:false}var e,h,i,k,n,r,p,t,K,O=function(){},F=this.imports={paths:d&&d.paths||[],queue:[],files:{},
|
||||
mime:d&&d.mime,push:function(f,j){var l=this;this.queue.push(f);o.Parser.importer(f,this.paths,function(q){l.queue.splice(l.queue.indexOf(f),1);l.files[f]=q;j(q);l.queue.length===0&&O()},d)}};this.env=d=d||{};this.optimization="optimization"in this.env?this.env.optimization:1;this.env.filename=this.env.filename||null;return K={imports:F,parse:function(f,j){var l,q,I,S=null;h=i=t=r=0;p=[];e=f.replace(/\r\n/g,"\n");p=function(L){for(var D=0,E=/[^"'`\{\}\/]+/g,G=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
|
||||
A=0,w,x=L[0],y,u=0,v;u<e.length;u++){E.lastIndex=u;if(w=E.exec(e))if(w.index===u){u+=w[0].length;x.push(w[0])}v=e.charAt(u);G.lastIndex=u;if(!y&&v==="/"){w=e.charAt(u+1);if(w==="/"||w==="*")if(w=G.exec(e))if(w.index===u){u+=w[0].length;x.push(w[0]);v=e.charAt(u)}}if(v==="{"&&!y){A++;x.push(v)}else if(v==="}"&&!y){A--;x.push(v);L[++D]=x=[]}else{if(v==='"'||v==="'"||v==="`")y=y?y===v?false:y:v;x.push(v)}}if(A>0)throw{type:"Syntax",message:"Missing closing `}`",filename:d.filename};return L.map(function(C){return C.join("")})}([[]]);
|
||||
l=new m.Ruleset([],a(this.parsers.primary));l.root=true;l.toCSS=function(L){var D,E;return function(G,A){function w(v){return v?(e.slice(0,v).match(/\n/g)||"").length:null}var x=[];G=G||{};if(typeof A==="object"&&!Array.isArray(A)){A=Object.keys(A).map(function(v){var C=A[v];if(!(C instanceof m.Value)){C instanceof m.Expression||(C=new m.Expression([C]));C=new m.Value([C])}return new m.Rule("@"+v,C,false,0)});x=[new m.Ruleset(null,A)]}try{var y=L.call(this,{frames:x}).toCSS([],{compress:G.compress||
|
||||
false})}catch(u){E=e.split("\n");D=w(u.index);x=u.index;for(y=-1;x>=0&&e.charAt(x)!=="\n";x--)y++;throw{type:u.type,message:u.message,filename:d.filename,index:u.index,line:typeof D==="number"?D+1:null,callLine:u.call&&w(u.call)+1,callExtract:E[w(u.call)],stack:u.stack,column:y,extract:[E[D-1],E[D],E[D+1]]};}return G.compress?y.replace(/(\s)+/g,"$1"):y}}(l.eval);if(h<e.length-1){h=r;I=e.split("\n");q=(e.slice(0,h).match(/\n/g)||"").length+1;for(var T=h,Y=-1;T>=0&&e.charAt(T)!=="\n";T--)Y++;S={name:"ParseError",
|
||||
message:"Syntax Error on line "+q,filename:d.filename,line:q,column:Y,extract:[I[q-2],I[q-1],I[q]]}}if(this.imports.queue.length>0)O=function(){j(S,l)};else j(S,l)},parsers:{primary:function(){for(var f,j=[];(f=a(this.mixin.definition)||a(this.rule)||a(this.ruleset)||a(this.mixin.call)||a(this.comment)||a(this.directive))||a(/^[\s\n]+/);)f&&j.push(f);return j},comment:function(){var f;if(e.charAt(h)==="/")if(e.charAt(h+1)==="/")return new m.Comment(a(/^\/\/.*/),true);else if(f=a(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new m.Comment(f)},
|
||||
entities:{quoted:function(){var f;if(!(e.charAt(h)!=='"'&&e.charAt(h)!=="'"))if(f=a(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new m.Quoted(f[0],f[1]||f[2])},keyword:function(){var f;if(f=a(/^[A-Za-z-]+/))return new m.Keyword(f)},call:function(){var f,j;if(f=/^([\w-]+|%)\(/.exec(p[i])){f=f[1].toLowerCase();if(f==="url")return null;else h+=f.length+1;if(f==="alpha")return a(this.alpha);j=a(this.entities.arguments);if(a(")"))if(f)return new m.Call(f,j)}},arguments:function(){for(var f=
|
||||
[],j;j=a(this.expression);){f.push(j);if(!a(","))break}return f},literal:function(){return a(this.entities.dimension)||a(this.entities.color)||a(this.entities.quoted)},url:function(){var f;if(!(e.charAt(h)!=="u"||!a(/^url\(/))){f=a(this.entities.quoted)||a(this.entities.variable)||a(this.entities.dataURI)||a(/^[-\w%@$\/.&=:;#+?]+/)||"";if(!a(")"))throw Error("missing closing ) for url()");return new m.URL(f.value||f.data||f instanceof m.Variable?f:new m.Anonymous(f),F.paths)}},dataURI:function(){var f;
|
||||
if(a(/^data:/)){f={};f.mime=a(/^[^\/]+\/[^,;)]+/)||"";f.charset=a(/^;\s*charset=[^,;)]+/)||"";f.base64=a(/^;\s*base64/)||"";f.data=a(/^,\s*[^)]+/);if(f.data)return f}},variable:function(){var f,j=h;if(e.charAt(h)==="@"&&(f=a(/^@[\w-]+/)))return new m.Variable(f,j)},color:function(){var f;if(e.charAt(h)==="#"&&(f=a(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new m.Color(f[1])},dimension:function(){var f;f=e.charCodeAt(h);if(!(f>57||f<45||f===47))if(f=a(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/))return new m.Dimension(f[1],
|
||||
f[2])},javascript:function(){var f;if(e.charAt(h)==="`")if(f=a(/^`([^`]*)`/))return new m.JavaScript(f[1],h)}},variable:function(){var f;if(e.charAt(h)==="@"&&(f=a(/^(@[\w-]+)\s*:/)))return f[1]},shorthand:function(){var f,j;if(g(/^[@\w.%-]+\/[@\w.-]+/))if((f=a(this.entity))&&a("/")&&(j=a(this.entity)))return new m.Shorthand(f,j)},mixin:{call:function(){var f=[],j,l,q,I=h;j=e.charAt(h);if(!(j!=="."&&j!=="#")){for(;j=a(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/);){f.push(new m.Element(l,
|
||||
j));l=a(">")}a("(")&&(q=a(this.entities.arguments))&&a(")");if(f.length>0&&(a(";")||g("}")))return new m.mixin.Call(f,q,I)}},definition:function(){var f,j=[],l,q;if(!(e.charAt(h)!=="."&&e.charAt(h)!=="#"||g(/^[^{]*(;|})/)))if(f=a(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)){for(f=f[1];l=a(this.entities.variable)||a(this.entities.literal)||a(this.entities.keyword);){if(l instanceof m.Variable)if(a(":"))if(q=a(this.expression))j.push({name:l.name,value:q});else throw Error("Expected value");
|
||||
else j.push({name:l.name});else j.push({value:l});if(!a(","))break}if(!a(")"))throw Error("Expected )");if(l=a(this.block))return new m.mixin.Definition(f,j,l)}}},entity:function(){return a(this.entities.literal)||a(this.entities.variable)||a(this.entities.url)||a(this.entities.call)||a(this.entities.keyword)||a(this.entities.javascript)},end:function(){return a(";")||g("}")},alpha:function(){var f;if(a(/^opacity=/i))if(f=a(/^\d+/)||a(this.entities.variable)){if(!a(")"))throw Error("missing closing ) for alpha()");
|
||||
return new m.Alpha(f)}},element:function(){var f;c=a(this.combinator);if(f=a(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)||a("*")||a(this.attribute)||a(/^\([^)@]+\)/))return new m.Element(c,f)},combinator:function(){var f=e.charAt(h);if(f===">"||f==="&"||f==="+"||f==="~"){for(h++;e.charAt(h)===" ";)h++;return new m.Combinator(f)}else if(f===":"&&e.charAt(h+1)===":"){for(h+=2;e.charAt(h)===" ";)h++;return new m.Combinator("::")}else return e.charAt(h-1)===" "?new m.Combinator(" "):
|
||||
new m.Combinator(null)},selector:function(){for(var f,j=[],l;f=a(this.element);){l=e.charAt(h);j.push(f);if(l==="{"||l==="}"||l===";"||l===",")break}if(j.length>0)return new m.Selector(j)},tag:function(){return a(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||a("*")},attribute:function(){var f="",j,l,q;if(a("[")){if(j=a(/^[a-zA-Z-]+/)||a(this.entities.quoted))f=(q=a(/^[|~*$^]?=/))&&(l=a(this.entities.quoted)||a(/^[\w-]+/))?[j,q,l.toCSS?l.toCSS():l].join(""):j;if(a("]"))if(f)return"["+f+"]"}},block:function(){var f;
|
||||
if(a("{")&&(f=a(this.primary))&&a("}"))return f},ruleset:function(){var f=[],j,l;k=p[i];t=n=h;if(j=/^([.#: \w-]+)[\s\n]*\{/.exec(p[i])){h+=j[0].length-1;f=[new m.Selector([new m.Element(null,j[1])])]}else{for(;j=a(this.selector);){f.push(j);if(!a(","))break}j&&a(this.comment)}if(f.length>0&&(l=a(this.block)))return new m.Ruleset(f,l);else{r=h;p[i]=k;t=h=n}},rule:function(){var f,j;f=e.charAt(h);var l;k=p[i];t=n=h;if(!(f==="."||f==="#"||f==="&"))if(f=a(this.variable)||a(this.property)){if(f.charAt(0)!=
|
||||
"@"&&(match=/^([^@+\/'"*`(;{}-]*);/.exec(p[i]))){h+=match[0].length-1;j=new m.Anonymous(match[1])}else j=f==="font"?a(this.font):a(this.value);l=a(this.important);if(j&&a(this.end))return new m.Rule(f,j,l,n);else{r=h;p[i]=k;t=h=n}}},"import":function(){var f;if(a(/^@import\s+/)&&(f=a(this.entities.quoted)||a(this.entities.url))&&a(";"))return new m.Import(f,F)},directive:function(){var f,j,l;if(e.charAt(h)==="@")if(j=a(this["import"]))return j;else if(f=a(/^@media|@page/)){l=(a(/^[^{]+/)||"").trim();
|
||||
if(j=a(this.block))return new m.Directive(f+" "+l,j)}else if(f=a(/^@[-a-z]+/))if(f==="@font-face"){if(j=a(this.block))return new m.Directive(f,j)}else if((j=a(this.entity))&&a(";"))return new m.Directive(f,j)},font:function(){for(var f=[],j=[],l;l=a(this.shorthand)||a(this.entity);)j.push(l);f.push(new m.Expression(j));if(a(","))for(;l=a(this.expression);){f.push(l);if(!a(","))break}return new m.Value(f)},value:function(){for(var f,j=[];f=a(this.expression);){j.push(f);if(!a(","))break}if(j.length>
|
||||
0)return new m.Value(j)},important:function(){if(e.charAt(h)==="!")return a(/^! *important/)},sub:function(){var f;if(a("(")&&(f=a(this.expression))&&a(")"))return f},multiplication:function(){var f,j,l,q;if(f=a(this.operand)){for(;(l=a("/")||a("*"))&&(j=a(this.operand));)q=new m.Operation(l,[q||f,j]);return q||f}},addition:function(){var f,j,l,q;if(f=a(this.multiplication)){for(;(l=a(/^[-+]\s+/)||e.charAt(h-1)!=" "&&(a("+")||a("-")))&&(j=a(this.multiplication));)q=new m.Operation(l,[q||f,j]);return q||
|
||||
f}},operand:function(){return a(this.sub)||a(this.entities.dimension)||a(this.entities.color)||a(this.entities.variable)||a(this.entities.call)},expression:function(){for(var f,j=[];f=a(this.addition)||a(this.entity);)j.push(f);if(j.length>0)return new m.Expression(j)},property:function(){var f;if(f=a(/^(\*?-?[-a-z_0-9]+)\s*:/))return f[1]}}}};if(typeof z!=="undefined")o.Parser.importer=function(d,b,a,g){if(d.charAt(0)!=="/"&&b.length>0)d=b[0]+d;X({href:d,title:d,type:g.mime},a,true)};(function(d){function b(e){return d.functions.hsla(e.h,
|
||||
e.s,e.l,e.a)}function a(e){if(e instanceof d.Dimension)return parseFloat(e.unit=="%"?e.value/100:e.value);else if(typeof e==="number")return e;else throw{error:"RuntimeError",message:"color functions take numbers as parameters"};}function g(e){return Math.min(1,Math.max(0,e))}d.functions={rgb:function(e,h,i){return this.rgba(e,h,i,1)},rgba:function(e,h,i,k){e=[e,h,i].map(function(n){return a(n)});k=a(k);return new d.Color(e,k)},hsl:function(e,h,i){return this.hsla(e,h,i,1)},hsla:function(e,h,i,k){function n(t){t=
|
||||
t<0?t+1:t>1?t-1:t;return t*6<1?p+(r-p)*t*6:t*2<1?r:t*3<2?p+(r-p)*(2/3-t)*6:p}e=a(e)%360/360;h=a(h);i=a(i);k=a(k);var r=i<=0.5?i*(h+1):i+h-i*h,p=i*2-r;return this.rgba(n(e+1/3)*255,n(e)*255,n(e-1/3)*255,k)},hue:function(e){return new d.Dimension(Math.round(e.toHSL().h))},saturation:function(e){return new d.Dimension(Math.round(e.toHSL().s*100),"%")},lightness:function(e){return new d.Dimension(Math.round(e.toHSL().l*100),"%")},alpha:function(e){return new d.Dimension(e.toHSL().a)},saturate:function(e,
|
||||
h){var i=e.toHSL();i.s+=h.value/100;i.s=g(i.s);return b(i)},desaturate:function(e,h){var i=e.toHSL();i.s-=h.value/100;i.s=g(i.s);return b(i)},lighten:function(e,h){var i=e.toHSL();i.l+=h.value/100;i.l=g(i.l);return b(i)},darken:function(e,h){var i=e.toHSL();i.l-=h.value/100;i.l=g(i.l);return b(i)},fadein:function(e,h){var i=e.toHSL();i.a+=h.value/100;i.a=g(i.a);return b(i)},fadeout:function(e,h){var i=e.toHSL();i.a-=h.value/100;i.a=g(i.a);return b(i)},spin:function(e,h){var i=e.toHSL(),k=(i.h+h.value)%
|
||||
360;i.h=k<0?360+k:k;return b(i)},mix:function(e,h,i){i=i.value/100;var k=i*2-1,n=e.toHSL().a-h.toHSL().a;k=((k*n==-1?k:(k+n)/(1+k*n))+1)/2;n=1-k;return new d.Color([e.rgb[0]*k+h.rgb[0]*n,e.rgb[1]*k+h.rgb[1]*n,e.rgb[2]*k+h.rgb[2]*n],e.alpha*i+h.alpha*(1-i))},greyscale:function(e){return this.desaturate(e,new d.Dimension(100))},e:function(e){return new d.Anonymous(e instanceof d.JavaScript?e.evaluated:e)},"%":function(e){for(var h=Array.prototype.slice.call(arguments,1),i=e.value,k=0;k<h.length;k++)i=
|
||||
i.replace(/%s/,h[k].value).replace(/%[da]/,h[k].toCSS());i=i.replace(/%%/g,"%");return new d.Quoted('"'+i+'"',i)}}})(s("less/tree"));(function(d){d.Alpha=function(b){this.value=b};d.Alpha.prototype={toCSS:function(){return"alpha(opacity="+(this.value.toCSS?this.value.toCSS():this.value)+")"},eval:function(){return this}}})(s("less/tree"));(function(d){d.Anonymous=function(b){this.value=b.value||b};d.Anonymous.prototype={toCSS:function(){return this.value},eval:function(){return this}}})(s("less/tree"));
|
||||
(function(d){d.Call=function(b,a){this.name=b;this.args=a};d.Call.prototype={eval:function(b){var a=this.args.map(function(g){return g.eval(b)});return this.name in d.functions?d.functions[this.name].apply(d.functions,a):new d.Anonymous(this.name+"("+a.map(function(g){return g.toCSS()}).join(", ")+")")},toCSS:function(b){return this.eval(b).toCSS()}}})(s("less/tree"));(function(d){d.Color=function(b,a){this.rgb=Array.isArray(b)?b:b.length==6?b.match(/.{2}/g).map(function(g){return parseInt(g,16)}):
|
||||
b.split("").map(function(g){return parseInt(g+g,16)});this.alpha=typeof a==="number"?a:1};d.Color.prototype={eval:function(){return this},toCSS:function(){return this.alpha<1?"rgba("+this.rgb.map(function(b){return Math.round(b)}).concat(this.alpha).join(", ")+")":"#"+this.rgb.map(function(b){b=Math.round(b);b=(b>255?255:b<0?0:b).toString(16);return b.length===1?"0"+b:b}).join("")},operate:function(b,a){var g=[];a instanceof d.Color||(a=a.toColor());for(var e=0;e<3;e++)g[e]=d.operate(b,this.rgb[e],
|
||||
a.rgb[e]);return new d.Color(g)},toHSL:function(){var b=this.rgb[0]/255,a=this.rgb[1]/255,g=this.rgb[2]/255,e=this.alpha,h=Math.max(b,a,g),i=Math.min(b,a,g),k,n=(h+i)/2,r=h-i;if(h===i)k=i=0;else{i=n>0.5?r/(2-h-i):r/(h+i);switch(h){case b:k=(a-g)/r+(a<g?6:0);break;case a:k=(g-b)/r+2;break;case g:k=(b-a)/r+4}k/=6}return{h:k*360,s:i,l:n,a:e}}}})(s("less/tree"));(function(d){d.Comment=function(b,a){this.value=b;this.silent=!!a};d.Comment.prototype={toCSS:function(b){return b.compress?"":this.value},eval:function(){return this}}})(s("less/tree"));
|
||||
(function(d){d.Dimension=function(b,a){this.value=parseFloat(b);this.unit=a||null};d.Dimension.prototype={eval:function(){return this},toColor:function(){return new d.Color([this.value,this.value,this.value])},toCSS:function(){return this.value+this.unit},operate:function(b,a){return new d.Dimension(d.operate(b,this.value,a.value),this.unit||a.unit)}}})(s("less/tree"));(function(d){d.Directive=function(b,a){this.name=b;if(Array.isArray(a))this.ruleset=new d.Ruleset([],a);else this.value=a};d.Directive.prototype=
|
||||
{toCSS:function(b,a){if(this.ruleset){this.ruleset.root=true;return this.name+(a.compress?"{":" {\n ")+this.ruleset.toCSS(b,a).trim().replace(/\n/g,"\n ")+(a.compress?"}":"\n}\n")}else return this.name+" "+this.value.toCSS()+";\n"},eval:function(b){b.frames.unshift(this);this.ruleset=this.ruleset&&this.ruleset.eval(b);b.frames.shift();return this},variable:function(b){return d.Ruleset.prototype.variable.call(this.ruleset,b)},find:function(){return d.Ruleset.prototype.find.apply(this.ruleset,arguments)},
|
||||
rulesets:function(){return d.Ruleset.prototype.rulesets.apply(this.ruleset)}}})(s("less/tree"));(function(d){d.Element=function(b,a){this.combinator=b instanceof d.Combinator?b:new d.Combinator(b);this.value=a.trim()};d.Element.prototype.toCSS=function(b){return this.combinator.toCSS(b||{})+this.value};d.Combinator=function(b){this.value=b===" "?" ":b?b.trim():""};d.Combinator.prototype.toCSS=function(b){return{"":""," ":" ","&":"",":":" :","::":"::","+":b.compress?"+":" + ","~":b.compress?"~":" ~ ",
|
||||
">":b.compress?">":" > "}[this.value]}})(s("less/tree"));(function(d){d.Expression=function(b){this.value=b};d.Expression.prototype={eval:function(b){return this.value.length>1?new d.Expression(this.value.map(function(a){return a.eval(b)})):this.value[0].eval(b)},toCSS:function(b){return this.value.map(function(a){return a.toCSS(b)}).join(" ")}}})(s("less/tree"));(function(d){d.Import=function(b,a){var g=this;this._path=b;this.path=b instanceof d.Quoted?/\.(le?|c)ss$/.test(b.value)?b.value:b.value+
|
||||
".less":b.value.value||b.value;(this.css=/css$/.test(this.path))||a.push(this.path,function(e){if(!e)throw Error("Error parsing "+g.path);g.root=e})};d.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(b){var a;if(this.css)return this;else{a=new d.Ruleset(null,this.root.rules.slice(0));for(var g=0;g<a.rules.length;g++)a.rules[g]instanceof d.Import&&Array.prototype.splice.apply(a.rules,[g,1].concat(a.rules[g].eval(b)));return a.rules}}}})(s("less/tree"));
|
||||
(function(d){d.JavaScript=function(b,a){this.expression=b;this.index=a};d.JavaScript.prototype={toCSS:function(){return JSON.stringify(this.evaluated)},eval:function(b){var a=new Function("return ("+this.expression+")"),g={},e;for(e in b.frames[0].variables())g[e.slice(1)]={value:b.frames[0].variables()[e].value,toJS:function(){return this.value.eval(b).toCSS()}};try{this.evaluated=a.call(g)}catch(h){throw{message:"JavaScript evaluation error: '"+h.name+": "+h.message+"'",index:this.index};}return this}}})(s("less/tree"));
|
||||
(function(d){d.Keyword=function(b){this.value=b};d.Keyword.prototype={eval:function(){return this},toCSS:function(){return this.value}}})(s("less/tree"));(function(d){d.mixin={};d.mixin.Call=function(b,a,g){this.selector=new d.Selector(b);this.arguments=a;this.index=g};d.mixin.Call.prototype={eval:function(b){for(var a,g=[],e=false,h=0;h<b.frames.length;h++)if((a=b.frames[h].find(this.selector)).length>0){for(h=0;h<a.length;h++)if(a[h].match(this.arguments,b))try{Array.prototype.push.apply(g,a[h].eval(b,
|
||||
this.arguments).rules);e=true}catch(i){throw{message:i.message,index:i.index,stack:i.stack,call:this.index};}if(e)return g;else throw{message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+this.arguments.map(function(k){return k.toCSS()}).join(", ")+")`",index:this.index};}throw{message:this.selector.toCSS().trim()+" is undefined",index:this.index};}};d.mixin.Definition=function(b,a,g){this.name=b;this.selectors=[new d.Selector([new d.Element(null,b)])];this.params=a;this.arity=
|
||||
a.length;this.rules=g;this._lookups={};this.required=a.reduce(function(e,h){return!h.name||h.name&&!h.value?e+1:e},0);this.parent=d.Ruleset.prototype;this.frames=[]};d.mixin.Definition.prototype={toCSS:function(){return""},variable:function(b){return this.parent.variable.call(this,b)},variables:function(){return this.parent.variables.call(this)},find:function(){return this.parent.find.apply(this,arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},eval:function(b,a){for(var g=
|
||||
new d.Ruleset(null,[]),e=0,h;e<this.params.length;e++)if(this.params[e].name)if(h=a&&a[e]||this.params[e].value)g.rules.unshift(new d.Rule(this.params[e].name,h.eval(b)));else throw{message:"wrong number of arguments for "+this.name+" ("+a.length+" for "+this.arity+")"};return(new d.Ruleset(null,this.rules.slice(0))).eval({frames:[this,g].concat(this.frames,b.frames)})},match:function(b,a){var g=b&&b.length||0;if(g<this.required)return false;if(this.required>0&&g>this.params.length)return false;g=
|
||||
Math.min(g,this.arity);for(var e=0;e<g;e++)if(!this.params[e].name)if(b[e].eval(a).toCSS()!=this.params[e].value.eval(a).toCSS())return false;return true}}})(s("less/tree"));(function(d){d.Operation=function(b,a){this.op=b.trim();this.operands=a};d.Operation.prototype.eval=function(b){var a=this.operands[0].eval(b);b=this.operands[1].eval(b);var g;if(a instanceof d.Dimension&&b instanceof d.Color)if(this.op==="*"||this.op==="+"){g=b;b=a;a=g}else throw{name:"OperationError",message:"Can't substract or divide a color from a number"};
|
||||
return a.operate(this.op,b)};d.operate=function(b,a,g){switch(b){case "+":return a+g;case "-":return a-g;case "*":return a*g;case "/":return a/g}}})(s("less/tree"));(function(d){d.Quoted=function(b,a){this.value=a||"";this.quote=b.charAt(0)};d.Quoted.prototype={toCSS:function(){return this.quote+this.value+this.quote},eval:function(){return this}}})(s("less/tree"));(function(d){d.Rule=function(b,a,g,e){this.name=b;this.value=a instanceof d.Value?a:new d.Value([a]);this.important=g?" "+g.trim():"";
|
||||
this.index=e;this.variable=b.charAt(0)==="@"?true:false};d.Rule.prototype.toCSS=function(b){return this.variable?"":this.name+(b.compress?":":": ")+this.value.toCSS(b)+this.important+";"};d.Rule.prototype.eval=function(b){return new d.Rule(this.name,this.value.eval(b),this.important,this.index)};d.Shorthand=function(b,a){this.a=b;this.b=a};d.Shorthand.prototype={toCSS:function(b){return this.a.toCSS(b)+"/"+this.b.toCSS(b)},eval:function(){return this}}})(s("less/tree"));(function(d){d.Ruleset=function(b,
|
||||
a){this.selectors=b;this.rules=a;this._lookups={}};d.Ruleset.prototype={eval:function(b){var a=new d.Ruleset(this.selectors,this.rules.slice(0));a.root=this.root;b.frames.unshift(a);if(a.root)for(var g=0;g<a.rules.length;g++)a.rules[g]instanceof d.Import&&Array.prototype.splice.apply(a.rules,[g,1].concat(a.rules[g].eval(b)));for(g=0;g<a.rules.length;g++)if(a.rules[g]instanceof d.mixin.Definition)a.rules[g].frames=b.frames.slice(0);for(g=0;g<a.rules.length;g++)a.rules[g]instanceof d.mixin.Call&&Array.prototype.splice.apply(a.rules,
|
||||
[g,1].concat(a.rules[g].eval(b)));g=0;for(var e;g<a.rules.length;g++){e=a.rules[g];e instanceof d.mixin.Definition||(a.rules[g]=e.eval?e.eval(b):e)}b.frames.shift();return a},match:function(b){return!b||b.length===0},variables:function(){return this._variables?this._variables:this._variables=this.rules.reduce(function(b,a){if(a instanceof d.Rule&&a.variable===true)b[a.name]=a;return b},{})},variable:function(b){return this.variables()[b]},rulesets:function(){return this._rulesets?this._rulesets:this._rulesets=
|
||||
this.rules.filter(function(b){return b instanceof d.Ruleset||b instanceof d.mixin.Definition})},find:function(b,a){a=a||this;var g=[],e=b.toCSS();if(e in this._lookups)return this._lookups[e];this.rulesets().forEach(function(h){if(h!==a)for(var i=0;i<h.selectors.length;i++)if(b.match(h.selectors[i])){b.elements.length>1?Array.prototype.push.apply(g,h.find(new d.Selector(b.elements.slice(1)),a)):g.push(h);break}});return this._lookups[e]=g},toCSS:function(b,a){var g=[],e=[],h=[],i=[],k;if(!this.root)if(b.length===
|
||||
0)i=this.selectors.map(function(r){return[r]});else for(k=0;k<this.selectors.length;k++)for(var n=0;n<b.length;n++)i.push(b[n].concat([this.selectors[k]]));for(n=0;n<this.rules.length;n++){k=this.rules[n];if(k.rules||k instanceof d.Directive)h.push(k.toCSS(i,a));else if(k instanceof d.Comment)k.silent||(this.root?h.push(k.toCSS(a)):e.push(k.toCSS(a)));else if(k.toCSS&&!k.variable)e.push(k.toCSS(a));else k.value&&!k.variable&&e.push(k.value.toString())}h=h.join("");if(this.root)g.push(e.join(a.compress?
|
||||
"":"\n"));else if(e.length>0){i=i.map(function(r){return r.map(function(p){return p.toCSS(a)}).join("").trim()}).join(a.compress?",":i.length>3?",\n":", ");g.push(i,(a.compress?"{":" {\n ")+e.join(a.compress?"":"\n ")+(a.compress?"}":"\n}\n"))}g.push(h);return g.join("")+(a.compress?"\n":"")}}})(s("less/tree"));(function(d){d.Selector=function(b){this.elements=b;if(this.elements[0].combinator.value==="")this.elements[0].combinator.value=" "};d.Selector.prototype.match=function(b){return this.elements[0].value===
|
||||
b.elements[0].value?true:false};d.Selector.prototype.toCSS=function(b){if(this._css)return this._css;return this._css=this.elements.map(function(a){return typeof a==="string"?" "+a.trim():a.toCSS(b)}).join("")}})(s("less/tree"));(function(d){d.URL=function(b,a){if(b.data)this.attrs=b;else{if(!/^(?:https?:\/|file:\/)?\//.test(b.value)&&a.length>0&&typeof z!=="undefined")b.value=a[0]+(b.value.charAt(0)==="/"?b.value.slice(1):b.value);this.value=b;this.paths=a}};d.URL.prototype={toCSS:function(){return"url("+
|
||||
(this.attrs?"data:"+this.attrs.mime+this.attrs.charset+this.attrs.base64+this.attrs.data:this.value.toCSS())+")"},eval:function(b){return this.attrs?this:new d.URL(this.value.eval(b),this.paths)}}})(s("less/tree"));(function(d){d.Value=function(b){this.value=b;this.is="value"};d.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new d.Value(this.value.map(function(a){return a.eval(b)}))},toCSS:function(b){return this.value.map(function(a){return a.toCSS(b)}).join(b.compress?
|
||||
",":", ")}}})(s("less/tree"));(function(d){d.Variable=function(b,a){this.name=b;this.index=a};d.Variable.prototype={eval:function(b){var a,g,e=this.name;if(a=d.find(b.frames,function(h){if(g=h.variable(e))return g.value.eval(b)}))return a;else throw{message:"variable "+this.name+" is undefined",index:this.index};}}})(s("less/tree"));s("less/tree").find=function(d,b){for(var a=0,g;a<d.length;a++)if(g=b.call(d,d[a]))return g;return null};var P=location.protocol==="file:"||location.protocol==="chrome:"||
|
||||
location.protocol==="resource:";o.env=o.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||P?"development":"production");o.async=false;o.poll=o.poll||(P?1E3:1500);o.watch=function(){return this.watchMode=true};o.unwatch=function(){return this.watchMode=false};if(o.env==="development"){o.optimization=0;/!watch/.test(location.hash)&&o.watch();o.watchTimer=setInterval(function(){o.watchMode&&W(function(d,b,a){d&&N(d.toCSS(),b,a.lastModified)})},
|
||||
o.poll)}else o.optimization=3;var B;try{B=typeof z.localStorage==="undefined"?null:z.localStorage}catch(aa){B=null}var M=document.getElementsByTagName("link"),V=/^text\/(x-)?less$/;o.sheets=[];for(var J=0;J<M.length;J++)if(M[J].rel==="stylesheet/less"||M[J].rel.match(/stylesheet/)&&M[J].type.match(V))o.sheets.push(M[J]);o.refresh=function(d){var b=endTime=new Date;W(function(a,g,e){if(e.local)H("loading "+g.href+" from cache.");else{H("parsed "+g.href+" successfully.");N(a.toCSS(),g,e.lastModified)}H("css for "+
|
||||
g.href+" generated in "+(new Date-endTime)+"ms");e.remaining===0&&H("css generated in "+(new Date-b)+"ms");endTime=new Date},d);U()};o.refreshStyles=U;o.refresh(o.env==="development")})(window);
|
24
less/baseline.less
Normal file
24
less/baseline.less
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Master Stylesheet
|
||||
This file is only for importing all required stylesheets for LESS to include and then compile.
|
||||
*/
|
||||
|
||||
// CSS Reset
|
||||
@import "reset.less";
|
||||
|
||||
// Core
|
||||
@import "bootstrap.less";
|
||||
@import "scaffolding.less";
|
||||
|
||||
// Styled patterns and elements
|
||||
@import "type.less";
|
||||
@import "forms.less";
|
||||
@import "tables.less";
|
||||
@import "patterns.less";
|
||||
|
||||
|
||||
/* Add additional stylesheets below
|
||||
-------------------------------------------------- */
|
||||
|
||||
// Documentation
|
||||
@import "docs.less";
|
201
less/bootstrap.less
vendored
Normal file
201
less/bootstrap.less
vendored
Normal file
@ -0,0 +1,201 @@
|
||||
/*
|
||||
Bootstrap v1.1
|
||||
Variables and mixins to bootstrap any new web development project. Modified from original version for Twitter Blueprint.
|
||||
*/
|
||||
|
||||
|
||||
/* Variables
|
||||
-------------------------------------------------- */
|
||||
|
||||
// Links
|
||||
@link-color: #0069d6;
|
||||
@link-hover-color: darken(@link-color, 10);
|
||||
|
||||
// Grays
|
||||
@white: #fff;
|
||||
@gray-lighter: #ccc;
|
||||
@gray-light: #777;
|
||||
@gray: #555;
|
||||
@gray-dark: #333;
|
||||
@black: #000;
|
||||
|
||||
// Accent Colors
|
||||
@blue: #08b5fb;
|
||||
@blue-dark: #0069d6;
|
||||
@green: #46a546;
|
||||
@red: #9d261d;
|
||||
@yellow: #ffc40d;
|
||||
@orange: #f89406;
|
||||
@pink: #c3325f;
|
||||
@purple: #7a43b6;
|
||||
|
||||
// Baseline grid
|
||||
@baseline: 20px;
|
||||
|
||||
|
||||
/* Mixins
|
||||
-------------------------------------------------- */
|
||||
|
||||
// Clearfix for clearing floats like a boss
|
||||
.clearfix {
|
||||
zoom: 1;
|
||||
&:after {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
height: 0;
|
||||
clear: both;
|
||||
content: ".";
|
||||
}
|
||||
}
|
||||
|
||||
// Floats
|
||||
.right {
|
||||
float: right;
|
||||
}
|
||||
.left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
// Input placeholder text
|
||||
.placeholder(@color: @gray-light) {
|
||||
:-moz-placeholder {
|
||||
color: @color;
|
||||
}
|
||||
::-webkit-input-placeholder {
|
||||
color: @color;
|
||||
}
|
||||
}
|
||||
|
||||
// Font Stacks
|
||||
.font(@weight: normal, @size: 14px, @lineheight: 20px) {
|
||||
font-size: @size;
|
||||
font-weight: @weight;
|
||||
line-height: @lineheight;
|
||||
}
|
||||
.sans-serif(@weight: normal, @size: 14px, @lineheight: 20px) {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: @size;
|
||||
font-weight: @weight;
|
||||
line-height: @lineheight;
|
||||
}
|
||||
.serif(@weight: normal, @size: 14px, @lineheight: 20px) {
|
||||
font-family: "Georgia", Times New Roman, Times, sans-serif;
|
||||
font-size: @size;
|
||||
font-weight: @weight;
|
||||
line-height: @lineheight;
|
||||
}
|
||||
.monospace(@weight: normal, @size: 12px, @lineheight: 20px) {
|
||||
font-family: "Monaco", Courier New, monospace;
|
||||
font-size: @size;
|
||||
font-weight: @weight;
|
||||
line-height: @lineheight;
|
||||
}
|
||||
|
||||
// Grid System
|
||||
@grid_columns: 16;
|
||||
@grid_column_width: 40px;
|
||||
@grid_gutter_width: 20px;
|
||||
.columns(@column_span: 1) {
|
||||
display: inline;
|
||||
float: left;
|
||||
width: (@grid_column_width * @column_span) + (@grid_gutter_width * (@column_span - 1));
|
||||
margin-left: @grid_gutter_width;
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Border Radius
|
||||
.border-radius(@radius: 5px) {
|
||||
-moz-border-radius: @radius;
|
||||
border-radius: @radius;
|
||||
}
|
||||
|
||||
// Drop shadows
|
||||
.box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) {
|
||||
-webkit-box-shadow: @shadow;
|
||||
-moz-box-shadow: @shadow;
|
||||
box-shadow: @shadow;
|
||||
}
|
||||
|
||||
// Transitions
|
||||
.transition(@transition) {
|
||||
-webkit-transition: @transition;
|
||||
-moz-transition: @transition;
|
||||
transition: @transition;
|
||||
}
|
||||
|
||||
// CSS3 Content Columns
|
||||
.content-columns(@column_count, @column_gap: 20px) {
|
||||
-webkit-column-count: @count;
|
||||
-webkit-column-gap: @gap;
|
||||
-moz-column-count: @count;
|
||||
-moz-column-gap: @gap;
|
||||
column-count: @count;
|
||||
column-gap: @gap;
|
||||
}
|
||||
|
||||
// Buttons
|
||||
.button(@color: #f9f9f9, @padding: 4px 14px, @text_color: #555, @text_shadow: 0 1px 0 rgba(255,255,255,.75), @font_size: 13px, @border_color: rgba(0,0,0,.1), @rounded: 4px) {
|
||||
display: inline-block;
|
||||
#gradient > .vertical-three-colors(@color, @color, 0.25, darken(@color, 10%));
|
||||
padding: @padding;
|
||||
text-shadow: @text_shadow;
|
||||
color: @text_color;
|
||||
line-height: @baseline;
|
||||
border: 1px solid @border_color;
|
||||
border-bottom-color: fadein(@border_color, 15%);
|
||||
.border-radius(@rounded);
|
||||
@shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.1);
|
||||
.box-shadow(@shadow);
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background-position: 0 -15px;
|
||||
color: darken(@text_color, 10%);
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
// Add an alphatransparency value to any background or border color (via Elyse Holladay)
|
||||
#translucent {
|
||||
.background(@color: @white, @alpha: 1) {
|
||||
background-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
|
||||
}
|
||||
.border(@color: @white, @alpha: 1) {
|
||||
border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
|
||||
background-clip: padding-box;
|
||||
}
|
||||
}
|
||||
|
||||
// Gradients
|
||||
#gradient {
|
||||
.horizontal(@startColor: #555, @endColor: #333) {
|
||||
background-color: @endColor;
|
||||
background-repeat: no-repeat;
|
||||
background-image: -webkit-gradient(linear, left top, right top, from(@startColor), to(@endColor));
|
||||
background-image: -webkit-linear-gradient(right center, @startColor, @endColor);
|
||||
background-image: -moz-linear-gradient(right center, @startColor, @endColor);
|
||||
background-image: -o-linear-gradient(left, @startColor, @endColor);
|
||||
background-image: -khtml-gradient(linear, left top, right top, from(@startColor), to(@endColor));
|
||||
filter: e(%("progid:DXImageTransform.Microsoft.Gradient(StartColorStr='%d', EndColorStr='%d', GradientType=1)",@startColor,@endColor));
|
||||
-ms-filter: %("progid:DXImageTransform.Microsoft.gradient(startColorStr='%d', EndColorStr='%d', GradientType=1))",@startColor,@endColor);
|
||||
}
|
||||
.vertical(@startColor: #555, @endColor: #333) {
|
||||
background-color: @endColor;
|
||||
background-repeat: no-repeat;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(@startColor), to(@endColor));
|
||||
background-image: -webkit-linear-gradient(@startColor, @endColor);
|
||||
background-image: -moz-linear-gradient(@startColor, @endColor);
|
||||
background-image: -o-linear-gradient(top, @startColor, @endColor);
|
||||
background-image: -khtml-gradient(linear, left top, left bottom, from(@startColor), to(@endColor));
|
||||
filter: e(%("progid:DXImageTransform.Microsoft.Gradient(StartColorStr='%d', EndColorStr='%d', GradientType=0)",@startColor,@endColor));
|
||||
-ms-filter: %("progid:DXImageTransform.Microsoft.gradient(startColorStr='%d', EndColorStr='%d', GradientType=0))",@startColor,@endColor);
|
||||
}
|
||||
.vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 0.5, @endColor: #c3325f) {
|
||||
background-color: @endColor;
|
||||
background-repeat: no-repeat;
|
||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
|
||||
background-image: -webkit-linear-gradient(@startColor, color-stop(@colorStop, @midColor), @endColor);
|
||||
background-image: -moz-linear-gradient(@startColor, color-stop(@midColor, @colorStop), @endColor);
|
||||
}
|
||||
}
|
79
less/docs.less
Normal file
79
less/docs.less
Normal file
@ -0,0 +1,79 @@
|
||||
// Give us some love
|
||||
header,
|
||||
section,
|
||||
footer,
|
||||
article,
|
||||
aside {
|
||||
display: block;
|
||||
}
|
||||
#masthead {
|
||||
margin-top: @baseline * -1;
|
||||
#gradient > .vertical(darken(@blue-dark, 5%), darken(@blue, 7.5%));
|
||||
div.inner {
|
||||
background: transparent url(../img/grid-20px.png) 0 -1px;
|
||||
padding: 40px 0;
|
||||
.box-shadow(inset 0 10px 30px rgba(0,0,0,.25));
|
||||
}
|
||||
h1 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
h1, p {
|
||||
color: #fff;
|
||||
text-shadow: 0 1px 0 rgba(0,0,0,.25);
|
||||
}
|
||||
p {
|
||||
.font(300,20px,30px);
|
||||
margin: 5px 0;
|
||||
}
|
||||
a.btn {
|
||||
#gradient > .vertical(@purple, darken(@purple, 15%));
|
||||
display: block;
|
||||
margin-bottom: 20px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
text-align: center;
|
||||
border: 0;
|
||||
@shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -1px 0 rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.4);
|
||||
.box-shadow(@shadow);
|
||||
}
|
||||
small {
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
line-height: @baseline;
|
||||
color: rgba(255,255,255,.5);
|
||||
a {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Body
|
||||
#body {
|
||||
padding: 0 0 40px;
|
||||
}
|
||||
|
||||
// Show the grids
|
||||
.show-grid {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
.column,
|
||||
.columns {
|
||||
background: rgba(0,0,0,.1);
|
||||
text-align: center;
|
||||
.border-radius(3px);
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
&:hover {
|
||||
.column,
|
||||
.columns {
|
||||
background: rgba(0,0,0,.25);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Break up sections
|
||||
section {
|
||||
margin-bottom: 40px;
|
||||
}
|
361
less/forms.less
Normal file
361
less/forms.less
Normal file
@ -0,0 +1,361 @@
|
||||
/*
|
||||
Forms
|
||||
Base line styles for various input types, form layouts, and states
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* Global form styles
|
||||
-------------------------------------------------- */
|
||||
|
||||
form {
|
||||
// Groups of fields with labels on top (legends)
|
||||
fieldset {
|
||||
margin-bottom: @baseline;
|
||||
padding-top: @baseline;
|
||||
legend {
|
||||
display: block;
|
||||
margin-left: 150px;
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
color: @gray-dark;
|
||||
}
|
||||
}
|
||||
// Parent element that clears floats and wraps labels and fields together
|
||||
div.clearfix {
|
||||
margin-bottom: @baseline;
|
||||
}
|
||||
// Set font for forms
|
||||
label, input, select, textarea {
|
||||
.sans-serif(normal,13px,normal);
|
||||
}
|
||||
// Float labels left
|
||||
label {
|
||||
padding-top: 6px;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
float: left;
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
}
|
||||
// Shift over the inside div to align all label's relevant content
|
||||
div.input {
|
||||
margin-left: 150px;
|
||||
}
|
||||
// Checkboxs and radio buttons
|
||||
input[type=checkbox],
|
||||
input[type=radio] {
|
||||
cursor: pointer;
|
||||
}
|
||||
// Inputs, Textareas, Selects
|
||||
input[type=text],
|
||||
input[type=password],
|
||||
textarea,
|
||||
select,
|
||||
.uneditable-input {
|
||||
display: block;
|
||||
width: 210px;
|
||||
margin: 0;
|
||||
padding: 4px;
|
||||
font-size: 13px;
|
||||
line-height: @baseline;
|
||||
height: @baseline;
|
||||
color: @gray;
|
||||
border: 1px solid #bbb;
|
||||
.border-radius(3px);
|
||||
}
|
||||
select,
|
||||
input[type=file] {
|
||||
height: @baseline * 1.5;
|
||||
line-height: @baseline * 1.5;
|
||||
}
|
||||
textarea {
|
||||
height: auto;
|
||||
}
|
||||
.uneditable-input {
|
||||
background-color: #eee;
|
||||
display: block;
|
||||
border-color: #ccc;
|
||||
.box-shadow(inset 0 1px 2px rgba(0,0,0,.075));
|
||||
}
|
||||
// Focus states
|
||||
input[type=text],
|
||||
input[type=password],
|
||||
select, textarea {
|
||||
@transition: border linear .2s, box-shadow linear .2s;
|
||||
.transition(@transition);
|
||||
}
|
||||
input[type=text]:focus,
|
||||
input[type=password]:focus,
|
||||
textarea:focus {
|
||||
outline: none;
|
||||
border-color: rgba(82,168,236,.75);
|
||||
.box-shadow(0 0 8px rgba(82,168,236,.5));
|
||||
}
|
||||
// Error styles
|
||||
div.error {
|
||||
background: lighten(@red, 57%);
|
||||
padding: 10px 0;
|
||||
margin: -10px 0 10px;
|
||||
.border-radius(4px);
|
||||
@error-text: desaturate(lighten(@red, 25%), 25%);
|
||||
> label {
|
||||
color: @red;
|
||||
}
|
||||
input[type=text],
|
||||
input[type=password],
|
||||
textarea {
|
||||
border-color: @error-text;
|
||||
.box-shadow(0 0 3px rgba(171,41,32,.25));
|
||||
&:focus {
|
||||
border-color: darken(@error-text, 10%);
|
||||
.box-shadow(0 0 6px rgba(171,41,32,.5));
|
||||
}
|
||||
}
|
||||
div.input-prepend,
|
||||
div.input-append {
|
||||
span.add-on {
|
||||
background: lighten(@red, 50%);
|
||||
border-color: @error-text;
|
||||
color: darken(@error-text, 10%);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Form element sizes
|
||||
.input-mini, input.mini, textarea.mini, select.mini {
|
||||
width: 60px;
|
||||
}
|
||||
.input-small, input.small, textarea.small, select.small {
|
||||
width: 90px;
|
||||
}
|
||||
.input-medium, input.medium, textarea.medium, select.medium {
|
||||
width: 150px;
|
||||
}
|
||||
.input-large, input.large, textarea.large, select.large {
|
||||
width: 210px;
|
||||
}
|
||||
.input-xlarge, input.xlarge, textarea.xlarge, select.xlarge {
|
||||
width: 270px;
|
||||
}
|
||||
.input-xxlarge, input.xxlarge, textarea.xxlarge, select.xxlarge {
|
||||
width: 530px;
|
||||
}
|
||||
textarea.xxlarge {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
// Turn off focus for disabled (read-only) form elements
|
||||
input[readonly]:focus,
|
||||
textarea[readonly]:focus,
|
||||
input.disabled {
|
||||
background: #f5f5f5;
|
||||
border-color: #ddd;
|
||||
.box-shadow(none);
|
||||
}
|
||||
}
|
||||
|
||||
// Actions (the buttons)
|
||||
div.actions {
|
||||
background: #f5f5f5;
|
||||
margin-top: @baseline;
|
||||
margin-bottom: @baseline;
|
||||
padding: (@baseline - 1) 20px @baseline 150px;
|
||||
border-top: 1px solid #ddd;
|
||||
.border-radius(0 0 3px 3px);
|
||||
div.secondary-action {
|
||||
float: right;
|
||||
a {
|
||||
line-height: 30px;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Help Text
|
||||
.help-inline,
|
||||
.help-block {
|
||||
font-size: 12px;
|
||||
line-height: @baseline;
|
||||
color: @gray-light;
|
||||
}
|
||||
.help-inline {
|
||||
padding-left: 5px;
|
||||
}
|
||||
// Big blocks of help text
|
||||
.help-block {
|
||||
display: block;
|
||||
max-width: 600px;
|
||||
h5, p, ol li {
|
||||
color: @gray;
|
||||
}
|
||||
p, ol li {
|
||||
font-size: 12px;
|
||||
}
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
font-size: 12px;
|
||||
line-height: @baseline;
|
||||
color: @gray-light;
|
||||
}
|
||||
ol {
|
||||
margin-bottom: 10px;
|
||||
margin-left: 25px;
|
||||
}
|
||||
}
|
||||
|
||||
// Inline Fields (input fields that appear as inline objects
|
||||
div.inline-inputs {
|
||||
color: @gray;
|
||||
span, input[type=text] {
|
||||
display: inline-block;
|
||||
}
|
||||
input.mini {
|
||||
width: 60px;
|
||||
}
|
||||
input.small {
|
||||
width: 90px;
|
||||
}
|
||||
span {
|
||||
padding: 0 2px 0 1px;
|
||||
}
|
||||
}
|
||||
|
||||
// Allow us to put symbols and text within the input field for a cleaner look
|
||||
div.input-prepend,
|
||||
div.input-append {
|
||||
input[type=text] {
|
||||
.border-radius(0 3px 3px 0);
|
||||
}
|
||||
.add-on {
|
||||
background: #f5f5f5;
|
||||
float: left;
|
||||
display: block;
|
||||
width: auto;
|
||||
min-width: 16px;
|
||||
padding: 5px 4px 5px 5px;
|
||||
color: @gray-light;
|
||||
font-weight: normal;
|
||||
line-height: 18px;
|
||||
height: 18px;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
border: 1px solid #bbb;
|
||||
border-right-width: 0;
|
||||
.border-radius(3px 0 0 3px);
|
||||
}
|
||||
.active {
|
||||
background: lighten(@green, 30);
|
||||
border-color: @green;
|
||||
}
|
||||
}
|
||||
div.input-append {
|
||||
input[type=text] {
|
||||
float: left;
|
||||
.border-radius(3px 0 0 3px);
|
||||
}
|
||||
.add-on {
|
||||
.border-radius(0 3px 3px 0);
|
||||
border-right-width: 1px;
|
||||
border-left-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Stacked options for forms (radio buttons or checkboxes)
|
||||
ul.inputs-list {
|
||||
margin: 0 0 5px;
|
||||
width: 100%;
|
||||
li {
|
||||
display: block;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
label {
|
||||
display: block;
|
||||
float: none;
|
||||
width: auto;
|
||||
padding: 0;
|
||||
line-height: @baseline;
|
||||
text-align: left;
|
||||
white-space: normal;
|
||||
strong {
|
||||
color: @gray;
|
||||
}
|
||||
small {
|
||||
font-size: 12px;
|
||||
font-weight: normal !important;
|
||||
}
|
||||
}
|
||||
ul.inputs-list {
|
||||
margin-left: 25px;
|
||||
margin-bottom: 10px;
|
||||
padding-top: 0;
|
||||
}
|
||||
&:first-child {
|
||||
padding-top: 5px;
|
||||
}
|
||||
}
|
||||
input[type=radio],
|
||||
input[type=checkbox] {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disabled states for form elements, containing elements, and help text */
|
||||
div.disabled span {
|
||||
color: #aaa;
|
||||
}
|
||||
div.disabled input[type=text],
|
||||
div.disabled input[type=passsword],
|
||||
div.disabled textarea {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
ul.options label.disabled,
|
||||
ul.options label.disabled span,
|
||||
ul.options label.disabled small,
|
||||
ul.options label.disabled strong {
|
||||
color: #aaa !important;
|
||||
}
|
||||
|
||||
|
||||
// Stacked forms
|
||||
form.stacked-form {
|
||||
h4, p {
|
||||
margin: 0 0 2px;
|
||||
color: rgba(0,0,0,.5);
|
||||
}
|
||||
fieldset {
|
||||
margin: 0;
|
||||
padding: 19px 0 0;
|
||||
border-top-color: rgba(0,0,0,.1);
|
||||
}
|
||||
div.actions {
|
||||
margin-left: 0;
|
||||
padding: 19px 0 30px 180px;
|
||||
border-top: 1px solid rgba(0,0,0,.1);
|
||||
}
|
||||
legend {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
label {
|
||||
display: block;
|
||||
float: none;
|
||||
width: auto;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
line-height: 20px;
|
||||
padding-top: 1px;
|
||||
}
|
||||
div.input {
|
||||
margin: 0;
|
||||
}
|
||||
div.clearfix {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
div.six.columns input, div.six.columns textarea, div.six.columns select {
|
||||
width: 320px;
|
||||
}
|
||||
div.three.columns input, div.three.columns textarea, div.three.columns select {
|
||||
width: 150px;
|
||||
}
|
||||
}
|
298
less/patterns.less
Normal file
298
less/patterns.less
Normal file
@ -0,0 +1,298 @@
|
||||
/*
|
||||
Patterns.less
|
||||
Repeatable UI elements outside the base styles provided from the scaffolding
|
||||
*/
|
||||
|
||||
|
||||
/* Top bar
|
||||
-------------------------------------------------- */
|
||||
|
||||
body {
|
||||
padding-top: 60px;
|
||||
background-position: 0 40px;
|
||||
}
|
||||
div.topbar {
|
||||
#gradient > .vertical(#333, #222);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
height: 40px;
|
||||
.box-shadow(0 1px 3px rgba(0,0,0,.5));
|
||||
a {
|
||||
color: #999;
|
||||
&:hover {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
background-color: rgba(255,255,255,.05);
|
||||
}
|
||||
}
|
||||
a#logo,
|
||||
ul li a {
|
||||
float: left;
|
||||
padding: 0 10px;
|
||||
line-height: 40px;
|
||||
}
|
||||
// Logo
|
||||
a#logo {
|
||||
margin-left: -10px;
|
||||
margin-right: 10px;
|
||||
color: @gray-light;
|
||||
font-size: 20px;
|
||||
font-weight: 200;
|
||||
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
||||
img {
|
||||
float: left;
|
||||
margin-top: 9px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
span {
|
||||
}
|
||||
}
|
||||
// Nav items
|
||||
ul {
|
||||
float: left;
|
||||
margin: 0;
|
||||
li {
|
||||
display: inline;
|
||||
a {
|
||||
|
||||
}
|
||||
&.active a {
|
||||
color: #fff;
|
||||
background-color: rgba(0,0,0,.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Page Headers
|
||||
-------------------------------------------------- */
|
||||
|
||||
div.page-header {
|
||||
margin-bottom: @baseline - 1;
|
||||
border-bottom: 1px solid #ddd;
|
||||
.border-radius(6px 6px 0 0);
|
||||
.box-shadow(0 1px 0 rgba(255,255,255,.5));
|
||||
h1 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Error Styles
|
||||
-------------------------------------------------- */
|
||||
|
||||
// One-liner alert bars
|
||||
div.alert-message {
|
||||
#gradient > .vertical(transparent, rgba(0,0,0,0.15));
|
||||
background-color: @gray-lighter;
|
||||
margin-bottom: @baseline;
|
||||
padding: 10px 15px 9px;
|
||||
.border-radius(6px);
|
||||
color: #fff;
|
||||
border-bottom: 1px solid rgba(0,0,0,.25);
|
||||
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
||||
p {
|
||||
color: #fff;
|
||||
margin-bottom: 0;
|
||||
+ p {
|
||||
margin-top: 5px;
|
||||
}
|
||||
}
|
||||
&.error {
|
||||
background-color: lighten(@red, 25%);
|
||||
}
|
||||
&.warning {
|
||||
background-color: lighten(@yellow, 15%);
|
||||
}
|
||||
&.success {
|
||||
background-color: lighten(@green, 15%);
|
||||
}
|
||||
&.info {
|
||||
background-color: lighten(@blue, 15%);
|
||||
}
|
||||
a.close {
|
||||
float: right;
|
||||
margin-top: -2px;
|
||||
opacity: .5;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 1px 0 rgba(0,0,0,.5);
|
||||
.border-radius(3px);
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Block-level Alerts
|
||||
div.block-message {
|
||||
margin-bottom: @baseline;
|
||||
padding: 14px 19px;
|
||||
color: #333;
|
||||
color: rgba(0,0,0,.8);
|
||||
text-shadow: 0 1px 0 rgba(255,255,255,.25);
|
||||
.border-radius(6px);
|
||||
p {
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
color: #333;
|
||||
color: rgba(0,0,0,.8);
|
||||
margin-right: 30px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
ul {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
strong {
|
||||
display: block;
|
||||
}
|
||||
a.close {
|
||||
display: block;
|
||||
color: #333;
|
||||
color: rgba(0,0,0,.5);
|
||||
text-shadow: 0 1px 1px rgba(255,255,255,.75);
|
||||
}
|
||||
&.error {
|
||||
background: lighten(@red, 55%);
|
||||
border: 1px solid lighten(@red, 50%);
|
||||
}
|
||||
&.warning {
|
||||
background: lighten(@yellow, 35%);
|
||||
border: 1px solid lighten(@yellow, 25%)
|
||||
}
|
||||
&.success {
|
||||
background: lighten(@green, 45%);
|
||||
border: 1px solid lighten(@green, 35%)
|
||||
}
|
||||
&.info {
|
||||
background: lighten(@blue, 45%);
|
||||
border: 1px solid lighten(@blue, 40%);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Navigation
|
||||
-------------------------------------------------- */
|
||||
|
||||
// Common tab and pill styles
|
||||
ul.tabs,
|
||||
ul.pills {
|
||||
margin: 0 0 20px;
|
||||
padding: 0;
|
||||
.clearfix();
|
||||
li {
|
||||
display: inline;
|
||||
a {
|
||||
display: inline;
|
||||
float: left;
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Basic Tabs
|
||||
ul.tabs {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #ccc;
|
||||
li {
|
||||
a {
|
||||
margin-bottom: -1px;
|
||||
margin-right: 2px;
|
||||
padding: 0 15px;
|
||||
line-height: (@baseline * 2) - 1;
|
||||
.border-radius(3px 3px 0 0);
|
||||
&:hover {
|
||||
background: #f5f5f5;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
&.active a {
|
||||
background: #fff;
|
||||
padding: 0 14px;
|
||||
border: 1px solid #ccc;
|
||||
border-bottom: 0;
|
||||
color: @gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Basic pill nav
|
||||
ul.pills {
|
||||
li {
|
||||
a {
|
||||
margin: 5px 3px 5px 0;
|
||||
padding: 0 15px;
|
||||
text-shadow: 0 1px 1px #fff;
|
||||
line-height: 30px;
|
||||
.border-radius(15px);
|
||||
&:hover {
|
||||
background: @link-hover-color;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
text-shadow: 0 1px 1px rgba(0,0,0,.25);
|
||||
}
|
||||
}
|
||||
&.active a {
|
||||
background: @link-color;
|
||||
color: #fff;
|
||||
text-shadow: 0 1px 1px rgba(0,0,0,.25);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Pagination
|
||||
-------------------------------------------------- */
|
||||
|
||||
div.pagination {
|
||||
height: @baseline * 2;
|
||||
margin: @baseline 0;
|
||||
ul {
|
||||
float: left;
|
||||
margin: 0;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
.border-radius(3px);
|
||||
.box-shadow(0 1px 2px rgba(0,0,0,.075);
|
||||
li {
|
||||
display: inline;
|
||||
a {
|
||||
display: inline;
|
||||
float: left;
|
||||
padding: 0 14px;
|
||||
line-height: (@baseline * 2) - 2;
|
||||
border-right: 1px solid rgba(0,0,0,.15);
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover,
|
||||
&.active a {
|
||||
background-color: lighten(@blue, 45%);
|
||||
}
|
||||
&.disabled a,
|
||||
&.disabled a:hover {
|
||||
background-color: none;
|
||||
color: @gray-light;
|
||||
}
|
||||
&.next a,
|
||||
&:last-child a {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Wells
|
||||
-------------------------------------------------- */
|
||||
|
||||
div.well {
|
||||
background: #f5f5f5;
|
||||
margin-bottom: 20px;
|
||||
padding: 19px;
|
||||
min-height: 20px;
|
||||
border: 1px solid #ddd;
|
||||
.border-radius(4px);
|
||||
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075);
|
||||
}
|
16
less/reset.less
Normal file
16
less/reset.less
Normal file
@ -0,0 +1,16 @@
|
||||
/*--------------------------------------------------
|
||||
|
||||
Global Reset
|
||||
|
||||
Props to Eric Meyer (meyerweb.com) for his CSS
|
||||
reset file. We're using an adapted version here
|
||||
that cuts out some of the reset HTML elements we
|
||||
will never need here (i.e., dfn, samp, etc).
|
||||
|
||||
-------------------------------------------------- */
|
||||
|
||||
html, body { margin: 0; padding: 0; }
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, cite, code, del, dfn, em, img, q, s, samp, small, strike, strong, sub, sup, tt, var, dd, dl, dt, li, ol, ul, fieldset, form, label, legend, button, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; font-weight: normal; font-style: normal; font-size: 100%; line-height: 1; font-family: inherit; }
|
||||
table { border-collapse: collapse; border-spacing: 0; }
|
||||
ol, ul { list-style: none; }
|
||||
q:before, q:after, blockquote:before, blockquote:after { content: ""; }
|
97
less/scaffolding.less
Normal file
97
less/scaffolding.less
Normal file
@ -0,0 +1,97 @@
|
||||
/*
|
||||
Scaffolding
|
||||
Basic and global styles for generating a grid system, structural layout, and page templates
|
||||
*/
|
||||
|
||||
/* Baseline Grid System
|
||||
-------------------------------------------------- */
|
||||
|
||||
div.row {
|
||||
.clearfix;
|
||||
div.span1 { .columns(1); }
|
||||
div.span2 { .columns(2); }
|
||||
div.span3 { .columns(3); }
|
||||
div.span4 { .columns(4); }
|
||||
div.span5 { .columns(5); }
|
||||
div.span6 { .columns(6); }
|
||||
div.span7 { .columns(7); }
|
||||
div.span8 { .columns(8); }
|
||||
div.span9 { .columns(9); }
|
||||
div.span10 { .columns(10); }
|
||||
div.span11 { .columns(11); }
|
||||
div.span12 { .columns(12); }
|
||||
div.span13 { .columns(13); }
|
||||
div.span14 { .columns(14); }
|
||||
div.span15 { .columns(15); }
|
||||
div.span16 { .columns(16); }
|
||||
}
|
||||
|
||||
|
||||
/* Structural Layout
|
||||
-------------------------------------------------- */
|
||||
|
||||
html, body {
|
||||
background-color: #fff;
|
||||
}
|
||||
body {
|
||||
#gradient > .vertical-three-colors(#eee, #fff, 0.25, #fff);
|
||||
background-attachment: fixed;
|
||||
margin: 0;
|
||||
.sans-serif(normal,14px,20px);
|
||||
color: @gray;
|
||||
text-rendering: optimizeLegibility;
|
||||
.box-shadow(inset 0 1px 0 #fff);
|
||||
}
|
||||
|
||||
// Containers
|
||||
div.container {
|
||||
width: 940px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
|
||||
/* Base Styles
|
||||
-------------------------------------------------- */
|
||||
|
||||
// Links
|
||||
a {
|
||||
color: @link-color;
|
||||
text-decoration: none;
|
||||
line-height: inherit;
|
||||
&:hover {
|
||||
color: @link-hover-color;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
// Buttons
|
||||
.btn {
|
||||
.button();
|
||||
&.primary {
|
||||
#gradient > .vertical(@blue, @blue-dark);
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
||||
&:hover {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
&.large {
|
||||
font-size: 16px;
|
||||
line-height: 30px;
|
||||
.border-radius(6px);
|
||||
}
|
||||
&.small {
|
||||
padding-right: 9px;
|
||||
padding-left: 9px;
|
||||
font-size: 11px;
|
||||
line-height: 16px;
|
||||
}
|
||||
}
|
||||
// Help Firefox not be a douche about adding extra padding to buttons
|
||||
button.btn,
|
||||
input[type=submit].btn {
|
||||
&::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
}
|
121
less/tables.less
Normal file
121
less/tables.less
Normal file
@ -0,0 +1,121 @@
|
||||
/*
|
||||
Tables
|
||||
*/
|
||||
|
||||
|
||||
/* Baseline styles
|
||||
-------------------------------------------------- */
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
margin-bottom: @baseline;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
border-collapse: separate;
|
||||
th, td {
|
||||
// #translucent > .background(@green, .15);
|
||||
padding: 10px 10px 9px;
|
||||
line-height: @baseline;
|
||||
vertical-align: middle;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
th {
|
||||
padding-top: 9px;
|
||||
font-weight: bold;
|
||||
border-bottom-width: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Zebra-striping
|
||||
-------------------------------------------------- */
|
||||
|
||||
// Default zebra-stripe styles (alternating gray and transparent backgrounds)
|
||||
table.zebra-striped {
|
||||
tbody {
|
||||
tr:nth-child(odd) td {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
tr:hover td {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
}
|
||||
// Tablesorting styles w/ jQuery plugin
|
||||
th.header { // For tablesorter tables, make THs have a pointer on hover
|
||||
cursor: pointer;
|
||||
padding-right: 20px;
|
||||
}
|
||||
th.headerSortUp,
|
||||
th.headerSortDown { // Style the sorted column headers (THs)
|
||||
background-image: url(../img/tablesorter-indicators.png);
|
||||
background-position: right -23px;
|
||||
background-repeat: no-repeat;
|
||||
background-color: rgba(141,192,219,.25);
|
||||
.border-radius(3px 3px 0 0);
|
||||
text-shadow: 0 1px 1px rgba(255,255,255,.75);
|
||||
}
|
||||
th.header:hover { // Style the ascending (reverse alphabetical) column header
|
||||
background-image: url(../img/tablesorter-indicators.png);
|
||||
background-position: right 15px;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
th.actions:hover {
|
||||
background-image: none !important;
|
||||
}
|
||||
th.headerSortDown,
|
||||
th.headerSortDown:hover { // Style the descending (alphabetical) column header
|
||||
background-position: right -25px;
|
||||
}
|
||||
th.headerSortUp,
|
||||
th.headerSortUp:hover { // Style the ascending (reverse alphabetical) column header
|
||||
background-position: right -65px;
|
||||
}
|
||||
// Blue Table Headings
|
||||
th.blue {
|
||||
color: @blue;
|
||||
border-bottom-color: @blue;
|
||||
}
|
||||
th.headerSortUp.blue, th.headerSortDown.blue {
|
||||
background-color: lighten(@blue, 40%);
|
||||
}
|
||||
// Green Table Headings
|
||||
th.green {
|
||||
color: @green;
|
||||
border-bottom-color: @green;
|
||||
}
|
||||
th.headerSortUp.green, th.headerSortDown.green { // backround color is 20% of border color
|
||||
background-color: lighten(@green, 40%);
|
||||
}
|
||||
// Red Table Headings
|
||||
th.red {
|
||||
color: @red;
|
||||
border-bottom-color: @red;
|
||||
}
|
||||
th.headerSortUp.red, th.headerSortDown.red { // backround color is 20% of border color
|
||||
background-color: lighten(@red, 50%);
|
||||
}
|
||||
// Yellow Table Headings
|
||||
th.yellow {
|
||||
color: @yellow;
|
||||
border-bottom-color: @yellow;
|
||||
}
|
||||
th.headerSortUp.yellow, th.headerSortDown.yellow { // backround color is 20% of border color
|
||||
background-color: lighten(@yellow, 40%);
|
||||
}
|
||||
// Orange Table Headings
|
||||
th.orange {
|
||||
color: @orange;
|
||||
border-bottom-color: @orange;
|
||||
}
|
||||
th.headerSortUp.orange, th.headerSortDown.orange { // backround color is 20% of border color
|
||||
background-color: lighten(@orange, 40%);
|
||||
}
|
||||
// Purple Table Headings
|
||||
th.purple {
|
||||
color: @purple;
|
||||
border-bottom-color: @purple;
|
||||
}
|
||||
th.headerSortUp.purple, th.headerSortDown.purple { // backround color is 20% of border color
|
||||
background-color: lighten(@purple, 40%);
|
||||
}
|
||||
}
|
256
less/type.less
Normal file
256
less/type.less
Normal file
@ -0,0 +1,256 @@
|
||||
/*
|
||||
Typography
|
||||
Headings, body text, lists, code, and more for a versatile and durable typography system
|
||||
*/
|
||||
|
||||
|
||||
/* Body text
|
||||
-------------------------------------------------- */
|
||||
|
||||
p {
|
||||
.font(normal,14px,@baseline);
|
||||
margin-bottom: @baseline;
|
||||
small {
|
||||
font-size: 12px;
|
||||
color: @gray-light;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Headings
|
||||
-------------------------------------------------- */
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-weight: 500;
|
||||
color: @gray-dark;
|
||||
small {
|
||||
color: @gray-light;
|
||||
}
|
||||
}
|
||||
h1 {
|
||||
margin-bottom: @baseline;
|
||||
font-size: 30px;
|
||||
line-height: @baseline * 2;
|
||||
small {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
h2 {
|
||||
font-size: 24px;
|
||||
line-height: @baseline * 2;
|
||||
small {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
h3, h4, h5, h6 {
|
||||
line-height: @baseline * 2;
|
||||
}
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
small {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
h4 {
|
||||
font-size: 16px;
|
||||
small {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
h5 {
|
||||
font-size: 14px;
|
||||
}
|
||||
h6 {
|
||||
font-size: 13px;
|
||||
color: @gray-light;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Colors
|
||||
-------------------------------------------------- */
|
||||
|
||||
// Unordered and Ordered lists
|
||||
ul, ol {
|
||||
margin: 0 0 @baseline 25px;
|
||||
}
|
||||
ul ul,
|
||||
ul ol,
|
||||
ol ol,
|
||||
ol ul {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
ul {
|
||||
list-style: disc;
|
||||
}
|
||||
ol {
|
||||
list-style: decimal;
|
||||
}
|
||||
li {
|
||||
line-height: @baseline;
|
||||
color: @gray;
|
||||
}
|
||||
ul.unstyled {
|
||||
list-style: none;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
// Description Lists
|
||||
dl {
|
||||
margin-bottom: @baseline;
|
||||
dt, dd {
|
||||
line-height: @baseline;
|
||||
}
|
||||
dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
dd {
|
||||
margin-left: @baseline / 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Misc
|
||||
-------------------------------------------------- */
|
||||
|
||||
// Labels
|
||||
span.label {
|
||||
background-color: #ccc;
|
||||
padding: 3px 5px;
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
text-shadow: 0 0 1px rgba(0,0,0,.01);
|
||||
text-transform: uppercase;
|
||||
.border-radius(3px);
|
||||
&.expired {
|
||||
background-color: #f5f5f5;
|
||||
color: #999;
|
||||
}
|
||||
&.pending {
|
||||
background-color: #48489b;
|
||||
}
|
||||
&.declined {
|
||||
background-color: #9b4848;
|
||||
}
|
||||
&.active,
|
||||
&.approved {
|
||||
background-color: #59bf59;
|
||||
}
|
||||
&.disabled {
|
||||
background-color: #faa226;
|
||||
}
|
||||
&.scheduled {
|
||||
background-color: #f5f5f5;
|
||||
color: #59bf59;
|
||||
text-shadow: 0 1px 0 rgba(255,255,255,.5);
|
||||
}
|
||||
}
|
||||
|
||||
// Horizontal rules
|
||||
hr {
|
||||
margin: 0 0 19px;
|
||||
border: 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
// Emphasis
|
||||
strong {
|
||||
font-style: inherit;
|
||||
font-weight: bold;
|
||||
line-height: inherit;
|
||||
}
|
||||
em {
|
||||
font-style: italic;
|
||||
font-weight: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
.muted {
|
||||
color: @gray-lighter;
|
||||
}
|
||||
|
||||
// Blockquotes
|
||||
blockquote {
|
||||
margin-bottom: @baseline;
|
||||
border-left: 5px solid #eee;
|
||||
padding-left: 15px;
|
||||
p {
|
||||
.font(300,14px,@baseline);
|
||||
margin-bottom: 0;
|
||||
}
|
||||
cite {
|
||||
display: block;
|
||||
.font(300,12px,@baseline);
|
||||
color: @gray-light;
|
||||
&:before {
|
||||
content: '\2014 \00A0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Addresses
|
||||
address {
|
||||
display: block;
|
||||
line-height: @baseline;
|
||||
margin-bottom: @baseline;
|
||||
}
|
||||
|
||||
// Inline and block code styles
|
||||
code, pre {
|
||||
padding: 0 3px 2px;
|
||||
font-family: Monaco, Andale Mono, Courier New, monospace;
|
||||
font-size: 12px;
|
||||
.border-radius(3px);
|
||||
}
|
||||
code {
|
||||
background-color: lighten(@orange, 40%);
|
||||
color: rgba(0,0,0,.75);
|
||||
padding: 2px 3px;
|
||||
}
|
||||
pre {
|
||||
background-color: #f5f5f5;
|
||||
display: block;
|
||||
padding: @baseline - 1;
|
||||
margin: 0 0 @baseline;
|
||||
line-height: @baseline;
|
||||
font-size: 12px;
|
||||
border: 1px solid rgba(0,0,0,.15);
|
||||
.border-radius(3px);
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
// Code block styling from Chili
|
||||
pre.css, pre.html {
|
||||
background-color: #fff;
|
||||
}
|
||||
pre ol {
|
||||
background-color: lighten(@orange, 42%);
|
||||
list-style: decimal;
|
||||
margin: (@baseline - 1) * -1;
|
||||
padding-left: 59px;
|
||||
.border-radius(2px);
|
||||
li {
|
||||
background-color: #fff;
|
||||
padding: 0 10px;
|
||||
border-left: 1px solid rgba(0,0,0,.1);
|
||||
border-left-color: lighten(@orange, 35%);
|
||||
font-size: 11px;
|
||||
line-height: @baseline;
|
||||
color: @gray-light;
|
||||
text-shadow: 0 1px 1px rgba(255,255,255,.5);
|
||||
word-wrap: break-word;
|
||||
&:hover {
|
||||
}
|
||||
&:first-child {
|
||||
padding-top: 9px;
|
||||
}
|
||||
&:last-child {
|
||||
padding-bottom: 9px;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Language Styles
|
||||
span.html__tag_start,
|
||||
span.html__tag_end { color: #277ac1; font-weight: normal; }
|
||||
span.html__attr_name { color: #d78b41; }
|
||||
span.html__attr_value { color: #de4a3f; }
|
13
readme.markdown
Normal file
13
readme.markdown
Normal file
@ -0,0 +1,13 @@
|
||||
TODOS
|
||||
|
||||
* Write "Using Twitter BP" section
|
||||
** Two ways to use: LESS.js or compiled
|
||||
** Not meant to be 100% bulletproof, but is 90% bulletproof (stats?)
|
||||
** Advanced framework for fast prototyping, internal app development, bootstraping new websites
|
||||
** Can be easily modified to provide more legacy support
|
||||
|
||||
* Add grid examples back in
|
||||
* Cross browser checks? Show this anywhere?
|
||||
* Add layouts section back in
|
||||
|
||||
* Point JS libraries to public library links instead of within the repo
|
Loading…
x
Reference in New Issue
Block a user