diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-07 15:10:28 +0300 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-08-07 15:10:28 +0300 |
commit | f64a7c4780e7ebd092f5cb37e09cb674d093631a (patch) | |
tree | 0810c759a6f3c48f09f31b4e7b919ee043a7cfdb /app | |
parent | ec93e17ac58ca6b79cdfd2b1848e07dc93d5c6f7 (diff) |
Remove repo_binary_viewer as it is no longer needed
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/repo/components/repo.vue | 3 | ||||
-rw-r--r-- | app/assets/javascripts/repo/components/repo_binary_viewer.vue | 67 |
2 files changed, 0 insertions, 70 deletions
diff --git a/app/assets/javascripts/repo/components/repo.vue b/app/assets/javascripts/repo/components/repo.vue index 8c645465553..56a3c9479a2 100644 --- a/app/assets/javascripts/repo/components/repo.vue +++ b/app/assets/javascripts/repo/components/repo.vue @@ -3,7 +3,6 @@ import RepoSidebar from './repo_sidebar.vue'; import RepoCommitSection from './repo_commit_section.vue'; import RepoTabs from './repo_tabs.vue'; import RepoFileButtons from './repo_file_buttons.vue'; -import RepoBinaryViewer from './repo_binary_viewer.vue'; import RepoPreview from './repo_preview.vue'; import RepoMixin from '../mixins/repo_mixin'; import PopupDialog from '../../vue_shared/components/popup_dialog.vue'; @@ -18,7 +17,6 @@ export default { 'repo-sidebar': RepoSidebar, 'repo-tabs': RepoTabs, 'repo-file-buttons': RepoFileButtons, - 'repo-binary-viewer': RepoBinaryViewer, 'repo-editor': MonacoLoaderHelper.repoEditorLoader, 'repo-commit-section': RepoCommitSection, 'popup-dialog': PopupDialog, @@ -50,7 +48,6 @@ export default { <repo-tabs/> <component :is="currentBlobView" class="blob-viewer-container"></component> <repo-file-buttons/> - <!-- <repo-binary-viewer/> soon™ --> </div> <repo-commit-section/> <popup-dialog diff --git a/app/assets/javascripts/repo/components/repo_binary_viewer.vue b/app/assets/javascripts/repo/components/repo_binary_viewer.vue deleted file mode 100644 index f843244950d..00000000000 --- a/app/assets/javascripts/repo/components/repo_binary_viewer.vue +++ /dev/null @@ -1,67 +0,0 @@ -<script> -import Store from '../stores/repo_store'; -import Helper from '../helpers/repo_helper'; - -const RepoBinaryViewer = { - data: () => Store, - - computed: { - pngBlobWithDataURI() { - if (this.binaryTypes.png) { - return `data:image/png;base64,${this.blobRaw}`; - } - return ''; - }, - - svgBlobWithDataURI() { - if (this.binaryTypes.svg) { - return `data:image/svg+xml;utf8,${this.blobRaw}`; - } - return ''; - }, - }, - - methods: { - errored() { - Store.binaryLoaded = false; - }, - - loaded() { - Store.binaryLoaded = true; - }, - - getBinaryType() { - if (Object.hasOwnProperty.call(this.binaryTypes, this.activeFile.extension)) { - return this.activeFile.extension; - } - return 'unknown'; - }, - }, - - watch: { - blobRaw() { - Store.resetBinaryTypes(); - if (Helper.isKindaBinary()) { - this.activeFile.raw = false; - // counts as binaryish so we use the binary viewer in this case. - this.binary = true; - } - if (!this.binary) return; - this.binaryTypes[this.getBinaryType()] = true; - }, - }, -}; - -export default RepoBinaryViewer; -</script> - -<template> -<div id="binary-viewer" v-if="binary && !activeFile.raw"> - <img v-show="binaryTypes.png && binaryLoaded" @error="errored" @load="loaded" :src="pngBlobWithDataURI" :alt="activeFile.name"/> - <img v-show="binaryTypes.svg" @error="errored" @load="loaded" :src="svgBlobWithDataURI" :alt="activeFile.name"/> - <div v-if="binaryTypes.md" v-html="activeFile.html"></div> - <div class="binary-unknown" v-if="binaryTypes.unknown"> - <span>Binary file. No preview available.</span> - </div> -</div> -</template> |