Commit 82292316 authored by Jacob Schatz's avatar Jacob Schatz

Change to given paths

parent 03716dd3
...@@ -45,12 +45,12 @@ export default RepoFileButtons; ...@@ -45,12 +45,12 @@ export default RepoFileButtons;
<template> <template>
<div id="repo-file-buttons" v-if="isMini" :style="{'border-bottom': editableBorder}"> <div id="repo-file-buttons" v-if="isMini" :style="{'border-bottom': editableBorder}">
<a :href="rawFileURL" target="_blank" class="btn btn-default raw">{{rawDownloadButtonLabel}}</a> <a :href="activeFile.raw_path" target="_blank" class="btn btn-default raw">{{rawDownloadButtonLabel}}</a>
<div class="btn-group" role="group" aria-label="File actions"> <div class="btn-group" role="group" aria-label="File actions">
<a :href="blameFileURL" class="btn btn-default blame">Blame</a> <a :href="activeFile.blame_path" class="btn btn-default blame">Blame</a>
<a :href="historyFileURL" class="btn btn-default history">History</a> <a :href="activeFile.commits_path" class="btn btn-default history">History</a>
<a href="#" class="btn btn-default permalink">Permalink</a> <a href="activeFile.permalink" class="btn btn-default permalink">Permalink</a>
</div> </div>
<a href="#" v-if="canPreview" @click.prevent="rawPreviewToggle" class="btn btn-default preview">{{activeFileLabel}}</a> <a href="#" v-if="canPreview" @click.prevent="rawPreviewToggle" class="btn btn-default preview">{{activeFileLabel}}</a>
......
...@@ -62,10 +62,6 @@ const RepoHelper = { ...@@ -62,10 +62,6 @@ const RepoHelper = {
return file; return file;
}, },
getRawURLFromBlobURL(url) {
return url.replace('blob', 'raw');
},
isKindaBinary() { isKindaBinary() {
const okExts = ['md', 'svg']; const okExts = ['md', 'svg'];
return okExts.indexOf(Store.activeFile.extension) > -1; return okExts.indexOf(Store.activeFile.extension) > -1;
...@@ -79,8 +75,8 @@ const RepoHelper = { ...@@ -79,8 +75,8 @@ const RepoHelper = {
return url.replace('blob', 'commits'); return url.replace('blob', 'commits');
}, },
setBinaryDataAsBase64(url, file) { setBinaryDataAsBase64(file) {
Service.getBase64Content(url) Service.getBase64Content(file.raw_path)
.then((response) => { .then((response) => {
Store.blobRaw = response; Store.blobRaw = response;
file.base64 = response; // eslint-disable-line no-param-reassign file.base64 = response; // eslint-disable-line no-param-reassign
...@@ -163,8 +159,7 @@ const RepoHelper = { ...@@ -163,8 +159,7 @@ const RepoHelper = {
if (data.binary) { if (data.binary) {
Store.binaryMimeType = data.mime_type; Store.binaryMimeType = data.mime_type;
// file might be undefined // file might be undefined
const rawUrl = RepoHelper.getRawURLFromBlobURL(file.url || Service.url); RepoHelper.setBinaryDataAsBase64(data);
RepoHelper.setBinaryDataAsBase64(rawUrl, data);
data.binary = true; data.binary = true;
} else { } else {
Service.getRaw(data.raw_path) Service.getRaw(data.raw_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment