Port Memes to TypeScript
This commit is contained in:
parent
ef9a08d3fc
commit
1a408e1bc6
|
@ -1,5 +0,0 @@
|
||||||
import cheet from 'cheet.js'
|
|
||||||
|
|
||||||
cheet 'up up down down left right left right b a', ->
|
|
||||||
($ "body").addClass 'fa-spin'
|
|
||||||
($ "p.answerbox__question-text").each (i) -> ($ this).html ":^)"
|
|
|
@ -10,6 +10,7 @@ import initLists from 'retrospring/features/lists';
|
||||||
import initQuestionbox from 'retrospring/features/questionbox';
|
import initQuestionbox from 'retrospring/features/questionbox';
|
||||||
import initQuestion from 'retrospring/features/question';
|
import initQuestion from 'retrospring/features/question';
|
||||||
import initModeration from 'retrospring/features/moderation';
|
import initModeration from 'retrospring/features/moderation';
|
||||||
|
import initMemes from 'retrospring/features/memes';
|
||||||
|
|
||||||
start();
|
start();
|
||||||
document.addEventListener('DOMContentLoaded', initAnswerbox);
|
document.addEventListener('DOMContentLoaded', initAnswerbox);
|
||||||
|
@ -20,4 +21,5 @@ document.addEventListener('DOMContentLoaded', initLists);
|
||||||
document.addEventListener('DOMContentLoaded', initQuestionbox);
|
document.addEventListener('DOMContentLoaded', initQuestionbox);
|
||||||
document.addEventListener('DOMContentLoaded', initQuestion);
|
document.addEventListener('DOMContentLoaded', initQuestion);
|
||||||
document.addEventListener('DOMContentLoaded', initModeration);
|
document.addEventListener('DOMContentLoaded', initModeration);
|
||||||
|
document.addEventListener('DOMContentLoaded', initMemes);
|
||||||
document.addEventListener('turbolinks:load', initAnnouncements)
|
document.addEventListener('turbolinks:load', initAnnouncements)
|
|
@ -9,7 +9,6 @@ import Cookies from 'js-cookie'
|
||||||
|
|
||||||
# this file is generated by Rails
|
# this file is generated by Rails
|
||||||
import I18n from '../legacy/i18n'
|
import I18n from '../legacy/i18n'
|
||||||
import '../legacy/memes'
|
|
||||||
import '../legacy/pagination'
|
import '../legacy/pagination'
|
||||||
import '../legacy/locale-box'
|
import '../legacy/locale-box'
|
||||||
import '../legacy/util'
|
import '../legacy/util'
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
import cheet from 'cheet.js';
|
||||||
|
|
||||||
|
export default (): void => {
|
||||||
|
cheet('up up down down left right left right b a', () => {
|
||||||
|
document.body.classList.add('fa-spin');
|
||||||
|
|
||||||
|
Array.from(document.querySelectorAll('.answerbox__question-text')).forEach((element: HTMLElement) => {
|
||||||
|
element.innerText = ':^)';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue