From: Jeanie Chung
Date: Wed, 18 Feb 2015 02:37:05 +0000 (-0800)
Subject: Changes to gulpfile to make exporting inky index.js easier. Added inline lists and...
X-Git-Tag: v2.0.0-rc.1~135
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eda5ac991d016fa42bbccc2ad2bf71e52c0990b;p=thirdparty%2Ffoundation%2Ffoundation-emails.git
Changes to gulpfile to make exporting inky index.js easier. Added inline lists and some corrections to how columns nest items in td elements. :cool: :cool: :cool:
---
diff --git a/gulpfile.js b/gulpfile.js
index 28c65319..38f8877b 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -104,8 +104,8 @@ gulp.task('copy-html', function() {
// - - - - - - - - - - - - - - -
gulp.task('inky-prime', function() {
- return gulp.src('node_modules/gulp-zurb-foundation-email/index.js')
- .pipe(gulp.dest('./output'));
+ return gulp.src('node_modules/gulp-zurb-foundation-email/node_modules/gulp-zurb-inky/index.js')
+ .pipe(gulp.dest('./output/gulp-zurb-inky'));
})
gulp.task('js', function() {
diff --git a/html/index.html b/html/index.html
index 2b9e5d4f..09f20608 100644
--- a/html/index.html
+++ b/html/index.html
@@ -90,7 +90,7 @@
-
+
@@ -99,7 +99,7 @@
-
+
@@ -119,20 +119,27 @@
-
-
- got some success yo
-
-
+
great success
-
-
- Watch out there, cowboy. Watch out there, cowboy. Watch out there, cowboy. Watch out there, cowboy. Watch out there, cowboy. Watch out there, cowboy. Watch out there, cowboy. Watch out there, cowboy. Watch out there, cowboy. Watch out there, cowboy. Watch oasdfasdfaout there, cowboy. Watch out there, cowboy. Watch out there, cowboy.
-
diff --git a/output/gulp-zurb-inky/index.js b/output/gulp-zurb-inky/index.js
index 77b27b8a..4a3e5edf 100644
--- a/output/gulp-zurb-inky/index.js
+++ b/output/gulp-zurb-inky/index.js
@@ -8,7 +8,9 @@ var Inky = function Inky () {
callout: 'callout',
columns: 'columns',
subcolumns: 'subcolumns',
- container: 'container'
+ container: 'container',
+ inlineListH: 'inline-list-h',
+ inlineListV: 'inline-list-v'
}
};
@@ -39,6 +41,37 @@ Inky.prototype = {
self.zfArray = arr;
},
+ isZfElement: function(elType) {
+ var self = this;
+ // create an array of our custom tags, if we haven't done so already
+ if(!self.zfArray) {
+ self.setTagArray();
+ }
+
+ // if the element is a custom element
+ if (self.zfArray.indexOf(elType) !== -1) {
+ // return true
+ return true;
+ }
+ else {
+ return false;
+ }
+ },
+
+ isTdElement: function(elType) {
+ var tdEls = ['subcolumns', 'callout']
+
+ // if the element is an element that comes with td
+ if (tdEls.indexOf(elType) !== -1) {
+ // return true
+ return true;
+ }
+ else {
+ return false;
+ }
+
+ },
+
// Description:
// Takes in HTML loaded via Cheerio as an argument, checks if there are any custom components.
// If there are, it replaces the nested components, traverses the DOM and replaces them with
@@ -226,6 +259,16 @@ Inky.prototype = {
output = '
';
- // subcolumns do not need an extra td
+
+ // if the column has children, put them in a td
+ // if the child already has a td with it (i.e subcolumns/callouts), just place them inside
// otherwise, place stuff inside columns in a td
- if ($(col).children()[0] && $(col).children()[0].name !== 'subcolumns') {
+
+ if ($(col).children()[0] && !self.isTdElement($(col).children()[0].name)) {
output += '