Skip to content

Commit

Permalink
swap encodeURI -> base64 encoded string
Browse files Browse the repository at this point in the history
  • Loading branch information
westlywright committed Aug 14, 2018
1 parent 0ae0b6f commit 3d741ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions component/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default Ember.Component.extend(NodeDriver, {
init() {
/*!!!!!!!!!!!DO NOT CHANGE START!!!!!!!!!!!*/
// This does on the fly template compiling, if you mess with this :cry:
const decodedLayout = decodeURI(LAYOUT);
const template = Ember.HTMLBars.compile(decodedLayout, {
const decodedLayout = window.atob(LAYOUT);
const template = Ember.HTMLBars.compile(decodedLayout, {
moduleName: 'nodes/components/driver-interoutevdc/template'
});
set(this,'layout', template);
Expand Down
6 changes: 4 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ gulp.task('babel', ['assets'], function() {
"comments": false
};

const hbs = fs.readFileSync(`${BASE}template.hbs`);
let hbs = fs.readFileSync(`${BASE}template.hbs`);

hbs = Buffer.from(hbs).toString('base64');

return gulp.src([
`${BASE}component.js`
])
.pipe(replace('const LAYOUT;', `const LAYOUT = "${ encodeURI(hbs) }";`))
.pipe(replace('const LAYOUT;', `const LAYOUT = "${ hbs }";`))
.pipe(babel(opts))
.pipe(gulpConcat(`component.js`,{newLine: ';\n'}))
.pipe(gulp.dest(TMP));
Expand Down

0 comments on commit 3d741ca

Please sign in to comment.