From 3d1a3b66442698601597d4f777d47d5f0ea744c2 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 31 Jan 2019 18:30:52 +0100 Subject: Move OC.Plugin to the server bundle Signed-off-by: Christoph Wurst --- core/js/js.js | 90 ----------------------------------------------------------- 1 file changed, 90 deletions(-) (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js index c542e95cad0..114f51bd535 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -870,96 +870,6 @@ Object.assign(window.OC, { } }); -/** - * Current user attributes - * - * @typedef {Object} OC.CurrentUser - * - * @property {String} uid user id - * @property {String} displayName display name - */ - -/** - * @namespace OC.Plugins - */ -OC.Plugins = { - /** - * @type Array. - */ - _plugins: {}, - - /** - * Register plugin - * - * @param {String} targetName app name / class name to hook into - * @param {OC.Plugin} plugin - */ - register: function(targetName, plugin) { - var plugins = this._plugins[targetName]; - if (!plugins) { - plugins = this._plugins[targetName] = []; - } - plugins.push(plugin); - }, - - /** - * Returns all plugin registered to the given target - * name / app name / class name. - * - * @param {String} targetName app name / class name to hook into - * @return {Array.} array of plugins - */ - getPlugins: function(targetName) { - return this._plugins[targetName] || []; - }, - - /** - * Call attach() on all plugins registered to the given target name. - * - * @param {String} targetName app name / class name - * @param {Object} object to be extended - * @param {Object} [options] options - */ - attach: function(targetName, targetObject, options) { - var plugins = this.getPlugins(targetName); - for (var i = 0; i < plugins.length; i++) { - if (plugins[i].attach) { - plugins[i].attach(targetObject, options); - } - } - }, - - /** - * Call detach() on all plugins registered to the given target name. - * - * @param {String} targetName app name / class name - * @param {Object} object to be extended - * @param {Object} [options] options - */ - detach: function(targetName, targetObject, options) { - var plugins = this.getPlugins(targetName); - for (var i = 0; i < plugins.length; i++) { - if (plugins[i].detach) { - plugins[i].detach(targetObject, options); - } - } - }, - - /** - * Plugin - * - * @todo make this a real class in the future - * @typedef {Object} OC.Plugin - * - * @property {String} name plugin name - * @property {Function} attach function that will be called when the - * plugin is attached - * @property {Function} [detach] function that will be called when the - * plugin is detached - */ - -}; - /** * @namespace OC.search */ -- cgit v1.2.3