From 0f339790858ca5cf33d4e64ea8ccb9c01b7d3c63 Mon Sep 17 00:00:00 2001 From: brunosimon Date: Sat, 12 Aug 2017 12:02:36 +0200 Subject: [PATCH] :sparkles: Add viewer --- site/src/components/file/script.js | 4 +++- site/src/components/file/template.html | 1 + .../src/components/files-tree-file/template.html | 4 ++-- .../components/files-tree-folder/template.html | 4 ++-- site/src/components/version/script.js | 8 ++++++++ site/src/components/version/template.html | 6 +++--- site/src/components/viewer/index.vue | 3 +++ site/src/components/viewer/script.js | 16 ++++++++++++++++ site/src/components/viewer/style.styl | 7 +++++++ site/src/components/viewer/template.html | 3 +++ site/src/store.js | 8 +++++++- 11 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 site/src/components/viewer/index.vue create mode 100644 site/src/components/viewer/script.js create mode 100644 site/src/components/viewer/style.styl create mode 100644 site/src/components/viewer/template.html diff --git a/site/src/components/file/script.js b/site/src/components/file/script.js index 08b25ac..9619d92 100644 --- a/site/src/components/file/script.js +++ b/site/src/components/file/script.js @@ -1,4 +1,5 @@ import Versions from '@/components/versions' +import Viewer from '@/components/viewer' export default { @@ -6,7 +7,8 @@ export default components: { - Versions + Versions, + Viewer }, props: diff --git a/site/src/components/file/template.html b/site/src/components/file/template.html index 2cf8334..35a9702 100644 --- a/site/src/components/file/template.html +++ b/site/src/components/file/template.html @@ -4,4 +4,5 @@ {{ content.path.directory }} {{ content.name }} + \ No newline at end of file diff --git a/site/src/components/files-tree-file/template.html b/site/src/components/files-tree-file/template.html index 2a9c507..98e4133 100644 --- a/site/src/components/files-tree-file/template.html +++ b/site/src/components/files-tree-file/template.html @@ -1,5 +1,5 @@
- +
\ No newline at end of file diff --git a/site/src/components/files-tree-folder/template.html b/site/src/components/files-tree-folder/template.html index 1f75a1f..1146049 100644 --- a/site/src/components/files-tree-folder/template.html +++ b/site/src/components/files-tree-folder/template.html @@ -1,7 +1,7 @@
- +
diff --git a/site/src/components/version/script.js b/site/src/components/version/script.js index 75099eb..7e22990 100644 --- a/site/src/components/version/script.js +++ b/site/src/components/version/script.js @@ -5,5 +5,13 @@ export default props: { content: { type: Object } + }, + + methods: + { + onClick() + { + this.$store.commit('setVersion', this.content) + } } } \ No newline at end of file diff --git a/site/src/components/version/template.html b/site/src/components/version/template.html index 6126231..978740e 100644 --- a/site/src/components/version/template.html +++ b/site/src/components/version/template.html @@ -1,3 +1,3 @@ -
- {{ content }} -
\ No newline at end of file + + {{ content.date }} + \ No newline at end of file diff --git a/site/src/components/viewer/index.vue b/site/src/components/viewer/index.vue new file mode 100644 index 0000000..246515d --- /dev/null +++ b/site/src/components/viewer/index.vue @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/site/src/components/viewer/script.js b/site/src/components/viewer/script.js new file mode 100644 index 0000000..9e33a26 --- /dev/null +++ b/site/src/components/viewer/script.js @@ -0,0 +1,16 @@ +export default +{ + name: 'viewer', + + components: + { + }, + + computed: + { + version() + { + return this.$store.state.version + } + } +} \ No newline at end of file diff --git a/site/src/components/viewer/style.styl b/site/src/components/viewer/style.styl new file mode 100644 index 0000000..fa82993 --- /dev/null +++ b/site/src/components/viewer/style.styl @@ -0,0 +1,7 @@ +.viewer + position absolute + top 30px + right 0 + width 75% + height 100% + background rgba(0, 0, 255, 0.3) \ No newline at end of file diff --git a/site/src/components/viewer/template.html b/site/src/components/viewer/template.html new file mode 100644 index 0000000..3859834 --- /dev/null +++ b/site/src/components/viewer/template.html @@ -0,0 +1,3 @@ +
+
{{ version.content }}
+
\ No newline at end of file diff --git a/site/src/store.js b/site/src/store.js index 88e0e93..e9c02bf 100644 --- a/site/src/store.js +++ b/site/src/store.js @@ -10,7 +10,8 @@ export default new Vuex.Store({ projects: {}, project: null, files: new FileTree({ autoWash: true }), - file: null + file: null, + version: null }, mutations: @@ -90,6 +91,11 @@ export default new Vuex.Store({ { state.file = file } + }, + + setVersion(state, data) + { + state.version = data } } }) \ No newline at end of file