1
0

encryption.js 829 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-FileCopyrightText: 2014-2015 ownCloud, Inc.
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. /**
  7. * @namespace
  8. * @memberOf OC
  9. */
  10. OC.Encryption = _.extend(OC.Encryption || {}, {
  11. displayEncryptionWarning: function () {
  12. if (!OC.currentUser || !OC.Notification.isHidden()) {
  13. return;
  14. }
  15. $.get(
  16. OC.generateUrl('/apps/encryption/ajax/getStatus'),
  17. function (result) {
  18. if (result.status === "interactionNeeded") {
  19. OC.Notification.show(result.data.message);
  20. }
  21. }
  22. );
  23. }
  24. });
  25. window.addEventListener('DOMContentLoaded', function() {
  26. // wait for other apps/extensions to register their event handlers and file actions
  27. // in the "ready" clause
  28. _.defer(function() {
  29. OC.Encryption.displayEncryptionWarning();
  30. });
  31. });