encryption.js 816 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * Copyright (c) 2014
  3. * Bjoern Schiessle <schiessle@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or later.
  5. * See the COPYING-README file.
  6. */
  7. /**
  8. * @namespace
  9. * @memberOf OC
  10. */
  11. OC.Encryption = _.extend(OC.Encryption || {}, {
  12. displayEncryptionWarning: function () {
  13. if (!OC.currentUser || !OC.Notification.isHidden()) {
  14. return;
  15. }
  16. $.get(
  17. OC.generateUrl('/apps/encryption/ajax/getStatus'),
  18. function (result) {
  19. if (result.status === "interactionNeeded") {
  20. OC.Notification.show(result.data.message);
  21. }
  22. }
  23. );
  24. }
  25. });
  26. $(document).ready(function() {
  27. // wait for other apps/extensions to register their event handlers and file actions
  28. // in the "ready" clause
  29. _.defer(function() {
  30. OC.Encryption.displayEncryptionWarning();
  31. });
  32. });