Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/circles.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxence Lange <maxence@nextcloud.com>2017-06-14 18:56:37 +0300
committerMaxence Lange <maxence@nextcloud.com>2017-06-14 18:56:37 +0300
commit05f19f4610ff3a35132df6faf6f1a5a718416e83 (patch)
tree3a60353a23c70d360f543f61e5a3f3f4758c4b85 /js/admin.js
parent3954d5f9aca94f929ffbc241adbdee2a6d245d89 (diff)
admin settings
Signed-off-by: Maxence Lange <maxence@nextcloud.com>
Diffstat (limited to 'js/admin.js')
-rw-r--r--js/admin.js56
1 files changed, 56 insertions, 0 deletions
diff --git a/js/admin.js b/js/admin.js
new file mode 100644
index 00000000..aca9f225
--- /dev/null
+++ b/js/admin.js
@@ -0,0 +1,56 @@
+/*
+ * Circles - Bring cloud-users closer together.
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Maxence Lange <maxence@pontapreta.net>
+ * @copyright 2017
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+var elements = {
+ allow_federated_circles: null
+};
+
+
+$(document).ready(function () {
+
+ elements.allow_federated_circles = $('#allow_federated_circle');
+ elements.allow_federated_circles.on('change', function () {
+ $.ajax({
+ method: 'POST',
+ url: OC.generateUrl('/apps/circles/admin/settings'),
+ data: {
+ allow_federated_circles: (elements.allow_federated_circles.is(
+ ':checked')) ? '1' : '0'
+ }
+ }).done(function (res) {
+ elements.allow_federated_circles.prop('checked', (res.allowFederatedCircles === '1'));
+ });
+ });
+
+ $.ajax({
+ method: 'GET',
+ url: OC.generateUrl('/apps/circles/admin/settings'),
+ data: {}
+ }).done(function (res) {
+ elements.allow_federated_circles.prop('checked', (res.allowFederatedCircles === '1'));
+ });
+
+}); \ No newline at end of file