Commit 4028f632 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

[ci skip] eslint-fix

parent ecd5d340
...@@ -30,9 +30,9 @@ GitLabDropdownInput = (function() { ...@@ -30,9 +30,9 @@ GitLabDropdownInput = (function() {
} }
}) })
.on('input', function(e) { .on('input', function(e) {
var val = e.currentTarget.value || 'new-branch' var val = e.currentTarget.value || 'new-branch';
val = val.split(' ').join('-') // replaces space with dash val = val.split(' ').join('-') // replaces space with dash
.replace(/[^a-zA-Z0-9 -]/g, '').toLowerCase() //replace non alphanumeric .replace(/[^a-zA-Z0-9 -]/g, '').toLowerCase() // replace non alphanumeric
.replace(/(-)\1+/g, '-'); // replace repeated dashes .replace(/(-)\1+/g, '-'); // replace repeated dashes
_this.cb(_this.options.fieldName, val, {}, true); _this.cb(_this.options.fieldName, val, {}, true);
_this.input.closest('.dropdown') _this.input.closest('.dropdown')
...@@ -43,7 +43,7 @@ GitLabDropdownInput = (function() { ...@@ -43,7 +43,7 @@ GitLabDropdownInput = (function() {
GitLabDropdownInput.prototype.onInput = function(cb) { GitLabDropdownInput.prototype.onInput = function(cb) {
this.cb = cb; this.cb = cb;
} };
return GitLabDropdownInput; return GitLabDropdownInput;
})(); })();
...@@ -306,9 +306,9 @@ GitLabDropdown = (function() { ...@@ -306,9 +306,9 @@ GitLabDropdown = (function() {
}); });
} }
} }
if(this.noFilterInput.length) { if (this.noFilterInput.length) {
this.plainInput = new GitLabDropdownInput(this.noFilterInput, this.options); this.plainInput = new GitLabDropdownInput(this.noFilterInput, this.options);
this.plainInput.onInput(this.addInput.bind(this)) this.plainInput.onInput(this.addInput.bind(this));
} }
// Init filterable // Init filterable
if (this.options.filterable) { if (this.options.filterable) {
...@@ -798,10 +798,10 @@ GitLabDropdown = (function() { ...@@ -798,10 +798,10 @@ GitLabDropdown = (function() {
GitLabDropdown.prototype.addInput = function(fieldName, value, selectedObject, single) { GitLabDropdown.prototype.addInput = function(fieldName, value, selectedObject, single) {
var $input; var $input;
// Create hidden input for form // Create hidden input for form
if(single){ if (single) {
$('input[name="' + fieldName + '"]').remove(); $('input[name="' + fieldName + '"]').remove();
} }
$input = $('<input>').attr('type', 'hidden').attr('name', fieldName).val(value); $input = $('<input>').attr('type', 'hidden').attr('name', fieldName).val(value);
if (this.options.inputId != null) { if (this.options.inputId != null) {
$input.attr('id', this.options.inputId); $input.attr('id', this.options.inputId);
......
...@@ -123,10 +123,9 @@ import Cookies from 'js-cookie'; ...@@ -123,10 +123,9 @@ import Cookies from 'js-cookie';
var shouldVisit = typeof $visit === 'undefined' ? true : $visit; var shouldVisit = typeof $visit === 'undefined' ? true : $visit;
var action = $form.attr('action'); var action = $form.attr('action');
var divider = action.indexOf('?') === -1 ? '?' : '&'; var divider = action.indexOf('?') === -1 ? '?' : '&';
if(shouldVisit){ if (shouldVisit) {
gl.utils.visitUrl(action + '' + divider + '' + $form.serialize()); gl.utils.visitUrl(action + '' + divider + '' + $form.serialize());
} }
} }
} }
}); });
......
...@@ -13,7 +13,7 @@ import RepoBinaryViewer from './repo_binary_viewer.vue'; ...@@ -13,7 +13,7 @@ import RepoBinaryViewer from './repo_binary_viewer.vue';
import RepoEditor from './repo_editor.vue'; import RepoEditor from './repo_editor.vue';
import monacoLoader from './monaco_loader'; import monacoLoader from './monaco_loader';
import RepoMixin from './repo_mixin'; import RepoMixin from './repo_mixin';
import PopupDialog from '../vue_shared/components/popup_dialog.vue' import PopupDialog from '../vue_shared/components/popup_dialog.vue';
Vue.use(Translate); Vue.use(Translate);
...@@ -40,7 +40,7 @@ function addEventsForNonVueEls() { ...@@ -40,7 +40,7 @@ function addEventsForNonVueEls() {
window.onbeforeunload = function (e) { window.onbeforeunload = function (e) {
const hasChanged = Store.openedFiles const hasChanged = Store.openedFiles
.some(file => file.changed); .some(file => file.changed);
if(!hasChanged) return; if (!hasChanged) return;
e = e || window.event; e = e || window.event;
if (e) { if (e) {
e.returnValue = 'Are you sure you want to lose unsaved changes?'; e.returnValue = 'Are you sure you want to lose unsaved changes?';
...@@ -53,7 +53,6 @@ function addEventsForNonVueEls() { ...@@ -53,7 +53,6 @@ function addEventsForNonVueEls() {
function initRepo() { function initRepo() {
const repo = document.getElementById('repo'); const repo = document.getElementById('repo');
Store.service = Service; Store.service = Service;
Store.service.url = repo.dataset.url; Store.service.url = repo.dataset.url;
Store.service.refsUrl = repo.dataset.refsUrl; Store.service.refsUrl = repo.dataset.refsUrl;
...@@ -107,8 +106,8 @@ function initRepo() { ...@@ -107,8 +106,8 @@ function initRepo() {
dialogSubmitted(status) { dialogSubmitted(status) {
this.dialog.open = false; this.dialog.open = false;
this.dialog.status = status; this.dialog.status = status;
} },
} },
}); });
const editButton = document.getElementById('editable-mode'); const editButton = document.getElementById('editable-mode');
......
...@@ -7,15 +7,14 @@ const RepoBinaryViewer = { ...@@ -7,15 +7,14 @@ const RepoBinaryViewer = {
computed: { computed: {
pngBlobWithDataURI() { pngBlobWithDataURI() {
if(this.binaryTypes.png){ if (this.binaryTypes.png) {
return `data:image/png;base64,${this.blobRaw}`; return `data:image/png;base64,${this.blobRaw}`;
} }
return ''; return '';
}, },
svgBlobWithDataURI() { svgBlobWithDataURI() {
if(this.binaryTypes.svg){ if (this.binaryTypes.svg) {
return `data:image/svg+xml;utf8,${this.blobRaw}`; return `data:image/svg+xml;utf8,${this.blobRaw}`;
} }
return ''; return '';
...@@ -32,11 +31,11 @@ const RepoBinaryViewer = { ...@@ -32,11 +31,11 @@ const RepoBinaryViewer = {
}, },
getBinaryType() { getBinaryType() {
if(this.binaryTypes.hasOwnProperty(this.activeFile.extension)) { if (this.binaryTypes.hasOwnProperty(this.activeFile.extension)) {
return this.activeFile.extension; return this.activeFile.extension;
} }
return 'unknown'; return 'unknown';
} },
}, },
watch: { watch: {
......
...@@ -2,24 +2,22 @@ ...@@ -2,24 +2,22 @@
/* global Flash */ /* global Flash */
import Store from './repo_store'; import Store from './repo_store';
import Api from '../api'; import Api from '../api';
import RepoMixin from './repo_mixin' import RepoMixin from './repo_mixin';
import Helper from './repo_helper' import Helper from './repo_helper';
const RepoCommitSection = { const RepoCommitSection = {
data: () => Store, data: () => Store,
mixins: [RepoMixin], mixins: [RepoMixin],
computed: { computed: {
branchPaths() { branchPaths() {
let branch = Helper.getBranch(); const branch = Helper.getBranch();
return this.changedFiles.map((f) => { return this.changedFiles.map(f => Helper.getFilePathFromFullPath(f.url, branch));
return Helper.getFilePathFromFullPath(f.url, branch);
});
}, },
filePluralize() { filePluralize() {
return this.changedFiles.length > 1 ? 'files' : 'file' return this.changedFiles.length > 1 ? 'files' : 'file';
}, },
}, },
......
...@@ -24,7 +24,7 @@ export default class RepoEditButton { ...@@ -24,7 +24,7 @@ export default class RepoEditButton {
}, },
methods: { methods: {
editClicked() { editClicked() {
if(this.changedFiles.length) { if (this.changedFiles.length) {
this.dialog.open = true; this.dialog.open = true;
return; return;
} }
......
...@@ -71,11 +71,11 @@ const RepoEditor = { ...@@ -71,11 +71,11 @@ const RepoEditor = {
readOnly, readOnly,
}); });
if(this.editMode){ if (this.editMode) {
$('.project-refs-form').addClass('disabled'); $('.project-refs-form').addClass('disabled');
$('.fa-long-arrow-right').show(); $('.fa-long-arrow-right').show();
$('.project-refs-target-form').show(); $('.project-refs-target-form').show();
}else{ } else {
$('.project-refs-form').removeClass('disabled'); $('.project-refs-form').removeClass('disabled');
$('.fa-long-arrow-right').hide(); $('.fa-long-arrow-right').hide();
$('.project-refs-target-form').hide(); $('.project-refs-target-form').hide();
...@@ -88,10 +88,10 @@ const RepoEditor = { ...@@ -88,10 +88,10 @@ const RepoEditor = {
dialog: { dialog: {
handler(obj) { handler(obj) {
if(obj.status) { if (obj.status) {
obj.status = false; obj.status = false;
this.openedFiles.map((f) => { this.openedFiles.map((f) => {
if(f.active) { if (f.active) {
this.blobRaw = f.plain; this.blobRaw = f.plain;
} }
f.changed = false; f.changed = false;
......
...@@ -58,7 +58,7 @@ const RepoHelper = { ...@@ -58,7 +58,7 @@ const RepoHelper = {
file.opened = true; file.opened = true;
file.icon = 'fa-folder-open'; file.icon = 'fa-folder-open';
RepoHelper.toURL(file.url, file.name) RepoHelper.toURL(file.url, file.name);
return file; return file;
}, },
...@@ -281,7 +281,7 @@ const RepoHelper = { ...@@ -281,7 +281,7 @@ const RepoHelper = {
history.pushState({ key: RepoHelper.key }, '', url); history.pushState({ key: RepoHelper.key }, '', url);
if(title) { if (title) {
document.title = `${title} · GitLab`; document.title = `${title} · GitLab`;
} }
}, },
......
...@@ -27,7 +27,7 @@ const RepoStore = { ...@@ -27,7 +27,7 @@ const RepoStore = {
minTabSize: 30, minTabSize: 30,
tabsOverflow: 41, tabsOverflow: 41,
submitCommitsLoading: false, submitCommitsLoading: false,
binaryLoaded:false, binaryLoaded: false,
dialog: { dialog: {
open: false, open: false,
title: '', title: '',
...@@ -60,7 +60,7 @@ const RepoStore = { ...@@ -60,7 +60,7 @@ const RepoStore = {
resetBinaryTypes() { resetBinaryTypes() {
let s = ''; let s = '';
for(s in RepoStore.binaryTypes){ for (s in RepoStore.binaryTypes) {
RepoStore.binaryTypes[s] = false; RepoStore.binaryTypes[s] = false;
} }
}, },
......
...@@ -20,7 +20,7 @@ const RepoTabs = { ...@@ -20,7 +20,7 @@ const RepoTabs = {
xclicked(file) { xclicked(file) {
Store.removeFromOpenedFiles(file); Store.removeFromOpenedFiles(file);
} },
}, },
watch: { watch: {
......
...@@ -23,10 +23,10 @@ const PopupDialog = { ...@@ -23,10 +23,10 @@ const PopupDialog = {
computed: { computed: {
typeOfClass() { typeOfClass() {
const className = `btn-${this.kind}`; const className = `btn-${this.kind}`;
let returnObj = {}; const returnObj = {};
returnObj[className] = true; returnObj[className] = true;
return returnObj; return returnObj;
} },
}, },
methods: { methods: {
...@@ -40,8 +40,8 @@ const PopupDialog = { ...@@ -40,8 +40,8 @@ const PopupDialog = {
noClick() { noClick() {
this.$emit('submit', false); this.$emit('submit', false);
} },
} },
}; };
export default PopupDialog; export default PopupDialog;
...@@ -64,4 +64,4 @@ export default PopupDialog; ...@@ -64,4 +64,4 @@ export default PopupDialog;
</div> </div>
</div> </div>
</div> </div>
</template> </template>
\ No newline at end of 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