controller.js 991 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * SPDX-FileCopyrightText: 2015 ownCloud, Inc.
  3. * SPDX-License-Identifier: AGPL-3.0-or-later
  4. */
  5. OCA = OCA || {};
  6. OCA.LDAP = {};
  7. OCA.LDAP.Wizard = {};
  8. (function(){
  9. /**
  10. * @classdesc minimalistic controller that basically makes the view render
  11. *
  12. * @constructor
  13. */
  14. var WizardController = function() {};
  15. WizardController.prototype = {
  16. /**
  17. * initializes the instance. Always call it after creating the instance.
  18. */
  19. init: function() {
  20. this.view = false;
  21. this.configModel = false;
  22. },
  23. /**
  24. * sets the model instance
  25. *
  26. * @param {OCA.LDAP.Wizard.ConfigModel} [model]
  27. */
  28. setModel: function(model) {
  29. this.configModel = model;
  30. },
  31. /**
  32. * sets the view instance
  33. *
  34. * @param {OCA.LDAP.Wizard.WizardView} [view]
  35. */
  36. setView: function(view) {
  37. this.view = view;
  38. },
  39. /**
  40. * makes the view render i.e. ready to be used
  41. */
  42. run: function() {
  43. this.view.render();
  44. }
  45. };
  46. OCA.LDAP.Wizard.Controller = WizardController;
  47. })();