} element to specify the
- * language, as in {@code }. Any class that
- * starts with "lang-" followed by a file extension, specifies the file type.
- * See the "lang-*.js" files in this directory for code that implements
- * per-language file handlers.
- *
- * Change log:
- * cbeust, 2006/08/22
- *
- * Java annotations (start with "@") are now captured as literals ("lit")
- *
- * @requires console
- */
-
-// JSLint declarations
-/*global console, document, navigator, setTimeout, window */
-
-/**
- * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
- * UI events.
- * If set to {@code false}, {@code prettyPrint()} is synchronous.
- */
-window['PR_SHOULD_USE_CONTINUATION'] = true;
-
-(function () {
- // Keyword lists for various languages.
- // We use things that coerce to strings to make them compact when minified
- // and to defeat aggressive optimizers that fold large string constants.
- var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"];
- var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," +
- "double,enum,extern,float,goto,int,long,register,short,signed,sizeof," +
- "static,struct,switch,typedef,union,unsigned,void,volatile"];
- var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," +
- "new,operator,private,protected,public,this,throw,true,try,typeof"];
- var CPP_KEYWORDS = [COMMON_KEYWORDS,"alignof,align_union,asm,axiom,bool," +
- "concept,concept_map,const_cast,constexpr,decltype," +
- "dynamic_cast,explicit,export,friend,inline,late_check," +
- "mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast," +
- "template,typeid,typename,using,virtual,where"];
- var JAVA_KEYWORDS = [COMMON_KEYWORDS,
- "abstract,boolean,byte,extends,final,finally,implements,import," +
- "instanceof,null,native,package,strictfp,super,synchronized,throws," +
- "transient"];
- var CSHARP_KEYWORDS = [JAVA_KEYWORDS,
- "as,base,by,checked,decimal,delegate,descending,dynamic,event," +
- "fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock," +
- "object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed," +
- "stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];
- var COFFEE_KEYWORDS = "all,and,by,catch,class,else,extends,false,finally," +
- "for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then," +
- "true,try,unless,until,when,while,yes";
- var JSCRIPT_KEYWORDS = [COMMON_KEYWORDS,
- "debugger,eval,export,function,get,null,set,undefined,var,with," +
- "Infinity,NaN"];
- var PERL_KEYWORDS = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for," +
- "goto,if,import,last,local,my,next,no,our,print,package,redo,require," +
- "sub,undef,unless,until,use,wantarray,while,BEGIN,END";
- var PYTHON_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "and,as,assert,class,def,del," +
- "elif,except,exec,finally,from,global,import,in,is,lambda," +
- "nonlocal,not,or,pass,print,raise,try,with,yield," +
- "False,True,None"];
- var RUBY_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "alias,and,begin,case,class," +
- "def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo," +
- "rescue,retry,self,super,then,true,undef,unless,until,when,yield," +
- "BEGIN,END"];
- var SH_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "case,done,elif,esac,eval,fi," +
- "function,in,local,set,then,until"];
- var ALL_KEYWORDS = [
- CPP_KEYWORDS, CSHARP_KEYWORDS, JSCRIPT_KEYWORDS, PERL_KEYWORDS +
- PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
- var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;
-
- // token style names. correspond to css classes
- /**
- * token style for a string literal
- * @const
- */
- var PR_STRING = 'str';
- /**
- * token style for a keyword
- * @const
- */
- var PR_KEYWORD = 'kwd';
- /**
- * token style for a comment
- * @const
- */
- var PR_COMMENT = 'com';
- /**
- * token style for a type
- * @const
- */
- var PR_TYPE = 'typ';
- /**
- * token style for a literal value. e.g. 1, null, true.
- * @const
- */
- var PR_LITERAL = 'lit';
- /**
- * token style for a punctuation string.
- * @const
- */
- var PR_PUNCTUATION = 'pun';
- /**
- * token style for a punctuation string.
- * @const
- */
- var PR_PLAIN = 'pln';
-
- /**
- * token style for an sgml tag.
- * @const
- */
- var PR_TAG = 'tag';
- /**
- * token style for a markup declaration such as a DOCTYPE.
- * @const
- */
- var PR_DECLARATION = 'dec';
- /**
- * token style for embedded source.
- * @const
- */
- var PR_SOURCE = 'src';
- /**
- * token style for an sgml attribute name.
- * @const
- */
- var PR_ATTRIB_NAME = 'atn';
- /**
- * token style for an sgml attribute value.
- * @const
- */
- var PR_ATTRIB_VALUE = 'atv';
-
- /**
- * A class that indicates a section of markup that is not code, e.g. to allow
- * embedding of line numbers within code listings.
- * @const
- */
- var PR_NOCODE = 'nocode';
-
-
-
-/**
- * A set of tokens that can precede a regular expression literal in
- * javascript
- * http://web.archive.org/web/20070717142515/http://www.mozilla.org/js/language/js20/rationale/syntax.html
- * has the full list, but I've removed ones that might be problematic when
- * seen in languages that don't support regular expression literals.
- *
- * Specifically, I've removed any keywords that can't precede a regexp
- * literal in a syntactically legal javascript program, and I've removed the
- * "in" keyword since it's not a keyword in many languages, and might be used
- * as a count of inches.
- *
- *
The link a above does not accurately describe EcmaScript rules since
- * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
- * very well in practice.
- *
- * @private
- * @const
- */
-var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*';
-
-// CAVEAT: this does not properly handle the case where a regular
-// expression immediately follows another since a regular expression may
-// have flags for case-sensitivity and the like. Having regexp tokens
-// adjacent is not valid in any language I'm aware of, so I'm punting.
-// TODO: maybe style special characters inside a regexp as punctuation.
-
-
- /**
- * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
- * matches the union of the sets of strings matched by the input RegExp.
- * Since it matches globally, if the input strings have a start-of-input
- * anchor (/^.../), it is ignored for the purposes of unioning.
- * @param {Array.} regexs non multiline, non-global regexs.
- * @return {RegExp} a global regex.
- */
- function combinePrefixPatterns(regexs) {
- var capturedGroupIndex = 0;
-
- var needToFoldCase = false;
- var ignoreCase = false;
- for (var i = 0, n = regexs.length; i < n; ++i) {
- var regex = regexs[i];
- if (regex.ignoreCase) {
- ignoreCase = true;
- } else if (/[a-z]/i.test(regex.source.replace(
- /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
- needToFoldCase = true;
- ignoreCase = false;
- break;
- }
- }
-
- var escapeCharToCodeUnit = {
- 'b': 8,
- 't': 9,
- 'n': 0xa,
- 'v': 0xb,
- 'f': 0xc,
- 'r': 0xd
- };
-
- function decodeEscape(charsetPart) {
- var cc0 = charsetPart.charCodeAt(0);
- if (cc0 !== 92 /* \\ */) {
- return cc0;
- }
- var c1 = charsetPart.charAt(1);
- cc0 = escapeCharToCodeUnit[c1];
- if (cc0) {
- return cc0;
- } else if ('0' <= c1 && c1 <= '7') {
- return parseInt(charsetPart.substring(1), 8);
- } else if (c1 === 'u' || c1 === 'x') {
- return parseInt(charsetPart.substring(2), 16);
- } else {
- return charsetPart.charCodeAt(1);
- }
- }
-
- function encodeEscape(charCode) {
- if (charCode < 0x20) {
- return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
- }
- var ch = String.fromCharCode(charCode);
- if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
- ch = '\\' + ch;
- }
- return ch;
- }
-
- function caseFoldCharset(charSet) {
- var charsetParts = charSet.substring(1, charSet.length - 1).match(
- new RegExp(
- '\\\\u[0-9A-Fa-f]{4}'
- + '|\\\\x[0-9A-Fa-f]{2}'
- + '|\\\\[0-3][0-7]{0,2}'
- + '|\\\\[0-7]{1,2}'
- + '|\\\\[\\s\\S]'
- + '|-'
- + '|[^-\\\\]',
- 'g'));
- var groups = [];
- var ranges = [];
- var inverse = charsetParts[0] === '^';
- for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
- var p = charsetParts[i];
- if (/\\[bdsw]/i.test(p)) { // Don't muck with named groups.
- groups.push(p);
- } else {
- var start = decodeEscape(p);
- var end;
- if (i + 2 < n && '-' === charsetParts[i + 1]) {
- end = decodeEscape(charsetParts[i + 2]);
- i += 2;
- } else {
- end = start;
- }
- ranges.push([start, end]);
- // If the range might intersect letters, then expand it.
- // This case handling is too simplistic.
- // It does not deal with non-latin case folding.
- // It works for latin source code identifiers though.
- if (!(end < 65 || start > 122)) {
- if (!(end < 65 || start > 90)) {
- ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
- }
- if (!(end < 97 || start > 122)) {
- ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
- }
- }
- }
- }
-
- // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
- // -> [[1, 12], [14, 14], [16, 17]]
- ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); });
- var consolidatedRanges = [];
- var lastRange = [NaN, NaN];
- for (var i = 0; i < ranges.length; ++i) {
- var range = ranges[i];
- if (range[0] <= lastRange[1] + 1) {
- lastRange[1] = Math.max(lastRange[1], range[1]);
- } else {
- consolidatedRanges.push(lastRange = range);
- }
- }
-
- var out = ['['];
- if (inverse) { out.push('^'); }
- out.push.apply(out, groups);
- for (var i = 0; i < consolidatedRanges.length; ++i) {
- var range = consolidatedRanges[i];
- out.push(encodeEscape(range[0]));
- if (range[1] > range[0]) {
- if (range[1] + 1 > range[0]) { out.push('-'); }
- out.push(encodeEscape(range[1]));
- }
- }
- out.push(']');
- return out.join('');
- }
-
- function allowAnywhereFoldCaseAndRenumberGroups(regex) {
- // Split into character sets, escape sequences, punctuation strings
- // like ('(', '(?:', ')', '^'), and runs of characters that do not
- // include any of the above.
- var parts = regex.source.match(
- new RegExp(
- '(?:'
- + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]' // a character set
- + '|\\\\u[A-Fa-f0-9]{4}' // a unicode escape
- + '|\\\\x[A-Fa-f0-9]{2}' // a hex escape
- + '|\\\\[0-9]+' // a back-reference or octal escape
- + '|\\\\[^ux0-9]' // other escape sequence
- + '|\\(\\?[:!=]' // start of a non-capturing group
- + '|[\\(\\)\\^]' // start/emd of a group, or line start
- + '|[^\\x5B\\x5C\\(\\)\\^]+' // run of other characters
- + ')',
- 'g'));
- var n = parts.length;
-
- // Maps captured group numbers to the number they will occupy in
- // the output or to -1 if that has not been determined, or to
- // undefined if they need not be capturing in the output.
- var capturedGroups = [];
-
- // Walk over and identify back references to build the capturedGroups
- // mapping.
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- var p = parts[i];
- if (p === '(') {
- // groups are 1-indexed, so max group index is count of '('
- ++groupIndex;
- } else if ('\\' === p.charAt(0)) {
- var decimalValue = +p.substring(1);
- if (decimalValue && decimalValue <= groupIndex) {
- capturedGroups[decimalValue] = -1;
- }
- }
- }
-
- // Renumber groups and reduce capturing groups to non-capturing groups
- // where possible.
- for (var i = 1; i < capturedGroups.length; ++i) {
- if (-1 === capturedGroups[i]) {
- capturedGroups[i] = ++capturedGroupIndex;
- }
- }
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- var p = parts[i];
- if (p === '(') {
- ++groupIndex;
- if (capturedGroups[groupIndex] === undefined) {
- parts[i] = '(?:';
- }
- } else if ('\\' === p.charAt(0)) {
- var decimalValue = +p.substring(1);
- if (decimalValue && decimalValue <= groupIndex) {
- parts[i] = '\\' + capturedGroups[groupIndex];
- }
- }
- }
-
- // Remove any prefix anchors so that the output will match anywhere.
- // ^^ really does mean an anchored match though.
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
- }
-
- // Expand letters to groups to handle mixing of case-sensitive and
- // case-insensitive patterns if necessary.
- if (regex.ignoreCase && needToFoldCase) {
- for (var i = 0; i < n; ++i) {
- var p = parts[i];
- var ch0 = p.charAt(0);
- if (p.length >= 2 && ch0 === '[') {
- parts[i] = caseFoldCharset(p);
- } else if (ch0 !== '\\') {
- // TODO: handle letters in numeric escapes.
- parts[i] = p.replace(
- /[a-zA-Z]/g,
- function (ch) {
- var cc = ch.charCodeAt(0);
- return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
- });
- }
- }
- }
-
- return parts.join('');
- }
-
- var rewritten = [];
- for (var i = 0, n = regexs.length; i < n; ++i) {
- var regex = regexs[i];
- if (regex.global || regex.multiline) { throw new Error('' + regex); }
- rewritten.push(
- '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
- }
-
- return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
- }
-
-
- /**
- * Split markup into a string of source code and an array mapping ranges in
- * that string to the text nodes in which they appear.
- *
- *
- * The HTML DOM structure:
- *
- * (Element "p"
- * (Element "b"
- * (Text "print ")) ; #1
- * (Text "'Hello '") ; #2
- * (Element "br") ; #3
- * (Text " + 'World';")) ; #4
- *
- *
- * corresponds to the HTML
- * {@code
print 'Hello ' + 'World';
}.
- *
- *
- * It will produce the output:
- *
- * {
- * sourceCode: "print 'Hello '\n + 'World';",
- * // 1 2
- * // 012345678901234 5678901234567
- * spans: [0, #1, 6, #2, 14, #3, 15, #4]
- * }
- *
- *
- * where #1 is a reference to the {@code "print "} text node above, and so
- * on for the other text nodes.
- *
- *
- *
- * The {@code} spans array is an array of pairs. Even elements are the start
- * indices of substrings, and odd elements are the text nodes (or BR elements)
- * that contain the text for those substrings.
- * Substrings continue until the next index or the end of the source.
- *
- *
- * @param {Node} node an HTML DOM subtree containing source-code.
- * @return {Object} source code and the text nodes in which they occur.
- */
- function extractSourceSpans(node) {
- var nocode = /(?:^|\s)nocode(?:\s|$)/;
-
- var chunks = [];
- var length = 0;
- var spans = [];
- var k = 0;
-
- var whitespace;
- if (node.currentStyle) {
- whitespace = node.currentStyle.whiteSpace;
- } else if (window.getComputedStyle) {
- whitespace = document.defaultView.getComputedStyle(node, null)
- .getPropertyValue('white-space');
- }
- var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
-
- function walk(node) {
- switch (node.nodeType) {
- case 1: // Element
- if (nocode.test(node.className)) { return; }
- for (var child = node.firstChild; child; child = child.nextSibling) {
- walk(child);
- }
- var nodeName = node.nodeName;
- if ('BR' === nodeName || 'LI' === nodeName) {
- chunks[k] = '\n';
- spans[k << 1] = length++;
- spans[(k++ << 1) | 1] = node;
- }
- break;
- case 3: case 4: // Text
- var text = node.nodeValue;
- if (text.length) {
- if (!isPreformatted) {
- text = text.replace(/[ \t\r\n]+/g, ' ');
- } else {
- text = text.replace(/\r\n?/g, '\n'); // Normalize newlines.
- }
- // TODO: handle tabs here?
- chunks[k] = text;
- spans[k << 1] = length;
- length += text.length;
- spans[(k++ << 1) | 1] = node;
- }
- break;
- }
- }
-
- walk(node);
-
- return {
- sourceCode: chunks.join('').replace(/\n$/, ''),
- spans: spans
- };
- }
-
-
- /**
- * Apply the given language handler to sourceCode and add the resulting
- * decorations to out.
- * @param {number} basePos the index of sourceCode within the chunk of source
- * whose decorations are already present on out.
- */
- function appendDecorations(basePos, sourceCode, langHandler, out) {
- if (!sourceCode) { return; }
- var job = {
- sourceCode: sourceCode,
- basePos: basePos
- };
- langHandler(job);
- out.push.apply(out, job.decorations);
- }
-
- var notWs = /\S/;
-
- /**
- * Given an element, if it contains only one child element and any text nodes
- * it contains contain only space characters, return the sole child element.
- * Otherwise returns undefined.
- *
- * This is meant to return the CODE element in {@code
} when
- * there is a single child element that contains all the non-space textual
- * content, but not to return anything where there are multiple child elements
- * as in {@code ...
...
} or when there
- * is textual content.
- */
- function childContentWrapper(element) {
- var wrapper = undefined;
- for (var c = element.firstChild; c; c = c.nextSibling) {
- var type = c.nodeType;
- wrapper = (type === 1) // Element Node
- ? (wrapper ? element : c)
- : (type === 3) // Text Node
- ? (notWs.test(c.nodeValue) ? element : wrapper)
- : wrapper;
- }
- return wrapper === element ? undefined : wrapper;
- }
-
- /** Given triples of [style, pattern, context] returns a lexing function,
- * The lexing function interprets the patterns to find token boundaries and
- * returns a decoration list of the form
- * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
- * where index_n is an index into the sourceCode, and style_n is a style
- * constant like PR_PLAIN. index_n-1 <= index_n, and style_n-1 applies to
- * all characters in sourceCode[index_n-1:index_n].
- *
- * The stylePatterns is a list whose elements have the form
- * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
- *
- * Style is a style constant like PR_PLAIN, or can be a string of the
- * form 'lang-FOO', where FOO is a language extension describing the
- * language of the portion of the token in $1 after pattern executes.
- * E.g., if style is 'lang-lisp', and group 1 contains the text
- * '(hello (world))', then that portion of the token will be passed to the
- * registered lisp handler for formatting.
- * The text before and after group 1 will be restyled using this decorator
- * so decorators should take care that this doesn't result in infinite
- * recursion. For example, the HTML lexer rule for SCRIPT elements looks
- * something like ['lang-js', /<[s]cript>(.+?)<\/script>/]. This may match
- * '
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/styleguide/item-components-buttons.html b/styleguide/item-components-buttons.html
deleted file mode 100644
index a100db6..0000000
--- a/styleguide/item-components-buttons.html
+++ /dev/null
@@ -1,177 +0,0 @@
-
-
-
-
- HolaKit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/styleguide/item-components-cards-basic.html b/styleguide/item-components-cards-basic.html
deleted file mode 100644
index 817ba4f..0000000
--- a/styleguide/item-components-cards-basic.html
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-
-
- HolaKit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Toggle example guides
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Toggle HTML markup
-
-
-
-
-
-
-
-
-
Card components are blocks by default. We don't suggest using them as inlines or
-inline-blocks. Normally you would just wrap cards in card stack or get them in
-layouts so they won't get too wide. In some cases you want to wrap cards directly
-in containers: Fine, but don't do it every where, since cards can be too wide for
-desktop users. In the following example page, we explictly get a max width for
-demostration purpose.
-
Cards can't be too narrow too; Because we have great padding around cards, if you
-get 4 or more columns in a container, the whole page may looks too messy, and
-lines in each column will be too short for a comfortable reading experience.
-
Of course titles are accepted in cards and you will use them frequently. We also
-get head images for cards, and even pure image cards. Go ahead and make your app
-vivid.
-
We have patched cards for being used in links; Feel free to use them as
-clickable items, but don't use them as buttons. For example, you can use linked
-cards as article items in a list page of blog, but don't use a card titled "Click
-Here" as an action button. Card always contains some actual data, instead of pure
-commands / verbs.
-
-
-
-
-
-
-
- Example
-
-
-
-
-
-
-
Basic Card Component
-
俱往矣,数风流人物,还看今朝。
-
-
-
Titled Card
-
Of course, cards can have a proper title.
-
-
-
-
Card with image
-
Card can comes with images. Make sure you have proper class set.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Markup: components/card/card.html
-
- <div class="hola-card-stack" style="max-width: 300px">
- <div class="hola-card">
- <p>Basic Card Component</p>
- <p>俱往矣,数风流人物,还看今朝。</p>
- </div>
- <div class="hola-card">
- <h2 class="hola-card-title">Titled Card</h2>
- <p>Of course, cards can have a proper title.</p>
- </div>
- <div class="hola-card hola-card-with-image">
- <img src="https://source.unsplash.com/featured/?head" alt="Photo from Unsplash" class="hola-image">
- <h2 class="hola-card-title">Card with image</h2>
- <p>Card can comes with images. Make sure you have proper class set.</p>
- </div>
- <div class="hola-card hola-card-full-image">
- <img src="https://source.unsplash.com/featured/?sky" alt="Photo from Unsplash" class="hola-image">
- </div>
-</div>
-
-
-
-
- Source: components/card/card.css
, line 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/styleguide/item-components-cards-stacks.html b/styleguide/item-components-cards-stacks.html
deleted file mode 100644
index 27f42d9..0000000
--- a/styleguide/item-components-cards-stacks.html
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
-
-
- HolaKit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Toggle example guides
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Toggle HTML markup
-
-
-
-
-
-
-
-
-
You have seen this in the basic section. But card stacks are more than a container
-of cards.
-
We have card stack titles to name the whole stack of cards, and they can be in
-both light and dark versions. In most cases you use dark versions, but in case
-you're using our hero component, you may need to set the first stack title to
-light version to match the dark blue extended hero background. Things can be much
-different when you're using a picture for heros, or a custom primary color. Try
-both color version to decide which suits best.
-
Card stacks can be used in combination with columns, and we automatically handle
-card margins to have correct shadow rendering - browsers wraps not only content
-but also any display effect applied to content in columns. Be aware, currently we
-only support using card stack columns directly under hola-container
.
-
-
-
-
-
-
-
- Example
-
-
-
-
-
-
Stack Title Light
-
-
-
Stack Title
-
-
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum, sequi.
-
Praesentium odio, voluptate nihil dolore repellat, aperiam quae adipisci numquam.
-
Saepe sequi iste neque, voluptatum quidem ducimus placeat obcaecati eum.
-
-
-
-
-
-
-
-
-
- Markup: components/card/stack.html
-
- <div style="background: #3498db; padding: 2rem;">
- <h3 class="hola-card-stack-title hola-card-stack-title-light">Stack Title Light</h3>
-</div>
-
-<h3 class="hola-card-stack-title">Stack Title</h3>
-<div class="hola-card-stack" style="max-width: 300px">
- <div class="hola-card">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laborum, sequi.</div>
- <div class="hola-card">Praesentium odio, voluptate nihil dolore repellat, aperiam quae adipisci numquam.</div>
- <div class="hola-card">Saepe sequi iste neque, voluptatum quidem ducimus placeat obcaecati eum.</div>
-</div>
-
-
-
-
- Source: components/card/stack.css
, line 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/styleguide/item-components-cards.html b/styleguide/item-components-cards.html
deleted file mode 100644
index dab0192..0000000
--- a/styleguide/item-components-cards.html
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
- HolaKit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Cards are the basic content blocks in HolaKit. You will be using it in most cases
-you need to host some content.
-
-
-
-
-
-
-
- Source: components/card/index.css
, line 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/styleguide/item-components-info-sheet.html b/styleguide/item-components-info-sheet.html
deleted file mode 100644
index 0d8640d..0000000
--- a/styleguide/item-components-info-sheet.html
+++ /dev/null
@@ -1,179 +0,0 @@
-
-
-
-
- HolaKit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Example
-
-
-
-
-
-
-
-
手机号码
-
+1 (555) 555 5555
-
-
-
备注
-
并不住在美国,但是用着一个美国手机号。他是 Holakit 的最初作者及维护者,常常诈尸。
-
-
-
-
-
-
-
-
-
- Markup: components/infosheet.html
-
- <div class="hola-infosheet">
- <div class="hola-infosheet-row">
- <span class="hola-infosheet-key">用户名</span>
- <p class="hola-infosheet-value">laosb</p>
- </div>
- <div class="hola-infosheet-row">
- <span class="hola-infosheet-key">手机号码</span>
- <p class="hola-infosheet-value">+1 (555) 555 5555</p>
- </div>
- <div class="hola-infosheet-row">
- <span class="hola-infosheet-key">备注</span>
- <p class="hola-infosheet-value">并不住在美国,但是用着一个美国手机号。他是 Holakit 的最初作者及维护者,常常诈尸。</p>
- </div>
-</div>
-
-
-
- Source: components/infosheet.css
, line 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/styleguide/item-components.html b/styleguide/item-components.html
deleted file mode 100644
index 8981b03..0000000
--- a/styleguide/item-components.html
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
-
- HolaKit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/styleguide/kss-assets/WARNING.txt b/styleguide/kss-assets/WARNING.txt
deleted file mode 100644
index 644e75e..0000000
--- a/styleguide/kss-assets/WARNING.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-WARNING: This folder is deleted and re-recreated each time the style guide is
-built. Do NOT put your own files in this folder.
diff --git a/styleguide/kss-assets/github-fork--black.png b/styleguide/kss-assets/github-fork--black.png
deleted file mode 100644
index 146ef8a..0000000
Binary files a/styleguide/kss-assets/github-fork--black.png and /dev/null differ
diff --git a/styleguide/kss-assets/kss-fullscreen.js b/styleguide/kss-assets/kss-fullscreen.js
deleted file mode 100644
index ca932d0..0000000
--- a/styleguide/kss-assets/kss-fullscreen.js
+++ /dev/null
@@ -1,59 +0,0 @@
-(function (window, document) {
- 'use strict';
-
- // Set the configuration values on object creation.
- // - idPrefix: The string that uniquely prefixes the ID of all elements that
- // can receive the fullscreen focus.
- // - bodyClass: The class that is set on the body element when the fullscreen
- // mode is toggled on.
- // - elementClass: the class that is set on the element that is receiving the
- // fullscreen focus.
- var KssFullScreen = function (config) {
- this.idPrefix = config.idPrefix || 'kss-fullscreen-';
- this.bodyClass = config.bodyClass || 'kss-fullscreen-mode';
- this.elementClass = config.elementClass || 'is-fullscreen';
-
- this.init();
- };
-
- // Initialize the page to see if the fullscreen mode should be immediately
- // turned on.
- KssFullScreen.prototype.init = function () {
- // Check the location hash to see if it matches the idPrefix.
- if (window.location.hash.slice(0, this.idPrefix.length + 1) === '#' + this.idPrefix) {
- this.setFocus(window.location.hash.slice(1 + this.idPrefix.length));
- }
-
- var self = this;
- // Initialize all fullscreen toggle buttons.
- document.querySelectorAll('a[data-kss-fullscreen]').forEach(function (button) {
- // Get the section reference from the data attribute.
- button.onclick = self.setFocus.bind(self, button.dataset.kssFullscreen);
- });
- };
-
- // Activation function that takes the ID of the element that will receive
- // fullscreen focus.
- KssFullScreen.prototype.setFocus = function (id) {
- var el;
-
- // Find the element with the given ID and start fullscreen mode.
- if (el = document.getElementById(id)) {
- el.classList.toggle('is-fullscreen');
- document.body.classList.toggle('kss-fullscreen-mode');
-
- // When enabling the focus mode, change the location hash.
- if (el.classList.contains('is-fullscreen')) {
- window.location.hash = '#' + this.idPrefix + id;
- // Don't follow the link location.
- return false;
- }
- }
-
- return true;
- };
-
- // Export to DOM global space.
- window.KssFullScreen = KssFullScreen;
-
-})(window, document);
diff --git a/styleguide/kss-assets/kss-guides.js b/styleguide/kss-assets/kss-guides.js
deleted file mode 100644
index 4806ca4..0000000
--- a/styleguide/kss-assets/kss-guides.js
+++ /dev/null
@@ -1,26 +0,0 @@
-(function (window, document) {
- 'use strict';
-
- var KssGuides = function (config) {
- this.bodyClass = config.bodyClass || 'kss-guides-mode';
-
- this.init();
- };
-
- KssGuides.prototype.init = function () {
- var self = this;
- // Initialize all guides toggle buttons.
- document.querySelectorAll('a[data-kss-guides]').forEach(function (el) {
- el.onclick = self.showGuides.bind(self);
- });
- };
-
- // Toggle the guides mode.
- KssGuides.prototype.showGuides = function () {
- document.getElementsByTagName('body')[0].classList.toggle(this.bodyClass);
- };
-
- // Export to DOM global space.
- window.KssGuides = KssGuides;
-
-})(window, document);
diff --git a/styleguide/kss-assets/kss-markup.js b/styleguide/kss-assets/kss-markup.js
deleted file mode 100644
index 6e11ff6..0000000
--- a/styleguide/kss-assets/kss-markup.js
+++ /dev/null
@@ -1,40 +0,0 @@
-(function (window, document) {
- 'use strict';
-
- var KssMarkup = function (config) {
- this.bodyClass = config.bodyClass || 'kss-markup-mode';
- this.detailsClass = config.detailsClass || 'kss-markup';
-
- this.init();
- };
-
- KssMarkup.prototype.init = function () {
- var self = this;
- // Initialize all markup toggle buttons.
- document.querySelectorAll('a[data-kss-markup]').forEach(function (el) {
- el.onclick = self.showGuides.bind(self);
- });
- };
-
- // Activation function that takes the ID of the element that will receive
- // fullscreen focus.
- KssMarkup.prototype.showGuides = function () {
- var body = document.getElementsByTagName('body')[0],
- enabled = body.classList.contains(this.bodyClass);
-
- document.querySelectorAll('.' + this.detailsClass).forEach(function (el) {
- if (enabled) {
- el.removeAttribute('open');
- } else {
- el.setAttribute('open', '');
- }
- });
-
- // Toggle the markup mode.
- body.classList.toggle(this.bodyClass);
- };
-
- // Export to DOM global space.
- window.KssMarkup = KssMarkup;
-
-})(window, document);
diff --git a/styleguide/kss-assets/kss.css b/styleguide/kss-assets/kss.css
deleted file mode 100644
index ec4c362..0000000
--- a/styleguide/kss-assets/kss.css
+++ /dev/null
@@ -1 +0,0 @@
-.kss-style{color:#444;font-family:Helvetica,"Helvetica Neue",Arial,sans-serif;font-size:16px;line-height:24px}.kss-style a{color:#0645ad;text-decoration:none;transition-property:color;transition-duration:0.5s}.kss-style a:visited{color:#0645ad}.kss-style a:hover,.kss-style a:focus{color:#2272f7}.kss-style a:active{color:#faa700}.kss-style a:hover,.kss-style a:active{outline:0}.kss-style p{margin:12px 0 24px 0}.kss-style h1,.kss-style h2,.kss-style h3,.kss-style h4,.kss-style h5,.kss-style h6{margin:24px 0 0 0;font-family:Helvetica,"Helvetica Neue",Arial,sans-serif;color:#111;line-height:1.15em}.kss-style h4,.kss-style h5,.kss-style h6{font-weight:bold}.kss-style h1{font-size:40px}.kss-style h2{font-size:36px}.kss-style h3{font-size:34px}.kss-style h4{font-size:32px}.kss-style h5{font-size:30px}.kss-style h6{font-size:28px}.kss-style blockquote{color:#666;margin:0;padding-left:24px;border-left:0.5em #d9d9d9 solid}.kss-style hr{display:block;height:2px;border:0;border-top:1px solid #ddd;border-bottom:1px solid #e6e6e6;margin:24px 0;padding:0}.kss-style pre,.kss-style code,.kss-style kbd,.kss-style samp{font-family:Menlo,"Ubuntu Mono","Lucida Console","Courier New",Courier,monospace;color:#2b2b2b;font-size:1em}.kss-style pre{white-space:pre;overflow:scroll}.kss-style ins{color:#111;background:#ff9;text-decoration:none}.kss-style mark{color:#111;background:#ff0;font-weight:bold}.kss-style sub,.kss-style sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.kss-style sup{top:-0.5em}.kss-style sub{bottom:-0.25em}.kss-style ul,.kss-style ol{margin:24px 0;padding:0 0 0 24px}.kss-style li p:last-child{margin:0}.kss-style dd{margin:0 0 0 24px}.kss-style img{max-width:100%;border:0;-ms-interpolation-mode:bicubic;vertical-align:middle}.kss-style table{border-collapse:collapse;border-spacing:0}.kss-style td{vertical-align:top}@media print{.kss-style a,.kss-style a:visited{text-decoration:underline}.kss-style hr{height:1px;border:0;border-bottom:1px solid black}.kss-style a[href]:after{content:" (" attr(href) ")"}.kss-style a[href^="javascript:"]:after,.kss-style a[href^="#"]:after{content:""}.kss-style abbr[title]:after{content:" (" attr(title) ")"}.kss-style pre,.kss-style blockquote{border:1px solid #999;padding-right:1em;page-break-inside:avoid}.kss-style tr,.kss-style img{page-break-inside:avoid}.kss-style img{max-width:100% !important}.kss-style p,.kss-style h2,.kss-style h3{orphans:3;widows:3}.kss-style h2,.kss-style h3{page-break-after:avoid}}#kss-node{margin:0;padding:20px;background:#fff}#kss-node.kss-fullscreen-mode .kss-sidebar,#kss-node.kss-fullscreen-mode .kss-section:not(.is-fullscreen),#kss-node.kss-fullscreen-mode .kss-github{display:none}@media screen and (min-width: 769px){#kss-node{padding:0}#kss-node .kss-main,#kss-node .kss-sidebar{float:left;margin-right:-100%;box-sizing:border-box}}#kss-node .kss-main{width:100%;margin:0 auto}@media screen and (min-width: 769px){#kss-node .kss-main{width:80%;margin-left:20%;padding:0 20px 0 30px}}#kss-node .kss-sidebar{border-bottom:1px solid #ddd}@media screen and (min-width: 769px){#kss-node .kss-sidebar{position:fixed;width:20%;height:100%;overflow:auto;padding:0 10px 0 20px;border-bottom:0;background-image:url(noise-low.png),-ms-radial-gradient(#fff, #eee);background-image:url(noise-low.png),-o-radial-gradient(#fff, #eee);background-image:url(noise-low.png),-webkit-radial-gradient(#fff, #eee);background-image:url(noise-low.png),radial-gradient(#fff, #eee);box-shadow:inset -10px 0 10px -10px rgba(0,0,0,0.7)}}#kss-node .kss-doc-title{margin:0}@media screen and (min-width: 769px){#kss-node .kss-doc-title{font-size:1.5em}}@media screen and (min-width: 769px){#kss-node .kss-header,#kss-node .kss-nav{margin-top:2em}}#kss-node .kss-nav__menu{margin-top:12px;margin-bottom:12px;padding:0;list-style-type:none}#kss-node .kss-nav__menu-item{display:inline-block;padding-right:24px}@media screen and (min-width: 769px){#kss-node .kss-nav__menu-item{display:list-item;padding-right:0}}#kss-node .kss-nav__menu-link{position:relative;display:inline-block}@media screen and (min-width: 769px){#kss-node .kss-nav__menu-link:before{content:' ';position:absolute;left:-20px;width:0;height:100%;background-color:transparent}}#kss-node .kss-nav__menu-link.is-in-viewport:before{background-color:#000;width:5px;transition:background-color .4s, width .6s}#kss-node .kss-nav__menu-child{display:none}@media screen and (min-width: 769px){#kss-node .kss-nav__menu-child{display:block;list-style-type:none;margin:0;padding:0}#kss-node .kss-nav__menu-child li:first-child{margin-top:10px;border-top:1px solid #ccc;padding:10px 0 0}#kss-node .kss-nav__menu-child li:last-child{margin-bottom:10px;border-bottom:1px solid #ccc;padding:0 0 10px}}#kss-node .kss-nav__ref{color:#333;font-weight:bold}#kss-node .kss-nav__ref:after{content:' '}#kss-node .kss-nav__ref-child{font-weight:normal}#kss-node .kss-section{margin-bottom:48px}#kss-node .kss-section.is-fullscreen{position:fixed !important;top:0 !important;left:0 !important;right:0 !important;bottom:0 !important;width:100% !important;height:100% !important;margin:0 !important;min-width:0 !important;max-width:none !important;min-height:0 !important;max-height:none !important;box-sizing:border-box !important;object-fit:contain !important;transform:none !important;overflow:auto !important;padding:20px}#kss-node .kss-title{margin-bottom:0}#kss-node .is-fullscreen .kss-title{margin-top:0}#kss-node .kss-title__ref{display:block;font-size:16px;line-height:16px;color:#666}#kss-node .kss-title__ref:before{content:'Section '}#kss-node .kss-title__permalink{display:block;color:#000;text-decoration:none}#kss-node .kss-title__permalink:hover,#kss-node .kss-title__permalink:focus,#kss-node .kss-title__permalink:active{color:#0645ad}@media screen and (min-width: 607px){#kss-node .kss-title__permalink:hover .kss-title__permalink-hash,#kss-node .kss-title__permalink:focus .kss-title__permalink-hash,#kss-node .kss-title__permalink:active .kss-title__permalink-hash{display:inline}}#kss-node .kss-title__permalink-hash{display:none;color:#ccc}#kss-node .kss-toolbar{margin:6px 0 24px;display:inline-block;border:1px solid #eee;background-color:#f9f9f9;border-right-color:#e0e0e0;border-bottom-color:#e0e0e0;line-height:1;padding:3px}#kss-node .kss-toolbar a{box-sizing:content-box;display:inline-block;width:16px;height:16px;padding:3px;vertical-align:top;position:relative;overflow:visible}#kss-node .kss-toolbar a+a{margin-left:6px}#kss-node .kss-toolbar a .kss-toolbar__icon-fill{fill:#ccc}#kss-node .kss-toolbar a svg.on{display:none}#kss-node .kss-toolbar a:focus,#kss-node .kss-toolbar a:hover{border-color:#000}#kss-node .kss-toolbar a:focus .kss-toolbar__icon-fill,#kss-node .kss-toolbar a:hover .kss-toolbar__icon-fill{fill:#000}#kss-node .kss-toolbar__tooltip{position:absolute;z-index:1;display:inline-block;bottom:100%;left:-10px;margin-bottom:5px;border:solid 1px #666;padding:8px 10px 6px;box-shadow:2px 2px 2px rgba(0,0,0,0.25);white-space:nowrap;color:#000;background:#fff;cursor:help;opacity:0;transition:opacity 0.25s;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);word-wrap:normal}#kss-node .kss-toolbar__tooltip:before,#kss-node .kss-toolbar__tooltip:after{content:'';position:absolute;bottom:-8px;left:15px;width:0;height:0;border-width:7px 5px 0;border-color:#666 transparent;border-style:solid}#kss-node .kss-toolbar__tooltip:after{bottom:-6px;border-top-color:#fff}#kss-node a:focus>.kss-toolbar__tooltip,#kss-node a:hover>.kss-toolbar__tooltip{opacity:1;clip:auto;height:auto;width:auto;overflow:visible}#kss-node .is-fullscreen .kss-toolbar a[data-kss-fullscreen],#kss-node.kss-guides-mode .kss-toolbar a[data-kss-guides],#kss-node.kss-markup-mode .kss-toolbar a[data-kss-markup]{border-color:#666;background-color:#666}#kss-node .is-fullscreen .kss-toolbar a[data-kss-fullscreen] .kss-toolbar__icon-fill,#kss-node.kss-guides-mode .kss-toolbar a[data-kss-guides] .kss-toolbar__icon-fill,#kss-node.kss-markup-mode .kss-toolbar a[data-kss-markup] .kss-toolbar__icon-fill{fill:#fff}#kss-node .is-fullscreen .kss-toolbar a[data-kss-fullscreen] svg.on,#kss-node.kss-guides-mode .kss-toolbar a[data-kss-guides] svg.on,#kss-node.kss-markup-mode .kss-toolbar a[data-kss-markup] svg.on{display:block}#kss-node .is-fullscreen .kss-toolbar a[data-kss-fullscreen] svg.off,#kss-node.kss-guides-mode .kss-toolbar a[data-kss-guides] svg.off,#kss-node.kss-markup-mode .kss-toolbar a[data-kss-markup] svg.off{display:none}#kss-node .kss-parameters{display:table;list-style-type:none;margin-top:0;margin-left:0;padding-left:0}#kss-node .kss-parameters__title{font-weight:bold}#kss-node .kss-parameters__item{display:table-row}#kss-node .kss-parameters__name{display:table-cell;padding-right:20px;white-space:nowrap}#kss-node .kss-parameters__description{display:table-cell}#kss-node .kss-parameters__default-value code{white-space:nowrap}#kss-node .kss-modifier__wrapper{border:1px solid #ccc;padding:0 10px 10px}#kss-node .is-fullscreen .kss-modifier__wrapper{margin-left:-20px;margin-right:-20px;padding-left:0;padding-right:0;border:none}#kss-node .kss-modifier__heading{margin:0 -10px 10px -10px;padding:10px;border-bottom:1px solid #ccc;background-color:#eee;font-weight:bold}#kss-node .is-fullscreen .kss-modifier__heading{margin:0 20px 10px;border:1px solid #ccc}#kss-node .kss-modifier__default-name{font-weight:bold;margin-bottom:12px}#kss-node .is-fullscreen .kss-modifier__default-name{margin-left:20px;margin-right:20px}#kss-node .kss-modifier__name{float:left;padding-right:10px;font-weight:bold}#kss-node .is-fullscreen .kss-modifier__name{margin-left:20px}#kss-node .kss-modifier__description{margin-bottom:12px}#kss-node .is-fullscreen .kss-modifier__description{margin-right:20px}#kss-node .kss-modifier__example{clear:left;border:2px dashed transparent;position:relative;z-index:0;margin:-2px -2px 22px}#kss-node .kss-modifier__example:last-child{margin-bottom:0}#kss-node.kss-guides-mode .kss-modifier__example:before,#kss-node.kss-guides-mode .kss-modifier__example:after,#kss-node.kss-guides-mode .kss-modifier__example-footer:before,#kss-node.kss-guides-mode .kss-modifier__example-footer:after{z-index:-1;box-sizing:border-box;content:'';position:absolute;width:5px;height:5px;border:2px solid #000}#kss-node.kss-guides-mode .kss-modifier__example{border-color:#000}#kss-node.kss-guides-mode .kss-modifier__example:before{top:-5px;left:-5px;border-top:0;border-left:0}#kss-node.kss-guides-mode .kss-modifier__example:after{top:-5px;right:-5px;border-top:0;border-right:0}#kss-node.kss-guides-mode.kss-fullscreen-mode .kss-modifier__example:before{left:auto;right:0}#kss-node.kss-guides-mode.kss-fullscreen-mode .kss-modifier__example:after{right:auto;left:0}#kss-node .kss-modifier__example-footer{clear:both}#kss-node.kss-guides-mode .kss-modifier__example-footer:before{bottom:-5px;left:-5px;border-bottom:0;border-left:0}#kss-node.kss-guides-mode .kss-modifier__example-footer:after{bottom:-5px;right:-5px;border-right:0;border-bottom:0}#kss-node.kss-guides-mode.kss-fullscreen-mode .kss-modifier__example-footer:before{left:auto;right:0}#kss-node.kss-guides-mode.kss-fullscreen-mode .kss-modifier__example-footer:after{right:auto;left:0}#kss-node .kss-markup{margin:24px 0;border:1px solid #ccc}#kss-node .kss-markup[open] summary{border-bottom:1px solid #ccc;margin-bottom:3px}#kss-node .kss-markup summary{padding-left:10px}#kss-node .kss-markup pre{margin:0}#kss-node .kss-source{font-size:80%}#kss-node .kss-github{display:none}@media screen and (min-width: 501px){#kss-node .kss-github{display:block;position:absolute;top:0;right:0}}#kss-node .kss-github img{border:0}#kss-node .pln{color:#000}#kss-node .str{color:#080}#kss-node .kwd{color:#008}#kss-node .com{color:#800}#kss-node .typ{color:#606}#kss-node .lit{color:#066}#kss-node .pun,#kss-node .opn,#kss-node .clo{color:#660}#kss-node .tag{color:#008}#kss-node .atn{color:#606}#kss-node .atv{color:#080}#kss-node .dec,#kss-node .var{color:#606}#kss-node .fun{color:red}@media print, projection{#kss-node .str{color:#060}#kss-node .kwd{color:#006;font-weight:bold}#kss-node .com{color:#600;font-style:italic}#kss-node .typ{color:#404;font-weight:bold}#kss-node .lit{color:#044}#kss-node .pun,#kss-node .opn,#kss-node .clo{color:#440}#kss-node .tag{color:#006;font-weight:bold}#kss-node .atn{color:#404}#kss-node .atv{color:#060}}#kss-node ol.linenums{margin:0;padding:0 0 3px 0;list-style-type:none}#kss-node ol.linenums li{min-height:24px;border-bottom:1px solid #eee;padding:0 10px;background:#fff}#kss-node ol.linenums li:first-child{padding-top:3px}#kss-node ol.linenums li.L0,#kss-node ol.linenums li.L2,#kss-node ol.linenums li.L4,#kss-node ol.linenums li.L6,#kss-node ol.linenums li.L8{background:#fcfcfc}
diff --git a/styleguide/kss-assets/kss.js b/styleguide/kss-assets/kss.js
deleted file mode 100644
index 9523bf2..0000000
--- a/styleguide/kss-assets/kss.js
+++ /dev/null
@@ -1,53 +0,0 @@
-(function() {
- var KssStateGenerator;
-
- KssStateGenerator = (function() {
- var pseudo_selectors;
-
- pseudo_selectors = ['hover', 'enabled', 'disabled', 'active', 'visited', 'focus', 'target', 'checked', 'empty', 'first-of-type', 'last-of-type', 'first-child', 'last-child'];
-
- function KssStateGenerator() {
- var idx, idxs, pseudos, replaceRule, rule, stylesheet, _i, _len, _len2, _ref, _ref2;
- pseudos = new RegExp("(\\:" + (pseudo_selectors.join('|\\:')) + ")", "g");
- try {
- _ref = document.styleSheets;
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- stylesheet = _ref[_i];
- if (stylesheet.href && stylesheet.href.indexOf(document.domain) >= 0) {
- idxs = [];
- _ref2 = stylesheet.cssRules;
- for (idx = 0, _len2 = _ref2.length; idx < _len2; idx++) {
- rule = _ref2[idx];
- if ((rule.type === CSSRule.STYLE_RULE) && pseudos.test(rule.selectorText)) {
- replaceRule = function(matched, stuff) {
- return matched.replace(/\:/g, '.pseudo-class-');
- };
- this.insertRule(rule.cssText.replace(pseudos, replaceRule));
- }
- pseudos.lastIndex = 0;
- }
- }
- }
- } catch (_error) {}
- }
-
- KssStateGenerator.prototype.insertRule = function(rule) {
- var headEl, styleEl;
- headEl = document.getElementsByTagName('head')[0];
- styleEl = document.createElement('style');
- styleEl.type = 'text/css';
- if (styleEl.styleSheet) {
- styleEl.styleSheet.cssText = rule;
- } else {
- styleEl.appendChild(document.createTextNode(rule));
- }
- return headEl.appendChild(styleEl);
- };
-
- return KssStateGenerator;
-
- })();
-
- new KssStateGenerator;
-
-}).call(this);
diff --git a/styleguide/kss-assets/kss.scss b/styleguide/kss-assets/kss.scss
deleted file mode 100644
index 7e791ea..0000000
--- a/styleguide/kss-assets/kss.scss
+++ /dev/null
@@ -1,745 +0,0 @@
-// ------------------------------------------------------------------------------
-// Variables - Colors, Fonts, etc.
-// ------------------------------------------------------------------------------
-$kss-colors-background : #fff;
-
-$kss-colors-foreground : #444;
-$kss-colors-heading : #111;
-$kss-colors-quotes : #666;
-
-$kss-colors-link : #0645ad;
-$kss-colors-link-visited : #0645ad;
-$kss-colors-link-hover : lighten($kss-colors-link, 20%);
-$kss-colors-link-active : #faa700;
-
-$kss-font-body : Helvetica, 'Helvetica Neue', Arial, sans-serif;
-$kss-font-code : Menlo, 'Ubuntu Mono', 'Lucida Console', 'Courier New', Courier, monospace;
-
-$kss-font-size : 16px;
-$kss-vertical-rhythm : $kss-font-size * 1.5;
-
-// ------------------------------------------------------------------------------
-// Wrap all of this builder's base HTML styling inside a .kss-style selector.
-// ------------------------------------------------------------------------------
-
-.kss-style {
- color: $kss-colors-foreground;
- font-family: $kss-font-body;
- font-size: $kss-font-size;
- line-height: $kss-vertical-rhythm;
-
- a {
- color: $kss-colors-link;
- text-decoration: none;
- transition-property: color;
- transition-duration: 0.5s;
-
- &:visited { color: $kss-colors-link-visited; }
- &:hover,
- &:focus { color: $kss-colors-link-hover; }
- &:active { color: $kss-colors-link-active; }
-
- &:hover,
- &:active {
- outline: 0;
- }
- }
-
- p {
- margin: ($kss-vertical-rhythm/2) 0 $kss-vertical-rhythm 0;
- }
-
- h1, h2, h3, h4, h5, h6 {
- margin: $kss-vertical-rhythm 0 0 0;
- font-family: $kss-font-body;
- color: $kss-colors-heading;
- line-height: 1.15em;
- }
-
- h4, h5, h6 {
- font-weight: bold;
- }
-
- h1 { font-size: $kss-font-size * 2.5; }
- h2 { font-size: $kss-font-size * 2.25; }
- h3 { font-size: $kss-font-size * 2.125; }
- h4 { font-size: $kss-font-size * 2; }
- h5 { font-size: $kss-font-size * 1.875; }
- h6 { font-size: $kss-font-size * 1.75; }
-
- blockquote {
- color: $kss-colors-quotes;
- margin: 0;
- padding-left: $kss-vertical-rhythm;
- border-left: 0.5em mix($kss-colors-quotes, $kss-colors-background, 25%) solid;
- }
-
- hr {
- display: block;
- height: 2px;
- border: 0;
- border-top: 1px solid lighten($kss-colors-foreground, 60%);
- border-bottom: 1px solid darken($kss-colors-background, 10%);
- margin: $kss-vertical-rhythm 0;
- padding: 0;
- }
-
- pre, code, kbd, samp {
- font-family: $kss-font-code;
- color: mix($kss-colors-foreground, $kss-colors-heading, 50%);
- font-size: 1em;
- }
-
- pre {
- white-space: pre;
- overflow: scroll;
- }
-
- ins {
- color: $kss-colors-heading;
- background: #ff9;
- text-decoration: none;
- }
-
- mark {
- color: $kss-colors-heading;
- background: #ff0;
- font-weight: bold;
- }
-
- sub, sup {
- font-size: 75%;
- line-height: 0;
- position: relative;
- vertical-align: baseline;
- }
- sup { top: -0.5em; }
- sub { bottom: -0.25em; }
-
- ul, ol {
- margin: $kss-vertical-rhythm 0;
- padding: 0 0 0 $kss-vertical-rhythm;
- }
- li p:last-child {
- margin: 0;
- }
- dd {
- margin: 0 0 0 $kss-vertical-rhythm;
- }
-
- img {
- max-width:100%;
- border: 0;
- -ms-interpolation-mode: bicubic;
- vertical-align: middle;
- }
-
- table {
- border-collapse: collapse;
- border-spacing: 0;
- }
- td {
- vertical-align: top;
- }
-
- @media print {
- a, a:visited { text-decoration: underline; }
- hr { height: 1px; border:0; border-bottom:1px solid black; }
- a[href]:after { content: " (" attr(href) ")"; }
- a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
- abbr[title]:after { content: " (" attr(title) ")"; }
- pre, blockquote { border: 1px solid #999; padding-right: 1em; page-break-inside: avoid; }
- tr, img { page-break-inside: avoid; }
- img { max-width: 100% !important; }
- p, h2, h3 { orphans: 3; widows: 3; }
- h2, h3 { page-break-after: avoid; }
- }
-}
-
-// ------------------------------------------------------------------------------
-// Layout and page background
-// ------------------------------------------------------------------------------
-
-#kss-node {
- margin: 0;
- padding: 20px;
- background: #fff;
-
- &.kss-fullscreen-mode {
- .kss-sidebar,
- .kss-section:not(.is-fullscreen),
- .kss-github {
- display: none;
- }
- }
-
- @media screen and (min-width: 769px) {
- padding: 0;
-
- .kss-main,
- .kss-sidebar {
- float: left;
- margin-right: -100%;
- box-sizing: border-box;
- }
- }
-
- .kss-main {
- width: 100%;
- margin: 0 auto;
-
- @media screen and (min-width: 769px) {
- width: 80%;
- margin-left: 20%;
- padding: 0 20px 0 30px;
- }
- }
-
- .kss-sidebar {
- border-bottom:1px solid #ddd;
-
- @media screen and (min-width: 769px) {
- position: fixed;
- width: 20%;
- height: 100%;
- overflow: auto;
- padding: 0 10px 0 20px;
- border-bottom: 0;
- background-image: url(noise-low.png), -ms-radial-gradient(#fff, #eee);
- background-image: url(noise-low.png), -o-radial-gradient(#fff, #eee);
- background-image: url(noise-low.png), -webkit-radial-gradient(#fff, #eee);
- background-image: url(noise-low.png), radial-gradient(#fff, #eee);
- box-shadow: inset -10px 0 10px -10px rgba(0,0,0,0.7);
- }
- }
-}
-
-// ------------------------------------------------------------------------------
-// Sidebar-area components
-// ------------------------------------------------------------------------------
-
-#kss-node {
-
- .kss-doc-title {
- margin: 0;
-
- @media screen and (min-width: 769px) {
- font-size: 1.5em;
- }
- }
-
- .kss-header,
- .kss-nav {
- @media screen and (min-width: 769px) {
- margin-top: 2em;
- }
- }
-
- .kss-nav__menu {
- margin-top: ($kss-vertical-rhythm/2);
- margin-bottom: ($kss-vertical-rhythm/2);
- padding: 0;
- list-style-type: none;
- }
-
- .kss-nav__menu-item {
- display: inline-block;
- padding-right: $kss-vertical-rhythm;
-
- @media screen and (min-width: 769px) {
- display: list-item;
- padding-right: 0;
- }
- }
-
- .kss-nav__menu-link {
- position: relative;
- display: inline-block;
-
- &:before {
- @media screen and (min-width: 769px) {
- content: ' ';
- position: absolute;
- left: -20px;
- width: 0;
- height: 100%;
- background-color: rgba(#000, 0);
- }
- }
-
- &.is-in-viewport:before {
- background-color: #000;
- width: 5px;
- transition: background-color .4s, width .6s;
- }
- }
-
- .kss-nav__menu-child {
- display: none;
-
- @media screen and (min-width: 769px) {
- display: block;
- list-style-type: none;
- margin: 0;
- padding: 0;
-
- // @TODO: The ul is output even when there are no children. Fix this, so
- // we can put these :first-child and :last child styles back on the ul.
- li:first-child {
- margin-top: 10px;
- border-top: 1px solid #ccc;
- padding: 10px 0 0;
- }
-
- li:last-child {
- margin-bottom: 10px;
- border-bottom: 1px solid #ccc;
- padding: 0 0 10px;
- }
- }
- }
-
- .kss-nav__ref {
- color: #333;
- font-weight: bold;
-
- &:after {
- content: ' ';
- }
- }
- .kss-nav__ref-child {
- font-weight: normal;
- }
-}
-
-// ------------------------------------------------------------------------------
-// Content-area components
-// ------------------------------------------------------------------------------
-
-#kss-node {
-
- .kss-section {
- margin-bottom: ($kss-vertical-rhythm * 2);
-
- // "fullscreen" styles copied from Mozilla's default stylesheet.
- &.is-fullscreen {
- position: fixed !important;
- top: 0 !important;
- left: 0 !important;
- right: 0 !important;
- bottom: 0 !important;
- width: 100% !important;
- height: 100% !important;
- margin: 0 !important;
- min-width: 0 !important;
- max-width: none !important;
- min-height: 0 !important;
- max-height: none !important;
- box-sizing: border-box !important;
- object-fit: contain !important;
- transform: none !important;
- // Turn on scrolling if needed.
- overflow: auto !important;
- padding: 20px;
- }
- }
-
- .kss-title {
- margin-bottom: 0;
- }
- .is-fullscreen .kss-title {
- margin-top: 0;
- }
- .kss-title__ref {
- display: block;
- font-size: $kss-font-size;
- line-height: $kss-font-size;
- color: #666;
-
- &:before {
- content: 'Section ';
- }
- }
- .kss-title__permalink {
- display: block;
- color: #000;
- text-decoration: none;
-
- &:hover,
- &:focus,
- &:active {
- color: $kss-colors-link;
-
- @media screen and (min-width: 607px) {
- .kss-title__permalink-hash {
- display: inline;
- }
- }
- }
- }
- .kss-title__permalink-hash {
- display: none;
- color: #ccc;
- }
-
- .kss-toolbar {
- margin: 6px 0 24px;
- display: inline-block;
- border: 1px solid #eee;
- background-color: #f9f9f9;
- border-right-color: #e0e0e0;
- border-bottom-color: #e0e0e0;
- line-height: 1;
- padding: 3px;
-
- a {
- box-sizing: content-box;
- display: inline-block;
- width: 16px;
- height: 16px;
- padding: 3px;
- vertical-align: top;
- // Tooltip wrapper styles:
- position: relative;
- overflow: visible;
-
- + a {
- margin-left: 6px;
- }
-
- .kss-toolbar__icon-fill {
- fill: #ccc;
- }
-
- svg.on {
- display: none;
- }
-
- &:focus,
- &:hover {
- border-color: #000;
-
- .kss-toolbar__icon-fill {
- fill: #000;
- }
- }
- }
- }
- .kss-toolbar__tooltip {
- position: absolute;
- z-index: 1;
- display: inline-block;
- bottom: 100%;
- left: -10px;
- margin-bottom: 5px;
- border: solid 1px #666;
- padding: 8px 10px 6px;
- box-shadow: 2px 2px 2px rgba(0, 0, 0, .25);
- white-space: nowrap;
- color: #000;
- background: #fff;
- cursor: help;
- opacity: 0;
- transition: opacity 0.25s;
- // Visually hidden
- height: 1px;
- width: 1px;
- overflow: hidden;
- clip: rect(1px, 1px, 1px, 1px);
- word-wrap: normal;
-
- // Solid grey triangle.
- &:before,
- &:after {
- content: '';
- position: absolute;
- bottom: -8px;
- left: 15px;
- width: 0;
- height: 0;
- border-width: 7px 5px 0;
- border-color: #666 transparent;
- border-style: solid;
- }
-
- // White triangle knock-out.
- &:after {
- bottom: -6px;
- border-top-color: #fff;
- }
- }
- a:focus,
- a:hover {
- > .kss-toolbar__tooltip {
- opacity: 1;
- // Visually hidden off
- clip: auto;
- height: auto;
- width: auto;
- overflow: visible;
- }
- }
- .is-fullscreen .kss-toolbar a[data-kss-fullscreen],
- &.kss-guides-mode .kss-toolbar a[data-kss-guides],
- &.kss-markup-mode .kss-toolbar a[data-kss-markup] {
- border-color: #666;
- background-color: #666;
-
- .kss-toolbar__icon-fill {
- fill: #fff;
- }
-
- svg.on {
- display: block;
- }
-
- svg.off {
- display: none;
- }
- }
-
- .kss-parameters {
- display: table;
- list-style-type: none;
- margin-top: 0;
- margin-left: 0;
- padding-left: 0;
- }
- .kss-parameters__title {
- font-weight: bold;
- }
- .kss-parameters__item {
- display: table-row;
- }
- .kss-parameters__name {
- display: table-cell;
- padding-right: 20px;
- white-space: nowrap;
- }
- .kss-parameters__description {
- display: table-cell;
- }
- .kss-parameters__default-value code {
- white-space: nowrap;
- }
-
- .kss-modifier__wrapper {
- border: 1px solid #ccc;
- padding: 0 10px 10px;
- }
- .is-fullscreen .kss-modifier__wrapper {
- // Un-do padding on .kss-section.
- margin-left: -20px;
- margin-right: -20px;
- // Remove all padding on the wrapper
- padding-left: 0;
- padding-right: 0;
- border: none;
- }
- .kss-modifier__heading {
- margin: 0 -10px 10px -10px;
- padding: 10px;
- border-bottom: 1px solid #ccc;
- background-color: #eee;
- font-weight: bold;
- }
- .is-fullscreen .kss-modifier__heading {
- margin: 0 20px 10px;
- border: 1px solid #ccc;
- }
- .kss-modifier__default-name {
- font-weight: bold;
- margin-bottom: ($kss-vertical-rhythm / 2);
- }
- .is-fullscreen .kss-modifier__default-name {
- margin-left: 20px;
- margin-right: 20px;
- }
- .kss-modifier__name {
- float: left;
- padding-right: 10px;
- font-weight: bold;
- }
- .is-fullscreen .kss-modifier__name {
- margin-left: 20px;
- }
- .kss-modifier__description {
- margin-bottom: ($kss-vertical-rhythm / 2);
- }
- .is-fullscreen .kss-modifier__description {
- margin-right: 20px;
- }
- .kss-modifier__example {
- clear: left;
- border: 2px dashed transparent;
- position: relative; // Contain the example's absolute positioning.
- z-index: 0; // Establishes a local stacking context.
- margin: -2px -2px ($kss-vertical-rhythm - 2px);
-
- &:last-child {
- margin-bottom: 0;
- }
- }
- &.kss-guides-mode .kss-modifier__example,
- &.kss-guides-mode .kss-modifier__example-footer {
- &:before,
- &:after {
- z-index: -1;
- box-sizing: border-box;
- content: '';
- position: absolute;
- width: 5px;
- height: 5px;
- border: 2px solid #000;
- }
- }
- &.kss-guides-mode .kss-modifier__example {
- border-color: #000;
-
- &:before {
- top: -5px;
- left: -5px;
- border-top: 0;
- border-left: 0;
- }
- &:after {
- top: -5px;
- right: -5px;
- border-top: 0;
- border-right: 0;
- }
- }
- &.kss-guides-mode.kss-fullscreen-mode .kss-modifier__example {
- &:before {
- left: auto;
- right: 0;
- }
- &:after {
- right: auto;
- left: 0;
- }
- }
- .kss-modifier__example-footer {
- clear: both;
- }
- &.kss-guides-mode .kss-modifier__example-footer {
- &:before {
- bottom: -5px;
- left: -5px;
- border-bottom: 0;
- border-left: 0;
- }
- &:after {
- bottom: -5px;
- right: -5px;
- border-right: 0;
- border-bottom: 0;
- }
- }
- &.kss-guides-mode.kss-fullscreen-mode .kss-modifier__example-footer {
- &:before {
- left: auto;
- right: 0;
- }
- &:after {
- right: auto;
- left: 0;
- }
- }
-
- .kss-markup {
- margin: $kss-vertical-rhythm 0;
- border: 1px solid #ccc;
-
- &[open] summary {
- border-bottom: 1px solid #ccc;
- margin-bottom: 3px;
- }
-
- summary {
- padding-left: 10px;
- }
-
- pre {
- margin: 0;
- }
- }
-
- .kss-source {
- font-size: 80%;
- }
-
- .kss-github {
- display:none;
-
- @media screen and (min-width: 501px) {
- display: block;
- position: absolute;
- top: 0;
- right: 0;
- }
-
- img {
- border: 0;
- }
- }
-
- // ------------------------------------------------------------------------------
- // prettify.js styles
- // ------------------------------------------------------------------------------
-
- /* SPAN elements with the classes below are added by prettyprint. */
- .pln { color: #000 } /* plain text */
-
- .str { color: #080 } /* string content */
- .kwd { color: #008 } /* a keyword */
- .com { color: #800 } /* a comment */
- .typ { color: #606 } /* a type name */
- .lit { color: #066 } /* a literal value */
- /* punctuation, lisp open bracket, lisp close bracket */
- .pun, .opn, .clo { color: #660 }
- .tag { color: #008 } /* a markup tag name */
- .atn { color: #606 } /* a markup attribute name */
- .atv { color: #080 } /* a markup attribute value */
- .dec, .var { color: #606 } /* a declaration; a variable name */
- .fun { color: red } /* a function name */
-
- /* Use higher contrast and text-weight for printable form. */
- @media print, projection {
- .str { color: #060 }
- .kwd { color: #006; font-weight: bold }
- .com { color: #600; font-style: italic }
- .typ { color: #404; font-weight: bold }
- .lit { color: #044 }
- .pun, .opn, .clo { color: #440 }
- .tag { color: #006; font-weight: bold }
- .atn { color: #404 }
- .atv { color: #060 }
- }
-
- /* Specify class=linenums on a pre to get line numbering */
- ol.linenums {
- margin: 0;
- padding: 0 0 3px 0;
- list-style-type: none;
-
- li {
- min-height: $kss-vertical-rhythm;
- border-bottom: 1px solid #eee;
- padding: 0 10px;
- background: #fff;
-
- &:first-child {
- padding-top: 3px;
- }
- }
- /* Alternate shading for lines */
- li.L0,
- li.L2,
- li.L4,
- li.L6,
- li.L8 {
- background: #fcfcfc;
- }
- }
-}
diff --git a/styleguide/kss-assets/noise-low.png b/styleguide/kss-assets/noise-low.png
deleted file mode 100644
index 105bee1..0000000
Binary files a/styleguide/kss-assets/noise-low.png and /dev/null differ
diff --git a/styleguide/kss-assets/prettify.js b/styleguide/kss-assets/prettify.js
deleted file mode 100644
index f00339e..0000000
--- a/styleguide/kss-assets/prettify.js
+++ /dev/null
@@ -1,1477 +0,0 @@
-// Copyright (C) 2006 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-/**
- * @fileoverview
- * some functions for browser-side pretty printing of code contained in html.
- *
- *
- * For a fairly comprehensive set of languages see the
- * README
- * file that came with this source. At a minimum, the lexer should work on a
- * number of languages including C and friends, Java, Python, Bash, SQL, HTML,
- * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk
- * and a subset of Perl, but, because of commenting conventions, doesn't work on
- * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class.
- *
- * Usage:
- * include this source file in an html page via
- * {@code }
- * define style rules. See the example page for examples.
- * mark the {@code } and {@code } tags in your source with
- * {@code class=prettyprint.}
- * You can also use the (html deprecated) {@code } tag, but the pretty
- * printer needs to do more substantial DOM manipulations to support that, so
- * some css styles may not be preserved.
- *
- * That's it. I wanted to keep the API as simple as possible, so there's no
- * need to specify which language the code is in, but if you wish, you can add
- * another class to the {@code } or {@code } element to specify the
- * language, as in {@code }. Any class that
- * starts with "lang-" followed by a file extension, specifies the file type.
- * See the "lang-*.js" files in this directory for code that implements
- * per-language file handlers.
- *
- * Change log:
- * cbeust, 2006/08/22
- *
- * Java annotations (start with "@") are now captured as literals ("lit")
- *
- * @requires console
- */
-
-// JSLint declarations
-/*global console, document, navigator, setTimeout, window */
-
-/**
- * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
- * UI events.
- * If set to {@code false}, {@code prettyPrint()} is synchronous.
- */
-window['PR_SHOULD_USE_CONTINUATION'] = true;
-
-(function () {
- // Keyword lists for various languages.
- // We use things that coerce to strings to make them compact when minified
- // and to defeat aggressive optimizers that fold large string constants.
- var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"];
- var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," +
- "double,enum,extern,float,goto,int,long,register,short,signed,sizeof," +
- "static,struct,switch,typedef,union,unsigned,void,volatile"];
- var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," +
- "new,operator,private,protected,public,this,throw,true,try,typeof"];
- var CPP_KEYWORDS = [COMMON_KEYWORDS,"alignof,align_union,asm,axiom,bool," +
- "concept,concept_map,const_cast,constexpr,decltype," +
- "dynamic_cast,explicit,export,friend,inline,late_check," +
- "mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast," +
- "template,typeid,typename,using,virtual,where"];
- var JAVA_KEYWORDS = [COMMON_KEYWORDS,
- "abstract,boolean,byte,extends,final,finally,implements,import," +
- "instanceof,null,native,package,strictfp,super,synchronized,throws," +
- "transient"];
- var CSHARP_KEYWORDS = [JAVA_KEYWORDS,
- "as,base,by,checked,decimal,delegate,descending,dynamic,event," +
- "fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock," +
- "object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed," +
- "stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];
- var COFFEE_KEYWORDS = "all,and,by,catch,class,else,extends,false,finally," +
- "for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then," +
- "true,try,unless,until,when,while,yes";
- var JSCRIPT_KEYWORDS = [COMMON_KEYWORDS,
- "debugger,eval,export,function,get,null,set,undefined,var,with," +
- "Infinity,NaN"];
- var PERL_KEYWORDS = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for," +
- "goto,if,import,last,local,my,next,no,our,print,package,redo,require," +
- "sub,undef,unless,until,use,wantarray,while,BEGIN,END";
- var PYTHON_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "and,as,assert,class,def,del," +
- "elif,except,exec,finally,from,global,import,in,is,lambda," +
- "nonlocal,not,or,pass,print,raise,try,with,yield," +
- "False,True,None"];
- var RUBY_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "alias,and,begin,case,class," +
- "def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo," +
- "rescue,retry,self,super,then,true,undef,unless,until,when,yield," +
- "BEGIN,END"];
- var SH_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "case,done,elif,esac,eval,fi," +
- "function,in,local,set,then,until"];
- var ALL_KEYWORDS = [
- CPP_KEYWORDS, CSHARP_KEYWORDS, JSCRIPT_KEYWORDS, PERL_KEYWORDS +
- PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
- var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;
-
- // token style names. correspond to css classes
- /**
- * token style for a string literal
- * @const
- */
- var PR_STRING = 'str';
- /**
- * token style for a keyword
- * @const
- */
- var PR_KEYWORD = 'kwd';
- /**
- * token style for a comment
- * @const
- */
- var PR_COMMENT = 'com';
- /**
- * token style for a type
- * @const
- */
- var PR_TYPE = 'typ';
- /**
- * token style for a literal value. e.g. 1, null, true.
- * @const
- */
- var PR_LITERAL = 'lit';
- /**
- * token style for a punctuation string.
- * @const
- */
- var PR_PUNCTUATION = 'pun';
- /**
- * token style for a punctuation string.
- * @const
- */
- var PR_PLAIN = 'pln';
-
- /**
- * token style for an sgml tag.
- * @const
- */
- var PR_TAG = 'tag';
- /**
- * token style for a markup declaration such as a DOCTYPE.
- * @const
- */
- var PR_DECLARATION = 'dec';
- /**
- * token style for embedded source.
- * @const
- */
- var PR_SOURCE = 'src';
- /**
- * token style for an sgml attribute name.
- * @const
- */
- var PR_ATTRIB_NAME = 'atn';
- /**
- * token style for an sgml attribute value.
- * @const
- */
- var PR_ATTRIB_VALUE = 'atv';
-
- /**
- * A class that indicates a section of markup that is not code, e.g. to allow
- * embedding of line numbers within code listings.
- * @const
- */
- var PR_NOCODE = 'nocode';
-
-
-
-/**
- * A set of tokens that can precede a regular expression literal in
- * javascript
- * http://web.archive.org/web/20070717142515/http://www.mozilla.org/js/language/js20/rationale/syntax.html
- * has the full list, but I've removed ones that might be problematic when
- * seen in languages that don't support regular expression literals.
- *
- * Specifically, I've removed any keywords that can't precede a regexp
- * literal in a syntactically legal javascript program, and I've removed the
- * "in" keyword since it's not a keyword in many languages, and might be used
- * as a count of inches.
- *
- *
The link a above does not accurately describe EcmaScript rules since
- * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
- * very well in practice.
- *
- * @private
- * @const
- */
-var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*';
-
-// CAVEAT: this does not properly handle the case where a regular
-// expression immediately follows another since a regular expression may
-// have flags for case-sensitivity and the like. Having regexp tokens
-// adjacent is not valid in any language I'm aware of, so I'm punting.
-// TODO: maybe style special characters inside a regexp as punctuation.
-
-
- /**
- * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
- * matches the union of the sets of strings matched by the input RegExp.
- * Since it matches globally, if the input strings have a start-of-input
- * anchor (/^.../), it is ignored for the purposes of unioning.
- * @param {Array.} regexs non multiline, non-global regexs.
- * @return {RegExp} a global regex.
- */
- function combinePrefixPatterns(regexs) {
- var capturedGroupIndex = 0;
-
- var needToFoldCase = false;
- var ignoreCase = false;
- for (var i = 0, n = regexs.length; i < n; ++i) {
- var regex = regexs[i];
- if (regex.ignoreCase) {
- ignoreCase = true;
- } else if (/[a-z]/i.test(regex.source.replace(
- /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
- needToFoldCase = true;
- ignoreCase = false;
- break;
- }
- }
-
- var escapeCharToCodeUnit = {
- 'b': 8,
- 't': 9,
- 'n': 0xa,
- 'v': 0xb,
- 'f': 0xc,
- 'r': 0xd
- };
-
- function decodeEscape(charsetPart) {
- var cc0 = charsetPart.charCodeAt(0);
- if (cc0 !== 92 /* \\ */) {
- return cc0;
- }
- var c1 = charsetPart.charAt(1);
- cc0 = escapeCharToCodeUnit[c1];
- if (cc0) {
- return cc0;
- } else if ('0' <= c1 && c1 <= '7') {
- return parseInt(charsetPart.substring(1), 8);
- } else if (c1 === 'u' || c1 === 'x') {
- return parseInt(charsetPart.substring(2), 16);
- } else {
- return charsetPart.charCodeAt(1);
- }
- }
-
- function encodeEscape(charCode) {
- if (charCode < 0x20) {
- return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
- }
- var ch = String.fromCharCode(charCode);
- if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
- ch = '\\' + ch;
- }
- return ch;
- }
-
- function caseFoldCharset(charSet) {
- var charsetParts = charSet.substring(1, charSet.length - 1).match(
- new RegExp(
- '\\\\u[0-9A-Fa-f]{4}'
- + '|\\\\x[0-9A-Fa-f]{2}'
- + '|\\\\[0-3][0-7]{0,2}'
- + '|\\\\[0-7]{1,2}'
- + '|\\\\[\\s\\S]'
- + '|-'
- + '|[^-\\\\]',
- 'g'));
- var groups = [];
- var ranges = [];
- var inverse = charsetParts[0] === '^';
- for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
- var p = charsetParts[i];
- if (/\\[bdsw]/i.test(p)) { // Don't muck with named groups.
- groups.push(p);
- } else {
- var start = decodeEscape(p);
- var end;
- if (i + 2 < n && '-' === charsetParts[i + 1]) {
- end = decodeEscape(charsetParts[i + 2]);
- i += 2;
- } else {
- end = start;
- }
- ranges.push([start, end]);
- // If the range might intersect letters, then expand it.
- // This case handling is too simplistic.
- // It does not deal with non-latin case folding.
- // It works for latin source code identifiers though.
- if (!(end < 65 || start > 122)) {
- if (!(end < 65 || start > 90)) {
- ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
- }
- if (!(end < 97 || start > 122)) {
- ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
- }
- }
- }
- }
-
- // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
- // -> [[1, 12], [14, 14], [16, 17]]
- ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); });
- var consolidatedRanges = [];
- var lastRange = [NaN, NaN];
- for (var i = 0; i < ranges.length; ++i) {
- var range = ranges[i];
- if (range[0] <= lastRange[1] + 1) {
- lastRange[1] = Math.max(lastRange[1], range[1]);
- } else {
- consolidatedRanges.push(lastRange = range);
- }
- }
-
- var out = ['['];
- if (inverse) { out.push('^'); }
- out.push.apply(out, groups);
- for (var i = 0; i < consolidatedRanges.length; ++i) {
- var range = consolidatedRanges[i];
- out.push(encodeEscape(range[0]));
- if (range[1] > range[0]) {
- if (range[1] + 1 > range[0]) { out.push('-'); }
- out.push(encodeEscape(range[1]));
- }
- }
- out.push(']');
- return out.join('');
- }
-
- function allowAnywhereFoldCaseAndRenumberGroups(regex) {
- // Split into character sets, escape sequences, punctuation strings
- // like ('(', '(?:', ')', '^'), and runs of characters that do not
- // include any of the above.
- var parts = regex.source.match(
- new RegExp(
- '(?:'
- + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]' // a character set
- + '|\\\\u[A-Fa-f0-9]{4}' // a unicode escape
- + '|\\\\x[A-Fa-f0-9]{2}' // a hex escape
- + '|\\\\[0-9]+' // a back-reference or octal escape
- + '|\\\\[^ux0-9]' // other escape sequence
- + '|\\(\\?[:!=]' // start of a non-capturing group
- + '|[\\(\\)\\^]' // start/emd of a group, or line start
- + '|[^\\x5B\\x5C\\(\\)\\^]+' // run of other characters
- + ')',
- 'g'));
- var n = parts.length;
-
- // Maps captured group numbers to the number they will occupy in
- // the output or to -1 if that has not been determined, or to
- // undefined if they need not be capturing in the output.
- var capturedGroups = [];
-
- // Walk over and identify back references to build the capturedGroups
- // mapping.
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- var p = parts[i];
- if (p === '(') {
- // groups are 1-indexed, so max group index is count of '('
- ++groupIndex;
- } else if ('\\' === p.charAt(0)) {
- var decimalValue = +p.substring(1);
- if (decimalValue && decimalValue <= groupIndex) {
- capturedGroups[decimalValue] = -1;
- }
- }
- }
-
- // Renumber groups and reduce capturing groups to non-capturing groups
- // where possible.
- for (var i = 1; i < capturedGroups.length; ++i) {
- if (-1 === capturedGroups[i]) {
- capturedGroups[i] = ++capturedGroupIndex;
- }
- }
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- var p = parts[i];
- if (p === '(') {
- ++groupIndex;
- if (capturedGroups[groupIndex] === undefined) {
- parts[i] = '(?:';
- }
- } else if ('\\' === p.charAt(0)) {
- var decimalValue = +p.substring(1);
- if (decimalValue && decimalValue <= groupIndex) {
- parts[i] = '\\' + capturedGroups[groupIndex];
- }
- }
- }
-
- // Remove any prefix anchors so that the output will match anywhere.
- // ^^ really does mean an anchored match though.
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
- }
-
- // Expand letters to groups to handle mixing of case-sensitive and
- // case-insensitive patterns if necessary.
- if (regex.ignoreCase && needToFoldCase) {
- for (var i = 0; i < n; ++i) {
- var p = parts[i];
- var ch0 = p.charAt(0);
- if (p.length >= 2 && ch0 === '[') {
- parts[i] = caseFoldCharset(p);
- } else if (ch0 !== '\\') {
- // TODO: handle letters in numeric escapes.
- parts[i] = p.replace(
- /[a-zA-Z]/g,
- function (ch) {
- var cc = ch.charCodeAt(0);
- return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
- });
- }
- }
- }
-
- return parts.join('');
- }
-
- var rewritten = [];
- for (var i = 0, n = regexs.length; i < n; ++i) {
- var regex = regexs[i];
- if (regex.global || regex.multiline) { throw new Error('' + regex); }
- rewritten.push(
- '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
- }
-
- return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
- }
-
-
- /**
- * Split markup into a string of source code and an array mapping ranges in
- * that string to the text nodes in which they appear.
- *
- *
- * The HTML DOM structure:
- *
- * (Element "p"
- * (Element "b"
- * (Text "print ")) ; #1
- * (Text "'Hello '") ; #2
- * (Element "br") ; #3
- * (Text " + 'World';")) ; #4
- *
- *
- * corresponds to the HTML
- * {@code
print 'Hello ' + 'World';
}.
- *
- *
- * It will produce the output:
- *
- * {
- * sourceCode: "print 'Hello '\n + 'World';",
- * // 1 2
- * // 012345678901234 5678901234567
- * spans: [0, #1, 6, #2, 14, #3, 15, #4]
- * }
- *
- *
- * where #1 is a reference to the {@code "print "} text node above, and so
- * on for the other text nodes.
- *
- *
- *
- * The {@code} spans array is an array of pairs. Even elements are the start
- * indices of substrings, and odd elements are the text nodes (or BR elements)
- * that contain the text for those substrings.
- * Substrings continue until the next index or the end of the source.
- *
- *
- * @param {Node} node an HTML DOM subtree containing source-code.
- * @return {Object} source code and the text nodes in which they occur.
- */
- function extractSourceSpans(node) {
- var nocode = /(?:^|\s)nocode(?:\s|$)/;
-
- var chunks = [];
- var length = 0;
- var spans = [];
- var k = 0;
-
- var whitespace;
- if (node.currentStyle) {
- whitespace = node.currentStyle.whiteSpace;
- } else if (window.getComputedStyle) {
- whitespace = document.defaultView.getComputedStyle(node, null)
- .getPropertyValue('white-space');
- }
- var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
-
- function walk(node) {
- switch (node.nodeType) {
- case 1: // Element
- if (nocode.test(node.className)) { return; }
- for (var child = node.firstChild; child; child = child.nextSibling) {
- walk(child);
- }
- var nodeName = node.nodeName;
- if ('BR' === nodeName || 'LI' === nodeName) {
- chunks[k] = '\n';
- spans[k << 1] = length++;
- spans[(k++ << 1) | 1] = node;
- }
- break;
- case 3: case 4: // Text
- var text = node.nodeValue;
- if (text.length) {
- if (!isPreformatted) {
- text = text.replace(/[ \t\r\n]+/g, ' ');
- } else {
- text = text.replace(/\r\n?/g, '\n'); // Normalize newlines.
- }
- // TODO: handle tabs here?
- chunks[k] = text;
- spans[k << 1] = length;
- length += text.length;
- spans[(k++ << 1) | 1] = node;
- }
- break;
- }
- }
-
- walk(node);
-
- return {
- sourceCode: chunks.join('').replace(/\n$/, ''),
- spans: spans
- };
- }
-
-
- /**
- * Apply the given language handler to sourceCode and add the resulting
- * decorations to out.
- * @param {number} basePos the index of sourceCode within the chunk of source
- * whose decorations are already present on out.
- */
- function appendDecorations(basePos, sourceCode, langHandler, out) {
- if (!sourceCode) { return; }
- var job = {
- sourceCode: sourceCode,
- basePos: basePos
- };
- langHandler(job);
- out.push.apply(out, job.decorations);
- }
-
- var notWs = /\S/;
-
- /**
- * Given an element, if it contains only one child element and any text nodes
- * it contains contain only space characters, return the sole child element.
- * Otherwise returns undefined.
- *
- * This is meant to return the CODE element in {@code
} when
- * there is a single child element that contains all the non-space textual
- * content, but not to return anything where there are multiple child elements
- * as in {@code ...
...
} or when there
- * is textual content.
- */
- function childContentWrapper(element) {
- var wrapper = undefined;
- for (var c = element.firstChild; c; c = c.nextSibling) {
- var type = c.nodeType;
- wrapper = (type === 1) // Element Node
- ? (wrapper ? element : c)
- : (type === 3) // Text Node
- ? (notWs.test(c.nodeValue) ? element : wrapper)
- : wrapper;
- }
- return wrapper === element ? undefined : wrapper;
- }
-
- /** Given triples of [style, pattern, context] returns a lexing function,
- * The lexing function interprets the patterns to find token boundaries and
- * returns a decoration list of the form
- * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
- * where index_n is an index into the sourceCode, and style_n is a style
- * constant like PR_PLAIN. index_n-1 <= index_n, and style_n-1 applies to
- * all characters in sourceCode[index_n-1:index_n].
- *
- * The stylePatterns is a list whose elements have the form
- * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
- *
- * Style is a style constant like PR_PLAIN, or can be a string of the
- * form 'lang-FOO', where FOO is a language extension describing the
- * language of the portion of the token in $1 after pattern executes.
- * E.g., if style is 'lang-lisp', and group 1 contains the text
- * '(hello (world))', then that portion of the token will be passed to the
- * registered lisp handler for formatting.
- * The text before and after group 1 will be restyled using this decorator
- * so decorators should take care that this doesn't result in infinite
- * recursion. For example, the HTML lexer rule for SCRIPT elements looks
- * something like ['lang-js', /<[s]cript>(.+?)<\/script>/]. This may match
- * '
-
-
-
-
-
-
-
-
-
-
-
-