From b42f17437cb02b0a2984af5ee71f5247bab8979b Mon Sep 17 00:00:00 2001 From: Jiiks Date: Sat, 20 Jan 2018 12:52:00 +0200 Subject: [PATCH] Cleanup and template splitting --- .../modules/ui/vue/components/BdSettings.vue | 67 +++++++++++++++++++ .../ui/vue/components/BdSettingsWrapper.vue | 20 ++++++ .../vue/components/generic/ScrollerWrap.vue | 2 + .../ui/vue/components/generic/index.js | 1 + .../generic/templates/ScrollerWrap.html | 5 ++ .../ui/vue/components/sidebar/Button.vue | 6 ++ .../ui/vue/components/sidebar/Header.vue | 6 ++ .../ui/vue/components/sidebar/Item.vue | 11 +++ .../ui/vue/components/sidebar/Sidebar.vue | 2 + .../ui/vue/components/sidebar/View.vue | 11 +++ .../ui/vue/components/sidebar/index.js | 5 ++ .../components/sidebar/templates/Button.html | 1 + .../components/sidebar/templates/Header.html | 1 + .../components/sidebar/templates/Item.html | 2 + .../components/sidebar/templates/Sidebar.html | 3 + .../components/sidebar/templates/View.html | 14 ++++ .../vue/components/templates/BdSettings.html | 10 +++ .../templates/BdSettingsWrapper.html | 6 ++ client/src/modules/ui/vueui.js | 15 ++--- 19 files changed, 180 insertions(+), 8 deletions(-) create mode 100644 client/src/modules/ui/vue/components/BdSettings.vue create mode 100644 client/src/modules/ui/vue/components/BdSettingsWrapper.vue create mode 100644 client/src/modules/ui/vue/components/generic/ScrollerWrap.vue create mode 100644 client/src/modules/ui/vue/components/generic/index.js create mode 100644 client/src/modules/ui/vue/components/generic/templates/ScrollerWrap.html create mode 100644 client/src/modules/ui/vue/components/sidebar/Button.vue create mode 100644 client/src/modules/ui/vue/components/sidebar/Header.vue create mode 100644 client/src/modules/ui/vue/components/sidebar/Item.vue create mode 100644 client/src/modules/ui/vue/components/sidebar/Sidebar.vue create mode 100644 client/src/modules/ui/vue/components/sidebar/View.vue create mode 100644 client/src/modules/ui/vue/components/sidebar/index.js create mode 100644 client/src/modules/ui/vue/components/sidebar/templates/Button.html create mode 100644 client/src/modules/ui/vue/components/sidebar/templates/Header.html create mode 100644 client/src/modules/ui/vue/components/sidebar/templates/Item.html create mode 100644 client/src/modules/ui/vue/components/sidebar/templates/Sidebar.html create mode 100644 client/src/modules/ui/vue/components/sidebar/templates/View.html create mode 100644 client/src/modules/ui/vue/components/templates/BdSettings.html create mode 100644 client/src/modules/ui/vue/components/templates/BdSettingsWrapper.html diff --git a/client/src/modules/ui/vue/components/BdSettings.vue b/client/src/modules/ui/vue/components/BdSettings.vue new file mode 100644 index 00000000..3f37c964 --- /dev/null +++ b/client/src/modules/ui/vue/components/BdSettings.vue @@ -0,0 +1,67 @@ + + + \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/BdSettingsWrapper.vue b/client/src/modules/ui/vue/components/BdSettingsWrapper.vue new file mode 100644 index 00000000..ac83566b --- /dev/null +++ b/client/src/modules/ui/vue/components/BdSettingsWrapper.vue @@ -0,0 +1,20 @@ + + \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/generic/ScrollerWrap.vue b/client/src/modules/ui/vue/components/generic/ScrollerWrap.vue new file mode 100644 index 00000000..a511f680 --- /dev/null +++ b/client/src/modules/ui/vue/components/generic/ScrollerWrap.vue @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/generic/index.js b/client/src/modules/ui/vue/components/generic/index.js new file mode 100644 index 00000000..c34f4339 --- /dev/null +++ b/client/src/modules/ui/vue/components/generic/index.js @@ -0,0 +1 @@ +export { default as ScrollerWrap } from './ScrollerWrap.vue'; \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/generic/templates/ScrollerWrap.html b/client/src/modules/ui/vue/components/generic/templates/ScrollerWrap.html new file mode 100644 index 00000000..bcc9d428 --- /dev/null +++ b/client/src/modules/ui/vue/components/generic/templates/ScrollerWrap.html @@ -0,0 +1,5 @@ +
+
+ +
+
\ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/Button.vue b/client/src/modules/ui/vue/components/sidebar/Button.vue new file mode 100644 index 00000000..9e4b64a5 --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/Button.vue @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/Header.vue b/client/src/modules/ui/vue/components/sidebar/Header.vue new file mode 100644 index 00000000..a0d22170 --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/Header.vue @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/Item.vue b/client/src/modules/ui/vue/components/sidebar/Item.vue new file mode 100644 index 00000000..424b1a28 --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/Item.vue @@ -0,0 +1,11 @@ + + \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/Sidebar.vue b/client/src/modules/ui/vue/components/sidebar/Sidebar.vue new file mode 100644 index 00000000..d58e9924 --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/Sidebar.vue @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/View.vue b/client/src/modules/ui/vue/components/sidebar/View.vue new file mode 100644 index 00000000..3432053c --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/View.vue @@ -0,0 +1,11 @@ + + \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/index.js b/client/src/modules/ui/vue/components/sidebar/index.js new file mode 100644 index 00000000..7c4adcc7 --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/index.js @@ -0,0 +1,5 @@ +export { default as SidebarView } from './View.vue'; +export { default as Sidebar } from './Sidebar.vue'; +export { default as SidebarHeader } from './Header.vue'; +export { default as SidebarButton } from './Button.vue'; +export { default as SidebarItem } from './Item.vue'; \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/templates/Button.html b/client/src/modules/ui/vue/components/sidebar/templates/Button.html new file mode 100644 index 00000000..649f65a5 --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/templates/Button.html @@ -0,0 +1 @@ +
{{item.text}}
\ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/templates/Header.html b/client/src/modules/ui/vue/components/sidebar/templates/Header.html new file mode 100644 index 00000000..2f430a8e --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/templates/Header.html @@ -0,0 +1 @@ +
{{item.text}}
\ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/templates/Item.html b/client/src/modules/ui/vue/components/sidebar/templates/Item.html new file mode 100644 index 00000000..2eb13873 --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/templates/Item.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/templates/Sidebar.html b/client/src/modules/ui/vue/components/sidebar/templates/Sidebar.html new file mode 100644 index 00000000..b423bd24 --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/templates/Sidebar.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/client/src/modules/ui/vue/components/sidebar/templates/View.html b/client/src/modules/ui/vue/components/sidebar/templates/View.html new file mode 100644 index 00000000..11eb65b3 --- /dev/null +++ b/client/src/modules/ui/vue/components/sidebar/templates/View.html @@ -0,0 +1,14 @@ +
+
+
+ + + +
+
+
+ + + +
+
\ No newline at end of file diff --git a/client/src/modules/ui/vue/components/templates/BdSettings.html b/client/src/modules/ui/vue/components/templates/BdSettings.html new file mode 100644 index 00000000..d2442e28 --- /dev/null +++ b/client/src/modules/ui/vue/components/templates/BdSettings.html @@ -0,0 +1,10 @@ +
+ + +
+ +
+ +
+
+
\ No newline at end of file diff --git a/client/src/modules/ui/vue/components/templates/BdSettingsWrapper.html b/client/src/modules/ui/vue/components/templates/BdSettingsWrapper.html new file mode 100644 index 00000000..7b72e058 --- /dev/null +++ b/client/src/modules/ui/vue/components/templates/BdSettingsWrapper.html @@ -0,0 +1,6 @@ +
+
+
+
+ +
\ No newline at end of file diff --git a/client/src/modules/ui/vueui.js b/client/src/modules/ui/vueui.js index 21387329..24601156 100644 --- a/client/src/modules/ui/vueui.js +++ b/client/src/modules/ui/vueui.js @@ -11,19 +11,18 @@ const $ = require('jquery'); const Vue = require('vue'); -const BdButton = (require('./components/bdbutton.vue')).default; +const BdSettingsWrapper = (require('./vue/components/BdSettingsWrapper.vue')).default; class UI { constructor() { - $('body').append($('
', { - class: 'bd-settingsbutton', - id: 'bd-settingsbutton' - })); + $('body').append($('').append($('
', { + id: 'bd-settings' + }))); this.vueInstance = new Vue.default({ - el: '#bd-settingsbutton', - template: '', - components: { BdButton } + el: '#bd-settings', + template: '', + components: { BdSettingsWrapper } }); }