Commit 33c8de60 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Further eslint fixes after conflict resolution

parent 9fe346af
......@@ -27,7 +27,7 @@ export default class RepoBinaryViewer {
watch: {
blobRaw() {
if(this.isMarkdown()) {
if (this.isMarkdown()) {
this.binaryTypes.markdown = true;
this.activeFile.raw = false;
// counts as binaryish so we use the binary viewer in this case.
......
import Tabs from './repo_tabs'
import Sidebar from './repo_sidebar'
import Editor from './repo_editor'
import FileButtons from './repo_file_buttons'
import EditButton from './repo_edit_button'
import BinaryViewer from './repo_binary_viewer'
import CommitSection from './repo_commit_section'
import Service from './repo_service'
import Store from './repo_store'
import Helper from './repo_helper'
import Tabs from './repo_tabs';
import Sidebar from './repo_sidebar';
import Editor from './repo_editor';
import FileButtons from './repo_file_buttons';
import EditButton from './repo_edit_button';
import BinaryViewer from './repo_binary_viewer';
import CommitSection from './repo_commit_section';
import Service from './repo_service';
import Store from './repo_store';
import Helper from './repo_helper';
export default class RepoBundle {
constructor() {
......
import Helper from './repo_helper'
import Vue from 'vue'
import Store from './repo_store'
import Vue from 'vue';
import Store from './repo_store';
export default class RepoCommitSection {
constructor() {
......@@ -16,13 +15,11 @@ export default class RepoCommitSection {
computed: {
changedFiles() {
const changedFileList = this.openedFiles
.filter((file) => {
return file.changed;
});
console.log('changedFileList',changedFileList);
.filter(file => file.changed);
console.log('changedFileList', changedFileList);
return changedFileList;
},
}
},
});
}
}
import Service from './repo_service'
import Helper from './repo_helper'
import Vue from 'vue'
import Store from './repo_store'
import Vue from 'vue';
import Store from './repo_store';
export default class RepoEditButton {
constructor() {
......@@ -20,13 +18,13 @@ export default class RepoEditButton {
buttonIcon() {
return this.editMode ? [] : ['fa', 'fa-pencil'];
}
},
},
methods: {
editClicked() {
this.editMode = !this.editMode;
}
}
},
},
});
}
}
......@@ -10,18 +10,11 @@ export default class RepoEditor {
}
addMonacoEvents() {
this.monacoEditor.onMouseUp(this.onMonacoEditorMouseUp.bind(this));
this.monacoEditor.onMouseUp(RepoEditor.onMonacoEditorMouseUp);
this.monacoEditor.onKeyUp(this.onMonacoEditorKeysPressed.bind(this));
}
static onMonacoEditorMouseUp(e) {
if (e.target.element.className === 'line-numbers') {
location.hash = `L${e.target.position.lineNumber}`;
Store.activeLine = e.target.position.lineNumber;
}
}
onMonacoEditorKeysPressed(e) {
onMonacoEditorKeysPressed() {
Helper.setActiveFileContents(this.monacoEditor.getValue());
}
......@@ -63,7 +56,7 @@ export default class RepoEditor {
methods: {
showHide() {
if(!this.openedFiles.length || (this.binary && !this.activeFile.raw)) {
if (!this.openedFiles.length || (this.binary && !this.activeFile.raw)) {
self.el.style.display = 'none';
} else {
self.el.style.display = 'inline-block';
......@@ -80,17 +73,16 @@ export default class RepoEditor {
},
editMode() {
if(this.editMode) {
if (this.editMode) {
document.querySelector('.panel-right').classList.add('edit-mode');
self.monacoEditor.updateOptions({
readOnly: false
readOnly: false,
});
} else {
document.querySelector('.panel-right').classList.remove('edit-mode');
self.monacoEditor.updateOptions({
readOnly: true
readOnly: true,
});
}
},
......@@ -114,7 +106,7 @@ export default class RepoEditor {
blobRaw() {
this.showHide();
if(!this.isTree) {
if (!this.isTree) {
// kill the current model;
self.monacoEditor.setModel(null);
// then create the new one
......@@ -130,4 +122,11 @@ export default class RepoEditor {
},
});
}
static onMonacoEditorMouseUp(e) {
if (e.target.element.className === 'line-numbers') {
location.hash = `L${e.target.position.lineNumber}`;
Store.activeLine = e.target.position.lineNumber;
}
}
}
import Vue from 'vue'
import Store from './repo_store'
import Helper from './repo_helper'
import RepoMiniMixin from './repo_mini_mixin'
import Vue from 'vue';
import Store from './repo_store';
import Helper from './repo_helper';
import RepoMiniMixin from './repo_mini_mixin';
export default class RepoSidebar {
constructor(url) {
......@@ -33,7 +33,7 @@ export default class RepoSidebar {
computed: {
editableBorder() {
return this.editMode ? '1px solid #1F78D1' :'1px solid #f0f0f0';
return this.editMode ? '1px solid #1F78D1' : '1px solid #f0f0f0';
},
canPreview() {
......@@ -56,7 +56,7 @@ export default class RepoSidebar {
methods: {
rawPreviewToggle() {
Helper.setCurrentFileRawOrPreview();
}
},
},
});
}
......
......@@ -70,12 +70,14 @@ const RepoHelper = {
setActiveFile(file) {
// don't load the file that is already loaded
if(file.url === Store.activeFile.url) return;
if (file.url === Store.activeFile.url) return;
Store.openedFiles = Store.openedFiles.map((openedFile, i) => {
openedFile.active = file.url === openedFile.url;
if(openedFile.active) {
Store.activeFile = openedFile;
const activeFile = openedFile;
activeFile.active = file.url === activeFile.url;
if (activeFile.active) {
Store.activeFile = activeFile;
Store.activeFileIndex = i;
}
return activeFile;
......@@ -86,7 +88,7 @@ const RepoHelper = {
// can't get vue to listen to raw for some reason so this for now.
Store.activeFileLabel = 'Raw';
if(file.binary) {
if (file.binary) {
Store.blobRaw = file.base64;
} else {
Store.blobRaw = file.plain;
......@@ -103,12 +105,13 @@ const RepoHelper = {
},
addToOpenedFiles(file) {
const openedFilesAlreadyExists = Store.openedFiles.some((openedFile) => {
return openedFile.url === file.url
});
if(!openedFilesAlreadyExists) {
file.changed = false;
Store.openedFiles.push(file);
const openFile = file;
const openedFilesAlreadyExists = Store.openedFiles
.some(openedFile => openedFile.url === openFile.url);
if (!openedFilesAlreadyExists) {
openFile.changed = false;
Store.openedFiles.push(openFile);
}
},
......@@ -143,7 +146,7 @@ const RepoHelper = {
},
setActiveFileContents(contents) {
if(!Store.editMode) return;
if (!Store.editMode) return;
Store.activeFile.newContent = contents;
Store.activeFile.changed = Store.activeFile.plain !== Store.activeFile.newContent;
Store.openedFiles[Store.activeFileIndex].changed = Store.activeFile.changed;
......@@ -180,7 +183,8 @@ const RepoHelper = {
},
// may be tree or file.
getContent(file) {
getContent(treeOrFile) {
let file = treeOrFile;
// don't load the same active file. That's silly.
// if(file && file.url === this.activeFile.url) return;
const loadingData = this.setLoading(true);
......@@ -206,7 +210,7 @@ const RepoHelper = {
Store.blobRaw = data.plain;
data.binary = false;
}
if(!file.url) {
if (!file.url) {
file.url = location.pathname;
}
data.url = file.url;
......
......@@ -48,11 +48,11 @@ export default class RepoSidebar {
if (file.type === 'tree' && file.opened) {
Helper.removeChildFilesOfTree(file);
return;
} else {
}
url = file.url;
Service.url = url;
Helper.getContent(file);
}
url = file.url;
Service.url = url;
Helper.getContent(file);
......
......@@ -24,7 +24,7 @@ const RepoStore = {
url: '',
raw: false,
newContent: '',
changed: false
changed: false,
},
activeFileIndex: 0,
activeLine: 0,
......
......@@ -20,10 +20,10 @@ const RepoTab = {
changedClass() {
const tabChangedObj = {
'fa-times': !this.tab.changed,
'fa-circle': this.tab.changed
'fa-circle': this.tab.changed,
};
return tabChangedObj
}
return tabChangedObj;
},
},
methods: {
......@@ -32,7 +32,7 @@ const RepoTab = {
},
xClicked(file) {
if(file.changed) return;
if (file.changed) return;
RepoHelper.removeFromOpenedFiles(file);
},
},
......
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