mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Move user defaults to separate module
This commit is contained in:
@@ -1768,30 +1768,7 @@ api.subscriptionBlocks =
|
|||||||
basic_12mo: months:12, price:48
|
basic_12mo: months:12, price:48
|
||||||
_.each api.subscriptionBlocks, (b,k)->b.key = k
|
_.each api.subscriptionBlocks, (b,k)->b.key = k
|
||||||
|
|
||||||
# repeat = {m:true,t:true,w:true,th:true,f:true,s:true,su:true}
|
api.userDefaults = require('../../dist/scripts/content/user-defaults')
|
||||||
api.userDefaults =
|
|
||||||
habits: [
|
|
||||||
{type: 'habit', text: t('defaultHabit1Text'), value: 0, up: true, down: false, attribute: 'per' }
|
|
||||||
{type: 'habit', text: t('defaultHabit2Text'), value: 0, up: false, down: true, attribute: 'str'}
|
|
||||||
{type: 'habit', text: t('defaultHabit3Text'), value: 0, up: true, down: true, attribute: 'str'}
|
|
||||||
]
|
|
||||||
|
|
||||||
dailys: [
|
|
||||||
]
|
|
||||||
|
|
||||||
todos: [
|
|
||||||
{type: 'todo', text: t('defaultTodo1Text'), notes: t('defaultTodoNotes'), completed: false, attribute: 'int' }
|
|
||||||
]
|
|
||||||
|
|
||||||
rewards: [
|
|
||||||
{type: 'reward', text: t('defaultReward1Text'), value: 10 }
|
|
||||||
]
|
|
||||||
|
|
||||||
tags: [
|
|
||||||
{name: t('defaultTag1')}
|
|
||||||
{name: t('defaultTag2')}
|
|
||||||
{name: t('defaultTag3')}
|
|
||||||
]
|
|
||||||
|
|
||||||
api.faq = require "../../dist/scripts/content/faq"
|
api.faq = require "../../dist/scripts/content/faq"
|
||||||
|
|
||||||
|
|||||||
60
common/script/src/content/user-defaults.js
Normal file
60
common/script/src/content/user-defaults.js
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
let habits = [
|
||||||
|
{
|
||||||
|
type: 'habit',
|
||||||
|
text: t('defaultHabit1Text'),
|
||||||
|
value: 0,
|
||||||
|
up: true,
|
||||||
|
down: false,
|
||||||
|
attribute: 'per',
|
||||||
|
}, {
|
||||||
|
type: 'habit',
|
||||||
|
text: t('defaultHabit2Text'),
|
||||||
|
value: 0,
|
||||||
|
up: false,
|
||||||
|
down: true,
|
||||||
|
attribute: 'str',
|
||||||
|
}, {
|
||||||
|
type: 'habit',
|
||||||
|
text: t('defaultHabit3Text'),
|
||||||
|
value: 0,
|
||||||
|
up: true,
|
||||||
|
down: true,
|
||||||
|
attribute: 'str',
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
let dailys = [];
|
||||||
|
|
||||||
|
let todos = [
|
||||||
|
{
|
||||||
|
type: 'todo',
|
||||||
|
text: t('defaultTodo1Text'),
|
||||||
|
notes: t('defaultTodoNotes'),
|
||||||
|
completed: false,
|
||||||
|
attribute: 'int',
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
let rewards = [
|
||||||
|
{
|
||||||
|
type: 'reward',
|
||||||
|
text: t('defaultReward1Text'),
|
||||||
|
value: 10,
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
let tags = [
|
||||||
|
{ name: t('defaultTag1') },
|
||||||
|
{ name: t('defaultTag2') },
|
||||||
|
{ name: t('defaultTag3') },
|
||||||
|
]
|
||||||
|
|
||||||
|
let userDefaults = {
|
||||||
|
habits: habits,
|
||||||
|
dailys: dailys,
|
||||||
|
todos: todos,
|
||||||
|
rewards: rewards,
|
||||||
|
tags: tags
|
||||||
|
};
|
||||||
|
|
||||||
|
export default userDefaults;
|
||||||
Reference in New Issue
Block a user