Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/src/OC
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/OC')
-rw-r--r--core/src/OC/apps.js18
-rw-r--r--core/src/OC/backbone.js2
-rw-r--r--core/src/OC/currentuser.js2
-rw-r--r--core/src/OC/get_set.js2
-rw-r--r--core/src/OC/index.js20
-rw-r--r--core/src/OC/l10n-registry.js2
-rw-r--r--core/src/OC/l10n.js34
-rw-r--r--core/src/OC/msg.js2
-rw-r--r--core/src/OC/notification.js2
-rw-r--r--core/src/OC/password-confirmation.js28
-rw-r--r--core/src/OC/plugins.js12
-rw-r--r--core/src/OC/query-string.js11
-rw-r--r--core/src/OC/requesttoken.js2
-rw-r--r--core/src/OC/routing.js4
-rw-r--r--core/src/OC/util-history.js22
-rw-r--r--core/src/OC/util.js42
-rw-r--r--core/src/OC/webroot.js2
17 files changed, 103 insertions, 104 deletions
diff --git a/core/src/OC/apps.js b/core/src/OC/apps.js
index f94059a4212..f55a5d03dcc 100644
--- a/core/src/OC/apps.js
+++ b/core/src/OC/apps.js
@@ -10,12 +10,12 @@
import $ from 'jquery'
-var dynamicSlideToggleEnabled = false
+let dynamicSlideToggleEnabled = false
const Apps = {
enableDynamicSlideToggle: function() {
dynamicSlideToggleEnabled = true
- }
+ },
}
/**
@@ -24,7 +24,7 @@ const Apps = {
* @param {Object} [$el] sidebar element to show, defaults to $('#app-sidebar')
*/
Apps.showAppSidebar = function($el) {
- var $appSidebar = $el || $('#app-sidebar')
+ const $appSidebar = $el || $('#app-sidebar')
$appSidebar.removeClass('disappear').show()
$('#app-content').trigger(new $.Event('appresized'))
}
@@ -36,7 +36,7 @@ Apps.showAppSidebar = function($el) {
* @param {Object} [$el] sidebar element to hide, defaults to $('#app-sidebar')
*/
Apps.hideAppSidebar = function($el) {
- var $appSidebar = $el || $('#app-sidebar')
+ const $appSidebar = $el || $('#app-sidebar')
$appSidebar.hide().addClass('disappear')
$('#app-content').trigger(new $.Event('appresized'))
}
@@ -51,7 +51,7 @@ Apps.hideAppSidebar = function($el) {
* <div class=".slide-area" class="hidden">I'm sliding up</div>
*/
export const registerAppsSlideToggle = () => {
- var buttons = $('[data-apps-slide-toggle]')
+ let buttons = $('[data-apps-slide-toggle]')
if (buttons.length === 0) {
$('#app-navigation').addClass('without-app-settings')
@@ -65,8 +65,8 @@ export const registerAppsSlideToggle = () => {
buttons.each(function(index, button) {
- var areaSelector = $(button).data('apps-slide-toggle')
- var area = $(areaSelector)
+ const areaSelector = $(button).data('apps-slide-toggle')
+ const area = $(areaSelector)
function hideArea() {
area.slideUp(OC.menuSpeed * 4, function() {
@@ -82,7 +82,7 @@ export const registerAppsSlideToggle = () => {
})
area.addClass('opened')
$(button).addClass('opened')
- var input = $(areaSelector + ' [autofocus]')
+ const input = $(areaSelector + ' [autofocus]')
if (input.length === 1) {
input.focus()
}
@@ -102,7 +102,7 @@ export const registerAppsSlideToggle = () => {
// all other areas that have not been clicked but are open
// should be slid up
} else {
- var closest = $(event.target).closest(areaSelector)
+ const closest = $(event.target).closest(areaSelector)
if (area.is(':visible') && closest[0] !== area[0]) {
hideArea()
}
diff --git a/core/src/OC/backbone.js b/core/src/OC/backbone.js
index 38bfc046501..86e98ec1b41 100644
--- a/core/src/OC/backbone.js
+++ b/core/src/OC/backbone.js
@@ -27,7 +27,7 @@ const Backbone = VendorBackbone.noConflict()
// Patch Backbone for DAV
Object.assign(Backbone, {
davCall,
- davSync: davSync(Backbone)
+ davSync: davSync(Backbone),
})
export default Backbone
diff --git a/core/src/OC/currentuser.js b/core/src/OC/currentuser.js
index c8f9d59c1eb..061abba89d6 100644
--- a/core/src/OC/currentuser.js
+++ b/core/src/OC/currentuser.js
@@ -31,6 +31,6 @@ export const currentUser = rawUid !== undefined ? rawUid : false
export const getCurrentUser = () => {
return {
uid: currentUser,
- displayName
+ displayName,
}
}
diff --git a/core/src/OC/get_set.js b/core/src/OC/get_set.js
index bf45ce85fc7..12f9aab56eb 100644
--- a/core/src/OC/get_set.js
+++ b/core/src/OC/get_set.js
@@ -28,7 +28,7 @@ export const get = context => name => {
const namespaces = name.split('.')
const tail = namespaces.pop()
- for (var i = 0; i < namespaces.length; i++) {
+ for (let i = 0; i < namespaces.length; i++) {
context = context[namespaces[i]]
if (!context) {
return false
diff --git a/core/src/OC/index.js b/core/src/OC/index.js
index 2a43d95eade..9ecb3e60f6f 100644
--- a/core/src/OC/index.js
+++ b/core/src/OC/index.js
@@ -25,7 +25,7 @@ import { addScript, addStyle } from './legacy-loader'
import {
ajaxConnectionLostHandler,
processAjaxError,
- registerXHRForErrorProcessing
+ registerXHRForErrorProcessing,
} from './xhr-error'
import Apps from './apps'
import { AppConfig, appConfig } from './appconfig'
@@ -37,11 +37,11 @@ import {
dirname,
encodePath,
isSamePath,
- joinPaths
+ joinPaths,
} from '@nextcloud/paths'
import {
build as buildQueryString,
- parse as parseQueryString
+ parse as parseQueryString,
} from './query-string'
import Config from './config'
import {
@@ -54,7 +54,7 @@ import {
PERMISSION_READ,
PERMISSION_SHARE,
PERMISSION_UPDATE,
- TAG_FAVORITE
+ TAG_FAVORITE,
} from './constants'
import ContactsMenu from './contactsmenu'
import { currentUser, getCurrentUser } from './currentuser'
@@ -66,22 +66,22 @@ import {
getHost,
getHostName,
getPort,
- getProtocol
+ getProtocol,
} from './host'
import {
- getToken as getRequestToken
+ getToken as getRequestToken,
} from './requesttoken'
import {
hideMenus,
registerMenu,
showMenu,
- unregisterMenu
+ unregisterMenu,
} from './menu'
import { isUserAdmin } from './admin'
import L10N, {
getCanonicalLocale,
getLanguage,
- getLocale
+ getLocale,
} from './l10n'
import {
@@ -92,7 +92,7 @@ import {
linkTo,
linkToOCS,
linkToRemote,
- linkToRemoteBase
+ linkToRemoteBase,
} from './routing'
import msg from './msg'
import Notification from './notification'
@@ -270,7 +270,7 @@ export default {
* @deprecated since 8.2, use OC.getRootPath() instead
* @see OC#getRootPath
*/
- webroot
+ webroot,
}
// Keep the request token prop in sync
diff --git a/core/src/OC/l10n-registry.js b/core/src/OC/l10n-registry.js
index 44dc6f91be5..dc353902337 100644
--- a/core/src/OC/l10n-registry.js
+++ b/core/src/OC/l10n-registry.js
@@ -83,6 +83,6 @@ export const hasAppTranslations = appId => {
export const getAppTranslations = appId => {
return {
translations: window._oc_l10n_registry_translations[appId] || {},
- pluralFunction: window._oc_l10n_registry_plural_functions[appId]
+ pluralFunction: window._oc_l10n_registry_plural_functions[appId],
}
}
diff --git a/core/src/OC/l10n.js b/core/src/OC/l10n.js
index ebb2c032b6a..5ada257d858 100644
--- a/core/src/OC/l10n.js
+++ b/core/src/OC/l10n.js
@@ -19,7 +19,7 @@ import {
getAppTranslations,
hasAppTranslations,
registerAppTranslations,
- unregisterAppTranslations
+ unregisterAppTranslations,
} from './l10n-registry'
/**
@@ -40,15 +40,15 @@ const L10n = {
load: function(appName, callback) {
// already available ?
if (hasAppTranslations(appName) || OC.getLocale() === 'en') {
- var deferred = $.Deferred()
- var promise = deferred.promise()
+ const deferred = $.Deferred()
+ const promise = deferred.promise()
promise.then(callback)
deferred.resolve()
return promise
}
- var self = this
- var url = OC.filePath(appName, 'l10n', OC.getLocale() + '.json')
+ const self = this
+ const url = OC.filePath(appName, 'l10n', OC.getLocale() + '.json')
// load JSON translation bundle per AJAX
return $.get(url)
@@ -87,19 +87,19 @@ const L10n = {
* @returns {string}
*/
translate: function(app, text, vars, count, options) {
- var defaultOptions = {
- escape: true
+ const defaultOptions = {
+ escape: true,
}
- var allOptions = options || {}
+ const allOptions = options || {}
_.defaults(allOptions, defaultOptions)
// TODO: cache this function to avoid inline recreation
// of the same function over and over again in case
// translate() is used in a loop
- var _build = function(text, vars, count) {
+ const _build = function(text, vars, count) {
return text.replace(/%n/g, count).replace(/{([^{}]*)}/g,
function(a, b) {
- var r = vars[b]
+ const r = vars[b]
if (typeof r === 'string' || typeof r === 'number') {
if (allOptions.escape) {
return DOMPurify.sanitize(escapeHTML(r))
@@ -112,9 +112,9 @@ const L10n = {
}
)
}
- var translation = text
- var bundle = getAppTranslations(app)
- var value = bundle.translations[text]
+ let translation = text
+ const bundle = getAppTranslations(app)
+ const value = bundle.translations[text]
if (typeof (value) !== 'undefined') {
translation = value
}
@@ -142,9 +142,9 @@ const L10n = {
const bundle = getAppTranslations(app)
const value = bundle.translations[identifier]
if (typeof (value) !== 'undefined') {
- var translation = value
+ const translation = value
if ($.isArray(translation)) {
- var plural = bundle.pluralFunction(count)
+ const plural = bundle.pluralFunction(count)
return this.translate(app, translation[plural], vars, count, options)
}
}
@@ -164,7 +164,7 @@ const L10n = {
* @private
*/
_getPlural: function(number) {
- var language = OC.getLanguage()
+ let language = OC.getLanguage()
if (language === 'pt_BR') {
// temporary set a locale for brazilian
language = 'xbr'
@@ -315,7 +315,7 @@ const L10n = {
default:
return 0
}
- }
+ },
}
export default L10n
diff --git a/core/src/OC/msg.js b/core/src/OC/msg.js
index e210f32bb14..744bd795b6c 100644
--- a/core/src/OC/msg.js
+++ b/core/src/OC/msg.js
@@ -113,5 +113,5 @@ export default {
.addClass('error')
.removeClass('success')
.show()
- }
+ },
}
diff --git a/core/src/OC/notification.js b/core/src/OC/notification.js
index b56fb6b14de..4e95476b69b 100644
--- a/core/src/OC/notification.js
+++ b/core/src/OC/notification.js
@@ -156,5 +156,5 @@ export default {
*/
isHidden: function() {
return !$('#content').find('.toastify').length
- }
+ },
}
diff --git a/core/src/OC/password-confirmation.js b/core/src/OC/password-confirmation.js
index e303d70bf5d..f708217fc84 100644
--- a/core/src/OC/password-confirmation.js
+++ b/core/src/OC/password-confirmation.js
@@ -39,8 +39,8 @@ export default {
},
requiresPasswordConfirmation: function() {
- var serverTimeDiff = this.pageLoadTime - (window.nc_pageLoad * 1000)
- var timeSinceLogin = moment.now() - (serverTimeDiff + (window.nc_lastLogin * 1000))
+ const serverTimeDiff = this.pageLoadTime - (window.nc_pageLoad * 1000)
+ const timeSinceLogin = moment.now() - (serverTimeDiff + (window.nc_lastLogin * 1000))
// if timeSinceLogin > 30 minutes and user backend allows password confirmation
return (window.backendAllowsPasswordConfirmation && timeSinceLogin > 30 * 60 * 1000)
@@ -53,7 +53,7 @@ export default {
*/
requirePasswordConfirmation: function(callback, options, rejectCallback) {
options = typeof options !== 'undefined' ? options : {}
- var defaults = {
+ const defaults = {
title: t('core', 'Authentication required'),
text: t(
'core',
@@ -61,12 +61,12 @@ export default {
),
confirm: t('core', 'Confirm'),
label: t('core', 'Password'),
- error: ''
+ error: '',
}
- var config = _.extend(defaults, options)
+ const config = _.extend(defaults, options)
- var self = this
+ const self = this
if (this.requiresPasswordConfirmation()) {
OC.dialogs.prompt(
@@ -83,16 +83,16 @@ export default {
config.label,
true
).then(function() {
- var $dialog = $('.oc-dialog:visible')
+ const $dialog = $('.oc-dialog:visible')
$dialog.find('.ui-icon').remove()
$dialog.addClass('password-confirmation')
if (config.error !== '') {
- var $error = $('<p></p>').addClass('msg warning').text(config.error)
+ const $error = $('<p></p>').addClass('msg warning').text(config.error)
+ $dialog.find('.oc-dialog-content').append($error)
}
- $dialog.find('.oc-dialog-content').append($error)
$dialog.find('.oc-dialog-buttonrow').addClass('aside')
- var $buttons = $dialog.find('button')
+ const $buttons = $dialog.find('button')
$buttons.eq(0).hide()
$buttons.eq(1).text(config.confirm)
})
@@ -102,12 +102,12 @@ export default {
},
_confirmPassword: function(password, config) {
- var self = this
+ const self = this
$.ajax({
url: OC.generateUrl('/login/confirm'),
data: {
- password: password
+ password: password,
},
type: 'POST',
success: function(response) {
@@ -120,7 +120,7 @@ export default {
error: function() {
config.error = t('core', 'Failed to authenticate, try again')
OC.PasswordConfirmation.requirePasswordConfirmation(self.callback, config)
- }
+ },
})
- }
+ },
}
diff --git a/core/src/OC/plugins.js b/core/src/OC/plugins.js
index 124116b9a59..1c9b59c7419 100644
--- a/core/src/OC/plugins.js
+++ b/core/src/OC/plugins.js
@@ -36,7 +36,7 @@ export default {
* @param {OC.Plugin} plugin plugin
*/
register: function(targetName, plugin) {
- var plugins = this._plugins[targetName]
+ let plugins = this._plugins[targetName]
if (!plugins) {
plugins = this._plugins[targetName] = []
}
@@ -62,8 +62,8 @@ export default {
* @param {Object} [options] options
*/
attach: function(targetName, targetObject, options) {
- var plugins = this.getPlugins(targetName)
- for (var i = 0; i < plugins.length; i++) {
+ const plugins = this.getPlugins(targetName)
+ for (let i = 0; i < plugins.length; i++) {
if (plugins[i].attach) {
plugins[i].attach(targetObject, options)
}
@@ -78,12 +78,12 @@ export default {
* @param {Object} [options] options
*/
detach: function(targetName, targetObject, options) {
- var plugins = this.getPlugins(targetName)
- for (var i = 0; i < plugins.length; i++) {
+ const plugins = this.getPlugins(targetName)
+ for (let i = 0; i < plugins.length; i++) {
if (plugins[i].detach) {
plugins[i].detach(targetObject, options)
}
}
- }
+ },
}
diff --git a/core/src/OC/query-string.js b/core/src/OC/query-string.js
index a8141777905..502fa15e474 100644
--- a/core/src/OC/query-string.js
+++ b/core/src/OC/query-string.js
@@ -25,10 +25,9 @@
* @returns {Object.<string, string>} map containing key/values matching the URL parameters
*/
export const parse = queryString => {
- let parts
let pos
let components
- let result = {}
+ const result = {}
let key
if (!queryString) {
return null
@@ -37,15 +36,15 @@ export const parse = queryString => {
if (pos >= 0) {
queryString = queryString.substr(pos + 1)
}
- parts = queryString.replace(/\+/g, '%20').split('&')
+ const parts = queryString.replace(/\+/g, '%20').split('&')
for (let i = 0; i < parts.length; i++) {
// split on first equal sign
- var part = parts[i]
+ const part = parts[i]
pos = part.indexOf('=')
if (pos >= 0) {
components = [
part.substr(0, pos),
- part.substr(pos + 1)
+ part.substr(pos + 1),
]
} else {
// key only
@@ -79,7 +78,7 @@ export const build = params => {
return ''
}
return $.map(params, function(value, key) {
- var s = encodeURIComponent(key)
+ let s = encodeURIComponent(key)
if (value !== null && typeof (value) !== 'undefined') {
s += '=' + encodeURIComponent(value)
}
diff --git a/core/src/OC/requesttoken.js b/core/src/OC/requesttoken.js
index 91b18069d75..b25fdafd5b4 100644
--- a/core/src/OC/requesttoken.js
+++ b/core/src/OC/requesttoken.js
@@ -35,6 +35,6 @@ export const setToken = newToken => {
token = newToken
emit('csrf-token-update', {
- token
+ token,
})
}
diff --git a/core/src/OC/routing.js b/core/src/OC/routing.js
index 36fd0009032..9244212286d 100644
--- a/core/src/OC/routing.js
+++ b/core/src/OC/routing.js
@@ -68,7 +68,7 @@ export const linkToOCS = (service, version) => {
*/
export const generateUrl = (url, params, options) => {
const defaultOptions = {
- escape: true
+ escape: true,
}
const allOptions = options || {}
_.defaults(allOptions, defaultOptions)
@@ -77,7 +77,7 @@ export const generateUrl = (url, params, options) => {
vars = vars || []
return text.replace(/{([^{}]*)}/g,
function(a, b) {
- var r = (vars[b])
+ const r = (vars[b])
if (allOptions.escape) {
return (typeof r === 'string' || typeof r === 'number') ? encodeURIComponent(r) : encodeURIComponent(a)
} else {
diff --git a/core/src/OC/util-history.js b/core/src/OC/util-history.js
index dfb5117c27e..61fe3fec098 100644
--- a/core/src/OC/util-history.js
+++ b/core/src/OC/util-history.js
@@ -46,7 +46,7 @@ export default {
* @param {boolean} [replace=false] whether to replace instead of pushing
*/
_pushState: function(params, url, replace) {
- var strParams
+ let strParams
if (typeof (params) === 'string') {
strParams = params
} else {
@@ -57,10 +57,10 @@ export default {
url = url || location.pathname + '?' + strParams
// Workaround for bug with SVG and window.history.pushState on Firefox < 51
// https://bugzilla.mozilla.org/show_bug.cgi?id=652991
- var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1
+ const isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1
if (isFirefox && parseInt(navigator.userAgent.split('/').pop()) < 51) {
- var patterns = document.querySelectorAll('[fill^="url(#"], [stroke^="url(#"], [filter^="url(#invert"]')
- for (var i = 0, ii = patterns.length, pattern; i < ii; i++) {
+ const patterns = document.querySelectorAll('[fill^="url(#"], [stroke^="url(#"], [filter^="url(#invert"]')
+ for (let i = 0, ii = patterns.length, pattern; i < ii; i++) {
pattern = patterns[i]
// eslint-disable-next-line no-self-assign
pattern.style.fill = pattern.style.fill
@@ -127,8 +127,8 @@ export default {
* @returns {string}
*/
_parseHashQuery: function() {
- var hash = window.location.hash
- var pos = hash.indexOf('?')
+ const hash = window.location.hash
+ const pos = hash.indexOf('?')
if (pos >= 0) {
return hash.substr(pos + 1)
}
@@ -150,8 +150,8 @@ export default {
* @returns {Object} map of parameters
*/
parseUrlQuery: function() {
- var query = this._parseHashQuery()
- var params
+ const query = this._parseHashQuery()
+ let params
// try and parse from URL hash first
if (query) {
params = OC.parseQueryString(this._decodeQuery(query))
@@ -166,7 +166,7 @@ export default {
this._cancelPop = false
return
}
- var params
+ let params
if (!this._handlers.length) {
return
}
@@ -176,8 +176,8 @@ export default {
} else if (!params) {
params = this.parseUrlQuery() || {}
}
- for (var i = 0; i < this._handlers.length; i++) {
+ for (let i = 0; i < this._handlers.length; i++) {
this._handlers[i](params)
}
- }
+ },
}
diff --git a/core/src/OC/util.js b/core/src/OC/util.js
index 7c4a44b77d9..1bb4ae9ead0 100644
--- a/core/src/OC/util.js
+++ b/core/src/OC/util.js
@@ -28,7 +28,7 @@ import humanFileSize from '../Util/human-file-size'
function chunkify(t) {
// Adapted from http://my.opera.com/GreyWyvern/blog/show.dml/1671288
- let tz = []
+ const tz = []
let x = 0
let y = -1
let n = 0
@@ -37,7 +37,7 @@ function chunkify(t) {
while (x < t.length) {
c = t.charAt(x)
// only include the dot in strings
- var m = ((!n && c === '.') || (c >= '0' && c <= '9'))
+ const m = ((!n && c === '.') || (c >= '0' && c <= '9'))
if (m !== n) {
// next chunk
y++
@@ -75,10 +75,10 @@ export default {
return null
}
- var s = string.toLowerCase().trim()
- var bytes = null
+ const s = string.toLowerCase().trim()
+ let bytes = null
- var bytesArray = {
+ const bytesArray = {
'b': 1,
'k': 1024,
'kb': 1024,
@@ -89,10 +89,10 @@ export default {
'tb': 1024 * 1024 * 1024 * 1024,
't': 1024 * 1024 * 1024 * 1024,
'pb': 1024 * 1024 * 1024 * 1024 * 1024,
- 'p': 1024 * 1024 * 1024 * 1024 * 1024
+ 'p': 1024 * 1024 * 1024 * 1024 * 1024,
}
- var matches = s.match(/^[\s+]?([0-9]*)(\.([0-9]+))?( +)?([kmgtp]?b?)$/i)
+ const matches = s.match(/^[\s+]?([0-9]*)(\.([0-9]+))?( +)?([kmgtp]?b?)$/i)
if (matches !== null) {
bytes = parseFloat(s)
if (!isFinite(bytes)) {
@@ -124,7 +124,7 @@ export default {
* @returns {string} human readable difference from now
*/
relativeModifiedDate: function(timestamp) {
- var diff = moment().diff(moment(timestamp))
+ const diff = moment().diff(moment(timestamp))
if (diff >= 0 && diff < 45000) {
return t('core', 'seconds ago')
}
@@ -150,11 +150,11 @@ export default {
return this._scrollBarWidth
}
- var inner = document.createElement('p')
+ const inner = document.createElement('p')
inner.style.width = '100%'
inner.style.height = '200px'
- var outer = document.createElement('div')
+ const outer = document.createElement('div')
outer.style.position = 'absolute'
outer.style.top = '0px'
outer.style.left = '0px'
@@ -165,9 +165,9 @@ export default {
outer.appendChild(inner)
document.body.appendChild(outer)
- var w1 = inner.offsetWidth
+ const w1 = inner.offsetWidth
outer.style.overflow = 'scroll'
- var w2 = inner.offsetWidth
+ let w2 = inner.offsetWidth
if (w1 === w2) {
w2 = outer.clientWidth
}
@@ -199,13 +199,13 @@ export default {
* or 0 if the strings are identical
*/
naturalSortCompare: function(a, b) {
- var x
- var aa = chunkify(a)
- var bb = chunkify(b)
+ let x
+ const aa = chunkify(a)
+ const bb = chunkify(b)
for (x = 0; aa[x] && bb[x]; x++) {
if (aa[x] !== bb[x]) {
- var aNum = Number(aa[x]); var bNum = Number(bb[x])
+ const aNum = Number(aa[x]); const bNum = Number(bb[x])
// note: == is correct here
/* eslint-disable-next-line */
if (aNum == aa[x] && bNum == bb[x]) {
@@ -226,7 +226,7 @@ export default {
* @param {integer} interval in milliseconds
*/
waitFor: function(callback, interval) {
- var internalCallback = function() {
+ const internalCallback = function() {
if (callback() !== true) {
setTimeout(internalCallback, interval)
}
@@ -242,13 +242,13 @@ export default {
* @returns {boolean} true if the cookie with the given name has the given value
*/
isCookieSetToValue: function(name, value) {
- var cookies = document.cookie.split(';')
- for (var i = 0; i < cookies.length; i++) {
- var cookie = cookies[i].split('=')
+ const cookies = document.cookie.split(';')
+ for (let i = 0; i < cookies.length; i++) {
+ const cookie = cookies[i].split('=')
if (cookie[0].trim() === name && cookie[1].trim() === value) {
return true
}
}
return false
- }
+ },
}
diff --git a/core/src/OC/webroot.js b/core/src/OC/webroot.js
index cf9da346f92..89c04a6bb07 100644
--- a/core/src/OC/webroot.js
+++ b/core/src/OC/webroot.js
@@ -23,7 +23,7 @@ let webroot = window._oc_webroot
if (typeof webroot === 'undefined') {
webroot = location.pathname
- var pos = webroot.indexOf('/index.php/')
+ const pos = webroot.indexOf('/index.php/')
if (pos !== -1) {
webroot = webroot.substr(0, pos)
} else {