/* * 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 * @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 . * */ /** global: OC */ /** global: OCA */ /** global: Notyf */ /** global: actions */ /** global: nav */ /** global: elements */ /** global: curr */ /** global: api */ /** global: define */ var resultLinks = { linkCircleResult: function (result) { if (result.status !== 1) { OCA.notification.onFail( t('circles', "A link to {remote} could not be initiated", { remote: result.remote }) + ': ' + ((result.error) ? result.error : t('circles', 'no error message'))); return; } if (result.link.status === define.linkRequestSent) { OCA.notification.onSuccess( t('circles', "A link to {remote} has been requested.", { remote: result.remote })); } if (result.link.status === define.linkUp) { OCA.notification.onSuccess( t('circles', "the link to {remote} is now up and running.", { remote: result.remote })); } curr.circleLinks = result.links; nav.displayLinks(''); }, linkStatusResult: function (result) { if (result.status !== 1) { OCA.notification.onFail( t('circles', "The status of the link could not be updated") + ': ' + ((result.error) ? result.error : t('circles', 'no error message'))); } else { OCA.notification.onSuccess(t('circles', "The status of the link has been updated")); curr.circleLinks = result.links; } nav.displayLinks(''); } } ;