diff --git a/.editorconfig b/.editorconfig
index 4423e0fd..29d11ece 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,4 +1,4 @@
-# 2016 March 8
+# 2017 March 3
# https://github.com/bevry/base
root = true
@@ -6,7 +6,7 @@ root = true
[*]
end_of_line = lf
charset = utf-8
-trim_trailing_whitespace = false
+trim_trailing_whitespace = true
insert_final_newline = false
indent_style = tab
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 00000000..84ec1ee1
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,931 @@
+// 2017 February 22
+// https://github.com/bevry/base
+// http://eslint.org
+// This code must be able to run on Node 0.10
+/* eslint no-warning-comments: 0 */
+'use strict'
+
+const IGNORE = 0, WARN = 1, ERROR = 2, MAX_PARAMS = 4
+
+const config = {
+ extends: ['eslint:recommended'],
+ plugins: [],
+ parserOptions: {ecmaFeatures: {}},
+ env: {},
+ rules: {
+ // ----------------------------
+ // Problems with these rules
+ // If we can figure out how to enable the following, that would be great
+
+ // Two spaces after one line if or else:
+ // if ( blah ) return
+ // Insead of one space:
+ // if ( blah ) return
+
+ // No spaces on embedded function:
+ // .forEach(function(key, value){
+ // instead of:
+ // .forEach(function (key, value) {
+
+ // Else and catch statements on the same line as closing brace:
+ // } else {
+ // } catch (e) {
+ // instead of:
+ // }
+ // else {
+
+
+ // --------------------------------------
+ // Possible Errors
+ // The following rules point out areas where you might have made mistakes.
+
+ // Don't allow assignments in conditional statements (if, while, etc.)
+ 'no-cond-assign': [ERROR, 'always'],
+
+ // Warn but don't error about console statements
+ 'no-console': WARN,
+
+ // Sometimes useful for debugging
+ // Allow while(true) loops
+ 'no-constant-condition': WARN,
+
+ // Seems like a good idea to error about this
+ 'no-control-regex': ERROR,
+
+ // Warn but don't error about console statements
+ 'no-debugger': WARN,
+
+ // Don't allow duplicate arguments in a function, they can cause errors
+ 'no-dupe-args': ERROR,
+
+ // Disallow duplicate keys in an object, they can cause errors
+ 'no-dupe-keys': ERROR,
+
+ // Disallow duplicate case statements in a switch
+ 'no-duplicate-case': ERROR,
+
+ // Allow empty block statements, they are useful for clarity
+ 'no-empty': IGNORE,
+
+ // Disallow empty [] in regular expressions as they cause unexpected behaviour
+ 'no-empty-character-class': ERROR,
+
+ // Overwriting the exception argument in a catch statement can cause memory leaks in some browsers
+ 'no-ex-assign': ERROR,
+
+ // Disallow superflous boolean casts, they offer no value
+ 'no-extra-boolean-cast': ERROR,
+
+ // Allow superflous parenthesis as they offer clarity in some cases
+ 'no-extra-parens': IGNORE,
+
+ // Disallow superflous semicolons, they offer no value
+ 'no-extra-semi': ERROR,
+
+ // Seems like a good idea to error about this
+ 'no-func-assign': ERROR,
+
+ // Seems like a good idea to error about this
+ 'no-inner-declarations': ERROR,
+
+ // Seems like a good idea to error about this
+ 'no-invalid-regexp': ERROR,
+
+ // Seems like a good idea to error about this
+ 'no-irregular-whitespace': ERROR,
+
+ // Seems like a good idea to error about this
+ 'no-obj-calls': ERROR,
+
+ // Not enough justification to change our existing use
+ 'no-prototype-builtins': IGNORE,
+
+ // Seems like a good idea to error about this
+ // Instead of / / used / {ERROR}/ instead
+ 'no-regex-spaces': ERROR,
+
+ // Seems like a good idea to error about this
+ 'no-sparse-arrays': ERROR,
+
+ // Probably an error on our part, so warn
+ 'no-template-curly-in-string': WARN,
+
+ // Seems like a good idea to error about this
+ 'no-unexpected-multiline': ERROR,
+
+ // Seems like a good idea to error about this
+ 'no-unreachable': ERROR,
+
+ // Seems like a good idea to error about this
+ 'no-unsafe-finally': ERROR,
+
+ // Seems like a good idea to error about this
+ 'no-unsafe-negation': ERROR,
+
+ // Seems like a good idea to error about this
+ 'use-isnan': ERROR,
+
+ // We use JSDoc again
+ 'valid-jsdoc': [ERROR, {
+ requireParamDescription: false,
+ requireReturnDescription: false
+ }],
+
+ // Seems like a good idea to error about this
+ 'valid-typeof': ERROR,
+
+
+ // --------------------------------------
+ // Best Practices
+ // These are rules designed to prevent you from making mistakes. They either prescribe a better way of doing something or help you avoid footguns.
+
+ // Often we only need one, setting both doesn't make sense
+ // Enforces getter/setter pairs in objects
+ 'accessor-pairs': IGNORE,
+
+ // Seems sensible
+ // Enforces return statements in callbacks of array's methods
+ 'array-callback-return': ERROR,
+
+ // This rule seems buggy
+ 'block-scoped-var': IGNORE,
+
+ // Seems interesting, lets give it a go
+ 'class-methods-use-this': WARN,
+
+ // Disable complexity checks, they are annoying and not that useful in detecting actual complexity
+ 'complexity': IGNORE,
+
+ // We use blank returns for break statements and for returning void
+ 'consistent-return': IGNORE,
+
+ // Always require curly braces unless the statement is all on a single line
+ 'curly': [ERROR, 'multi-line'],
+
+ // If we don't have a default cause, it probably means we should throw an error
+ 'default-case': ERROR,
+
+ // Dots should be on the newlines
+ // chainableThingy
+ // .doSomething()
+ // .doSomethingElse()
+ 'dot-location': [ERROR, 'property'],
+
+ // Use dot notation where possible
+ 'dot-notation': ERROR,
+
+ // Unless you are doing == null, then force === to avoid truthy/falsey mistakes
+ 'eqeqeq': [ERROR, 'allow-null'],
+
+ // Always use hasOwnProperty when doing for in
+ 'guard-for-in': ERROR,
+
+ // Warn about alert statements in our code
+ // Use one of the suggested alternatives instead
+ // Reasoning is they could be mistaken for left over debugging statements
+ 'no-alert': WARN,
+
+ // They are very slow
+ 'no-caller': ERROR,
+
+ // Wow...
+ 'no-case-declarations': ERROR,
+
+ // Seems like a good idea to error about this
+ 'no-div-regex': ERROR,
+
+ // Returns in else statements offer code clarity, so disable this rule
+ 'no-else-return': IGNORE,
+
+ // Up to developer sensibility
+ // disallow use of empty functions
+ 'no-empty-function': IGNORE,
+
+ // Seems sensible
+ 'no-empty-pattern': ERROR,
+
+ // We know that == null is a null and undefined check
+ 'no-eq-null': IGNORE,
+
+ // Eval is slow and unsafe, use vm's instead
+ 'no-eval': ERROR,
+
+ // There is never a good reason for this
+ 'no-extend-native': ERROR,
+
+ // Don't allow useless binds
+ 'no-extra-bind': ERROR,
+
+ // Seems sensible
+ 'no-extra-label': ERROR,
+
+ // Don't allow switch case statements to follow through, use continue keyword instead
+ 'no-fallthrough': ERROR,
+
+ // Use zero when doing decimals, otherwise it is confusing
+ 'no-floating-decimal': ERROR,
+
+ // Seems sensible
+ 'no-global-assign': ERROR,
+
+ // Cleverness is unclear
+ 'no-implicit-coercion': ERROR,
+
+ // Seems sensible providing detection works correctly
+ 'no-implicit-globals': ERROR,
+
+ // A sneaky way to do evals
+ 'no-implied-eval': ERROR,
+
+ // This throws for a lot of senseless things, like chainy functions
+ 'no-invalid-this': IGNORE,
+
+ // Use proper iterators instead
+ 'no-iterator': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-labels': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-lone-blocks': ERROR,
+
+ // Loop functions always cause problems, as the scope isn't clear through iterations
+ 'no-loop-func': ERROR,
+
+ // Far too annoying
+ 'no-magic-numbers': IGNORE,
+
+ // We like multi spaces for clarity
+ // E.g. We like
+ // if ( blah ) return foo
+ // Instead of:
+ // if ( blah ) return foo
+ // @TODO would be great to enforce the above
+ 'no-multi-spaces': IGNORE,
+
+ // Use ES6 template strings instead
+ 'no-multi-str': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-new-func': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-new-wrappers': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-new': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-octal-escape': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-octal': ERROR,
+
+ // We got to be pretty silly if we don't realise we are doing this
+ // As such, take any usage as intentional and aware
+ 'no-param-reassign': IGNORE,
+
+ // We never use this, it seems silly to allow this
+ 'no-proto': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-redeclare': ERROR,
+
+ // No defaults for this that are useful
+ 'no-restricted-properties': IGNORE,
+
+ // We never use this, it seems silly to allow this
+ 'no-return-assign': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-script-url': ERROR,
+
+ // Seems sensible
+ 'no-self-assign': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-self-compare': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-sequences': ERROR,
+
+ // We always want proper error objects as they have stack traces and respond to instanceof Error checks
+ 'no-throw-literal': ERROR,
+
+ // Could be a getter, so warn
+ 'no-unmodified-loop-condition': WARN,
+
+ // We never use this, it seems silly to allow this
+ 'no-unused-expressions': ERROR,
+
+ // Seems sensible
+ 'no-unused-labels': ERROR,
+
+ // Seems sensible
+ 'no-useless-call': ERROR,
+
+ // Seems sensible
+ 'no-useless-concat': ERROR,
+
+ // Seems sensible
+ 'no-useless-escape': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-void': ERROR,
+
+ // Warn about todos
+ 'no-warning-comments': [WARN, { terms: ['todo', 'fixme'], location: 'anywhere' }],
+
+ // We never use this, it seems silly to allow this
+ 'no-with': ERROR,
+
+ // Always specify a radix to avoid errors
+ 'radix': ERROR,
+
+ // We appreciate the clarity late defines offer
+ 'vars-on-top': IGNORE,
+
+ // Wrap instant called functions in parenthesis for clearer intent
+ 'wrap-iife': ERROR,
+
+ // Because we force === and never allow assignments in conditions
+ // we have no need for yoda statements, so disable them
+ 'yoda': [ERROR, 'never'],
+
+
+ // --------------------------------------
+ // Strict Mode
+ // These rules relate to using strict mode.
+
+ // Ensure that use strict is specified to prevent the runtime erorr:
+ // SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
+ 'strict': [ERROR, 'global'],
+
+
+ // --------------------------------------
+ // Variables
+ // These rules have to do with variable declarations.
+
+ // We don't care
+ 'init-declarations': IGNORE,
+
+ // Don't allow the catch method to shadow objects as browsers handle this differently
+ // Update: We don't care for IE8
+ 'no-catch-shadow': IGNORE,
+
+ // Don't use delete, it disables optimisations
+ 'no-delete-var': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'no-label-var': ERROR,
+
+ // No useful defaults
+ 'no-restricted-globals': IGNORE,
+
+ // We never use this, it seems silly to allow this
+ 'no-shadow-restricted-names': ERROR,
+
+ // We use shadowing
+ 'no-shadow': IGNORE,
+
+ // Makes sense
+ 'no-undef-init': ERROR,
+
+ // Error when an undefined variable is used
+ 'no-undef': ERROR,
+
+ // typeof blah === 'undefined' should always be used
+ 'no-undefined': ERROR,
+
+ // Warn us when we don't use something
+ 'no-unused-vars': WARN,
+
+ // Error when we try and use something before it is defined
+ 'no-use-before-define': ERROR,
+
+
+ // --------------------------------------
+ // Node.js and CommonJS
+ // These rules are specific to JavaScript running on Node.js or using CommonJS in the browser.
+
+ // Seems to difficult to enforce
+ 'callback-return': IGNORE,
+
+ // We use require where it is appropriate to use it
+ 'global-require': IGNORE,
+
+ // Force handling of callback errors
+ 'handle-callback-err': ERROR,
+
+ // @TODO decide if this is good or not
+ 'no-mixed-requires': ERROR,
+
+ // Disallow error prone syntax
+ 'no-new-require': ERROR,
+
+ // Always use path.join for windows support
+ 'no-path-concat': ERROR,
+
+ // We use process.env wisely
+ 'no-process-env': IGNORE,
+
+ // We know what we are doing
+ 'no-process-exit': IGNORE,
+
+ // No need to disallow any modules
+ 'no-restricted-modules': IGNORE,
+
+ // Sometimes sync methods are useful, so warn but don't error
+ 'no-sync': WARN,
+
+
+ // --------------------------------------
+ // Stylistic
+ // These rules are purely matters of style and are quite subjective.
+
+ // We don't use spaces with brackets
+ 'array-bracket-spacing': [ERROR, 'never'],
+
+ // Disallow or enforce spaces inside of single line blocks
+ 'block-spacing': [ERROR, 'always'],
+
+ // Opening brace on same line, closing brace on its own line, except when statement is a single line
+ 'brace-style': [ERROR, 'stroustrup', { allowSingleLine: true }],
+
+ // Use camel case
+ 'camelcase': ERROR,
+
+ // ES6 supports dangling commas
+ 'comma-dangle': [ERROR, 'never'],
+
+ // Require a comma after always
+ 'comma-spacing': [ERROR, { before: false, after: true }],
+
+ // Commas go last, we have tooling to detect if we forget a comma
+ 'comma-style': [ERROR, 'last'],
+
+ // Require or disallow padding inside computed properties
+ 'computed-property-spacing': [ERROR, 'never'],
+
+ // Enabling this was incredibly annoying when doing layers of nesting
+ 'consistent-this': IGNORE,
+
+ // Enable to make UNIX people's lives easier
+ 'eol-last': ERROR,
+
+ // We never use this, it seems silly to allow this
+ 'func-call-spacing': [ERROR, 'never'],
+
+ // This rule is not currently useful
+ 'func-name-matching': IGNORE,
+
+ // We like anonymous functions
+ 'func-names': IGNORE,
+
+ // Prefer to define functions via variables
+ 'func-style': [WARN, 'declaration'],
+
+ // Nothing we want to blacklist
+ // blacklist certain identifiers to prevent them being used
+ 'id-blacklist': IGNORE,
+
+ // Sometimes short names are appropriate
+ 'id-length': IGNORE,
+
+ // Camel case handles this for us
+ 'id-match': IGNORE,
+
+ // Use tabs and indent case blocks
+ 'indent': [ERROR, 'tab', {
+ SwitchCase: 1,
+ VariableDeclarator: 0,
+ outerIIFEBody: 1,
+ MemberExpression: 1,
+ FunctionDeclaration: {
+ body: 1,
+ parameters: 0
+ },
+ FunctionExpression: {
+ body: 1,
+ parameters: 0
+ }
+ }],
+ // ^ broken before, let us try again
+
+ // Prefer double qoutes for JSX properties: ,
+ 'jsx-quotes': [ERROR, 'prefer-double'],
+
+ // Space after the colon
+ 'key-spacing': [ERROR, {
+ beforeColon: false,
+ afterColon: true
+ }],
+
+ // Always force a space before and after a keyword
+ 'keyword-spacing': [ERROR],
+
+ // we use both
+ 'line-comment-position': IGNORE,
+
+ // Enforce unix line breaks
+ 'linebreak-style': [ERROR, 'unix'],
+
+ // Enforce new lines before block comments
+ 'lines-around-comment': [ERROR, {
+ beforeBlockComment: true,
+ allowBlockStart: true
+ }],
+
+ // Enforce directives with no line above but a line below
+ 'lines-around-directive': [ERROR, {
+ before: 'never',
+ after: 'always'
+ }],
+
+ // Disabled to ensure consistency with complexity option
+ 'max-depth': IGNORE,
+
+ // We use soft wrap
+ 'max-len': IGNORE,
+
+ // Perhaps in the future we can set this to 300 or so
+ // but for now it is not useful for the things we write and maintain
+ 'max-lines': IGNORE,
+
+ // We are smart enough to know if this is bad or not
+ 'max-nested-callbacks': IGNORE,
+
+ // Sometimes we have no control over this for compat reasons, so just warn
+ 'max-params': [WARN, MAX_PARAMS],
+
+ // Let's give this a go and see what is appropriate for our usage
+ 'max-statements-per-line': [WARN, {max: 1}],
+
+ // We should be able to use whatever feels right
+ 'max-statements': IGNORE,
+
+ // Current options are not useful
+ 'multiline-ternary': IGNORE,
+
+ // Constructors should be CamelCase
+ 'new-cap': ERROR,
+
+ // Always use parens when instantiating a class
+ 'new-parens': ERROR,
+
+ // Too difficult to enforce correctly as too many edge-cases
+ // require or disallow an empty newline after variable declarations
+ 'newline-after-var': IGNORE,
+
+ // Let the author decide
+ // enforce newline after each call when chaining the calls
+ 'newline-per-chained-call': IGNORE,
+
+ // Don't use the array constructor when it is not needed
+ 'no-array-constructor': ERROR,
+
+ // We never use bitwise, they are too clever
+ 'no-bitwise': ERROR,
+
+ // We use continue
+ 'no-continue': IGNORE,
+
+ // We like inline comments
+ 'no-inline-comments': IGNORE,
+
+ // The code could be optimised if this error occurs
+ 'no-lonely-if': ERROR,
+
+ // Seems sensible, let's see how we go with this
+ 'no-mixed-operators': ERROR,
+
+ // Don't mix spaces and tabs
+ // Maybe [ERROR, 'smart-tabs'] will be better, we will see
+ 'no-mixed-spaces-and-tabs': ERROR,
+
+ // We use multiple empty lines for styling
+ 'no-multiple-empty-lines': IGNORE,
+
+ // Sometimes it is more understandable with a negated condition
+ 'no-negated-condition': IGNORE,
+
+ // Sometimes these are useful
+ 'no-nested-ternary': IGNORE,
+
+ // Use {} instead of new Object()
+ 'no-new-object': ERROR,
+
+ // We use plus plus
+ 'no-plusplus': IGNORE,
+
+ // Handled by other rules
+ 'no-restricted-syntax': IGNORE,
+
+ // We use tabs
+ 'no-tabs': IGNORE,
+
+ // Sometimes ternaries are useful
+ 'no-ternary': IGNORE,
+
+ // Disallow trailing spaces
+ 'no-trailing-spaces': ERROR,
+
+ // Sometimes this is useful when avoiding shadowing
+ 'no-underscore-dangle': IGNORE,
+
+ // Sensible
+ 'no-unneeded-ternary': ERROR,
+
+ // Seems sensible
+ 'no-whitespace-before-property': ERROR,
+
+ // Object indentation should be consistent within the object
+ // Ignore until https://github.com/eslint/eslint/issues/7434 is done
+ 'object-curly-newline': [IGNORE, {multiline: true}],
+
+ // Desirable, but too many edge cases it turns out where it is actually preferred
+ 'object-curly-spacing': IGNORE,
+
+ // We like multiple var statements
+ 'one-var': IGNORE,
+ 'one-var-declaration-per-line': IGNORE,
+
+ // Force use of shorthands when available
+ 'operator-assignment': [ERROR, 'always'],
+
+ // Should be before, but not with =, *=, /=, += lines
+ // @TODO figure out how to enforce
+ 'operator-linebreak': IGNORE,
+
+ // This rule doesn't appear to work correclty
+ 'padded-blocks': IGNORE,
+
+ // Seems like a good idea to error about this
+ // was broken before, but lets give a go again
+ 'quote-props': [ERROR, 'consistent-as-needed'],
+
+ // Use single quotes where escaping isn't needed
+ 'quotes': [ERROR, 'single', 'avoid-escape'],
+
+ // We use YUIdoc
+ 'require-jsdoc': IGNORE,
+
+ // If semi's are used, then add spacing after
+ 'semi-spacing': [ERROR, { before: false, after: true }],
+
+ // Never use semicolons
+ 'semi': [ERROR, 'never'],
+
+ // Importance makes more sense than alphabetical
+ 'sort-keys': IGNORE,
+
+ // Importance makes more sense than alphabetical
+ 'sort-vars': IGNORE,
+
+ // Always force a space before a {
+ 'space-before-blocks': [ERROR, 'always'],
+
+ // function () {, get blah () {
+ 'space-before-function-paren': [ERROR, 'always'],
+
+ // This is for spacing between (), so doSomething( WARN, ERROR, 3 ) or if ( WARN === 3 )
+ // which we want for ifs, but don't want for calls
+ 'space-in-parens': IGNORE,
+
+ // We use this
+ 'space-infix-ops': ERROR,
+
+ // We use this
+ 'space-unary-ops': ERROR,
+
+ // We use this
+ // 'spaced-line-comment': ERROR,
+ 'spaced-comment': ERROR,
+
+ // When would we ever do this? Makes no sense
+ 'unicode-bom': [ERROR, 'never'],
+
+ // We do this, seems to work well
+ 'wrap-regex': ERROR,
+
+
+ // --------------------------------------
+ // ECMAScript 6 / ES6
+
+ // Sensible to create more informed and clear code
+ 'arrow-body-style': [ERROR, 'as-needed'],
+
+ // We do this, no reason why, just what we do
+ 'arrow-parens': [ERROR, 'always'],
+
+ // Require consistent spacing for arrow functions
+ 'arrow-spacing': ERROR,
+
+ // Makes sense as otherwise runtime error will occur
+ 'constructor-super': ERROR,
+
+ // Seems the most consistent location for it
+ 'generator-star-spacing': [ERROR, 'before'],
+
+ // Makes sense
+ 'no-class-assign': ERROR,
+
+ // Makes sense
+ 'no-confusing-arrow': ERROR,
+
+ // Of course
+ 'no-const-assign': ERROR,
+
+ // Of course
+ 'no-dupe-class-members': ERROR,
+
+ // Seems sensible, may be times when we want this
+ 'no-duplicate-imports': WARN,
+
+ // Seems sensible
+ 'no-new-symbol': ERROR,
+
+ // No need to disallow any imports
+ 'no-restricted-imports': IGNORE,
+
+ // Makes sense as otherwise runtime error will occur
+ 'no-this-before-super': ERROR,
+
+ // Seems sensible
+ 'no-useless-computed-key': ERROR,
+
+ // Seems sensible
+ 'no-useless-constructor': ERROR,
+
+ // Seems sensible
+ 'no-useless-rename': ERROR,
+
+ // Of course
+ // However, would be good to have this adjusted per environment
+ 'no-var': WARN,
+
+ // Enforce ES6 object shorthand
+ 'object-shorthand': ERROR,
+
+ // Better performance when running native
+ // but horrible performance if not running native as could fallback to bind
+ // https://travis-ci.org/bevry/es6-benchmarks
+ 'prefer-arrow-callback': IGNORE,
+
+ // Of course
+ 'prefer-const': ERROR,
+
+ // Makes sense
+ 'prefer-numeric-literals': ERROR,
+
+ // Controversial change, but makes sense to move towards to reduce the risk of bad people overwriting apply and call
+ // https://github.com/eslint/eslint/issues/ERROR939
+ // Ignoring because node does not yet support it, so we don't want to get the performance hit of using the compiled ES5 version
+ 'prefer-reflect': IGNORE,
+
+ // Makes sense to enforce, exceptions should be opted out of on case by case
+ 'prefer-rest-params': ERROR,
+
+ // Sure, why not
+ 'prefer-spread': ERROR,
+
+ // Too annoying to enforce
+ 'prefer-template': IGNORE,
+
+ // Makes sense
+ 'require-yield': ERROR,
+
+ // Makes sense
+ 'rest-spread-spacing': [ERROR, 'never'],
+
+ // Importance makes more sense than alphabetical
+ 'sort-imports': IGNORE,
+
+ // Makes sense
+ 'symbol-description': ERROR,
+
+ // Makes sense
+ 'template-curly-spacing': [ERROR, 'never'],
+
+ // Our preference
+ 'yield-star-spacing': [ERROR, 'both'],
+
+
+ // --------------------------------------
+ // Plugins
+
+ // Not sure why, but okay
+ 'babel/no-await-in-loop': WARN,
+ 'flow-vars/define-flow-type': WARN,
+ 'flow-vars/use-flow-type': WARN
+ }
+}
+
+// ------------------------------------
+// Enhancements
+
+// Load data.json file if it exists
+const rules = Object.keys(config.rules)
+let data = {}, devDeps = []
+try {
+ data = require('./package.json') || {}
+ devDeps = Object.keys(data.devDependencies || {})
+}
+catch ( err ) {}
+
+// Set the parser options depending on our editions
+if ( data.editions ) {
+ const sourceEdition = data.editions[0]
+ for ( let syntaxIndex = 0; syntaxIndex < sourceEdition.syntaxes.length; ++syntaxIndex ) {
+ const syntax = sourceEdition.syntaxes[syntaxIndex]
+ if ( syntax === 'esnext' ) {
+ config.parserOptions.ecmaVersion = 8
+ break
+ }
+ else if ( syntax.indexOf('es') === 0 ) {
+ config.parserOptions.ecmaVersion = Number(syntax.substr(2))
+ break
+ }
+ }
+ config.parserOptions.ecmaFeatures.sourceType = sourceEdition.syntaxes.indexOf('import') !== -1 ? 'module' : 'script'
+ config.parserOptions.ecmaFeatures.jsx = sourceEdition.syntaxes.indexOf('jsx') !== -1
+}
+else {
+ // node version
+ const node = data.engines && data.engines.node && data.engines.node.replace('>=', '').replace(/ /g, '').replace(/\..+$/, '')
+ config.parserOptions.ecmaVersion = node >= 6 ? 6 : 5
+}
+
+// Set the environments depending on whether we need them or not
+config.env.es6 = Boolean(config.parserOptions.ecmaVersion && config.parserOptions.ecmaVersion >= 6)
+config.env.node = Boolean(data.engines && data.engines.node)
+config.env.browser = Boolean(data.browser)
+if ( config.env.browser ) {
+ config.env.commonjs = true
+ if ( config.env.node ) {
+ config.env['shared-node-browser'] = true
+ }
+}
+
+// If not on legacy javascript, disable esnext rules
+if ( config.parserOptions.ecmaVersion && config.parserOptions.ecmaVersion <= 5 ) {
+ config.rules['no-var'] = IGNORE
+ config.rules['object-shorthand'] = [ERROR, 'never']
+}
+
+// Add babel parsing if installed
+if ( devDeps.indexOf('babel-eslint') !== -1 ) {
+ config.parser = 'babel-eslint'
+}
+
+// Add react linting if installed
+if ( devDeps.indexOf('eslint-plugin-react') !== -1 ) {
+ config.extends.push('plugin:react/recommended')
+ config.plugins.push('react')
+}
+
+if ( devDeps.indexOf('eslint-plugin-babel') !== -1 ) {
+ // Remove rules that babel rules replace
+ config.plugins.push('babel')
+ const replacements = [
+ 'array-bracket-spacing',
+ 'new-cap',
+ 'object-curly-spacing',
+ 'arrow-parens',
+ 'generator-star-spacing',
+ 'object-shorthand'
+ ]
+ replacements.forEach(function (key) {
+ if ( rules.indexOf(key) !== -1 ) {
+ config.rules['babel/' + key] = config.rules[key]
+ config.rules[key] = IGNORE
+ }
+ })
+}
+else {
+ // Remove babel rules if not using babel
+ rules.forEach(function (key) {
+ if ( key.indexOf('babel/') === 0 ) {
+ delete config.rules[key]
+ }
+ })
+}
+
+if ( devDeps.indexOf('eslint-plugin-flow-vars') !== -1 ) {
+ // Add flow plugin if installed
+ config.plugins.push('flow-vars')
+}
+else {
+ // Remove flow rules if plugin not installed
+ rules.forEach(function (key) {
+ if ( key.indexOf('flow-vars/') === 0 ) {
+ delete config.rules[key]
+ }
+ })
+}
+
+
+// ------------------------------------
+// Export
+
+module.exports = config
diff --git a/.gitignore b/.gitignore
index 3afd533b..ca68e21a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-# 2016 October 17
+# 2017 January 27
# https://github.com/bevry/base
# Temp Files
@@ -21,6 +21,7 @@ coffee/
es5/
es2015/
esnext/
+docs/
# Editor Caches
.c9/
diff --git a/.travis.yml b/.travis.yml
index 7aee9b45..97b853fc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,32 +1,140 @@
-# 2016 April 27
+# 2017 March 22
# https://github.com/bevry/base
# Use the latest travis infrastructure
sudo: false
-# We use node
+# Complete Node.js Version Matrix
+# https://github.com/balupton/awesome-travis#complete-nodejs-version-matrix
language: node_js
node_js:
- - "0.12"
- - "4"
- - "5"
- - "6"
+ - "0.8" # end of life
+ - "0.10" # end of life
+ - "0.12" # maintenance
+ - "4" # lts
+ - "6" # lts
+ - "7" # stable
+matrix:
+ fast_finish: true
+ allow_failures:
+ - node_js: "0.8"
+ - node_js: "0.10"
cache:
directories:
- - node_modules
+ - $HOME/.npm # npm's cache
-# Prepare our tests
-# Ensure the project is setup correctly and compiled
-install: "npm run-script setup"
-before_script: "npm run-script compile"
+install: |
+ # Ensure NPM is latest
+ # https://github.com/balupton/awesome-travis#ensure-npm-is-latest
+ export CURRENT_NPM_VERSION="$(npm --version)" || exit -1
+ export LATEST_NPM_VERSION="$(npm view npm version)" || exit -1
+ if test "$CURRENT_NPM_VERSION" != "$LATEST_NPM_VERSION"; then
+ echo "running an old npm version $CURRENT_NPM_VERSION, upgrading npm to $LATEST_NPM_VERSION..."
+ npm install npm --global --cache-min=Infinity || exit -1
+ echo "...npm upgrade complete"
+ fi
+ # Ensure dependencies install with a LTS node version
+ # https://github.com/balupton/awesome-travis#use-lts-node-version-for-preparation
+ export CURRENT_NODE_VERSION="$(node --version)" || exit -1
+ export LTS_NODE_VERSIONS="$(nvm ls-remote --lts)" || exit -1
+ if echo "$LTS_NODE_VERSIONS" | grep "$CURRENT_NODE_VERSION"; then
+ echo "running on a LTS node version, completing setup..."
+ npm run our:setup || exit -1
+ echo "...setup complete with current LTS version"
+ else
+ echo "running on a non-LTS node version, completing setup on a LTS node version..."
+ nvm install --lts
+ export LTS_NODE_INSTALLED_VERSION="$(node --version)" || exit -1
+ npm run our:setup || exit -1
+ nvm use "$TRAVIS_NODE_VERSION" || exit -1
+ echo "...setup complete with LTS"
+ fi
+before_script: |
+ # Ensure compilation and linting occur on a LTS node version
+ # https://github.com/balupton/awesome-travis#use-lts-node-version-for-preparation
+ if test "$LTS_NODE_INSTALLED_VERSION"; then
+ echo "running on a non-LTS node version, compiling with LTS, skipping linting..."
+ nvm use "$LTS_NODE_INSTALLED_VERSION" || exit -1
+ npm run our:compile || exit -1
+ nvm use "$TRAVIS_NODE_VERSION" || exit -1
+ echo "...compiled"
+ else
+ echo "running on a LTS node version, compiling and linting..."
+ npm run our:compile && npm run our:verify || exit -1
+ echo "...compiled and linted"
+ fi
+after_success: |
+ # Release to Surge
+ # https://github.com/balupton/awesome-travis#release-to-surge
+ export CURRENT_NODE_VERSION="$(node --version)" || exit -1
+ export LTS_NODE_LATEST_VERSION="$(nvm version-remote --lts)" || exit -1
+ if test "$CURRENT_NODE_VERSION" = "$LTS_NODE_LATEST_VERSION"; then
+ echo "running on latest LTS node version, performing release to surge..."
+ echo "preparing release"
+ npm run our:meta || exit -1
+ echo "installing surge"
+ npm install surge || exit -1
+ echo "performing deploy"
+ export SURGE_SLUG="$(echo $TRAVIS_REPO_SLUG | sed 's/^\(.*\)\/\(.*\)/\2.\1/')" || exit -1
+ if test "$TRAVIS_BRANCH"; then
+ echo "deploying branch..."
+ surge --project $SURGE_PROJECT --domain "$TRAVIS_BRANCH.$SURGE_SLUG.surge.sh" || exit -1
+ fi
+ if test "$TRAVIS_TAG"; then
+ echo "deploying tag..."
+ surge --project $SURGE_PROJECT --domain "$TRAVIS_TAG.$SURGE_SLUG.surge.sh" || exit -1
+ fi
+ if test "$TRAVIS_COMMIT"; then
+ echo "deploying commit..."
+ surge --project $SURGE_PROJECT --domain "$TRAVIS_COMMIT.$SURGE_SLUG.surge.sh" || exit -1
+ fi
+ echo "...released to surge"
+ else
+ echo "running on non-latest LTS node version, skipping release to surge"
+ fi
+ # Release to NPM
+ # https://github.com/balupton/awesome-travis#release-to-npm
+ export CURRENT_NODE_VERSION="$(node --version)" || exit -1
+ export LTS_NODE_LATEST_VERSION="$(nvm version-remote --lts)" || exit -1
+ if test "$CURRENT_NODE_VERSION" = "$LTS_NODE_LATEST_VERSION"; then
+ if test "$TRAVIS_TAG"; then
+ echo "logging in..."
+ echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login || exit -1
+ echo "publishing..."
+ npm publish || exit -1
+ echo "...released to npm"
+ else
+ echo "non-tag, no need for release"
+ fi
+ else
+ echo "running on non-latest LTS node version, skipping release to npm"
+ fi
-# Run our tests
-script: "npm test"
+# ========================================
+# Custom Configuration
+# https://github.com/bevry/base#configuration
-# Custom notifications
+env:
+ global:
+ # Release to NPM
+ # https://github.com/balupton/awesome-travis#release-to-npm
+ - secure: WeIfuQhk2MgqXySloBoW1Th6dh7GTp7FbE/KHP/v7WKh/wFwxN6dIp7+zl3oMi/uVIWkiZ18EX82v6CUJq+u01vzd/Rk4Sj4p3L1lNi4wwElniXSblCnTakKivZfP/VaFO2ka2nwiIN7lSFBLoHojAecH2g5vxU8Q6mEW6mOVP4=
+ - secure: gcR6X6qf1XC2zu/oN8/fIiCMpEg7dFlzWPPkZ+8wqH7Dan77FsPIhisDw1W1seneMvms3Ku3gV07QU/kSrpbNTNfRrIusCl/Bh/imUPMElfQxxEcykQcUaHSzmWHa/SaLwRJWPp6ii5hu6Z1F3pwgyl1TpheRQrMcjmRr5I/SkU=
+ - secure: B5IlZLjgldcR5+ypZ0oiurUsybmpu0ZDD2mIu22fcP6eBzrGcVUPeUBBT2qC8DUFkYYJqi8gbQfJ/pJBngWktXxbyj5jJkV9bBdMzf7eupz8vcjcq1kr9piLTF+66qB7+djS+1Gm9uxVP1cM5BjOO44eWoKGfxl8oNVlPaRqmQE=
+ # Release to Surge
+ # https://github.com/balupton/awesome-travis#release-to-surge
+ - SURGE_PROJECT='.' # ths is the path that you want to deploy to surge
+ - secure: fHn9nZBNewevxuVLmzHrWGniwWBs8pz7ejy8QHLFvv1910w8fT7ZowzstyfQPWaidP5+/z76rAKvSp05qF0WMM2XBcpKJzbMHyrp1zxnboah9cDNz87Tx8tULhB2eo6/Cb1BUD9jlOyEwkbS3PzhiLNgy9gnF9+rijnA2tf0QYE=
+ - secure: OMTu9+wWFGKD5CCIadP8WZXFxY2DRx/21qKes5WUpjipnho2GyxcjfDK0MFloThLzSayDWIbjxNH3WmMUb3c4uLsqhEm9wj5vWllUsJ+ELgyeK/9Q1M6vkIAS2vrkjnc4peltCd6t85SQF0SE/DwToj8sGajNwRzsikLEULSCMQ=
+ # Custom Configuration for this repository
+
+# https://github.com/balupton/awesome-travis#slack
+# https://github.com/balupton/awesome-travis#email
+env:
+ global:
notifications:
slack:
- secure: hYTEHwzc03LIgAC08QvXU5yvhMwDM00rUtk7r0j5Qr1aD04PaKFVTRlBcvvy8YkNoMrtUWizPqmSZ4RamliXt+kioI6A/Phf6r6V3/tupEVBcvVzTi8LamzUomj3vYXOwJNN4IVWjdoCf0kZTB8Sz7xwXsvGnEkAlhRJD7ZEG2s=
+ secure: TV6bx7xKGz4dVbcmnp1Oy8zXhyvkOeg3xOga7PxIlE+Grof2+a7oNJk8kk8ti0Wmnx3KznmJnKw7qHauijfMFOvJJaMvDLx499L07jjA/x9D93U0tUvpcy8hCIGwWHaoyr3UFjopFKt7RdUBVW2MtXWtvLwVuQmnwoFKwHbN970=
email:
recipients:
- secure: jvtlCYaUCPzvE985LlJpEGIIgVzhkEUi/ImAa4fLxyGKAmTG1JsykDznwquggN5UbTFlOYS+i+rFmPLm4hLJf9bGUtl/yk90KN0NlHZfZ+x7EE/nTIpr6iaK8TqdrmaMNnwuj87/6zBdl9iKjzU/1lrBnz1hanUABU96kbWFFJE=
+ secure: lCRwaxvOAOnv6FHwATCeufywriNoksNnexTMYX3lIGTcTfVJN1n3EZoicaZ5KiwG0cHdFX7Na2lBjCELpOtL9ZOOYf1zg+9/ily8Kc2InQvnv9dsySa7HAXPto12pprwajFqlbULCWVP8HJiMv8U5QRGnc39+K83Ev35YEHZLkk=
diff --git a/README.md b/README.md
index 828dd33d..18e74510 100755
--- a/README.md
+++ b/README.md
@@ -15,13 +15,15 @@
-
-
+
+
-
-
+
+
+
+
@@ -145,10 +147,11 @@ These amazing people have contributed finances to this project:
Become a sponsor!
-
+
+
-
-
+
+
@@ -171,7 +174,7 @@ These amazing people have contributed code to this project:
' +
- 'Some items are not shown due to the current visibility ' +
- 'settings. Use the checkboxes at the upper right of this ' +
- 'page to change the visibility settings.' +
- '
' +
- '
'
- );
- } else {
- panelNode.append(
- '
' +
- '
' +
- 'This class doesn\'t provide any methods, properties, ' +
- 'attributes, or events.' +
- '
' +
- '
'
- );
- }
- }
-
- // Hide index sections without any visible items.
- Y.all('.index-section').each(function (section) {
- var items = 0,
- visibleItems = 0;
-
- section.all('.index-item').each(function (itemNode) {
- items += 1;
-
- if (itemNode.getComputedStyle('display') !== 'none') {
- visibleItems += 1;
- }
- });
-
- section.toggleClass('hidden', !visibleItems);
- section.toggleClass('no-columns', visibleItems < 4);
- });
-};
-
-pjax.initClassTabView = function () {
- if (!Y.all('#classdocs .api-class-tab').size()) {
- return;
- }
-
- if (classTabView) {
- classTabView.destroy();
- selectedTab = null;
- }
-
- classTabView = new Y.TabView({
- srcNode: '#classdocs',
-
- on: {
- selectionChange: pjax.onTabSelectionChange
- }
- });
-
- pjax.updateTabState();
- classTabView.render();
-};
-
-pjax.initLineNumbers = function () {
- var hash = win.location.hash.substring(1),
- container = pjax.get('container'),
- hasLines, node;
-
- // Add ids for each line number in the file source view.
- container.all('.linenums>li').each(function (lineNode, index) {
- lineNode.set('id', 'l' + (index + 1));
- lineNode.addClass('file-line');
- hasLines = true;
- });
-
- // Scroll to the desired line.
- if (hasLines && /^l\d+$/.test(hash)) {
- if ((node = container.getById(hash))) {
- win.scroll(0, node.getY());
- }
- }
-};
-
-pjax.initRoot = function () {
- var terminators = /^(?:classes|files|elements|modules)$/,
- parts = pjax._getPathRoot().split('/'),
- root = [],
- i, len, part;
-
- for (i = 0, len = parts.length; i < len; i += 1) {
- part = parts[i];
-
- if (part.match(terminators)) {
- // Makes sure the path will end with a "/".
- root.push('');
- break;
- }
-
- root.push(part);
- }
-
- pjax.set('root', root.join('/'));
-};
-
-pjax.updateTabState = function (src) {
- var hash = win.location.hash.substring(1),
- defaultTab, node, tab, tabPanel;
-
- function scrollToNode() {
- if (node.hasClass('protected')) {
- Y.one('#api-show-protected').set('checked', true);
- pjax.updateVisibility();
- }
-
- if (node.hasClass('private')) {
- Y.one('#api-show-private').set('checked', true);
- pjax.updateVisibility();
- }
-
- setTimeout(function () {
- // For some reason, unless we re-get the node instance here,
- // getY() always returns 0.
- var node = Y.one('#classdocs').getById(hash);
- win.scrollTo(0, node.getY() - 70);
- }, 1);
- }
-
- if (!classTabView) {
- return;
- }
-
- if (src === 'hashchange' && !hash) {
- defaultTab = 'index';
- } else {
- if (localStorage) {
- defaultTab = localStorage.getItem('tab_' + pjax.getPath()) ||
- 'index';
- } else {
- defaultTab = 'index';
- }
- }
-
- if (hash && (node = Y.one('#classdocs').getById(hash))) {
- if ((tabPanel = node.ancestor('.api-class-tabpanel', true))) {
- if ((tab = Y.one('#classdocs .api-class-tab.' + tabPanel.get('id')))) {
- if (classTabView.get('rendered')) {
- Y.Widget.getByNode(tab).set('selected', 1);
- } else {
- tab.addClass('yui3-tab-selected');
- }
- }
- }
-
- // Scroll to the desired element if this is a hash URL.
- if (node) {
- if (classTabView.get('rendered')) {
- scrollToNode();
- } else {
- classTabView.once('renderedChange', scrollToNode);
- }
- }
- } else {
- tab = Y.one('#classdocs .api-class-tab.' + defaultTab);
-
- // When the `defaultTab` node isn't found, `localStorage` is stale.
- if (!tab && defaultTab !== 'index') {
- tab = Y.one('#classdocs .api-class-tab.index');
- }
-
- if (classTabView.get('rendered')) {
- Y.Widget.getByNode(tab).set('selected', 1);
- } else {
- tab.addClass('yui3-tab-selected');
- }
- }
-};
-
-pjax.updateVisibility = function () {
- var container = pjax.get('container');
-
- container.toggleClass('hide-inherited',
- !Y.one('#api-show-inherited').get('checked'));
-
- container.toggleClass('show-deprecated',
- Y.one('#api-show-deprecated').get('checked'));
-
- container.toggleClass('show-protected',
- Y.one('#api-show-protected').get('checked'));
-
- container.toggleClass('show-private',
- Y.one('#api-show-private').get('checked'));
-
- pjax.checkVisibility();
-};
-
-// -- Route Handlers -----------------------------------------------------------
-
-pjax.handleClasses = function (req, res, next) {
- var status = res.ioResponse.status;
-
- // Handles success and local filesystem XHRs.
- if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) {
- pjax.initClassTabView();
- }
-
- next();
-};
-
-pjax.handleFiles = function (req, res, next) {
- var status = res.ioResponse.status;
-
- // Handles success and local filesystem XHRs.
- if (res.ioResponse.readyState === 4 && (!status || (status >= 200 && status < 300))) {
- pjax.initLineNumbers();
- }
-
- next();
-};
-
-// -- Event Handlers -----------------------------------------------------------
-
-pjax.onNavigate = function (e) {
- var hash = e.hash,
- originTarget = e.originEvent && e.originEvent.target,
- tab;
-
- if (hash) {
- tab = originTarget && originTarget.ancestor('.yui3-tab', true);
-
- if (hash === win.location.hash) {
- pjax.updateTabState('hashchange');
- } else if (!tab) {
- win.location.hash = hash;
- }
-
- e.preventDefault();
- return;
- }
-
- // Only scroll to the top of the page when the URL doesn't have a hash.
- this.set('scrollToTop', !e.url.match(/#.+$/));
-
- bdNode.addClass('loading');
-};
-
-pjax.onOptionClick = function (e) {
- pjax.updateVisibility();
-};
-
-pjax.onTabSelectionChange = function (e) {
- var tab = e.newVal,
- tabId = tab.get('contentBox').getAttribute('href').substring(1);
-
- selectedTab = tab;
-
- // If switching from a previous tab (i.e., this is not the default tab),
- // replace the history entry with a hash URL that will cause this tab to
- // be selected if the user navigates away and then returns using the back
- // or forward buttons.
- if (e.prevVal && localStorage) {
- localStorage.setItem('tab_' + pjax.getPath(), tabId);
- }
-
- pjax.checkVisibility(tab);
-};
-
-// -- Init ---------------------------------------------------------------------
-
-pjax.on('navigate', pjax.onNavigate);
-
-pjax.initRoot();
-pjax.upgrade();
-pjax.initClassTabView();
-pjax.initLineNumbers();
-pjax.updateVisibility();
-
-Y.APIList.rootPath = pjax.get('root');
-
-Y.one('#api-options').delegate('click', pjax.onOptionClick, 'input');
-
-Y.on('hashchange', function (e) {
- pjax.updateTabState('hashchange');
-}, win);
-
-});
diff --git a/docs/assets/js/yui-prettify.js b/docs/assets/js/yui-prettify.js
deleted file mode 100755
index 18de8649..00000000
--- a/docs/assets/js/yui-prettify.js
+++ /dev/null
@@ -1,17 +0,0 @@
-YUI().use('node', function(Y) {
- var code = Y.all('.prettyprint.linenums');
- if (code.size()) {
- code.each(function(c) {
- var lis = c.all('ol li'),
- l = 1;
- lis.each(function(n) {
- n.prepend('');
- l++;
- });
- });
- var h = location.hash;
- location.hash = '';
- h = h.replace('LINE_', 'LINENUM_');
- location.hash = h;
- }
-});
diff --git a/docs/assets/vendor/prettify/CHANGES.html b/docs/assets/vendor/prettify/CHANGES.html
deleted file mode 100755
index b50b8414..00000000
--- a/docs/assets/vendor/prettify/CHANGES.html
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
- Change Log
-
-
- README
-
-
Known Issues
-
-
Perl formatting is really crappy. Partly because the author is lazy and
- partly because Perl is
- hard to parse.
-
On some browsers, <code> elements with newlines in the text
- which use CSS to specify white-space:pre will have the newlines
- improperly stripped if the element is not attached to the document at the time
- the stripping is done. Also, on IE 6, all newlines will be stripped from
- <code> elements because of the way IE6 produces
- innerHTML. Workaround: use <pre> for code with
- newlines.
-
-
-
Change Log
-
29 March 2007
-
-
Added tests for PHP support
- to address
- issue 3.
-
Fixed
- bug: prettyPrintOne was not halting. This was not
- reachable through the normal entry point.
-
Fixed
- bug: recursing into a script block or PHP tag that was not properly
- closed would not silently drop the content.
- (test)
-
Fixed bug: / in regex [charsets] should not end regex
-
-
5 Jul 2008
-
-
Defined language extensions for Lisp and Lua
-
-
14 Jul 2008
-
-
Language handlers for F#, OCAML, SQL
-
Support for nocode spans to allow embedding of line
- numbers and code annotations which should not be styled or otherwise
- affect the tokenization of prettified code.
- See the issue 22
- testcase.
-
-
6 Jan 2009
-
-
Language handlers for Visual Basic, Haskell, CSS, and WikiText
-
Added .mxml extension to the markup style handler for
- Flex MXML files. See
- issue 37.
-
Added .m extension to the C style handler so that Objective
- C source files properly highlight. See
- issue 58.
-
Changed HTML lexer to use the same embedded source mechanism as the
- wiki language handler, and changed to use the registered
- CSS handler for STYLE element content.
-
-
21 May 2009
-
-
Rewrote to improve performance on large files.
- See benchmarks.
-
Fixed bugs with highlighting of Haskell line comments, Lisp
- number literals, Lua strings, C preprocessor directives,
- newlines in Wiki code on Windows, and newlines in IE6.
-
-
14 August 2009
-
-
Fixed prettifying of <code> blocks with embedded newlines.
-
-
3 October 2009
-
-
Fixed prettifying of XML/HTML tags that contain uppercase letters.
-
A variety of markup formatting fixes courtesy smain and thezbyg.
-
Fixed copy and paste in IE[678].
-
Changed output to use   instead of
- so that the output works when embedded in XML.
- Bug
- 108.
-
-
-
diff --git a/docs/assets/vendor/prettify/COPYING b/docs/assets/vendor/prettify/COPYING
deleted file mode 100755
index d6456956..00000000
--- a/docs/assets/vendor/prettify/COPYING
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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.
diff --git a/docs/assets/vendor/prettify/README.html b/docs/assets/vendor/prettify/README.html
deleted file mode 100755
index c6fe1a32..00000000
--- a/docs/assets/vendor/prettify/README.html
+++ /dev/null
@@ -1,203 +0,0 @@
-
-
-
-
- Javascript code prettifier
-
-
-
-
-
-
-
-
-
- Languages : CH
-
Include the script and stylesheets in your document
- (you will need to make sure the css and js file are on your server, and
- adjust the paths in the script and link tag)
-
Add onload="prettyPrint()" to your
- document's body tag.
-
Modify the stylesheet to get the coloring you prefer
-
-
-
Usage
-
Put code snippets in
- <pre class="prettyprint">...</pre>
- or <code class="prettyprint">...</code>
- and it will automatically be pretty printed.
-
-
-
-
The original
-
Prettier
-
-
class Voila {
-public:
- // Voila
- static const string VOILA = "Voila";
-
- // will not interfere with embedded tags.
-}
-
-
class Voila {
-public:
- // Voila
- static const string VOILA = "Voila";
-
- // will not interfere with embedded tags.
-}
-
-
-
FAQ
-
Which languages does it work for?
-
The comments in prettify.js are authoritative but 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, VB, and Awk and a decent subset of Perl
- and Ruby, but, because of commenting conventions, doesn't work on
- Smalltalk, or CAML-like languages.
-
-
LISPy languages are supported via an extension:
- lang-lisp.js.
If you'd like to add an extension for your favorite language, please
- look at src/lang-lisp.js and file an
- issue including your language extension, and a testcase.
-
-
How do I specify which language my code is in?
-
You don't need to specify the language since prettyprint()
- will guess. You can specify a language by specifying the language extension
- along with the prettyprint class like so:
-
<pre class="prettyprint lang-html">
- The lang-* class specifies the language file extensions.
- File extensions supported by default include
- "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
- "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
- "xhtml", "xml", "xsl".
-</pre>
-
-
It doesn't work on <obfuscated code sample>?
-
Yes. Prettifying obfuscated code is like putting lipstick on a pig
- — i.e. outside the scope of this tool.
-
-
Which browsers does it work with?
-
It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4.
- Look at the test page to see if it
- works in your browser.
Why doesn't Prettyprinting of strings work on WordPress?
-
Apparently wordpress does "smart quoting" which changes close quotes.
- This causes end quotes to not match up with open quotes.
-
This breaks prettifying as well as copying and pasting of code samples.
- See
- WordPress's help center for info on how to stop smart quoting of code
- snippets.
-
-
How do I put line numbers in my code?
-
You can use the linenums class to turn on line
- numbering. If your code doesn't start at line number 1, you can
- add a colon and a line number to the end of that class as in
- linenums:52.
-
-
For example
-
<pre class="prettyprint linenums:4"
->// This is line 4.
-foo();
-bar();
-baz();
-boo();
-far();
-faz();
-<pre>
- produces
-
// This is line 4.
-foo();
-bar();
-baz();
-boo();
-far();
-faz();
-
-
-
How do I prevent a portion of markup from being marked as code?
-
You can use the nocode class to identify a span of markup
- that is not code.
-
<pre class=prettyprint>
-int x = foo(); /* This is a comment <span class="nocode">This is not code</span>
- Continuation of comment */
-int y = bar();
-</pre>
-produces
-
-int x = foo(); /* This is a comment This is not code
- Continuation of comment */
-int y = bar();
-
-
-
For a more complete example see the issue22
- testcase.
-
-
I get an error message "a is not a function" or "opt_whenDone is not a function"
-
If you are calling prettyPrint via an event handler, wrap it in a function.
- Instead of doing
-
- addEventListener('load', prettyPrint, false);
-
- wrap it in a closure like
-
- addEventListener('load', function (event) { prettyPrint() }, false);
-
- so that the browser does not pass an event object to prettyPrint which
- will confuse it.
-
-