diff options
Diffstat (limited to 'node_modules/renderkid/lib/renderKid')
28 files changed, 0 insertions, 1046 deletions
diff --git a/node_modules/renderkid/lib/renderKid/Styles.js b/node_modules/renderkid/lib/renderKid/Styles.js deleted file mode 100644 index 52651aa01..000000000 --- a/node_modules/renderkid/lib/renderKid/Styles.js +++ /dev/null @@ -1,76 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var MixedDeclarationSet, StyleSheet, Styles, terminalWidth; - -StyleSheet = require('./styles/StyleSheet'); - -MixedDeclarationSet = require('./styles/rule/MixedDeclarationSet'); - -terminalWidth = require('../tools').getCols(); - -module.exports = Styles = (function() { - var self; - - self = Styles; - - Styles.defaultRules = { - '*': { - display: 'inline' - }, - 'body': { - background: 'none', - color: 'white', - display: 'block', - width: terminalWidth + ' !important' - } - }; - - function Styles() { - this._defaultStyles = new StyleSheet; - this._userStyles = new StyleSheet; - this._setDefaultStyles(); - } - - Styles.prototype._setDefaultStyles = function() { - this._defaultStyles.setRule(self.defaultRules); - }; - - Styles.prototype.setRule = function(selector, rules) { - this._userStyles.setRule.apply(this._userStyles, arguments); - return this; - }; - - Styles.prototype.getStyleFor = function(el) { - var styles; - styles = el.styles; - if (styles == null) { - el.styles = styles = this._getComputedStyleFor(el); - } - return styles; - }; - - Styles.prototype._getRawStyleFor = function(el) { - var def, user; - def = this._defaultStyles.getRulesFor(el); - user = this._userStyles.getRulesFor(el); - return MixedDeclarationSet.mix(def, user).toObject(); - }; - - Styles.prototype._getComputedStyleFor = function(el) { - var decs, parent, prop, ref, val; - decs = {}; - parent = el.parent; - ref = this._getRawStyleFor(el); - for (prop in ref) { - val = ref[prop]; - if (val !== 'inherit') { - decs[prop] = val; - } else { - throw Error("Inherited styles are not supported yet."); - } - } - return decs; - }; - - return Styles; - -})(); diff --git a/node_modules/renderkid/lib/renderKid/styleApplier/_common.js b/node_modules/renderkid/lib/renderKid/styleApplier/_common.js deleted file mode 100644 index 8e3bc5627..000000000 --- a/node_modules/renderkid/lib/renderKid/styleApplier/_common.js +++ /dev/null @@ -1,35 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var AnsiPainter, _common; - -AnsiPainter = require('../../AnsiPainter'); - -module.exports = _common = { - getStyleTagsFor: function(style) { - var i, len, ret, tag, tagName, tagsToAdd; - tagsToAdd = []; - if (style.color != null) { - tagName = 'color-' + style.color; - if (AnsiPainter.tags[tagName] == null) { - throw Error("Unkown color `" + style.color + "`"); - } - tagsToAdd.push(tagName); - } - if (style.background != null) { - tagName = 'bg-' + style.background; - if (AnsiPainter.tags[tagName] == null) { - throw Error("Unkown background `" + style.background + "`"); - } - tagsToAdd.push(tagName); - } - ret = { - before: '', - after: '' - }; - for (i = 0, len = tagsToAdd.length; i < len; i++) { - tag = tagsToAdd[i]; - ret.before = ("<" + tag + ">") + ret.before; - ret.after = ret.after + ("</" + tag + ">"); - } - return ret; - } -}; diff --git a/node_modules/renderkid/lib/renderKid/styleApplier/block.js b/node_modules/renderkid/lib/renderKid/styleApplier/block.js deleted file mode 100644 index de091d72b..000000000 --- a/node_modules/renderkid/lib/renderKid/styleApplier/block.js +++ /dev/null @@ -1,83 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var _common, blockStyleApplier, object, self; - -_common = require('./_common'); - -object = require('utila').object; - -module.exports = blockStyleApplier = self = { - applyTo: function(el, style) { - var config, ret; - ret = _common.getStyleTagsFor(style); - ret.blockConfig = config = {}; - this._margins(style, config); - this._bullet(style, config); - this._dims(style, config); - return ret; - }, - _margins: function(style, config) { - if (style.marginLeft != null) { - object.appendOnto(config, { - linePrependor: { - options: { - amount: parseInt(style.marginLeft) - } - } - }); - } - if (style.marginRight != null) { - object.appendOnto(config, { - lineAppendor: { - options: { - amount: parseInt(style.marginRight) - } - } - }); - } - if (style.marginTop != null) { - object.appendOnto(config, { - blockPrependor: { - options: { - amount: parseInt(style.marginTop) - } - } - }); - } - if (style.marginBottom != null) { - object.appendOnto(config, { - blockAppendor: { - options: { - amount: parseInt(style.marginBottom) - } - } - }); - } - }, - _bullet: function(style, config) { - var after, before, bullet, conf, ref; - if ((style.bullet != null) && style.bullet.enabled) { - bullet = style.bullet; - conf = {}; - conf.alignment = style.bullet.alignment; - ref = _common.getStyleTagsFor({ - color: bullet.color, - background: bullet.background - }), before = ref.before, after = ref.after; - conf.char = before + bullet.char + after; - object.appendOnto(config, { - linePrependor: { - options: { - bullet: conf - } - } - }); - } - }, - _dims: function(style, config) { - var w; - if (style.width != null) { - w = parseInt(style.width); - config.width = w; - } - } -}; diff --git a/node_modules/renderkid/lib/renderKid/styleApplier/inline.js b/node_modules/renderkid/lib/renderKid/styleApplier/inline.js deleted file mode 100644 index 0978fb07d..000000000 --- a/node_modules/renderkid/lib/renderKid/styleApplier/inline.js +++ /dev/null @@ -1,26 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var _common, inlineStyleApplier, self, tools; - -tools = require('../../tools'); - -_common = require('./_common'); - -module.exports = inlineStyleApplier = self = { - applyTo: function(el, style) { - var ret; - ret = _common.getStyleTagsFor(style); - if (style.marginLeft != null) { - ret.before = (tools.repeatString("&sp;", parseInt(style.marginLeft))) + ret.before; - } - if (style.marginRight != null) { - ret.after += tools.repeatString("&sp;", parseInt(style.marginRight)); - } - if (style.paddingLeft != null) { - ret.before += tools.repeatString("&sp;", parseInt(style.paddingLeft)); - } - if (style.paddingRight != null) { - ret.after = (tools.repeatString("&sp;", parseInt(style.paddingRight))) + ret.after; - } - return ret; - } -}; diff --git a/node_modules/renderkid/lib/renderKid/styles/Rule.js b/node_modules/renderkid/lib/renderKid/styles/Rule.js deleted file mode 100644 index 8e289281a..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/Rule.js +++ /dev/null @@ -1,21 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var DeclarationBlock, Rule, Selector; - -Selector = require('./rule/Selector'); - -DeclarationBlock = require('./rule/DeclarationBlock'); - -module.exports = Rule = (function() { - function Rule(selector) { - this.selector = new Selector(selector); - this.styles = new DeclarationBlock; - } - - Rule.prototype.setStyles = function(styles) { - this.styles.set(styles); - return this; - }; - - return Rule; - -})(); diff --git a/node_modules/renderkid/lib/renderKid/styles/StyleSheet.js b/node_modules/renderkid/lib/renderKid/styles/StyleSheet.js deleted file mode 100644 index 2ea260751..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/StyleSheet.js +++ /dev/null @@ -1,72 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Rule, StyleSheet; - -Rule = require('./Rule'); - -module.exports = StyleSheet = (function() { - var self; - - self = StyleSheet; - - function StyleSheet() { - this._rulesBySelector = {}; - } - - StyleSheet.prototype.setRule = function(selector, styles) { - var key, val; - if (typeof selector === 'string') { - this._setRule(selector, styles); - } else if (typeof selector === 'object') { - for (key in selector) { - val = selector[key]; - this._setRule(key, val); - } - } - return this; - }; - - StyleSheet.prototype._setRule = function(s, styles) { - var i, len, ref, selector; - ref = self.splitSelectors(s); - for (i = 0, len = ref.length; i < len; i++) { - selector = ref[i]; - this._setSingleRule(selector, styles); - } - return this; - }; - - StyleSheet.prototype._setSingleRule = function(s, styles) { - var rule, selector; - selector = self.normalizeSelector(s); - if (!(rule = this._rulesBySelector[selector])) { - rule = new Rule(selector); - this._rulesBySelector[selector] = rule; - } - rule.setStyles(styles); - return this; - }; - - StyleSheet.prototype.getRulesFor = function(el) { - var ref, rule, rules, selector; - rules = []; - ref = this._rulesBySelector; - for (selector in ref) { - rule = ref[selector]; - if (rule.selector.matches(el)) { - rules.push(rule); - } - } - return rules; - }; - - StyleSheet.normalizeSelector = function(selector) { - return selector.replace(/[\s]+/g, ' ').replace(/[\s]*([>\,\+]{1})[\s]*/g, '$1').trim(); - }; - - StyleSheet.splitSelectors = function(s) { - return s.trim().split(','); - }; - - return StyleSheet; - -})(); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/DeclarationBlock.js b/node_modules/renderkid/lib/renderKid/styles/rule/DeclarationBlock.js deleted file mode 100644 index b2821804b..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/DeclarationBlock.js +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Arbitrary, DeclarationBlock, declarationClasses; - -module.exports = DeclarationBlock = (function() { - var self; - - self = DeclarationBlock; - - function DeclarationBlock() { - this._declarations = {}; - } - - DeclarationBlock.prototype.set = function(prop, value) { - var key, val; - if (typeof prop === 'object') { - for (key in prop) { - val = prop[key]; - this.set(key, val); - } - return this; - } - prop = self.sanitizeProp(prop); - this._getDeclarationClass(prop).setOnto(this._declarations, prop, value); - return this; - }; - - DeclarationBlock.prototype._getDeclarationClass = function(prop) { - var cls; - if (prop[0] === '_') { - return Arbitrary; - } - if (!(cls = declarationClasses[prop])) { - throw Error("Unkown property `" + prop + "`. Write it as `_" + prop + "` if you're defining a custom property"); - } - return cls; - }; - - DeclarationBlock.sanitizeProp = function(prop) { - return String(prop).trim(); - }; - - return DeclarationBlock; - -})(); - -Arbitrary = require('./declarationBlock/Arbitrary'); - -declarationClasses = { - color: require('./declarationBlock/Color'), - background: require('./declarationBlock/Background'), - width: require('./declarationBlock/Width'), - height: require('./declarationBlock/Height'), - bullet: require('./declarationBlock/Bullet'), - display: require('./declarationBlock/Display'), - margin: require('./declarationBlock/Margin'), - marginTop: require('./declarationBlock/MarginTop'), - marginLeft: require('./declarationBlock/MarginLeft'), - marginRight: require('./declarationBlock/MarginRight'), - marginBottom: require('./declarationBlock/MarginBottom'), - padding: require('./declarationBlock/Padding'), - paddingTop: require('./declarationBlock/PaddingTop'), - paddingLeft: require('./declarationBlock/PaddingLeft'), - paddingRight: require('./declarationBlock/PaddingRight'), - paddingBottom: require('./declarationBlock/PaddingBottom') -}; diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/MixedDeclarationSet.js b/node_modules/renderkid/lib/renderKid/styles/rule/MixedDeclarationSet.js deleted file mode 100644 index ceea06ed7..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/MixedDeclarationSet.js +++ /dev/null @@ -1,78 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var MixedDeclarationSet, - slice = [].slice; - -module.exports = MixedDeclarationSet = (function() { - var self; - - self = MixedDeclarationSet; - - MixedDeclarationSet.mix = function() { - var i, len, mixed, ruleSets, rules; - ruleSets = 1 <= arguments.length ? slice.call(arguments, 0) : []; - mixed = new self; - for (i = 0, len = ruleSets.length; i < len; i++) { - rules = ruleSets[i]; - mixed.mixWithList(rules); - } - return mixed; - }; - - function MixedDeclarationSet() { - this._declarations = {}; - } - - MixedDeclarationSet.prototype.mixWithList = function(rules) { - var i, len, rule; - rules.sort(function(a, b) { - return a.selector.priority > b.selector.priority; - }); - for (i = 0, len = rules.length; i < len; i++) { - rule = rules[i]; - this._mixWithRule(rule); - } - return this; - }; - - MixedDeclarationSet.prototype._mixWithRule = function(rule) { - var dec, prop, ref; - ref = rule.styles._declarations; - for (prop in ref) { - dec = ref[prop]; - this._mixWithDeclaration(dec); - } - }; - - MixedDeclarationSet.prototype._mixWithDeclaration = function(dec) { - var cur; - cur = this._declarations[dec.prop]; - if ((cur != null) && cur.important && !dec.important) { - return; - } - this._declarations[dec.prop] = dec; - }; - - MixedDeclarationSet.prototype.get = function(prop) { - if (prop == null) { - return this._declarations; - } - if (this._declarations[prop] == null) { - return null; - } - return this._declarations[prop].val; - }; - - MixedDeclarationSet.prototype.toObject = function() { - var dec, obj, prop, ref; - obj = {}; - ref = this._declarations; - for (prop in ref) { - dec = ref[prop]; - obj[prop] = dec.val; - } - return obj; - }; - - return MixedDeclarationSet; - -})(); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/Selector.js b/node_modules/renderkid/lib/renderKid/styles/rule/Selector.js deleted file mode 100644 index 7b23903d3..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/Selector.js +++ /dev/null @@ -1,38 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var CSSSelect, Selector; - -CSSSelect = require('css-select'); - -module.exports = Selector = (function() { - var self; - - self = Selector; - - function Selector(text1) { - this.text = text1; - this._fn = CSSSelect.compile(this.text); - this.priority = self.calculatePriority(this.text); - } - - Selector.prototype.matches = function(elem) { - return CSSSelect.is(elem, this._fn); - }; - - Selector.calculatePriority = function(text) { - var n, priotrity; - priotrity = 0; - if (n = text.match(/[\#]{1}/g)) { - priotrity += 100 * n.length; - } - if (n = text.match(/[a-zA-Z]+/g)) { - priotrity += 2 * n.length; - } - if (n = text.match(/\*/g)) { - priotrity += 1 * n.length; - } - return priotrity; - }; - - return Selector; - -})(); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Arbitrary.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Arbitrary.js deleted file mode 100644 index 5411b3a73..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Arbitrary.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Arbitrary, _Declaration, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Declaration = require('./_Declaration'); - -module.exports = Arbitrary = (function(superClass) { - extend(Arbitrary, superClass); - - function Arbitrary() { - return Arbitrary.__super__.constructor.apply(this, arguments); - } - - return Arbitrary; - -})(_Declaration); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Background.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Background.js deleted file mode 100644 index e02b377cd..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Background.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Background, _Declaration, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Declaration = require('./_Declaration'); - -module.exports = Background = (function(superClass) { - extend(Background, superClass); - - function Background() { - return Background.__super__.constructor.apply(this, arguments); - } - - return Background; - -})(_Declaration); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Bullet.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Bullet.js deleted file mode 100644 index a04e0c7be..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Bullet.js +++ /dev/null @@ -1,63 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Bullet, _Declaration, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Declaration = require('./_Declaration'); - -module.exports = Bullet = (function(superClass) { - var self; - - extend(Bullet, superClass); - - function Bullet() { - return Bullet.__super__.constructor.apply(this, arguments); - } - - self = Bullet; - - Bullet.prototype._set = function(val) { - var alignment, bg, char, color, enabled, m, original; - val = String(val); - original = val; - char = null; - enabled = false; - color = 'none'; - bg = 'none'; - if (m = val.match(/\"([^"]+)\"/) || (m = val.match(/\'([^']+)\'/))) { - char = m[1]; - val = val.replace(m[0], ''); - enabled = true; - } - if (m = val.match(/(none|left|right|center)/)) { - alignment = m[1]; - val = val.replace(m[0], ''); - } else { - alignment = 'left'; - } - if (alignment === 'none') { - enabled = false; - } - if (m = val.match(/color\:([\w\-]+)/)) { - color = m[1]; - val = val.replace(m[0], ''); - } - if (m = val.match(/bg\:([\w\-]+)/)) { - bg = m[1]; - val = val.replace(m[0], ''); - } - if (val.trim() !== '') { - throw Error("Unrecognizable value `" + original + "` for `" + this.prop + "`"); - } - return this.val = { - enabled: enabled, - char: char, - alignment: alignment, - background: bg, - color: color - }; - }; - - return Bullet; - -})(_Declaration); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Color.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Color.js deleted file mode 100644 index 709dd89ea..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Color.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Color, _Declaration, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Declaration = require('./_Declaration'); - -module.exports = Color = (function(superClass) { - extend(Color, superClass); - - function Color() { - return Color.__super__.constructor.apply(this, arguments); - } - - return Color; - -})(_Declaration); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Display.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Display.js deleted file mode 100644 index 80a9ae440..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Display.js +++ /dev/null @@ -1,32 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Display, _Declaration, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - -_Declaration = require('./_Declaration'); - -module.exports = Display = (function(superClass) { - var self; - - extend(Display, superClass); - - function Display() { - return Display.__super__.constructor.apply(this, arguments); - } - - self = Display; - - Display._allowed = ['inline', 'block', 'none']; - - Display.prototype._set = function(val) { - val = String(val).toLowerCase(); - if (indexOf.call(self._allowed, val) < 0) { - throw Error("Unrecognizable value `" + val + "` for `" + this.prop + "`"); - } - return this.val = val; - }; - - return Display; - -})(_Declaration); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Height.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Height.js deleted file mode 100644 index 35bf7ba78..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Height.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Height, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Length = require('./_Length'); - -module.exports = Height = (function(superClass) { - extend(Height, superClass); - - function Height() { - return Height.__super__.constructor.apply(this, arguments); - } - - return Height; - -})(_Length); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Margin.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Margin.js deleted file mode 100644 index 6dfe0764d..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Margin.js +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Margin, MarginBottom, MarginLeft, MarginRight, MarginTop, _Declaration, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Declaration = require('./_Declaration'); - -MarginTop = require('./MarginTop'); - -MarginLeft = require('./MarginLeft'); - -MarginRight = require('./MarginRight'); - -MarginBottom = require('./MarginBottom'); - -module.exports = Margin = (function(superClass) { - var self; - - extend(Margin, superClass); - - function Margin() { - return Margin.__super__.constructor.apply(this, arguments); - } - - self = Margin; - - Margin.setOnto = function(declarations, prop, originalValue) { - var append, val, vals; - append = ''; - val = _Declaration.sanitizeValue(originalValue); - if (_Declaration.importantClauseRx.test(String(val))) { - append = ' !important'; - val = val.replace(_Declaration.importantClauseRx, ''); - } - val = val.trim(); - if (val.length === 0) { - return self._setAllDirections(declarations, append, append, append, append); - } - vals = val.split(" ").map(function(val) { - return val + append; - }); - if (vals.length === 1) { - return self._setAllDirections(declarations, vals[0], vals[0], vals[0], vals[0]); - } else if (vals.length === 2) { - return self._setAllDirections(declarations, vals[0], vals[1], vals[0], vals[1]); - } else if (vals.length === 3) { - return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[1]); - } else if (vals.length === 4) { - return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[3]); - } else { - throw Error("Can't understand value for margin: `" + originalValue + "`"); - } - }; - - Margin._setAllDirections = function(declarations, top, right, bottom, left) { - MarginTop.setOnto(declarations, 'marginTop', top); - MarginTop.setOnto(declarations, 'marginRight', right); - MarginTop.setOnto(declarations, 'marginBottom', bottom); - MarginTop.setOnto(declarations, 'marginLeft', left); - }; - - return Margin; - -})(_Declaration); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginBottom.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginBottom.js deleted file mode 100644 index 45f2e21af..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginBottom.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var MarginBottom, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Length = require('./_Length'); - -module.exports = MarginBottom = (function(superClass) { - extend(MarginBottom, superClass); - - function MarginBottom() { - return MarginBottom.__super__.constructor.apply(this, arguments); - } - - return MarginBottom; - -})(_Length); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginLeft.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginLeft.js deleted file mode 100644 index e4b1ddd6d..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginLeft.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var MarginLeft, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Length = require('./_Length'); - -module.exports = MarginLeft = (function(superClass) { - extend(MarginLeft, superClass); - - function MarginLeft() { - return MarginLeft.__super__.constructor.apply(this, arguments); - } - - return MarginLeft; - -})(_Length); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginRight.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginRight.js deleted file mode 100644 index 3d6fcdc03..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginRight.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var MarginRight, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Length = require('./_Length'); - -module.exports = MarginRight = (function(superClass) { - extend(MarginRight, superClass); - - function MarginRight() { - return MarginRight.__super__.constructor.apply(this, arguments); - } - - return MarginRight; - -})(_Length); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginTop.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginTop.js deleted file mode 100644 index ffd5ef329..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/MarginTop.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var MarginTop, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Length = require('./_Length'); - -module.exports = MarginTop = (function(superClass) { - extend(MarginTop, superClass); - - function MarginTop() { - return MarginTop.__super__.constructor.apply(this, arguments); - } - - return MarginTop; - -})(_Length); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Padding.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Padding.js deleted file mode 100644 index 9681204ba..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Padding.js +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Padding, PaddingBottom, PaddingLeft, PaddingRight, PaddingTop, _Declaration, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Declaration = require('./_Declaration'); - -PaddingTop = require('./PaddingTop'); - -PaddingLeft = require('./PaddingLeft'); - -PaddingRight = require('./PaddingRight'); - -PaddingBottom = require('./PaddingBottom'); - -module.exports = Padding = (function(superClass) { - var self; - - extend(Padding, superClass); - - function Padding() { - return Padding.__super__.constructor.apply(this, arguments); - } - - self = Padding; - - Padding.setOnto = function(declarations, prop, originalValue) { - var append, val, vals; - append = ''; - val = _Declaration.sanitizeValue(originalValue); - if (_Declaration.importantClauseRx.test(String(val))) { - append = ' !important'; - val = val.replace(_Declaration.importantClauseRx, ''); - } - val = val.trim(); - if (val.length === 0) { - return self._setAllDirections(declarations, append, append, append, append); - } - vals = val.split(" ").map(function(val) { - return val + append; - }); - if (vals.length === 1) { - return self._setAllDirections(declarations, vals[0], vals[0], vals[0], vals[0]); - } else if (vals.length === 2) { - return self._setAllDirections(declarations, vals[0], vals[1], vals[0], vals[1]); - } else if (vals.length === 3) { - return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[1]); - } else if (vals.length === 4) { - return self._setAllDirections(declarations, vals[0], vals[1], vals[2], vals[3]); - } else { - throw Error("Can't understand value for padding: `" + originalValue + "`"); - } - }; - - Padding._setAllDirections = function(declarations, top, right, bottom, left) { - PaddingTop.setOnto(declarations, 'paddingTop', top); - PaddingTop.setOnto(declarations, 'paddingRight', right); - PaddingTop.setOnto(declarations, 'paddingBottom', bottom); - PaddingTop.setOnto(declarations, 'paddingLeft', left); - }; - - return Padding; - -})(_Declaration); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingBottom.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingBottom.js deleted file mode 100644 index 7052a6064..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingBottom.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var PaddingBottom, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Length = require('./_Length'); - -module.exports = PaddingBottom = (function(superClass) { - extend(PaddingBottom, superClass); - - function PaddingBottom() { - return PaddingBottom.__super__.constructor.apply(this, arguments); - } - - return PaddingBottom; - -})(_Length); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingLeft.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingLeft.js deleted file mode 100644 index 35d5fbd68..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingLeft.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var PaddingLeft, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Length = require('./_Length'); - -module.exports = PaddingLeft = (function(superClass) { - extend(PaddingLeft, superClass); - - function PaddingLeft() { - return PaddingLeft.__super__.constructor.apply(this, arguments); - } - - return PaddingLeft; - -})(_Length); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingRight.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingRight.js deleted file mode 100644 index 31d2af99c..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingRight.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var PaddingRight, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Length = require('./_Length'); - -module.exports = PaddingRight = (function(superClass) { - extend(PaddingRight, superClass); - - function PaddingRight() { - return PaddingRight.__super__.constructor.apply(this, arguments); - } - - return PaddingRight; - -})(_Length); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingTop.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingTop.js deleted file mode 100644 index a6cf14ac3..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/PaddingTop.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var PaddingTop, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Length = require('./_Length'); - -module.exports = PaddingTop = (function(superClass) { - extend(PaddingTop, superClass); - - function PaddingTop() { - return PaddingTop.__super__.constructor.apply(this, arguments); - } - - return PaddingTop; - -})(_Length); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Width.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Width.js deleted file mode 100644 index 4f573b62f..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/Width.js +++ /dev/null @@ -1,17 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var Width, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Length = require('./_Length'); - -module.exports = Width = (function(superClass) { - extend(Width, superClass); - - function Width() { - return Width.__super__.constructor.apply(this, arguments); - } - - return Width; - -})(_Length); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Declaration.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Declaration.js deleted file mode 100644 index dce27e213..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Declaration.js +++ /dev/null @@ -1,84 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var _Declaration; - -module.exports = _Declaration = (function() { - var self; - - self = _Declaration; - - _Declaration.importantClauseRx = /(\s\!important)$/; - - _Declaration.setOnto = function(declarations, prop, val) { - var dec; - if (!(dec = declarations[prop])) { - return declarations[prop] = new this(prop, val); - } else { - return dec.set(val); - } - }; - - _Declaration.sanitizeValue = function(val) { - return String(val).trim().replace(/[\s]+/g, ' '); - }; - - _Declaration.inheritAllowed = false; - - function _Declaration(prop1, val) { - this.prop = prop1; - this.important = false; - this.set(val); - } - - _Declaration.prototype.get = function() { - return this._get(); - }; - - _Declaration.prototype._get = function() { - return this.val; - }; - - _Declaration.prototype._pickImportantClause = function(val) { - if (self.importantClauseRx.test(String(val))) { - this.important = true; - return val.replace(self.importantClauseRx, ''); - } else { - this.important = false; - return val; - } - }; - - _Declaration.prototype.set = function(val) { - val = self.sanitizeValue(val); - val = this._pickImportantClause(val); - val = val.trim(); - if (this._handleNullOrInherit(val)) { - return this; - } - this._set(val); - return this; - }; - - _Declaration.prototype._set = function(val) { - return this.val = val; - }; - - _Declaration.prototype._handleNullOrInherit = function(val) { - if (val === '') { - this.val = ''; - return true; - } - if (val === 'inherit') { - if (this.constructor.inheritAllowed) { - this.val = 'inherit'; - } else { - throw Error("Inherit is not allowed for `" + this.prop + "`"); - } - return true; - } else { - return false; - } - }; - - return _Declaration; - -})(); diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Length.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Length.js deleted file mode 100644 index 0440d30c3..000000000 --- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Length.js +++ /dev/null @@ -1,24 +0,0 @@ -// Generated by CoffeeScript 1.9.3 -var _Declaration, _Length, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - -_Declaration = require('./_Declaration'); - -module.exports = _Length = (function(superClass) { - extend(_Length, superClass); - - function _Length() { - return _Length.__super__.constructor.apply(this, arguments); - } - - _Length.prototype._set = function(val) { - if (!/^[0-9]+$/.test(String(val))) { - throw Error("`" + this.prop + "` only takes an integer for value"); - } - return this.val = parseInt(val); - }; - - return _Length; - -})(_Declaration); |