Skip to content
This repository was archived by the owner on Mar 6, 2020. It is now read-only.

Commit f6debe4

Browse files
author
René Kooi
committed
emoji-data: jscs
1 parent 7c8d387 commit f6debe4

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

src/plugins/EmojiDataPlugin.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
11
define(function (require, exports, module) {
22

3-
const Plugin = require('../Plugin')
4-
const Events = require('plug/core/Events')
5-
const emoji = require('plug/util/emoji')
6-
const { around } = require('meld')
3+
const Plugin = require('../Plugin');
4+
const Events = require('plug/core/Events');
5+
const emoji = require('plug/util/emoji');
6+
const { around } = require('meld');
77

88
const EmojiDataPlugin = Plugin.extend({
99
name: 'Emoji Data',
1010
description: 'Adds CSS classes and HTML5 data attributes to emoji images.',
1111

1212
enable() {
1313
this.advice = around(emoji, 'replacement', joinpoint => {
14-
let name = joinpoint.args[2]
14+
let name = joinpoint.args[2];
1515
if (!name) {
1616
// attempt to find the name in the emoji-data map
17-
let id = joinpoint.args[0]
18-
let data = emoji.data[id]
19-
if (data) name = data[3][0]
17+
let id = joinpoint.args[0];
18+
let data = emoji.data[id];
19+
if (data) name = data[3][0];
2020
}
21-
let html = joinpoint.proceed()
21+
let html = joinpoint.proceed();
2222
if (name) {
2323
return html.replace(
2424
' class="emoji-inner',
2525
` data-emoji-name="${name}" class="emoji-inner extplug-emoji-${name}`
26-
)
26+
);
2727
}
28-
return html
29-
})
28+
return html;
29+
});
3030

3131
this.listenTo(Events, 'chat:afterreceive', (msg, el) => {
3232
el.find('.gemoji-plug').each(function () {
33-
let inner = $(this)
34-
let emojiName = inner.attr('class').match(/gemoji-plug-(\S+)/)
33+
let inner = $(this);
34+
let emojiName = inner.attr('class').match(/gemoji-plug-(\S+)/);
3535
if (emojiName) {
3636
inner.attr('data-emoji-name', emojiName[1])
37-
.addClass(`extplug-emoji-${name}`)
37+
.addClass(`extplug-emoji-${name}`);
3838
}
39-
})
40-
})
39+
});
40+
});
4141
},
4242

4343
disable() {
44-
this.advice.remove()
44+
this.advice.remove();
4545
}
46-
})
46+
});
4747

48-
module.exports = EmojiDataPlugin
48+
module.exports = EmojiDataPlugin;
4949

50-
})
50+
});

0 commit comments

Comments
 (0)