summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-08-01 14:41:24 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-08-01 14:41:24 +0100
commit4028f632ed2eddb9906fc5a1c7ad44e58ee84ac3 (patch)
tree752b357164ba350cfb836de55d7ad5a82866847d /app/assets/javascripts
parentecd5d3401799e835fa1eb936b0edcd35698742ef (diff)
downloadgitlab-ce-4028f632ed2eddb9906fc5a1c7ad44e58ee84ac3.tar.gz
[ci skip] eslint-fix
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/gl_dropdown.js16
-rw-r--r--app/assets/javascripts/project.js5
-rw-r--r--app/assets/javascripts/repo/index.js9
-rw-r--r--app/assets/javascripts/repo/repo_binary_viewer.vue11
-rw-r--r--app/assets/javascripts/repo/repo_commit_section.vue14
-rw-r--r--app/assets/javascripts/repo/repo_edit_button.js2
-rw-r--r--app/assets/javascripts/repo/repo_editor.vue8
-rw-r--r--app/assets/javascripts/repo/repo_helper.js4
-rw-r--r--app/assets/javascripts/repo/repo_store.js4
-rw-r--r--app/assets/javascripts/repo/repo_tabs.vue2
-rw-r--r--app/assets/javascripts/vue_shared/components/popup_dialog.vue10
11 files changed, 40 insertions, 45 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js
index 5cb31ddd500..8ef75742e0a 100644
--- a/app/assets/javascripts/gl_dropdown.js
+++ b/app/assets/javascripts/gl_dropdown.js
@@ -30,9 +30,9 @@ GitLabDropdownInput = (function() {
}
})
.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
- .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
_this.cb(_this.options.fieldName, val, {}, true);
_this.input.closest('.dropdown')
@@ -43,7 +43,7 @@ GitLabDropdownInput = (function() {
GitLabDropdownInput.prototype.onInput = function(cb) {
this.cb = cb;
- }
+ };
return GitLabDropdownInput;
})();
@@ -306,9 +306,9 @@ GitLabDropdown = (function() {
});
}
}
- if(this.noFilterInput.length) {
+ if (this.noFilterInput.length) {
this.plainInput = new GitLabDropdownInput(this.noFilterInput, this.options);
- this.plainInput.onInput(this.addInput.bind(this))
+ this.plainInput.onInput(this.addInput.bind(this));
}
// Init filterable
if (this.options.filterable) {
@@ -798,10 +798,10 @@ GitLabDropdown = (function() {
GitLabDropdown.prototype.addInput = function(fieldName, value, selectedObject, single) {
var $input;
// Create hidden input for form
- if(single){
- $('input[name="' + fieldName + '"]').remove();
+ if (single) {
+ $('input[name="' + fieldName + '"]').remove();
}
-
+
$input = $('<input>').attr('type', 'hidden').attr('name', fieldName).val(value);
if (this.options.inputId != null) {
$input.attr('id', this.options.inputId);
diff --git a/app/assets/javascripts/project.js b/app/assets/javascripts/project.js
index bae613aab90..b1363c73f11 100644
--- a/app/assets/javascripts/project.js
+++ b/app/assets/javascripts/project.js
@@ -123,10 +123,9 @@ import Cookies from 'js-cookie';
var shouldVisit = typeof $visit === 'undefined' ? true : $visit;
var action = $form.attr('action');
var divider = action.indexOf('?') === -1 ? '?' : '&';
- if(shouldVisit){
- gl.utils.visitUrl(action + '' + divider + '' + $form.serialize());
+ if (shouldVisit) {
+ gl.utils.visitUrl(action + '' + divider + '' + $form.serialize());
}
-
}
}
});
diff --git a/app/assets/javascripts/repo/index.js b/app/assets/javascripts/repo/index.js
index a7c80098e22..6b6fb4eeec1 100644
--- a/app/assets/javascripts/repo/index.js
+++ b/app/assets/javascripts/repo/index.js
@@ -13,7 +13,7 @@ import RepoBinaryViewer from './repo_binary_viewer.vue';
import RepoEditor from './repo_editor.vue';
import monacoLoader from './monaco_loader';
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);
@@ -40,7 +40,7 @@ function addEventsForNonVueEls() {
window.onbeforeunload = function (e) {
const hasChanged = Store.openedFiles
.some(file => file.changed);
- if(!hasChanged) return;
+ if (!hasChanged) return;
e = e || window.event;
if (e) {
e.returnValue = 'Are you sure you want to lose unsaved changes?';
@@ -53,7 +53,6 @@ function addEventsForNonVueEls() {
function initRepo() {
const repo = document.getElementById('repo');
-
Store.service = Service;
Store.service.url = repo.dataset.url;
Store.service.refsUrl = repo.dataset.refsUrl;
@@ -107,8 +106,8 @@ function initRepo() {
dialogSubmitted(status) {
this.dialog.open = false;
this.dialog.status = status;
- }
- }
+ },
+ },
});
const editButton = document.getElementById('editable-mode');
diff --git a/app/assets/javascripts/repo/repo_binary_viewer.vue b/app/assets/javascripts/repo/repo_binary_viewer.vue
index ee005366be2..49f8896fa5b 100644
--- a/app/assets/javascripts/repo/repo_binary_viewer.vue
+++ b/app/assets/javascripts/repo/repo_binary_viewer.vue
@@ -7,15 +7,14 @@ const RepoBinaryViewer = {
computed: {
pngBlobWithDataURI() {
- if(this.binaryTypes.png){
- return `data:image/png;base64,${this.blobRaw}`;
+ if (this.binaryTypes.png) {
+ return `data:image/png;base64,${this.blobRaw}`;
}
return '';
-
},
svgBlobWithDataURI() {
- if(this.binaryTypes.svg){
+ if (this.binaryTypes.svg) {
return `data:image/svg+xml;utf8,${this.blobRaw}`;
}
return '';
@@ -32,11 +31,11 @@ const RepoBinaryViewer = {
},
getBinaryType() {
- if(this.binaryTypes.hasOwnProperty(this.activeFile.extension)) {
+ if (this.binaryTypes.hasOwnProperty(this.activeFile.extension)) {
return this.activeFile.extension;
}
return 'unknown';
- }
+ },
},
watch: {
diff --git a/app/assets/javascripts/repo/repo_commit_section.vue b/app/assets/javascripts/repo/repo_commit_section.vue
index caab02c221c..68a51680b76 100644
--- a/app/assets/javascripts/repo/repo_commit_section.vue
+++ b/app/assets/javascripts/repo/repo_commit_section.vue
@@ -2,24 +2,22 @@
/* global Flash */
import Store from './repo_store';
import Api from '../api';
-import RepoMixin from './repo_mixin'
-import Helper from './repo_helper'
+import RepoMixin from './repo_mixin';
+import Helper from './repo_helper';
const RepoCommitSection = {
data: () => Store,
mixins: [RepoMixin],
-
+
computed: {
branchPaths() {
- let branch = Helper.getBranch();
- return this.changedFiles.map((f) => {
- return Helper.getFilePathFromFullPath(f.url, branch);
- });
+ const branch = Helper.getBranch();
+ return this.changedFiles.map(f => Helper.getFilePathFromFullPath(f.url, branch));
},
filePluralize() {
- return this.changedFiles.length > 1 ? 'files' : 'file'
+ return this.changedFiles.length > 1 ? 'files' : 'file';
},
},
diff --git a/app/assets/javascripts/repo/repo_edit_button.js b/app/assets/javascripts/repo/repo_edit_button.js
index 27f3e4c1c20..0e5b1653195 100644
--- a/app/assets/javascripts/repo/repo_edit_button.js
+++ b/app/assets/javascripts/repo/repo_edit_button.js
@@ -24,7 +24,7 @@ export default class RepoEditButton {
},
methods: {
editClicked() {
- if(this.changedFiles.length) {
+ if (this.changedFiles.length) {
this.dialog.open = true;
return;
}
diff --git a/app/assets/javascripts/repo/repo_editor.vue b/app/assets/javascripts/repo/repo_editor.vue
index 7bc5269ecd4..1692d2a6427 100644
--- a/app/assets/javascripts/repo/repo_editor.vue
+++ b/app/assets/javascripts/repo/repo_editor.vue
@@ -71,11 +71,11 @@ const RepoEditor = {
readOnly,
});
- if(this.editMode){
+ if (this.editMode) {
$('.project-refs-form').addClass('disabled');
$('.fa-long-arrow-right').show();
$('.project-refs-target-form').show();
- }else{
+ } else {
$('.project-refs-form').removeClass('disabled');
$('.fa-long-arrow-right').hide();
$('.project-refs-target-form').hide();
@@ -88,10 +88,10 @@ const RepoEditor = {
dialog: {
handler(obj) {
- if(obj.status) {
+ if (obj.status) {
obj.status = false;
this.openedFiles.map((f) => {
- if(f.active) {
+ if (f.active) {
this.blobRaw = f.plain;
}
f.changed = false;
diff --git a/app/assets/javascripts/repo/repo_helper.js b/app/assets/javascripts/repo/repo_helper.js
index de553e3b700..27202786d44 100644
--- a/app/assets/javascripts/repo/repo_helper.js
+++ b/app/assets/javascripts/repo/repo_helper.js
@@ -58,7 +58,7 @@ const RepoHelper = {
file.opened = true;
file.icon = 'fa-folder-open';
- RepoHelper.toURL(file.url, file.name)
+ RepoHelper.toURL(file.url, file.name);
return file;
},
@@ -281,7 +281,7 @@ const RepoHelper = {
history.pushState({ key: RepoHelper.key }, '', url);
- if(title) {
+ if (title) {
document.title = `${title} ยท GitLab`;
}
},
diff --git a/app/assets/javascripts/repo/repo_store.js b/app/assets/javascripts/repo/repo_store.js
index 96a685a43f5..a0c28d0205a 100644
--- a/app/assets/javascripts/repo/repo_store.js
+++ b/app/assets/javascripts/repo/repo_store.js
@@ -27,7 +27,7 @@ const RepoStore = {
minTabSize: 30,
tabsOverflow: 41,
submitCommitsLoading: false,
- binaryLoaded:false,
+ binaryLoaded: false,
dialog: {
open: false,
title: '',
@@ -60,7 +60,7 @@ const RepoStore = {
resetBinaryTypes() {
let s = '';
- for(s in RepoStore.binaryTypes){
+ for (s in RepoStore.binaryTypes) {
RepoStore.binaryTypes[s] = false;
}
},
diff --git a/app/assets/javascripts/repo/repo_tabs.vue b/app/assets/javascripts/repo/repo_tabs.vue
index a8364dd3a0c..101054b1977 100644
--- a/app/assets/javascripts/repo/repo_tabs.vue
+++ b/app/assets/javascripts/repo/repo_tabs.vue
@@ -20,7 +20,7 @@ const RepoTabs = {
xclicked(file) {
Store.removeFromOpenedFiles(file);
- }
+ },
},
watch: {
diff --git a/app/assets/javascripts/vue_shared/components/popup_dialog.vue b/app/assets/javascripts/vue_shared/components/popup_dialog.vue
index f63125e4d81..7d339c0e753 100644
--- a/app/assets/javascripts/vue_shared/components/popup_dialog.vue
+++ b/app/assets/javascripts/vue_shared/components/popup_dialog.vue
@@ -23,10 +23,10 @@ const PopupDialog = {
computed: {
typeOfClass() {
const className = `btn-${this.kind}`;
- let returnObj = {};
+ const returnObj = {};
returnObj[className] = true;
return returnObj;
- }
+ },
},
methods: {
@@ -40,8 +40,8 @@ const PopupDialog = {
noClick() {
this.$emit('submit', false);
- }
- }
+ },
+ },
};
export default PopupDialog;
@@ -64,4 +64,4 @@ export default PopupDialog;
</div>
</div>
</div>
-</template> \ No newline at end of file
+</template>