Proyectos de Subversion Moodle

Rev

Rev 964 | Rev 968 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 964 Rev 965
Línea 1... Línea 1...
1
define([
1
define([
2
  "jquery",
2
  "jquery",
3
  "core/yui",
3
  "core/yui",
4
  "core/str",
4
  "core/str",
-
 
5
  "core/config",
-
 
6
  "core/notification",
5
  "core/modal_factory",
7
  "core/modal_factory",
6
], function ($, Y, str, ModalFactory) {
8
], function ($, Y, str, config, notification, ModalFactory) {
7
  var CONFIG;
9
  var CONFIG;
8
  var NODES = {
10
  var NODES = {
9
    DELETE_ICON: '<span class="delete">&#x274C;</span>',
11
    DELETE_ICON: '<span class="delete">&#x274C;</span>',
10
  };
12
  };
11
  var SELECTORS = {
13
  var SELECTORS = {
Línea 138... Línea 140...
138
      if (args.form) {
140
      if (args.form) {
139
        cfg.form = args.form;
141
        cfg.form = args.form;
140
      }
142
      }
141
      Y.io(this.api, cfg);
143
      Y.io(this.api, cfg);
142
    },
144
    },
-
 
145
 
143
    printcesa_notes: function (e) {
146
    printcesa_notes: function (e) {
144
      e.preventDefault();
147
      e.preventDefault();
145
      let note_content_input = $("#id_mynotecontent-" + CONFIG.instanceid);
148
      let note_content_input = $("#id_mynotecontent-" + CONFIG.instanceid);
146
      let arg = {
149
      let arg = {
147
        action: "print",
150
        action: "print",
Línea 163... Línea 166...
163
            backgroundImage: "",
166
            backgroundImage: "",
164
          });
167
          });
165
        },
168
        },
166
      });
169
      });
167
    },
170
    },
-
 
171
 
168
    savecesa_notes: function (e) {
172
    savecesa_notes: function (e) {
169
      e.preventDefault();
173
      e.preventDefault();
170
      var scope = this;
174
      var scope = this;
Línea 171... Línea 175...
171
 
175
 
Línea 827... Línea 831...
827
        M.cfg.wwwroot + "/blocks/cesa_notes/cesa_notes_ajax.php"
831
        M.cfg.wwwroot + "/blocks/cesa_notes/cesa_notes_ajax.php"
828
      );
832
      );
829
      var strtitle = M.util.get_string("showcesa_notes", "block_cesa_notes");
833
      var strtitle = M.util.get_string("showcesa_notes", "block_cesa_notes");
830
      if (!CONFIG.editing) {
834
      if (!CONFIG.editing) {
831
        var handler = $(
835
        var handler = $(
832
          '<section class="block_cesa_notes block card tab-pane">' +
-
 
833
          '<div class="' +
836
          '<div class="' +
834
            CSS.cesa_notes_OPENER +
837
            CSS.cesa_notes_OPENER +
835
            '" title="' +
838
            '" title="' +
836
            strtitle +
839
            strtitle +
837
            '" alt="' +
840
            '" alt="' +
838
            strtitle +
841
            strtitle +
839
            '">' +
842
            '">' +
840
            M.util.get_string("cesa_notes", "block_cesa_notes") +
843
            M.util.get_string("cesa_notes", "block_cesa_notes") +
841
            "</div>" + 
844
            "</div>"
842
            '</section>'
-
 
843
        );
845
        );
844
        handler.addClass(CONFIG.editingicon_pos);
846
        handler.addClass(CONFIG.editingicon_pos);
845
        $("body").append(handler);
847
        $("body").append(handler);
846
        handler.html('<span class="pencil">&#x270D;</span>');
848
        handler.html('<span class="pencil">&#x270D;</span>');
847
      } else {
849
      } else {
848
        var handler = $(
850
        var handler = $(
849
          '<section class="block_cesa_notes block card tab-pane">' +
-
 
850
          '<div class="' +
851
          '<div class="' +
851
            CSS.cesa_notes_OPENER +
852
            CSS.cesa_notes_OPENER +
852
            '" title="' +
853
            '" title="' +
853
            strtitle +
854
            strtitle +
854
            '" alt="' +
855
            '" alt="' +
855
            strtitle +
856
            strtitle +
856
            '">' +
857
            '">' +
857
            M.util.get_string("cesa_notes", "block_cesa_notes") +
858
            M.util.get_string("cesa_notes", "block_cesa_notes") +
858
            "</div>" +
859
            "</div>"
859
            '</section>'
-
 
860
        );
860
        );
861
        handler.addClass(CONFIG.editingicon_pos);
861
        handler.addClass(CONFIG.editingicon_pos);
862
        handler.html('<span class="pencil">&#x270D;</span>');
862
        handler.html('<span class="pencil">&#x270D;</span>');
863
        $(".inline-" + CSS.cesa_notes_OPENER).html(handler);
863
        $(".inline-" + CSS.cesa_notes_OPENER).html(handler);
864
        $(".inline-" + CSS.cesa_notes_OPENER).append(
864
        $(".inline-" + CSS.cesa_notes_OPENER).append(
Línea 867... Línea 867...
867
            '">' +
867
            '">' +
868
            strtitle +
868
            strtitle +
869
            "</div>"
869
            "</div>"
870
        );
870
        );
871
      }
871
      }
872
      var body = $(".block-region");
872
      var body = $("body");
873
      body.delegate(SELECTORS.cesa_notes_OPENER, "click", this.displayDialogue);
873
      body.delegate(SELECTORS.cesa_notes_OPENER, "click", this.displayDialogue);
874
    },
874
    },
875
  };
875
  };
Línea 876... Línea 876...
876
 
876