/* * Copyright (c) 2014 * * This file is licensed under the Affero General Public License version 3 * or later. * * See the COPYING-README file. * */ (function() { if (!OCA.Files) { /** * Namespace for the files app * @namespace OCA.Files */ OCA.Files = {}; } /** * @namespace OCA.Files.Admin */ OCA.Files.Admin = { initialize: function() { $('#submitMaxUpload').on('click', _.bind(this._onClickSubmitMaxUpload, this)); }, _onClickSubmitMaxUpload: function () { OC.msg.startSaving('#maxUploadSizeSettingsMsg'); var request = $.ajax({ url: OC.generateUrl('/apps/files/settings/maxUpload'), type: 'POST', data: { maxUploadSize: $('#maxUploadSize').val() } }); request.done(function (data) { $('#maxUploadSize').val(data.maxUploadSize); OC.msg.finishedSuccess('#maxUploadSizeSettingsMsg', 'Saved'); }); request.fail(function () { OC.msg.finishedError('#maxUploadSizeSettingsMsg', 'Error'); }); } } })(); function switchPublicFolder() { var publicEnable = $('#publicEnable').is(':checked'); // find all radiobuttons of that group var sharingaimGroup = $('input:radio[name=sharingaim]'); $.each(sharingaimGroup, function(index, sharingaimItem) { // set all buttons to the correct state sharingaimItem.disabled = !publicEnable; }); } $(document).ready(function() { OCA.Files.Admin.initialize(); // Execute the function after loading DOM tree switchPublicFolder(); $('#publicEnable').click(function() { // To get rid of onClick() switchPublicFolder(); }); }); tions-6951dec90a'>dependabot/github_actions/github-actions-6951dec90a The official jQuery user interface library: https://github.com/jquery/jquery-uiwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/ui/plugin.js
blob: 0f1d9b040a83567ccf1c47e2326178f9a90f27a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
( function( factory ) {
	if ( typeof define === "function" && define.amd ) {

		// AMD. Register as an anonymous module.
		define( [ "jquery", "./version" ], factory );
	} else {

		// Browser globals
		factory( jQuery );
	}
} ( function( $ ) {

// $.ui.plugin is deprecated. Use $.widget() extensions instead.
return $.ui.plugin = {
	add: function( module, option, set ) {
		var i,
			proto = $.ui[ module ].prototype;
		for ( i in set ) {
			proto.plugins[ i ] = proto.plugins[ i ] || [];
			proto.plugins[ i ].push( [ option, set[ i ] ] );
		}
	},
	call: function( instance, name, args, allowDisconnected ) {
		var i,
			set = instance.plugins[ name ];

		if ( !set ) {
			return;
		}

		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
			return;
		}

		for ( i = 0; i < set.length; i++ ) {
			if ( instance.options[ set[ i ][ 0 ] ] ) {
				set[ i ][ 1 ].apply( instance.element, args );
			}
		}
	}
};

} ) );