From d20354dd47bbb2dc72408653556a6d8dfc4b8fe9 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Thu, 17 Sep 2015 08:03:33 -0500 Subject: [PATCH] Es2015ify the js content --- common/script/content/events.js | 4 +--- common/script/content/faq.js | 10 ++++------ common/script/content/index.coffee | 2 ++ common/script/content/mystery-sets.js | 10 ++++------ common/script/content/time-traveler-stable.js | 6 ++---- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/common/script/content/events.js b/common/script/content/events.js index 8497a0317d..4cef45bb1f 100644 --- a/common/script/content/events.js +++ b/common/script/content/events.js @@ -1,10 +1,8 @@ -'use strict'; - // IMPORTANT: The end date should be one to two days AFTER the actual end of // the event, to allow people in different timezones to still buy the // event gear up until at least the actual end of the event. -var events = { +let events = { winter: {start:'2013-12-31',end:'2014-02-01'}, birthday: {start:'2013-01-30',end:'2014-02-01'}, spring: {start:'2014-03-21',end:'2014-05-01'}, diff --git a/common/script/content/faq.js b/common/script/content/faq.js index 09752d1002..808dc3497b 100644 --- a/common/script/content/faq.js +++ b/common/script/content/faq.js @@ -1,15 +1,13 @@ -'use strict'; +let t = require('./helpers/translator.js'); -var t = require('./helpers/translator.js'); +const NUMBER_OF_QUESTIONS = 12; -var NUMBER_OF_QUESTIONS = 12; - -var faq = {}; +let faq = {}; faq.questions = []; for (var i = 0; i < NUMBER_OF_QUESTIONS; i++) { - var question = { + let question = { question: t('faqQuestion' + i), ios: t('iosFaqAnswer' + i), web: t('webFaqAnswer' + i) diff --git a/common/script/content/index.coffee b/common/script/content/index.coffee index 6fc9720b87..19d3ce6d9f 100644 --- a/common/script/content/index.coffee +++ b/common/script/content/index.coffee @@ -4,6 +4,8 @@ _ = require 'lodash' moment = require 'moment' t = require './helpers/translator.js' +require('babel/register') + ### --------------------------------------------------------------- Gear (Weapons, Armor, Head, Shield) diff --git a/common/script/content/mystery-sets.js b/common/script/content/mystery-sets.js index b62a4b5a64..8c9023694b 100644 --- a/common/script/content/mystery-sets.js +++ b/common/script/content/mystery-sets.js @@ -1,8 +1,6 @@ -'use strict'; +let each = require('lodash').each; -var each = require('lodash').each; - -var mysterySets = { +let mysterySets = { 201402: { start: '2014-02-22', end: '2014-02-28', @@ -114,8 +112,8 @@ var mysterySets = { } }; -each(mysterySets, function(value, key) { - value.key = key; +each(mysterySets, (objectSet, name) => { + objectSet.key = name; }); module.exports = mysterySets; diff --git a/common/script/content/time-traveler-stable.js b/common/script/content/time-traveler-stable.js index ad60931d08..4efab5e69a 100644 --- a/common/script/content/time-traveler-stable.js +++ b/common/script/content/time-traveler-stable.js @@ -1,8 +1,6 @@ -'use strict'; +let t = require('./helpers/translator.js'); -var t = require('./helpers/translator.js'); - -var stable = { +let stable = { pets: { 'Mammoth-Base': t('mammoth'), 'MantisShrimp-Base': t('mantisShrimp')