From 4862602bea4e4b47a707609f007f5ac5a7abd473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Z=CC=8Celjko=20Galetic=CC=81?= Date: Tue, 5 Apr 2016 19:49:57 +0200 Subject: [PATCH 1/8] Created component library to allow components extending and creation of new components --- lib/componentFactory.js | 130 ++---------------------------------- lib/componentLibrary.js | 141 ++++++++++++++++++++++++++++++++++++++++ lib/inky.js | 2 + 3 files changed, 148 insertions(+), 125 deletions(-) create mode 100644 lib/componentLibrary.js diff --git a/lib/componentFactory.js b/lib/componentFactory.js index 0361e4d..5057150 100644 --- a/lib/componentFactory.js +++ b/lib/componentFactory.js @@ -7,130 +7,10 @@ var $ = require('cheerio'); * @returns {string} HTML converted from a custom element to table syntax. */ module.exports = function(element) { - var inner = element.html(); - - switch (element[0].name) { - // - case this.components.columns: - return this.makeColumn(element, 'columns'); - - // - case this.components.row: - var classes = ['row']; - if (element.attr('class')) { - classes = classes.concat(element.attr('class').split(' ')); - } - - return format('%s
', classes.join(' '), inner); - - //