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
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2019-11-13 15:05:10 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-12-19 13:55:33 +0300
commitec01e0a790448fff38364f629a4de4edb5d465bf (patch)
tree8fb5369e3d6f9f805025802e12feaa4dfaef1e03 /core/src/jquery
parent5d9fd7ba0cced84f1d07627b0860ac5490de164d (diff)
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/jquery')
-rw-r--r--core/src/jquery/avatar.js12
-rw-r--r--core/src/jquery/contactsmenu.js26
-rw-r--r--core/src/jquery/index.js4
-rw-r--r--core/src/jquery/ocdialog.js32
-rw-r--r--core/src/jquery/octemplate.js18
-rw-r--r--core/src/jquery/selectrange.js2
-rw-r--r--core/src/jquery/showpassword.js22
-rw-r--r--core/src/jquery/tipsy.js4
-rw-r--r--core/src/jquery/ui-fixes.js2
9 files changed, 61 insertions, 61 deletions
diff --git a/core/src/jquery/avatar.js b/core/src/jquery/avatar.js
index eaedce1461b..24cef392d34 100644
--- a/core/src/jquery/avatar.js
+++ b/core/src/jquery/avatar.js
@@ -65,7 +65,7 @@ import OC from '../OC'
*/
$.fn.avatar = function(user, size, ie8fix, hidedefault, callback, displayname) {
- var setAvatarForUnknownUser = function(target) {
+ const setAvatarForUnknownUser = function(target) {
target.imageplaceholder('?')
target.css('background-color', '#b9b9b9')
}
@@ -102,8 +102,8 @@ $.fn.avatar = function(user, size, ie8fix, hidedefault, callback, displayname) {
// sanitize
user = String(user).replace(/\//g, '')
- var $div = this
- var url
+ const $div = this
+ let url
// If this is our own avatar we have to use the version attribute
if (user === OC.getCurrentUser().uid) {
@@ -112,18 +112,18 @@ $.fn.avatar = function(user, size, ie8fix, hidedefault, callback, displayname) {
{
user: user,
size: Math.ceil(size * window.devicePixelRatio),
- version: oc_userconfig.avatar.version
+ version: oc_userconfig.avatar.version,
})
} else {
url = OC.generateUrl(
'/avatar/{user}/{size}',
{
user: user,
- size: Math.ceil(size * window.devicePixelRatio)
+ size: Math.ceil(size * window.devicePixelRatio),
})
}
- var img = new Image()
+ const img = new Image()
// If the new image loads successfully set it.
img.onload = function() {
diff --git a/core/src/jquery/contactsmenu.js b/core/src/jquery/contactsmenu.js
index 389c8809be0..ee708dcf982 100644
--- a/core/src/jquery/contactsmenu.js
+++ b/core/src/jquery/contactsmenu.js
@@ -38,14 +38,14 @@ const entryTemplate = require('./contactsmenu/jquery_entry.handlebars')
$.fn.contactsMenu = function(shareWith, shareType, appendTo) {
// 0 - user, 4 - email, 6 - remote
- var allowedTypes = [0, 4, 6]
+ const allowedTypes = [0, 4, 6]
if (allowedTypes.indexOf(shareType) === -1) {
return
}
- var $div = this
+ const $div = this
appendTo.append(LIST)
- var $list = appendTo.find('div.contactsmenu-popover')
+ const $list = appendTo.find('div.contactsmenu-popover')
$div.click(function() {
if (!$list.hasClass('hidden')) {
@@ -66,46 +66,46 @@ $.fn.contactsMenu = function(shareWith, shareType, appendTo) {
method: 'POST',
data: {
shareType: shareType,
- shareWith: shareWith
- }
+ shareWith: shareWith,
+ },
}).then(function(data) {
$list.find('ul').find('li').addClass('hidden')
- var actions
+ let actions
if (!data.topAction) {
actions = [{
hyperlink: '#',
- title: t('core', 'No action available')
+ title: t('core', 'No action available'),
}]
} else {
actions = [data.topAction].concat(data.actions)
}
actions.forEach(function(action) {
- var template = entryTemplate
+ const template = entryTemplate
$list.find('ul').append(template(action))
})
}, function(jqXHR) {
$list.find('ul').find('li').addClass('hidden')
- var title
+ let title
if (jqXHR.status === 404) {
title = t('core', 'No action available')
} else {
title = t('core', 'Error fetching contact actions')
}
- var template = entryTemplate
+ const template = entryTemplate
$list.find('ul').append(template({
hyperlink: '#',
- title: title
+ title: title,
}))
})
})
$(document).click(function(event) {
- var clickedList = ($list.has(event.target).length > 0)
- var clickedTarget = ($div.has(event.target).length > 0)
+ const clickedList = ($list.has(event.target).length > 0)
+ let clickedTarget = ($div.has(event.target).length > 0)
$div.each(function() {
if ($(this).is(event.target)) {
diff --git a/core/src/jquery/index.js b/core/src/jquery/index.js
index d131ae5245a..c0145cb948f 100644
--- a/core/src/jquery/index.js
+++ b/core/src/jquery/index.js
@@ -48,8 +48,8 @@ import './css/jquery.ocdialog.scss'
*/
$.ajaxSetup({
contents: {
- script: false
- }
+ script: false,
+ },
})
/**
diff --git a/core/src/jquery/ocdialog.js b/core/src/jquery/ocdialog.js
index 68384311531..518a28f75d3 100644
--- a/core/src/jquery/ocdialog.js
+++ b/core/src/jquery/ocdialog.js
@@ -27,15 +27,15 @@ $.widget('oc.ocdialog', {
height: 'auto',
closeButton: true,
closeOnEscape: true,
- modal: false
+ modal: false,
},
_create: function() {
- var self = this
+ const self = this
this.originalCss = {
display: this.element[0].style.display,
width: this.element[0].style.width,
- height: this.element[0].style.height
+ height: this.element[0].style.height,
}
this.originalTitle = this.element.attr('title')
@@ -45,7 +45,7 @@ $.widget('oc.ocdialog', {
.attr({
// Setting tabIndex makes the div focusable
tabIndex: -1,
- role: 'dialog'
+ role: 'dialog',
})
.insertBefore(this.element)
this.$dialog.append(this.element.detach())
@@ -53,7 +53,7 @@ $.widget('oc.ocdialog', {
this.$dialog.css({
display: 'inline-block',
- position: 'fixed'
+ position: 'fixed',
})
this.enterCallback = null
@@ -92,7 +92,7 @@ $.widget('oc.ocdialog', {
self.$buttonrow
&& self.$buttonrow.find($(event.target)).length === 0
) {
- var $button = self.$buttonrow.find('button.primary')
+ const $button = self.$buttonrow.find('button.primary')
if ($button && !$button.prop('disabled')) {
$button.trigger('click')
}
@@ -111,13 +111,13 @@ $.widget('oc.ocdialog', {
this._trigger('open')
},
_setOption: function(key, value) {
- var self = this
+ const self = this
switch (key) {
case 'title':
if (this.$title) {
this.$title.text(value)
} else {
- var $title = $('<h2 class="oc-dialog-title">'
+ const $title = $('<h2 class="oc-dialog-title">'
+ value
+ '</h2>')
this.$title = $title.prependTo(this.$dialog)
@@ -128,7 +128,7 @@ $.widget('oc.ocdialog', {
if (this.$buttonrow) {
this.$buttonrow.empty()
} else {
- var $buttonrow = $('<div class="oc-dialog-buttonrow" />')
+ const $buttonrow = $('<div class="oc-dialog-buttonrow" />')
this.$buttonrow = $buttonrow.appendTo(this.$dialog)
}
if (value.length === 1) {
@@ -139,7 +139,7 @@ $.widget('oc.ocdialog', {
this.$buttonrow.addClass('threebuttons')
}
$.each(value, function(idx, val) {
- var $button = $('<button>').text(val.text)
+ const $button = $('<button>').text(val.text)
if (val.classes) {
$button.addClass(val.classes)
}
@@ -166,7 +166,7 @@ $.widget('oc.ocdialog', {
break
case 'closeButton':
if (value) {
- var $closeButton = $('<a class="oc-dialog-close"></a>')
+ const $closeButton = $('<a class="oc-dialog-close"></a>')
this.$dialog.prepend($closeButton)
$closeButton.on('click', function() {
self.close()
@@ -193,7 +193,7 @@ $.widget('oc.ocdialog', {
$.Widget.prototype._setOptions.apply(this, arguments)
},
_setSizes: function() {
- var lessHeight = 0
+ let lessHeight = 0
if (this.$title) {
lessHeight += this.$title.outerHeight(true)
}
@@ -201,7 +201,7 @@ $.widget('oc.ocdialog', {
lessHeight += this.$buttonrow.outerHeight(true)
}
this.element.css({
- 'height': 'calc(100% - ' + lessHeight + 'px)'
+ 'height': 'calc(100% - ' + lessHeight + 'px)',
})
},
_createOverlay: function() {
@@ -209,7 +209,7 @@ $.widget('oc.ocdialog', {
return
}
- var self = this
+ const self = this
this.overlay = $('<div>')
.addClass('oc-dialog-dim')
.appendTo($('#content'))
@@ -243,7 +243,7 @@ $.widget('oc.ocdialog', {
},
close: function() {
this._destroyOverlay()
- var self = this
+ const self = this
// Ugly hack to catch remaining keyup events.
setTimeout(function() {
self._trigger('close', self)
@@ -266,5 +266,5 @@ $.widget('oc.ocdialog', {
this.element.removeClass('oc-dialog-content')
.css(this.originalCss).detach().insertBefore(this.$dialog)
this.$dialog.remove()
- }
+ },
})
diff --git a/core/src/jquery/octemplate.js b/core/src/jquery/octemplate.js
index a8502b7b796..27b2dff970b 100644
--- a/core/src/jquery/octemplate.js
+++ b/core/src/jquery/octemplate.js
@@ -62,27 +62,27 @@ const Template = {
this.options = $.extend({}, this.options, options)
this.elem = elem
- var self = this
+ const self = this
if (typeof this.options.escapeFunction === 'function') {
- var keys = Object.keys(this.vars)
- for (var key = 0; key < keys.length; key++) {
+ const keys = Object.keys(this.vars)
+ for (let key = 0; key < keys.length; key++) {
if (typeof this.vars[keys[key]] === 'string') {
this.vars[keys[key]] = self.options.escapeFunction(this.vars[keys[key]])
}
}
}
- var _html = this._build(this.vars)
+ const _html = this._build(this.vars)
return $(_html)
},
// From stackoverflow.com/questions/1408289/best-way-to-do-variable-interpolation-in-javascript
_build: function(o) {
- var data = this.elem.attr('type') === 'text/template' ? this.elem.html() : this.elem.get(0).outerHTML
+ const data = this.elem.attr('type') === 'text/template' ? this.elem.html() : this.elem.get(0).outerHTML
try {
return data.replace(/{([^{}]*)}/g,
function(a, b) {
- var r = o[b]
+ const r = o[b]
return typeof r === 'string' || typeof r === 'number' ? r : a
}
)
@@ -91,14 +91,14 @@ const Template = {
}
},
options: {
- escapeFunction: escapeHTML
- }
+ escapeFunction: escapeHTML,
+ },
}
$.fn.octemplate = function(vars, options) {
vars = vars || {}
if (this.length) {
- var _template = Object.create(Template)
+ const _template = Object.create(Template)
return _template.init(vars, options, this)
}
}
diff --git a/core/src/jquery/selectrange.js b/core/src/jquery/selectrange.js
index b53bac4fc02..3076726024a 100644
--- a/core/src/jquery/selectrange.js
+++ b/core/src/jquery/selectrange.js
@@ -34,7 +34,7 @@ $.fn.selectRange = function(start, end) {
this.focus()
this.setSelectionRange(start, end)
} else if (this.createTextRange) {
- var range = this.createTextRange()
+ const range = this.createTextRange()
range.collapse(true)
range.moveEnd('character', end)
range.moveStart('character', start)
diff --git a/core/src/jquery/showpassword.js b/core/src/jquery/showpassword.js
index a9857f4d6d4..393ecac08b5 100644
--- a/core/src/jquery/showpassword.js
+++ b/core/src/jquery/showpassword.js
@@ -39,15 +39,15 @@ $.fn.extend({
showPassword: function(c) {
// Setup callback object
- var callback = { 'fn': null, 'args': {} }
+ const callback = { 'fn': null, 'args': {} }
callback.fn = c
// Clones passwords and turn the clones into text inputs
- var cloneElement = function(element) {
+ const cloneElement = function(element) {
- var $element = $(element)
+ const $element = $(element)
- var $clone = $('<input />')
+ const $clone = $('<input />')
// Name added for JQuery Validation compatibility
// Element name is required to avoid script warning.
@@ -58,7 +58,7 @@ $.fn.extend({
'size': $element.attr('size'),
'name': $element.attr('name') + '-clone',
'tabindex': $element.attr('tabindex'),
- 'autocomplete': 'off'
+ 'autocomplete': 'off',
})
if ($element.attr('placeholder') !== undefined) {
@@ -70,12 +70,12 @@ $.fn.extend({
}
// Transfers values between two elements
- var update = function(a, b) {
+ const update = function(a, b) {
b.val(a.val())
}
// Shows a or b depending on checkbox
- var setState = function(checkbox, a, b) {
+ const setState = function(checkbox, a, b) {
if (checkbox.is(':checked')) {
update(a, b)
@@ -91,11 +91,11 @@ $.fn.extend({
return this.each(function() {
- var $input = $(this)
- var $checkbox = $($input.data('typetoggle'))
+ const $input = $(this)
+ const $checkbox = $($input.data('typetoggle'))
// Create clone
- var $clone = cloneElement($input)
+ const $clone = cloneElement($input)
$clone.insertAfter($input)
// Set callback arguments
@@ -144,5 +144,5 @@ $.fn.extend({
}
})
- }
+ },
})
diff --git a/core/src/jquery/tipsy.js b/core/src/jquery/tipsy.js
index 75e90b1c060..0ae6ec83af0 100644
--- a/core/src/jquery/tipsy.js
+++ b/core/src/jquery/tipsy.js
@@ -32,12 +32,12 @@ $.fn.tipsy = function(argument) {
if (typeof argument === 'object' && argument !== null) {
// tipsy defaults
- var options = {
+ const options = {
placement: 'bottom',
delay: { 'show': 0, 'hide': 0 },
trigger: 'hover',
html: false,
- container: 'body'
+ container: 'body',
}
if (argument.gravity) {
switch (argument.gravity) {
diff --git a/core/src/jquery/ui-fixes.js b/core/src/jquery/ui-fixes.js
index fb5ce4d7ba8..d70c5579f94 100644
--- a/core/src/jquery/ui-fixes.js
+++ b/core/src/jquery/ui-fixes.js
@@ -3,6 +3,6 @@ import $ from 'jquery'
// Set autocomplete width the same as the related input
// See http://stackoverflow.com/a/11845718
$.ui.autocomplete.prototype._resizeMenu = function() {
- var ul = this.menu.element
+ const ul = this.menu.element
ul.outerWidth(this.element.outerWidth())
}