From 33cf76221157522ee62503e7cc7e70abf3d6500b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Feb 2017 16:37:22 +0900 Subject: [PATCH] :v: --- src/web/app/boot.js | 4 +- .../scripts/generate-default-userdata.js | 47 +++++++++++++++++++ .../scripts/generate-default-userdata.ls | 28 ----------- 3 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 src/web/app/common/scripts/generate-default-userdata.js delete mode 100644 src/web/app/common/scripts/generate-default-userdata.ls diff --git a/src/web/app/boot.js b/src/web/app/boot.js index 32950071a..a77bdd6da 100644 --- a/src/web/app/boot.js +++ b/src/web/app/boot.js @@ -5,8 +5,8 @@ const riot = require('riot'); require('velocity-animate'); const api = require('./common/scripts/api'); -const signout = require('./common/scripts/signout.ls'); -const generateDefaultUserdata = require('./common/scripts/generate-default-userdata.ls'); +const signout = require('./common/scripts/signout'); +const generateDefaultUserdata = require('./common/scripts/generate-default-userdata'); const mixins = require('./common/mixins.ls'); const checkForUpdate = require('./common/scripts/check-for-update.ls'); require('./common/tags'); diff --git a/src/web/app/common/scripts/generate-default-userdata.js b/src/web/app/common/scripts/generate-default-userdata.js new file mode 100644 index 000000000..f6c8c2fe5 --- /dev/null +++ b/src/web/app/common/scripts/generate-default-userdata.js @@ -0,0 +1,47 @@ +const uuid = require('./uuid.js'); + +const home = { + left: [ + 'profile', + 'calendar', + 'rss-reader', + 'photo-stream' + ], + right: [ + 'broadcast', + 'notifications', + 'user-recommendation', + 'donation', + 'nav', + 'tips' + ] +}; + +module.exports = () => { + const homeData = []; + + home.left.forEach(widget => { + homeData.push({ + name: widget, + id: uuid(), + place: 'left' + }); + }); + + home.right.forEach(widget => { + homeData.push({ + name: widget, + id: uuid(), + place: 'right' + }); + }); + + const data = { + cache: true, + debug: false, + nya: true, + home: homeData + }; + + return data; +}; diff --git a/src/web/app/common/scripts/generate-default-userdata.ls b/src/web/app/common/scripts/generate-default-userdata.ls deleted file mode 100644 index c13d221bb..000000000 --- a/src/web/app/common/scripts/generate-default-userdata.ls +++ /dev/null @@ -1,28 +0,0 @@ -uuid = require './uuid.js' - -home = - left: [ \profile \calendar \rss-reader \photo-stream ] - right: [ \broadcast \notifications \user-recommendation \donation \nav \tips ] - -module.exports = ~> - home-data = [] - - home.left.for-each (widget) ~> - home-data.push do - name: widget - id: uuid! - place: \left - - home.right.for-each (widget) ~> - home-data.push do - name: widget - id: uuid! - place: \right - - data = - cache: true - debug: false - nya: true - home: home-data - - return data