summaryrefslogtreecommitdiffstats
path: root/core/src/OCP
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2019-11-13 12:05:10 +0000
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-12-19 11:55:33 +0100
commitec01e0a790448fff38364f629a4de4edb5d465bf (patch)
tree8fb5369e3d6f9f805025802e12feaa4dfaef1e03 /core/src/OCP
parent5d9fd7ba0cced84f1d07627b0860ac5490de164d (diff)
downloadnextcloud-server-ec01e0a790448fff38364f629a4de4edb5d465bf.tar.gz
nextcloud-server-ec01e0a790448fff38364f629a4de4edb5d465bf.zip
Bump eslint-config-nextcloud from 0.0.6 to 0.1.0
Bumps [eslint-config-nextcloud](https://github.com/nextcloud/eslint-config-nextcloud) from 0.0.6 to 0.1.0. - [Release notes](https://github.com/nextcloud/eslint-config-nextcloud/releases) - [Commits](https://github.com/nextcloud/eslint-config-nextcloud/compare/v0.0.6...v0.1.0) Co-authored-by: Christoph Wurst <christoph@winzerhof-wurst.at> Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/src/OCP')
-rw-r--r--core/src/OCP/appconfig.js6
-rw-r--r--core/src/OCP/collaboration.js6
-rw-r--r--core/src/OCP/index.js4
-rw-r--r--core/src/OCP/loader.js14
-rw-r--r--core/src/OCP/toast.js8
-rw-r--r--core/src/OCP/whatsnew.js16
6 files changed, 27 insertions, 27 deletions
diff --git a/core/src/OCP/appconfig.js b/core/src/OCP/appconfig.js
index f4213419aab..d7aaf12ddeb 100644
--- a/core/src/OCP/appconfig.js
+++ b/core/src/OCP/appconfig.js
@@ -43,7 +43,7 @@ function call(method, endpoint, options) {
url: OC.linkToOCS('apps/provisioning_api/api/v1', 2) + 'config/apps' + endpoint,
data: options.data || {},
success: options.success,
- error: options.error
+ error: options.error,
})
}
@@ -79,7 +79,7 @@ export function getKeys(app, options) {
export function getValue(app, key, defaultValue, options) {
options = options || {}
options.data = {
- defaultValue: defaultValue
+ defaultValue: defaultValue,
}
call('get', '/' + app + '/' + key, options)
@@ -97,7 +97,7 @@ export function getValue(app, key, defaultValue, options) {
export function setValue(app, key, value, options) {
options = options || {}
options.data = {
- value: value
+ value: value,
}
call('post', '/' + app + '/' + key, options)
diff --git a/core/src/OCP/collaboration.js b/core/src/OCP/collaboration.js
index 4eea517f3aa..cfb307a0a3f 100644
--- a/core/src/OCP/collaboration.js
+++ b/core/src/OCP/collaboration.js
@@ -30,7 +30,7 @@
/**
* @type {TypeDefinition[]}
**/
-let types = {}
+const types = {}
/**
* Those translations will be used by the vue component but they should be shipped with the server
@@ -47,7 +47,7 @@ export const l10nProjects = () => {
t('core', 'Failed to create a project'),
t('core', 'Failed to add the item to the project'),
t('core', 'Connect items to a project to make them easier to find'),
- t('core', 'Type to search for existing projects')
+ t('core', 'Type to search for existing projects'),
]
}
@@ -75,5 +75,5 @@ export default {
getLink(type, id) {
/* TODO: Allow action to be executed instead of href as well */
return typeof types[type] !== 'undefined' ? types[type].link(id) : ''
- }
+ },
}
diff --git a/core/src/OCP/index.js b/core/src/OCP/index.js
index 3309e3fe047..d8640b1ff0c 100644
--- a/core/src/OCP/index.js
+++ b/core/src/OCP/index.js
@@ -18,9 +18,9 @@ export default {
/**
* @deprecated 18.0.0 add https://www.npmjs.com/package/@nextcloud/initial-state to your app
*/
- loadState
+ loadState,
},
Loader,
Toast,
- WhatsNew
+ WhatsNew,
}
diff --git a/core/src/OCP/loader.js b/core/src/OCP/loader.js
index 7f72c47ca64..293af9bbec2 100644
--- a/core/src/OCP/loader.js
+++ b/core/src/OCP/loader.js
@@ -20,8 +20,8 @@
*
*/
-let loadedScripts = {}
-let loadedStylesheets = {}
+const loadedScripts = {}
+const loadedStylesheets = {}
/**
* @namespace OCP
* @class Loader
@@ -42,8 +42,8 @@ export default {
}
loadedScripts[key] = true
return new Promise(function(resolve, reject) {
- var scriptPath = OC.filePath(app, 'js', file)
- var script = document.createElement('script')
+ const scriptPath = OC.filePath(app, 'js', file)
+ const script = document.createElement('script')
script.src = scriptPath
script.setAttribute('nonce', btoa(OC.requestToken))
script.onload = () => resolve()
@@ -66,8 +66,8 @@ export default {
}
loadedStylesheets[key] = true
return new Promise(function(resolve, reject) {
- var stylePath = OC.filePath(app, 'css', file)
- var link = document.createElement('link')
+ const stylePath = OC.filePath(app, 'css', file)
+ const link = document.createElement('link')
link.href = stylePath
link.type = 'text/css'
link.rel = 'stylesheet'
@@ -75,5 +75,5 @@ export default {
link.onerror = () => reject(new Error(`Failed to load stylesheet from ${stylePath}`))
document.head.appendChild(link)
})
- }
+ },
}
diff --git a/core/src/OCP/toast.js b/core/src/OCP/toast.js
index 58f98d93480..6bb3b130287 100644
--- a/core/src/OCP/toast.js
+++ b/core/src/OCP/toast.js
@@ -27,7 +27,7 @@ const TOAST_TYPE_CLASES = {
info: 'toast-info',
warning: 'toast-warning',
success: 'toast-success',
- permanent: 'permanent'
+ permanent: 'permanent',
}
const Toast = {
@@ -59,7 +59,7 @@ const Toast = {
isHTML: false,
type: undefined,
close: true,
- callback: () => {}
+ callback: () => {},
})
if (!options.isHTML) {
text = $('<div/>').text(text).html()
@@ -78,12 +78,12 @@ const Toast = {
selector: !window.TESTING ? 'content' : 'testArea',
positionLeft: false,
backgroundColor: '',
- className: 'toast ' + classes
+ className: 'toast ' + classes,
})
toast.showToast()
// add toastify object to the element for reference in legacy OC.Notification
toast.toastElement.toastify = toast
return toast
- }
+ },
}
export default Toast
diff --git a/core/src/OCP/whatsnew.js b/core/src/OCP/whatsnew.js
index c2935c5e78c..c0df8af7b3f 100644
--- a/core/src/OCP/whatsnew.js
+++ b/core/src/OCP/whatsnew.js
@@ -14,14 +14,14 @@ import OC from '../OC/index'
export function query(options) {
options = options || {}
- var dismissOptions = options.dismiss || {}
+ const dismissOptions = options.dismiss || {}
$.ajax({
type: 'GET',
url: options.url || OC.linkToOCS('core', 2) + 'whatsnew?format=json',
success: options.success || function(data, statusText, xhr) {
onQuerySuccess(data, statusText, xhr, dismissOptions)
},
- error: options.error || onQueryError
+ error: options.error || onQueryError,
})
}
@@ -32,7 +32,7 @@ export function dismiss(version, options) {
url: options.url || OC.linkToOCS('core', 2) + 'whatsnew',
data: { version: encodeURIComponent(version) },
success: options.success || onDismissSuccess,
- error: options.error || onDismissError
+ error: options.error || onDismissError,
})
// remove element immediately
$('.whatsNewPopover').remove()
@@ -46,12 +46,12 @@ function onQuerySuccess(data, statusText, xhr, dismissOptions) {
return
}
- var item, menuItem, text, icon
+ let item, menuItem, text, icon
- var div = document.createElement('div')
+ const div = document.createElement('div')
div.classList.add('popovermenu', 'open', 'whatsNewPopover', 'menu-left')
- var list = document.createElement('ul')
+ const list = document.createElement('ul')
// header
item = document.createElement('li')
@@ -74,8 +74,8 @@ function onQuerySuccess(data, statusText, xhr, dismissOptions) {
list.appendChild(item)
// Highlights
- for (var i in data['ocs']['data']['whatsNew']['regular']) {
- var whatsNewTextItem = data['ocs']['data']['whatsNew']['regular'][i]
+ for (const i in data['ocs']['data']['whatsNew']['regular']) {
+ const whatsNewTextItem = data['ocs']['data']['whatsNew']['regular'][i]
item = document.createElement('li')
menuItem = document.createElement('span')