Fix some jshint issues in core/js/share*

This commit is contained in:
Roeland Jago Douma 2016-08-19 21:03:25 +02:00
parent 8007ea60fb
commit 555ea93b1c
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
7 changed files with 19 additions and 11 deletions

View File

@ -8,7 +8,7 @@
*
*/
/* global moment */
/* global moment, oc_appconfig, oc_config */
(function() {
if (!OC.Share) {

View File

@ -8,7 +8,7 @@
*
*/
/* global moment */
/* global moment, Handlebars */
(function() {
if (!OC.Share) {
@ -107,7 +107,7 @@
$target.tooltip('hide');
$target.removeClass('error');
expiration = moment($target.val(), 'DD-MM-YYYY').format('YYYY-MM-DD');
var expiration = moment($target.val(), 'DD-MM-YYYY').format('YYYY-MM-DD');
this.model.get('linkShare').expiration = expiration;
this.model.saveLinkShare({
expiration: expiration

View File

@ -8,6 +8,8 @@
*
*/
/* globals Clipboard, Handlebars */
(function() {
if (!OC.Share) {
OC.Share = {};
@ -131,7 +133,7 @@
var clipboard = new Clipboard('.clipboardButton');
clipboard.on('success', function(e) {
$input = $(e.trigger);
var $input = $(e.trigger);
$input.tooltip({placement: 'bottom', trigger: 'manual', title: t('core', 'Copied!')});
$input.tooltip('show');
_.delay(function() {
@ -139,7 +141,7 @@
}, 3000);
});
clipboard.on('error', function (e) {
$input = $(e.trigger);
var $input = $(e.trigger);
var actionMsg = '';
if (/iPhone|iPad/i.test(navigator.userAgent)) {
actionMsg = t('core', 'Not supported!');
@ -206,7 +208,7 @@
},
onPasswordKeyUp: function(event) {
if(event.keyCode == 13) {
if(event.keyCode === 13) {
this.onPasswordEntered();
}
},

View File

@ -8,6 +8,8 @@
*
*/
/* globals escapeHTML, Handlebars */
(function() {
if (!OC.Share) {
OC.Share = {};
@ -137,7 +139,7 @@
fetch: 'getShareWithEmail',
search: search.term
}, function(result) {
if (result.status == 'success' && result.data.length > 0) {
if (result.status === 'success' && result.data.length > 0) {
response(result.data);
}
});

View File

@ -8,6 +8,8 @@
*
*/
/* globals Handlebars */
(function() {
if (!OC.Share) {
OC.Share = {};

View File

@ -8,6 +8,8 @@
*
*/
/* globals Handlebars */
(function() {
if (!OC.Share) {
OC.Share = {};
@ -254,8 +256,6 @@
var $element = $(event.target);
var $li = $element.closest('li');
var shareId = $li.data('share-id');
var shareType = $li.data('share-type');
var shareWith = $li.attr('data-share-with');
// adjust checkbox states
var $checkboxes = $('.permissions', $li).not('input[name="edit"]').not('input[name="share"]');

View File

@ -8,6 +8,8 @@
*
*/
/* globals Handlebars */
(function() {
if(!OC.Share) {
OC.Share = {};
@ -148,7 +150,7 @@
function (result) {
$loading.addClass('hidden');
$loading.removeClass('inlineblock');
if (result.ocs.meta.statuscode == 100) {
if (result.ocs.meta.statuscode === 100) {
var users = result.ocs.data.exact.users.concat(result.ocs.data.users);
var groups = result.ocs.data.exact.groups.concat(result.ocs.data.groups);
var remotes = result.ocs.data.exact.remotes.concat(result.ocs.data.remotes);
@ -404,7 +406,7 @@
if (this.configModel.get('isRemoteShareAllowed')) {
sharePlaceholder = t('core', 'Share with users, groups or remote users…');
} else {
sharePlaceholder = t('core', 'Share with users or groups…')
sharePlaceholder = t('core', 'Share with users or groups…');
}
} else if (this.configModel.get('isRemoteShareAllowed')) {
sharePlaceholder = t('core', 'Share with users or remote users…');