Skip to content

Commit 75cff1a

Browse files
committed
fix(image): Fixed default return bug in image embed and remove dead code
1 parent c19b027 commit 75cff1a

7 files changed

Lines changed: 2967 additions & 3082 deletions

File tree

Gruntfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ module.exports = function(grunt) {
2929
},
3030
css: {
3131
files: ['src/css/**/*.scss'],
32-
tasks: ['sass']
32+
tasks: ['sass','postcss']
3333
},
3434
js: {
3535
files: ['src/js/**/*.es6','build.json'],
36-
tasks: ['webpack:build-dev']
36+
tasks: ['webpack:build-dev','uglify']
3737
}
3838
},
3939

dist/embed.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/embed.js

Lines changed: 2946 additions & 3071 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/embed.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/modules/audio/audio.es6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const utils = require('../utils.es6');
22

3-
// if(build.SOUNDCLOUD) var SoundCloud = require('./soundcloud.es6');
3+
if(build.SOUNDCLOUD) var SoundCloud = require('./soundcloud.es6');
44
if(build.SPOTIFY) var Spotify = require('./spotify.es6');
55
if(build.BASICAUDIO) var BasicAudio = require('./basic.es6');
66

@@ -17,7 +17,7 @@ class Audio{
1717
let output = this.output;
1818
let embeds = this.embeds;
1919
console.log(output, embeds);
20-
// embeds = utils.ifEmbed(this.options, 'soundcloud') && build.SOUNDCLOUD ? (new SoundCloud(this.input, this.options, embeds).process()) : embeds;
20+
embeds = utils.ifEmbed(this.options, 'soundcloud') && build.SOUNDCLOUD ? (new SoundCloud(this.input, this.options, embeds).process()) : embeds;
2121
embeds = utils.ifEmbed(this.options, 'spotify') && build.SPOTIFY ? (new Spotify(this.input, this.options, embeds).process()) : embeds;
2222
embeds = this.options.audioEmbed && build.BASICAUDIO ? (new BasicAudio(this.input, this.options, embeds).process()) : embeds;
2323

src/js/modules/image/image.es6

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class Image{
1717
let input = this.input;
1818
let output = this.output;
1919
let embeds = this.embeds;
20-
embeds = utils.ifEmbed(this.options, 'flickr') && build.FLICKR ? (new Flickr(input, this.options, embeds).process()) : output;
21-
embeds = utils.ifEmbed(this.options, 'instagram') && build.INSTAGRAM ? (new Instagram(input, this.options, embeds).process()) : output;
22-
embeds = this.options.imageEmbed && build.BASICIMAGE ? (new Basic(input, this.options, embeds).process()) : output;
20+
embeds = utils.ifEmbed(this.options, 'flickr') && build.FLICKR ? (new Flickr(input, this.options, embeds).process()) : embeds;
21+
embeds = utils.ifEmbed(this.options, 'instagram') && build.INSTAGRAM ? (new Instagram(input, this.options, embeds).process()) : embeds;
22+
embeds = this.options.imageEmbed && build.BASICIMAGE ? (new Basic(input, this.options, embeds).process()) : embeds;
2323

2424
return [output, embeds];
2525
}catch(error){

webpack.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ module.exports = {
3030
'fetchJsonp': 'fetch-jsonp'
3131
}),
3232
new webpack.optimize.DedupePlugin(),
33+
new webpack.optimize.UglifyJsPlugin({
34+
compress:{
35+
warnings:false
36+
},
37+
mangle:false,
38+
output:{
39+
beautify:true,
40+
comments:true
41+
}
42+
})
3343
],
3444
stats: {
3545
// Nice colored output

0 commit comments

Comments
 (0)