Merge pull request #11946 from nextcloud/bugfix/11945/fix-js-namespace-of-files-external
Fix JS namespace of files_external app
This commit is contained in:
commit
b28a0c10bf
|
@ -8,16 +8,16 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!OCA.External) {
|
if (!OCA.Files_External) {
|
||||||
/**
|
/**
|
||||||
* @namespace
|
* @namespace
|
||||||
*/
|
*/
|
||||||
OCA.External = {};
|
OCA.Files_External = {};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @namespace
|
* @namespace
|
||||||
*/
|
*/
|
||||||
OCA.External.App = {
|
OCA.Files_External.App = {
|
||||||
|
|
||||||
fileList: null,
|
fileList: null,
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ OCA.External.App = {
|
||||||
return this.fileList;
|
return this.fileList;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fileList = new OCA.External.FileList(
|
this.fileList = new OCA.Files_External.FileList(
|
||||||
$el,
|
$el,
|
||||||
{
|
{
|
||||||
fileActions: this._createFileActions()
|
fileActions: this._createFileActions()
|
||||||
|
@ -67,10 +67,10 @@ OCA.External.App = {
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#app-content-extstoragemounts').on('show', function(e) {
|
$('#app-content-extstoragemounts').on('show', function(e) {
|
||||||
OCA.External.App.initList($(e.target));
|
OCA.Files_External.App.initList($(e.target));
|
||||||
});
|
});
|
||||||
$('#app-content-extstoragemounts').on('hide', function() {
|
$('#app-content-extstoragemounts').on('hide', function() {
|
||||||
OCA.External.App.removeList();
|
OCA.Files_External.App.removeList();
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Status Manager */
|
/* Status Manager */
|
||||||
|
@ -82,27 +82,27 @@ $(document).ready(function() {
|
||||||
if (e.dir === '/') {
|
if (e.dir === '/') {
|
||||||
var mount_point = e.previousDir.split('/', 2)[1];
|
var mount_point = e.previousDir.split('/', 2)[1];
|
||||||
// Every time that we return to / root folder from a mountpoint, mount_point status is rechecked
|
// Every time that we return to / root folder from a mountpoint, mount_point status is rechecked
|
||||||
OCA.External.StatusManager.getMountPointList(function() {
|
OCA.Files_External.StatusManager.getMountPointList(function() {
|
||||||
OCA.External.StatusManager.recheckConnectivityForMount([mount_point], true);
|
OCA.Files_External.StatusManager.recheckConnectivityForMount([mount_point], true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('fileActionsReady', function(e){
|
.on('fileActionsReady', function(e){
|
||||||
if ($.isArray(e.$files)) {
|
if ($.isArray(e.$files)) {
|
||||||
if (OCA.External.StatusManager.mountStatus === null ||
|
if (OCA.Files_External.StatusManager.mountStatus === null ||
|
||||||
OCA.External.StatusManager.mountPointList === null ||
|
OCA.Files_External.StatusManager.mountPointList === null ||
|
||||||
_.size(OCA.External.StatusManager.mountStatus) !== _.size(OCA.External.StatusManager.mountPointList)) {
|
_.size(OCA.Files_External.StatusManager.mountStatus) !== _.size(OCA.Files_External.StatusManager.mountPointList)) {
|
||||||
// Will be the very first check when the files view will be loaded
|
// Will be the very first check when the files view will be loaded
|
||||||
OCA.External.StatusManager.launchFullConnectivityCheckOneByOne();
|
OCA.Files_External.StatusManager.launchFullConnectivityCheckOneByOne();
|
||||||
} else {
|
} else {
|
||||||
// When we change between general files view and external files view
|
// When we change between general files view and external files view
|
||||||
OCA.External.StatusManager.getMountPointList(function(){
|
OCA.Files_External.StatusManager.getMountPointList(function(){
|
||||||
var fileNames = [];
|
var fileNames = [];
|
||||||
$.each(e.$files, function(key, value){
|
$.each(e.$files, function(key, value){
|
||||||
fileNames.push(value.attr('data-file'));
|
fileNames.push(value.attr('data-file'));
|
||||||
});
|
});
|
||||||
// Recheck if launched but work from cache
|
// Recheck if launched but work from cache
|
||||||
OCA.External.StatusManager.recheckConnectivityForMount(fileNames, false);
|
OCA.Files_External.StatusManager.recheckConnectivityForMount(fileNames, false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class OCA.External.FileList
|
* @class OCA.Files_External.FileList
|
||||||
* @augments OCA.Files.FileList
|
* @augments OCA.Files.FileList
|
||||||
*
|
*
|
||||||
* @classdesc External storage file list.
|
* @classdesc External storage file list.
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
FileList.prototype = _.extend({}, OCA.Files.FileList.prototype,
|
FileList.prototype = _.extend({}, OCA.Files.FileList.prototype,
|
||||||
/** @lends OCA.External.FileList.prototype */ {
|
/** @lends OCA.Files_External.FileList.prototype */ {
|
||||||
appName: 'External storages',
|
appName: 'External storages',
|
||||||
|
|
||||||
_allowSelection: false,
|
_allowSelection: false,
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {OCA.External.MountPointInfo} fileData
|
* @param {OCA.Files_External.MountPointInfo} fileData
|
||||||
*/
|
*/
|
||||||
_createRow: function(fileData) {
|
_createRow: function(fileData) {
|
||||||
// TODO: hook earlier and render the whole row here
|
// TODO: hook earlier and render the whole row here
|
||||||
|
@ -138,12 +138,12 @@
|
||||||
/**
|
/**
|
||||||
* Mount point info attributes.
|
* Mount point info attributes.
|
||||||
*
|
*
|
||||||
* @typedef {Object} OCA.External.MountPointInfo
|
* @typedef {Object} OCA.Files_External.MountPointInfo
|
||||||
*
|
*
|
||||||
* @property {String} name mount point name
|
* @property {String} name mount point name
|
||||||
* @property {String} scope mount point scope "personal" or "system"
|
* @property {String} scope mount point scope "personal" or "system"
|
||||||
* @property {String} backend external storage backend name
|
* @property {String} backend external storage backend name
|
||||||
*/
|
*/
|
||||||
|
|
||||||
OCA.External.FileList = FileList;
|
OCA.Files_External.FileList = FileList;
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -4,7 +4,7 @@ $(document).ready(function() {
|
||||||
$tr.find('.configuration input.auth-param').attr('disabled', 'disabled').addClass('disabled-success');
|
$tr.find('.configuration input.auth-param').attr('disabled', 'disabled').addClass('disabled-success');
|
||||||
}
|
}
|
||||||
|
|
||||||
OCA.External.Settings.mountConfig.whenSelectAuthMechanism(function($tr, authMechanism, scheme, onCompletion) {
|
OCA.Files_External.Settings.mountConfig.whenSelectAuthMechanism(function($tr, authMechanism, scheme, onCompletion) {
|
||||||
if (authMechanism === 'oauth1::oauth1') {
|
if (authMechanism === 'oauth1::oauth1') {
|
||||||
var config = $tr.find('.configuration');
|
var config = $tr.find('.configuration');
|
||||||
config.append($(document.createElement('input'))
|
config.append($(document.createElement('input'))
|
||||||
|
@ -34,7 +34,7 @@ $(document).ready(function() {
|
||||||
$(token).val(result.access_token);
|
$(token).val(result.access_token);
|
||||||
$(token_secret).val(result.access_token_secret);
|
$(token_secret).val(result.access_token_secret);
|
||||||
$(configured).val('true');
|
$(configured).val('true');
|
||||||
OCA.External.Settings.mountConfig.saveStorageConfig($tr, function(status) {
|
OCA.Files_External.Settings.mountConfig.saveStorageConfig($tr, function(status) {
|
||||||
if (status) {
|
if (status) {
|
||||||
displayGranted($tr);
|
displayGranted($tr);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ $(document).ready(function() {
|
||||||
$(configured).val('false');
|
$(configured).val('false');
|
||||||
$(token).val(result.data.request_token);
|
$(token).val(result.data.request_token);
|
||||||
$(token_secret).val(result.data.request_token_secret);
|
$(token_secret).val(result.data.request_token_secret);
|
||||||
OCA.External.Settings.mountConfig.saveStorageConfig(tr, function() {
|
OCA.Files_External.Settings.mountConfig.saveStorageConfig(tr, function() {
|
||||||
window.location = result.data.url;
|
window.location = result.data.url;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -4,7 +4,7 @@ $(document).ready(function() {
|
||||||
$tr.find('.configuration input.auth-param').attr('disabled', 'disabled').addClass('disabled-success');
|
$tr.find('.configuration input.auth-param').attr('disabled', 'disabled').addClass('disabled-success');
|
||||||
}
|
}
|
||||||
|
|
||||||
OCA.External.Settings.mountConfig.whenSelectAuthMechanism(function($tr, authMechanism, scheme, onCompletion) {
|
OCA.Files_External.Settings.mountConfig.whenSelectAuthMechanism(function($tr, authMechanism, scheme, onCompletion) {
|
||||||
if (authMechanism === 'oauth2::oauth2') {
|
if (authMechanism === 'oauth2::oauth2') {
|
||||||
var config = $tr.find('.configuration');
|
var config = $tr.find('.configuration');
|
||||||
config.append($(document.createElement('input'))
|
config.append($(document.createElement('input'))
|
||||||
|
@ -43,7 +43,7 @@ $(document).ready(function() {
|
||||||
if (result && result.status == 'success') {
|
if (result && result.status == 'success') {
|
||||||
$(token).val(result.data.token);
|
$(token).val(result.data.token);
|
||||||
$(configured).val('true');
|
$(configured).val('true');
|
||||||
OCA.External.Settings.mountConfig.saveStorageConfig($tr, function(status) {
|
OCA.Files_External.Settings.mountConfig.saveStorageConfig($tr, function(status) {
|
||||||
if (status) {
|
if (status) {
|
||||||
displayGranted($tr);
|
displayGranted($tr);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ $(document).ready(function() {
|
||||||
if (result && result.status == 'success') {
|
if (result && result.status == 'success') {
|
||||||
$(configured).val('false');
|
$(configured).val('false');
|
||||||
$(token).val('false');
|
$(token).val('false');
|
||||||
OCA.External.Settings.mountConfig.saveStorageConfig(tr, function(status) {
|
OCA.Files_External.Settings.mountConfig.saveStorageConfig(tr, function(status) {
|
||||||
window.location = result.data.url;
|
window.location = result.data.url;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
OCA.External.Settings.mountConfig.whenSelectAuthMechanism(function($tr, authMechanism, scheme, onCompletion) {
|
OCA.Files_External.Settings.mountConfig.whenSelectAuthMechanism(function($tr, authMechanism, scheme, onCompletion) {
|
||||||
if (scheme === 'publickey' && authMechanism === 'publickey::rsa') {
|
if (scheme === 'publickey' && authMechanism === 'publickey::rsa') {
|
||||||
var config = $tr.find('.configuration');
|
var config = $tr.find('.configuration');
|
||||||
if ($(config).find('[name="public_key_generate"]').length === 0) {
|
if ($(config).find('[name="public_key_generate"]').length === 0) {
|
||||||
|
@ -53,7 +53,7 @@ $(document).ready(function() {
|
||||||
if (result && result.status === 'success') {
|
if (result && result.status === 'success') {
|
||||||
$(config).find('[data-parameter="public_key"]').val(result.data.public_key).keyup();
|
$(config).find('[data-parameter="public_key"]').val(result.data.public_key).keyup();
|
||||||
$(config).find('[data-parameter="private_key"]').val(result.data.private_key);
|
$(config).find('[data-parameter="private_key"]').val(result.data.private_key);
|
||||||
OCA.External.Settings.mountConfig.saveStorageConfig(tr, function() {
|
OCA.Files_External.Settings.mountConfig.saveStorageConfig(tr, function() {
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -124,14 +124,14 @@ var RollingQueue = function (functionList, queueWindow, callback) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!OCA.External) {
|
if (!OCA.Files_External) {
|
||||||
OCA.External = {};
|
OCA.Files_External = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!OCA.External.StatusManager) {
|
if (!OCA.Files_External.StatusManager) {
|
||||||
OCA.External.StatusManager = {};
|
OCA.Files_External.StatusManager = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
OCA.External.StatusManager.RollingQueue = RollingQueue;
|
OCA.Files_External.StatusManager.RollingQueue = RollingQueue;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -163,7 +163,7 @@ function addSelect2 ($elements, userListLimit) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class OCA.External.Settings.StorageConfig
|
* @class OCA.Files_External.Settings.StorageConfig
|
||||||
*
|
*
|
||||||
* @classdesc External storage config
|
* @classdesc External storage config
|
||||||
*/
|
*/
|
||||||
|
@ -185,7 +185,7 @@ StorageConfig.Visibility = {
|
||||||
DEFAULT: 3
|
DEFAULT: 3
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* @memberof OCA.External.Settings
|
* @memberof OCA.Files_External.Settings
|
||||||
*/
|
*/
|
||||||
StorageConfig.prototype = {
|
StorageConfig.prototype = {
|
||||||
_url: null,
|
_url: null,
|
||||||
|
@ -348,8 +348,8 @@ StorageConfig.prototype = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class OCA.External.Settings.GlobalStorageConfig
|
* @class OCA.Files_External.Settings.GlobalStorageConfig
|
||||||
* @augments OCA.External.Settings.StorageConfig
|
* @augments OCA.Files_External.Settings.StorageConfig
|
||||||
*
|
*
|
||||||
* @classdesc Global external storage config
|
* @classdesc Global external storage config
|
||||||
*/
|
*/
|
||||||
|
@ -359,10 +359,10 @@ var GlobalStorageConfig = function(id) {
|
||||||
this.applicableGroups = [];
|
this.applicableGroups = [];
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* @memberOf OCA.External.Settings
|
* @memberOf OCA.Files_External.Settings
|
||||||
*/
|
*/
|
||||||
GlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
|
GlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
|
||||||
/** @lends OCA.External.Settings.GlobalStorageConfig.prototype */ {
|
/** @lends OCA.Files_External.Settings.GlobalStorageConfig.prototype */ {
|
||||||
_url: 'apps/files_external/globalstorages',
|
_url: 'apps/files_external/globalstorages',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -402,8 +402,8 @@ GlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class OCA.External.Settings.UserStorageConfig
|
* @class OCA.Files_External.Settings.UserStorageConfig
|
||||||
* @augments OCA.External.Settings.StorageConfig
|
* @augments OCA.Files_External.Settings.StorageConfig
|
||||||
*
|
*
|
||||||
* @classdesc User external storage config
|
* @classdesc User external storage config
|
||||||
*/
|
*/
|
||||||
|
@ -411,13 +411,13 @@ var UserStorageConfig = function(id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
};
|
};
|
||||||
UserStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
|
UserStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
|
||||||
/** @lends OCA.External.Settings.UserStorageConfig.prototype */ {
|
/** @lends OCA.Files_External.Settings.UserStorageConfig.prototype */ {
|
||||||
_url: 'apps/files_external/userstorages'
|
_url: 'apps/files_external/userstorages'
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class OCA.External.Settings.UserGlobalStorageConfig
|
* @class OCA.Files_External.Settings.UserGlobalStorageConfig
|
||||||
* @augments OCA.External.Settings.StorageConfig
|
* @augments OCA.Files_External.Settings.StorageConfig
|
||||||
*
|
*
|
||||||
* @classdesc User external storage config
|
* @classdesc User external storage config
|
||||||
*/
|
*/
|
||||||
|
@ -425,13 +425,13 @@ var UserGlobalStorageConfig = function (id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
};
|
};
|
||||||
UserGlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
|
UserGlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
|
||||||
/** @lends OCA.External.Settings.UserStorageConfig.prototype */ {
|
/** @lends OCA.Files_External.Settings.UserStorageConfig.prototype */ {
|
||||||
|
|
||||||
_url: 'apps/files_external/userglobalstorages'
|
_url: 'apps/files_external/userglobalstorages'
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class OCA.External.Settings.MountOptionsDropdown
|
* @class OCA.Files_External.Settings.MountOptionsDropdown
|
||||||
*
|
*
|
||||||
* @classdesc Dropdown for mount options
|
* @classdesc Dropdown for mount options
|
||||||
*
|
*
|
||||||
|
@ -440,7 +440,7 @@ UserGlobalStorageConfig.prototype = _.extend({}, StorageConfig.prototype,
|
||||||
var MountOptionsDropdown = function() {
|
var MountOptionsDropdown = function() {
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* @memberof OCA.External.Settings
|
* @memberof OCA.Files_External.Settings
|
||||||
*/
|
*/
|
||||||
MountOptionsDropdown.prototype = {
|
MountOptionsDropdown.prototype = {
|
||||||
/**
|
/**
|
||||||
|
@ -462,7 +462,7 @@ MountOptionsDropdown.prototype = {
|
||||||
MountOptionsDropdown._last.hide();
|
MountOptionsDropdown._last.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
var $el = $(OCA.External.Templates.mountOptionsDropDown({
|
var $el = $(OCA.Files_External.Templates.mountOptionsDropDown({
|
||||||
mountOptionsEncodingLabel: t('files_external', 'Compatibility with Mac NFD encoding (slow)'),
|
mountOptionsEncodingLabel: t('files_external', 'Compatibility with Mac NFD encoding (slow)'),
|
||||||
mountOptionsEncryptLabel: t('files_external', 'Enable encryption'),
|
mountOptionsEncryptLabel: t('files_external', 'Enable encryption'),
|
||||||
mountOptionsPreviewsLabel: t('files_external', 'Enable previews'),
|
mountOptionsPreviewsLabel: t('files_external', 'Enable previews'),
|
||||||
|
@ -549,7 +549,7 @@ MountOptionsDropdown.prototype = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class OCA.External.Settings.MountConfigListView
|
* @class OCA.Files_External.Settings.MountConfigListView
|
||||||
*
|
*
|
||||||
* @classdesc Mount configuration list view
|
* @classdesc Mount configuration list view
|
||||||
*
|
*
|
||||||
|
@ -574,7 +574,7 @@ MountConfigListView.ParameterTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @memberOf OCA.External.Settings
|
* @memberOf OCA.Files_External.Settings
|
||||||
*/
|
*/
|
||||||
MountConfigListView.prototype = _.extend({
|
MountConfigListView.prototype = _.extend({
|
||||||
|
|
||||||
|
@ -633,9 +633,9 @@ MountConfigListView.prototype = _.extend({
|
||||||
this.$el = $el;
|
this.$el = $el;
|
||||||
this._isPersonal = ($el.data('admin') !== true);
|
this._isPersonal = ($el.data('admin') !== true);
|
||||||
if (this._isPersonal) {
|
if (this._isPersonal) {
|
||||||
this._storageConfigClass = OCA.External.Settings.UserStorageConfig;
|
this._storageConfigClass = OCA.Files_External.Settings.UserStorageConfig;
|
||||||
} else {
|
} else {
|
||||||
this._storageConfigClass = OCA.External.Settings.GlobalStorageConfig;
|
this._storageConfigClass = OCA.Files_External.Settings.GlobalStorageConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options && !_.isUndefined(options.userListLimit)) {
|
if (options && !_.isUndefined(options.userListLimit)) {
|
||||||
|
@ -1008,7 +1008,7 @@ MountConfigListView.prototype = _.extend({
|
||||||
* Gets the storage model from the given row
|
* Gets the storage model from the given row
|
||||||
*
|
*
|
||||||
* @param $tr row element
|
* @param $tr row element
|
||||||
* @return {OCA.External.StorageConfig} storage model instance
|
* @return {OCA.Files_External.StorageConfig} storage model instance
|
||||||
*/
|
*/
|
||||||
getStorageConfig: function($tr) {
|
getStorageConfig: function($tr) {
|
||||||
var storageId = $tr.data('id');
|
var storageId = $tr.data('id');
|
||||||
|
@ -1367,13 +1367,13 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// global instance
|
// global instance
|
||||||
OCA.External.Settings.mountConfig = mountConfigListView;
|
OCA.Files_External.Settings.mountConfig = mountConfigListView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Legacy
|
* Legacy
|
||||||
*
|
*
|
||||||
* @namespace
|
* @namespace
|
||||||
* @deprecated use OCA.External.Settings.mountConfig instead
|
* @deprecated use OCA.Files_External.Settings.mountConfig instead
|
||||||
*/
|
*/
|
||||||
OC.MountConfig = {
|
OC.MountConfig = {
|
||||||
saveStorage: _.bind(mountConfigListView.saveStorageConfig, mountConfigListView)
|
saveStorage: _.bind(mountConfigListView.saveStorageConfig, mountConfigListView)
|
||||||
|
@ -1382,14 +1382,14 @@ $(document).ready(function() {
|
||||||
|
|
||||||
// export
|
// export
|
||||||
|
|
||||||
OCA.External = OCA.External || {};
|
OCA.Files_External = OCA.Files_External || {};
|
||||||
/**
|
/**
|
||||||
* @namespace
|
* @namespace
|
||||||
*/
|
*/
|
||||||
OCA.External.Settings = OCA.External.Settings || {};
|
OCA.Files_External.Settings = OCA.Files_External.Settings || {};
|
||||||
|
|
||||||
OCA.External.Settings.GlobalStorageConfig = GlobalStorageConfig;
|
OCA.Files_External.Settings.GlobalStorageConfig = GlobalStorageConfig;
|
||||||
OCA.External.Settings.UserStorageConfig = UserStorageConfig;
|
OCA.Files_External.Settings.UserStorageConfig = UserStorageConfig;
|
||||||
OCA.External.Settings.MountConfigListView = MountConfigListView;
|
OCA.Files_External.Settings.MountConfigListView = MountConfigListView;
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -14,15 +14,15 @@
|
||||||
|
|
||||||
/** @global Handlebars */
|
/** @global Handlebars */
|
||||||
|
|
||||||
if (!OCA.External) {
|
if (!OCA.Files_External) {
|
||||||
OCA.External = {};
|
OCA.Files_External = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!OCA.External.StatusManager) {
|
if (!OCA.Files_External.StatusManager) {
|
||||||
OCA.External.StatusManager = {};
|
OCA.Files_External.StatusManager = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
OCA.External.StatusManager = {
|
OCA.Files_External.StatusManager = {
|
||||||
|
|
||||||
mountStatus: null,
|
mountStatus: null,
|
||||||
mountPointList: null,
|
mountPointList: null,
|
||||||
|
@ -209,18 +209,18 @@ OCA.External.StatusManager = {
|
||||||
|
|
||||||
var mountPoint = mountData.mount_point;
|
var mountPoint = mountData.mount_point;
|
||||||
if (mountStatus.status > 0) {
|
if (mountStatus.status > 0) {
|
||||||
var trElement = FileList.findFileEl(OCA.External.StatusManager.Utils.jqSelEscape(mountPoint));
|
var trElement = FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(mountPoint));
|
||||||
|
|
||||||
var route = OCA.External.StatusManager.Utils.getIconRoute(trElement) + '-error';
|
var route = OCA.Files_External.StatusManager.Utils.getIconRoute(trElement) + '-error';
|
||||||
|
|
||||||
if (OCA.External.StatusManager.Utils.isCorrectViewAndRootFolder()) {
|
if (OCA.Files_External.StatusManager.Utils.isCorrectViewAndRootFolder()) {
|
||||||
OCA.External.StatusManager.Utils.showIconError(mountPoint, $.proxy(OCA.External.StatusManager.manageMountPointError, OCA.External.StatusManager), route);
|
OCA.Files_External.StatusManager.Utils.showIconError(mountPoint, $.proxy(OCA.Files_External.StatusManager.manageMountPointError, OCA.Files_External.StatusManager), route);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (OCA.External.StatusManager.Utils.isCorrectViewAndRootFolder()) {
|
if (OCA.Files_External.StatusManager.Utils.isCorrectViewAndRootFolder()) {
|
||||||
OCA.External.StatusManager.Utils.restoreFolder(mountPoint);
|
OCA.Files_External.StatusManager.Utils.restoreFolder(mountPoint);
|
||||||
OCA.External.StatusManager.Utils.toggleLink(mountPoint, true, true);
|
OCA.Files_External.StatusManager.Utils.toggleLink(mountPoint, true, true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ OCA.External.StatusManager = {
|
||||||
processMountList: function (mountList) {
|
processMountList: function (mountList) {
|
||||||
var elementList = null;
|
var elementList = null;
|
||||||
$.each(mountList, function (name, value) {
|
$.each(mountList, function (name, value) {
|
||||||
var trElement = $('#fileList tr[data-file=\"' + OCA.External.StatusManager.Utils.jqSelEscape(value.mount_point) + '\"]'); //FileList.findFileEl(OCA.External.StatusManager.Utils.jqSelEscape(value.mount_point));
|
var trElement = $('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(value.mount_point) + '\"]'); //FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(value.mount_point));
|
||||||
trElement.attr('data-external-backend', value.backend);
|
trElement.attr('data-external-backend', value.backend);
|
||||||
if (elementList) {
|
if (elementList) {
|
||||||
elementList = elementList.add(trElement);
|
elementList = elementList.add(trElement);
|
||||||
|
@ -245,14 +245,14 @@ OCA.External.StatusManager = {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (elementList instanceof $) {
|
if (elementList instanceof $) {
|
||||||
if (OCA.External.StatusManager.Utils.isCorrectViewAndRootFolder()) {
|
if (OCA.Files_External.StatusManager.Utils.isCorrectViewAndRootFolder()) {
|
||||||
// Put their custom icon
|
// Put their custom icon
|
||||||
OCA.External.StatusManager.Utils.changeFolderIcon(elementList);
|
OCA.Files_External.StatusManager.Utils.changeFolderIcon(elementList);
|
||||||
// Save default view
|
// Save default view
|
||||||
OCA.External.StatusManager.Utils.storeDefaultFolderIconAndBgcolor(elementList);
|
OCA.Files_External.StatusManager.Utils.storeDefaultFolderIconAndBgcolor(elementList);
|
||||||
// Disable row until check status
|
// Disable row until check status
|
||||||
elementList.addClass('externalDisabledRow');
|
elementList.addClass('externalDisabledRow');
|
||||||
OCA.External.StatusManager.Utils.toggleLink(elementList.find('a.name'), false, false);
|
OCA.Files_External.StatusManager.Utils.toggleLink(elementList.find('a.name'), false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -289,7 +289,7 @@ OCA.External.StatusManager = {
|
||||||
ajaxQueue.push(queueElement);
|
ajaxQueue.push(queueElement);
|
||||||
});
|
});
|
||||||
|
|
||||||
var rolQueue = new OCA.External.StatusManager.RollingQueue(ajaxQueue, 4, function () {
|
var rolQueue = new OCA.Files_External.StatusManager.RollingQueue(ajaxQueue, 4, function () {
|
||||||
if (!self.notificationHasShown) {
|
if (!self.notificationHasShown) {
|
||||||
var showNotification = false;
|
var showNotification = false;
|
||||||
$.each(self.mountStatus, function (key, value) {
|
$.each(self.mountStatus, function (key, value) {
|
||||||
|
@ -335,7 +335,7 @@ OCA.External.StatusManager = {
|
||||||
};
|
};
|
||||||
ajaxQueue.push(queueElement);
|
ajaxQueue.push(queueElement);
|
||||||
});
|
});
|
||||||
new OCA.External.StatusManager.RollingQueue(ajaxQueue, 4).runQueue();
|
new OCA.Files_External.StatusManager.RollingQueue(ajaxQueue, 4).runQueue();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ OCA.External.StatusManager = {
|
||||||
* @param mountData
|
* @param mountData
|
||||||
*/
|
*/
|
||||||
showCredentialsDialog: function (mountPoint, mountData) {
|
showCredentialsDialog: function (mountPoint, mountData) {
|
||||||
var dialog = $(OCA.External.Templates.credentialsDialog({
|
var dialog = $(OCA.Files_External.Templates.credentialsDialog({
|
||||||
credentials_text: t('files_external', 'Please enter the credentials for the {mount} mount', {
|
credentials_text: t('files_external', 'Please enter the credentials for the {mount} mount', {
|
||||||
'mount': mountPoint
|
'mount': mountPoint
|
||||||
}),
|
}),
|
||||||
|
@ -422,7 +422,7 @@ OCA.External.StatusManager = {
|
||||||
OC.Notification.show(t('files_external', 'Credentials saved'), {type: 'error'});
|
OC.Notification.show(t('files_external', 'Credentials saved'), {type: 'error'});
|
||||||
dialog.ocdialog('close');
|
dialog.ocdialog('close');
|
||||||
/* Trigger status check again */
|
/* Trigger status check again */
|
||||||
OCA.External.StatusManager.recheckConnectivityForMount([OC.basename(data.mountPoint)], true);
|
OCA.Files_External.StatusManager.recheckConnectivityForMount([OC.basename(data.mountPoint)], true);
|
||||||
},
|
},
|
||||||
error: function () {
|
error: function () {
|
||||||
$('.oc-dialog-close').show();
|
$('.oc-dialog-close').show();
|
||||||
|
@ -461,11 +461,11 @@ OCA.External.StatusManager = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
OCA.External.StatusManager.Utils = {
|
OCA.Files_External.StatusManager.Utils = {
|
||||||
|
|
||||||
showIconError: function (folder, clickAction, errorImageUrl) {
|
showIconError: function (folder, clickAction, errorImageUrl) {
|
||||||
var imageUrl = "url(" + errorImageUrl + ")";
|
var imageUrl = "url(" + errorImageUrl + ")";
|
||||||
var trFolder = $('#fileList tr[data-file=\"' + OCA.External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); //FileList.findFileEl(OCA.External.StatusManager.Utils.jqSelEscape(folder));
|
var trFolder = $('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); //FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(folder));
|
||||||
this.changeFolderIcon(folder, imageUrl);
|
this.changeFolderIcon(folder, imageUrl);
|
||||||
this.toggleLink(folder, false, clickAction);
|
this.toggleLink(folder, false, clickAction);
|
||||||
trFolder.addClass('externalErroredRow');
|
trFolder.addClass('externalErroredRow');
|
||||||
|
@ -479,7 +479,7 @@ OCA.External.StatusManager.Utils = {
|
||||||
if (folder instanceof $) {
|
if (folder instanceof $) {
|
||||||
trFolder = folder;
|
trFolder = folder;
|
||||||
} else {
|
} else {
|
||||||
trFolder = $('#fileList tr[data-file=\"' + OCA.External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); //FileList.findFileEl(OCA.External.StatusManager.Utils.jqSelEscape(folder)); //$('#fileList tr[data-file=\"' + OCA.External.StatusManager.Utils.jqSelEscape(folder) + '\"]');
|
trFolder = $('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]'); //FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(folder)); //$('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]');
|
||||||
}
|
}
|
||||||
trFolder.each(function () {
|
trFolder.each(function () {
|
||||||
var thisElement = $(this);
|
var thisElement = $(this);
|
||||||
|
@ -505,8 +505,8 @@ OCA.External.StatusManager.Utils = {
|
||||||
if (folder instanceof $) {
|
if (folder instanceof $) {
|
||||||
trFolder = folder;
|
trFolder = folder;
|
||||||
} else {
|
} else {
|
||||||
// can't use here FileList.findFileEl(OCA.External.StatusManager.Utils.jqSelEscape(folder)); return incorrect instance of filelist
|
// can't use here FileList.findFileEl(OCA.Files_External.StatusManager.Utils.jqSelEscape(folder)); return incorrect instance of filelist
|
||||||
trFolder = $('#fileList tr[data-file=\"' + OCA.External.StatusManager.Utils.jqSelEscape(folder) + '\"]');
|
trFolder = $('#fileList tr[data-file=\"' + OCA.Files_External.StatusManager.Utils.jqSelEscape(folder) + '\"]');
|
||||||
}
|
}
|
||||||
trFolder.removeClass('externalErroredRow').removeClass('externalDisabledRow');
|
trFolder.removeClass('externalErroredRow').removeClass('externalDisabledRow');
|
||||||
var tdChilds = trFolder.find("td.filename div.thumbnail");
|
var tdChilds = trFolder.find("td.filename div.thumbnail");
|
||||||
|
@ -526,14 +526,14 @@ OCA.External.StatusManager.Utils = {
|
||||||
if (filename instanceof $) {
|
if (filename instanceof $) {
|
||||||
//trElementList
|
//trElementList
|
||||||
$.each(filename, function (index) {
|
$.each(filename, function (index) {
|
||||||
route = OCA.External.StatusManager.Utils.getIconRoute($(this));
|
route = OCA.Files_External.StatusManager.Utils.getIconRoute($(this));
|
||||||
$(this).attr("data-icon", route);
|
$(this).attr("data-icon", route);
|
||||||
$(this).find('td.filename div.thumbnail').css('background-image', "url(" + route + ")").css('display', 'none').css('display', 'inline');
|
$(this).find('td.filename div.thumbnail').css('background-image', "url(" + route + ")").css('display', 'none').css('display', 'inline');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
file = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td.filename div.thumbnail");
|
file = $("#fileList tr[data-file=\"" + this.jqSelEscape(filename) + "\"] > td.filename div.thumbnail");
|
||||||
var parentTr = file.parents('tr:first');
|
var parentTr = file.parents('tr:first');
|
||||||
route = OCA.External.StatusManager.Utils.getIconRoute(parentTr);
|
route = OCA.Files_External.StatusManager.Utils.getIconRoute(parentTr);
|
||||||
parentTr.attr("data-icon", route);
|
parentTr.attr("data-icon", route);
|
||||||
file.css('background-image', "url(" + route + ")").css('display', 'none').css('display', 'inline');
|
file.css('background-image', "url(" + route + ")").css('display', 'none').css('display', 'inline');
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
(function() {
|
(function() {
|
||||||
var template = Handlebars.template, templates = OCA.External.Templates = OCA.External.Templates || {};
|
var template = Handlebars.template, templates = OCA.Files_External.Templates = OCA.Files_External.Templates || {};
|
||||||
templates['credentialsDialog'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
|
templates['credentialsDialog'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
|
||||||
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
|
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
describe('OCA.External.App tests', function() {
|
describe('OCA.Files_External.App tests', function() {
|
||||||
var App = OCA.External.App;
|
var App = OCA.Files_External.App;
|
||||||
var fileList;
|
var fileList;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
describe('OCA.External.FileList tests', function() {
|
describe('OCA.Files_External.FileList tests', function() {
|
||||||
var testFiles, alertStub, notificationStub, fileList;
|
var testFiles, alertStub, notificationStub, fileList;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
|
@ -62,7 +62,7 @@ describe('OCA.External.FileList tests', function() {
|
||||||
var ocsResponse;
|
var ocsResponse;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
fileList = new OCA.External.FileList(
|
fileList = new OCA.Files_External.FileList(
|
||||||
$('#app-content-container')
|
$('#app-content-container')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
describe('OCA.External.Settings tests', function() {
|
describe('OCA.Files_External.Settings tests', function() {
|
||||||
var clock;
|
var clock;
|
||||||
var select2Stub;
|
var select2Stub;
|
||||||
var select2ApplicableUsers;
|
var select2ApplicableUsers;
|
||||||
|
@ -156,7 +156,7 @@ describe('OCA.External.Settings tests', function() {
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
var $el = $('#externalStorage');
|
var $el = $('#externalStorage');
|
||||||
view = new OCA.External.Settings.MountConfigListView($el, {encryptionEnabled: false});
|
view = new OCA.Files_External.Settings.MountConfigListView($el, {encryptionEnabled: false});
|
||||||
});
|
});
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
view = null;
|
view = null;
|
||||||
|
|
|
@ -32,7 +32,7 @@ handlebars -n OCA.WorkflowEngine.Templates apps/workflowengine/js/templates -f a
|
||||||
handlebars -n OCA.Sharing.Templates apps/files_sharing/js/templates -f apps/files_sharing/js/templates.js
|
handlebars -n OCA.Sharing.Templates apps/files_sharing/js/templates -f apps/files_sharing/js/templates.js
|
||||||
|
|
||||||
# Files external
|
# Files external
|
||||||
handlebars -n OCA.External.Templates apps/files_external/js/templates -f apps/files_external/js/templates.js
|
handlebars -n OCA.Files_External.Templates apps/files_external/js/templates -f apps/files_external/js/templates.js
|
||||||
|
|
||||||
if [[ $(git diff --name-only) ]]; then
|
if [[ $(git diff --name-only) ]]; then
|
||||||
echo "Please submit your compiled handlebars templates"
|
echo "Please submit your compiled handlebars templates"
|
||||||
|
|
Loading…
Reference in New Issue