From b7cd46a6fe02b1ce1db910b8e5549ff39b2bc0a2 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sat, 19 Sep 2015 19:42:47 -0500 Subject: [PATCH] Move subscription blocks to separate module --- common/script/content/index.coffee | 8 +---- .../script/src/content/subscription-blocks.js | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 common/script/src/content/subscription-blocks.js diff --git a/common/script/content/index.coffee b/common/script/content/index.coffee index 311607f36c..0b33567d4c 100644 --- a/common/script/content/index.coffee +++ b/common/script/content/index.coffee @@ -1760,13 +1760,7 @@ api.backgrounds = text: t('backgroundTavernText') notes: t('backgroundTavernNotes') -api.subscriptionBlocks = - basic_earned: months:1, price:5 - basic_3mo: months:3, price:15 - basic_6mo: months:6, price:30 - google_6mo: months:6, price:24, discount:true, original:30 - basic_12mo: months:12, price:48 -_.each api.subscriptionBlocks, (b,k)->b.key = k +api.subscriptionBlocks = require('../../dist/scripts/content/subscription-blocks') api.userDefaults = require('../../dist/scripts/content/user-defaults') diff --git a/common/script/src/content/subscription-blocks.js b/common/script/src/content/subscription-blocks.js new file mode 100644 index 0000000000..f51ed45cc7 --- /dev/null +++ b/common/script/src/content/subscription-blocks.js @@ -0,0 +1,32 @@ +import {each} from 'lodash'; + +let subscriptionBlocks = { + basic_earned: { + months: 1, + price: 5 + }, + basic_3mo: { + months: 3, + price: 15 + }, + basic_6mo: { + months: 6, + price: 30 + }, + google_6mo: { + months: 6, + price: 24, + discount: true, + original: 30 + }, + basic_12mo: { + months: 12, + price: 48 + } +}; + +each(subscriptionBlocks, function(block, key) { + block.key = key; +}); + +export default subscriptionBlocks;