提交 82292316 编写于 作者: J Jacob Schatz

Change to given paths

上级 03716dd3
......@@ -45,12 +45,12 @@ export default RepoFileButtons;
<template>
<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">
<a :href="blameFileURL" class="btn btn-default blame">Blame</a>
<a :href="historyFileURL" class="btn btn-default history">History</a>
<a href="#" class="btn btn-default permalink">Permalink</a>
<a :href="activeFile.blame_path" class="btn btn-default blame">Blame</a>
<a :href="activeFile.commits_path" class="btn btn-default history">History</a>
<a href="activeFile.permalink" class="btn btn-default permalink">Permalink</a>
</div>
<a href="#" v-if="canPreview" @click.prevent="rawPreviewToggle" class="btn btn-default preview">{{activeFileLabel}}</a>
......
......@@ -62,10 +62,6 @@ const RepoHelper = {
return file;
},
getRawURLFromBlobURL(url) {
return url.replace('blob', 'raw');
},
isKindaBinary() {
const okExts = ['md', 'svg'];
return okExts.indexOf(Store.activeFile.extension) > -1;
......@@ -79,8 +75,8 @@ const RepoHelper = {
return url.replace('blob', 'commits');
},
setBinaryDataAsBase64(url, file) {
Service.getBase64Content(url)
setBinaryDataAsBase64(file) {
Service.getBase64Content(file.raw_path)
.then((response) => {
Store.blobRaw = response;
file.base64 = response; // eslint-disable-line no-param-reassign
......@@ -163,8 +159,7 @@ const RepoHelper = {
if (data.binary) {
Store.binaryMimeType = data.mime_type;
// file might be undefined
const rawUrl = RepoHelper.getRawURLFromBlobURL(file.url || Service.url);
RepoHelper.setBinaryDataAsBase64(rawUrl, data);
RepoHelper.setBinaryDataAsBase64(data);
data.binary = true;
} else {
Service.getRaw(data.raw_path)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册