Proyectos de Subversion Moodle

Rev

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

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