Skip to content

Commit

Permalink
templates blends and slideDeck work in ie+
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonwright committed Oct 12, 2015
2 parents 2970044 + 06699d6 commit 2a9b084
Show file tree
Hide file tree
Showing 29 changed files with 1,351 additions and 669 deletions.
25 changes: 16 additions & 9 deletions Gulpfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ fs = require("fs")
minify = require("minify")
path = require('path')
traitify = require('traitify');
coffee = require('gulp-coffee');
gutil = require('gulp-util');
qunit = require('gulp-qunit');
concat = require('gulp-concat');
Expand All @@ -16,15 +15,20 @@ gzip = require('gulp-gzip');
notify = require("gulp-notify");
insert = require("gulp-insert");
escapeString = require("js-string-escape");
gulpCopy = require("gulp-copy");
clean = require('gulp-clean');

gulp.task('clean:lib', ->
gulp.src('./public/js/lib', {read: false})
.pipe(clean())
)

getFolderName = (filename)->
fileSlice = filename.path.split("/")
fileSlice.slice(0, fileSlice.length - 1).join("/")

gulp.task('coffee', ->
gulp.src('./src/**/*.coffee')
.pipe(coffee({bare: true}).on('error', gutil.log))
.pipe(gulp.dest('./public/js'))
#["clean:lib"],
gulp.task('lib', ->
gulp.src('src/lib/**/*.js').pipe(gulp.dest("public/js/lib"))
)

gulp.task('mustache', ->
Expand All @@ -36,10 +40,13 @@ gulp.task('mustache', ->
data = data.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "")

options = {
name: details.name,
data: details.data,
template: data,
target: details.target,
scripts: scripts.map((script)-> script.replace(/\<script\>/g, "").replace(/\<\/script\>/g, ""))
}

data = "Traitify.ui.widget(\"#{details.name}\", #{JSON.stringify(options)})"
data
)).pipe(rename({extname: ".js"})).pipe(gulp.dest("./public/js/templates"))
Expand All @@ -60,8 +67,8 @@ gulp.task('watch', ->
gulp.watch('./src/templates/**/*.mustache', {}, ->
gulp.start('mustache')
)
gulp.watch('./src/**/*.coffee', {}, ->
gulp.start('coffee')
gulp.watch('./src/lib/*.js', {}, ->
gulp.start('lib')
)
gulp.watch('./public/js/**/*.js', {}, ->
gulp.start("bundle:concat")
Expand Down Expand Up @@ -99,7 +106,7 @@ gulp.task('bundle:compress', ->
)

gulp.task('bundle', ->
runSequence('coffee', 'mustache', "bundle:concat", "bundle:minify", "bundle:compress")
runSequence('lib', 'mustache', "bundle:concat", "bundle:minify", "bundle:compress")
)

gulp.task('bundles', ->
Expand Down
5 changes: 4 additions & 1 deletion bundles.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
v2:
- "public/support/polyfill"
- "traitify-js-client/compiled/bundles/v1"
- "public/js/lib/v2-client-patch"
- "public/support/mustache"
- "public/support/currentscript_polyfill"
- "public/js/lib/polyfill"
- "public/js/lib/main"
- "public/js/templates/slide-deck/slide-deck"

- "public/js/templates/personality-blend/personality-blend"
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"cors": "latest",
"express": "^4.12.4",
"gulp": ">= 3.8.11",
"gulp-clean": "^0.3.1",
"gulp-coffee": "latest",
"gulp-concat": "^2.5.2",
"gulp-copy": "0.0.2",
"gulp-gzip": "^1.1.0",
"gulp-insert": "^0.5.0",
"gulp-notify": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion public/assessment.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"id":"26da6496-3461-41bb-8e7d-2f12fc6e2ce4","deck_id":"career-deck","tags":null,"completed_at":null,"created_at":1443192844014,"publicKey":"qiohnq1emjqmiebinnli9lskfv","host":"api-sandbox.traitify.com"}
{"id":"ece5cfff-8909-41b3-942a-ca8af771786b","deck_id":"career-deck","tags":null,"completed_at":null,"created_at":1444680243643,"publicKey":"qiohnq1emjqmiebinnli9lskfv","host":"api-sandbox.traitify.com"}
Loading

0 comments on commit 2a9b084

Please sign in to comment.