moodle-atto_iassign-button-debug.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. YUI.add('moodle-atto_iassign-button', function (Y, NAME) {
  2. /*
  3. * @package atto_iassign
  4. * @copyright 2014
  5. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  6. */
  7. /**
  8. * Atto text editor iAssign plugin.
  9. *
  10. * @module moodle-atto_iassign-button
  11. * @namespace M.atto_iassign
  12. * @class button
  13. * @extends M.editor_atto.EditorPlugin
  14. */
  15. var PLUGINNAME = 'atto_iassign';
  16. Y.namespace('M.atto_iassign').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
  17. _currentSelection: null,
  18. /**
  19. * Function for initialize namespace.
  20. */
  21. initializer: function () {
  22. this.addButton({
  23. icon: M.util.image_url('icon', PLUGINNAME),
  24. callback: this._selectFile
  25. });
  26. },
  27. /**
  28. * Function for callback button in editor.
  29. */
  30. _selectFile: function () {
  31. this._currentSelection = this.get('host').getSelection();
  32. open_ilm_manager = window.open(this.get('iassign_wwwroot') + '?id=' + this.get('iassign_course') + '&from=atto', '', 'width=1000,height=880,menubar=0,location=0,scrollbars,status,fullscreen,resizable');
  33. }
  34. }, {
  35. ATTRS: {
  36. iassign_wwwroot: {
  37. value: null
  38. },
  39. iassign_course: {
  40. value: null
  41. }
  42. }
  43. });
  44. }, '@VERSION@', {"requires": ["moodle-editor_atto-plugin"]});