Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
735 ariadna 1
// This file is part of Moodle - http://moodle.org/
2
//
3
// Moodle is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, either version 3 of the License, or
6
// (at your option) any later version.
7
//
8
// Moodle is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
// GNU General Public License for more details.
12
//
13
// You should have received a copy of the GNU General Public License
14
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
 
16
/* *
17
 * Javascript controller for the mynotes panel at the bottom of the page.
18
 *
19
 * @module     block_mynotes/mynotesblock
20
 * @package    block_mynotes
21
 * @author     Gautam Kumar Das<gautam.arg@gmail.com>
22
 */
23
 
24
define([
25
  "jquery",
26
  "core/yui",
27
  "core/str",
28
  "core/config",
29
  "core/notification",
30
], function ($, Y, str, config, notification) {
31
  var CONFIG;
32
  var NODES = {
33
    DELETE_ICON: '<span class="delete">&#x274C;</span>',
34
  };
35
  var SELECTORS = {
36
    MYNOTES_BASE: "#mynotes_base",
37
    MYNOTES_OPENER: ".mynotes-opener",
38
    MYNOTES_LISTS: ".mynotes_list",
39
  };
40
  var CSS = {
41
    MYNOTES_BASE: "mynotes_base",
42
    MYNOTES_OPENER: "mynotes-opener",
43
    MYNOTES_LISTS: "mynotes_list",
44
  };
45
  var panel = null;
46
  var initnotes = null;
47
  var strdeletenote = M.util.get_string("deletemynotes", "block_mynotes");
48
 
49
  var getMynotesValidatedUrl = function (baseurl) {
50
    var a = document.createElement("a");
51
    a.href = baseurl;
52
    return a.search.length > 0 ? baseurl : baseurl + "?";
53
  };
54
 
55
  var mynotes = {
56
    /** @alias module:blocks/mynotes */
57
 
58
    getMynotesValidatedUrl: function (baseurl) {
59
      var a = document.createElement("a");
60
      a.href = baseurl;
61
      return a.search.length > 0 ? baseurl : baseurl + "?";
62
    },
63
    /*
64
     * Validation for textarea input text
65
     */
66
    getWarnings: function (status) {
67
      if (status == false) {
68
        $("#addmynote-label-" + CONFIG.instanceid + "  span.warning").html(
69
          CONFIG.maxallowedcharacters_warning
70
        );
71
      } else {
72
        var ta = $("#id_mynotecontent-" + CONFIG.instanceid);
73
        if (ta.val() == "") {
74
          $("#addmynote-label-" + CONFIG.instanceid + "  span.warning").html(
75
            ""
76
          );
77
        } else {
78
          var cl = CONFIG.maxallowedcharacters - ta.val().length;
79
          $("#addmynote-label-" + CONFIG.instanceid + "  span.warning").html(
80
            M.util.get_string("charactersleft", "block_mynotes") + cl
81
          );
82
        }
83
      }
84
    },
85
    checkInputText: function () {
86
      var ta = $("#id_mynotecontent-" + CONFIG.instanceid);
87
      if (ta.val().length <= CONFIG.maxallowedcharacters) {
88
        $("#addmynote_submit").removeAttr("disabled", "");
89
        return true;
90
      } else {
91
        $("#addmynote_submit").attr("disabled", "disabled");
92
        return false;
93
      }
94
      return true;
95
    },
96
    toggle_textarea: function (e) {
97
      var ta = $("#id_mynotecontent-" + CONFIG.instanceid);
98
 
99
      if (!ta) {
100
        return false;
101
      }
102
      var focus = e.type == "focusin";
103
      if (focus) {
104
        if (
105
          ta.val() == M.util.get_string("placeholdercontent", "block_mynotes")
106
        ) {
107
          ta.val("");
108
          $(".textarea").css("border-color", "black");
109
        }
110
      } else {
111
        if (ta.val() == "") {
112
          ta.val(M.util.get_string("placeholdercontent", "block_mynotes"));
113
          $(".textarea").css("border-color", "gray");
114
          $("#addmynote-label-" + CONFIG.instanceid + "  span.warning").html(
115
            ""
116
          );
117
        }
118
      }
119
    },
120
    request: function (args) {
121
      var params = {};
122
      var scope = this;
123
      if (args["scope"]) {
124
        scope = args["scope"];
125
      }
126
      params["contextarea"] = scope.currenttab.replace(CONFIG.prefix, "");
127
      params["contextarea"] = params["contextarea"].replace("#", "");
128
      if (args.params) {
129
        for (i in args.params) {
130
          params[i] = args.params[i];
131
        }
132
      }
133
      params["sesskey"] = M.cfg.sesskey;
134
 
135
      var cfg = {
136
        method: "POST",
137
        on: {
138
          start: function () {
139
            //'<div class="mdl-align"><img src="'+M.util.image_url('i/loading', 'core')+'" /></div>';
140
          },
141
          complete: function (id, o, p) {
142
            if (!o) {
143
              alert("IO FATAL");
144
              return false;
145
            }
146
            var data = Y.JSON.parse(o.responseText);
147
            if (data.error) {
148
              if (data.error == "require_login") {
149
                args.callback(id, data, p);
150
                return true;
151
              }
152
              alert(data.error);
153
              return false;
154
            } else {
155
              args.callback(id, data, p);
156
              return true;
157
            }
158
          },
159
        },
160
        arguments: {
161
          scope: scope,
162
        },
163
        headers: {
164
          "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
165
        },
166
        data: build_querystring(params),
167
      };
168
      if (args.form) {
169
        cfg.form = args.form;
170
      }
171
      Y.io(this.api, cfg);
172
    },
173
    saveMynotes: function (e) {
174
      e.preventDefault();
175
      var scope = this;
176
 
177
      if (scope.checkInputText() == false) {
178
        return false;
179
      }
180
      var ta = $("#id_mynotecontent-" + CONFIG.instanceid);
181
      if (
182
        ta.val() == "" ||
183
        ta.val() == M.util.get_string("placeholdercontent", "block_mynotes")
184
      ) {
185
        return false;
186
      }
187
      var arg = {
188
        contextid: CONFIG.contextid,
189
        content: ta.val(),
190
        action: "add",
191
        contextarea: scope.currenttabindex,
192
      };
193
      ta.attr("disabled", true);
194
      ta.css({
195
        backgroundImage:
196
          "url(" + M.util.image_url("i/loading_small", "core") + ")",
197
        backgroundRepeat: "no-repeat",
198
        backgroundPosition: "center center",
199
      });
200
      this.request({
201
        params: arg,
202
        callback: function (id, ret, args) {
203
          if (!ret.notes) {
204
            return false;
205
          }
206
          $("#addmynote-label-" + CONFIG.instanceid + "  span.warning").html(
207
            ""
208
          );
209
          $("#id_mynotecontent-" + CONFIG.instanceid).val(
210
            M.util.get_string("placeholdercontent", "block_mynotes")
211
          );
212
          $("#id_mynotecontent-" + CONFIG.instanceid).removeAttr("disabled");
213
          $("#id_mynotecontent-" + CONFIG.instanceid).css({
214
            backgroundImage: "",
215
          });
216
          if (scope.currenttab != scope.defaulttab) {
217
            scope.currenttab = scope.defaulttab;
218
            var tab = scope.currenttab.replace("#", "#tab-");
219
            $(SELECTORS.MYNOTES_BASE + " ul.tabs-menu li").removeClass(
220
              "current"
221
            );
222
            $(SELECTORS.MYNOTES_BASE + " " + tab).addClass("current");
223
            $(SELECTORS.MYNOTES_BASE + " .tab-content")
224
              .has(scope.currenttab)
225
              .addClass("current");
226
            $(SELECTORS.MYNOTES_BASE + " .tab-content")
227
              .not(scope.currenttab)
228
              .css("display", "none");
229
            $(
230
              SELECTORS.MYNOTES_BASE + " " + scope.currenttab + ".tab-content"
231
            ).css("display", "block");
232
          }
233
          scope.addToList(ret, "add");
234
          scope.displayMynotes();
235
          $(SELECTORS.MYNOTES_BASE)
236
            .find(".responsetext")
237
            .html(M.util.get_string("savedsuccess", "block_mynotes"));
238
        },
239
      });
240
    },
241
    addToList: function (notesobj, action = "") {
242
      var scope = this;
243
      var el = $(SELECTORS.MYNOTES_BASE).find(scope.currenttab + "-list");
244
      if (action == "add") {
245
        el.prepend(scope.renderMynotes(notesobj.notes));
246
      } else {
247
        el.append(scope.renderMynotes(notesobj.notes));
248
        $(el)
249
          .find("li")
250
          .sort(sort_li) // sort elements
251
          .appendTo(el); // append again to the list
252
        // sort function callback
253
        function sort_li(a, b) {
254
          return $(b).data("itemid") > $(a).data("itemid") ? 1 : -1;
255
        }
256
      }
257
      $(SELECTORS.MYNOTES_BASE)
258
        .find(scope.currenttab)
259
        .attr("notes-count", notesobj.count);
260
    },
261
    getMynotes: function (page = 0) {
262
      var scope = this;
263
      page = parseInt(page);
264
      var el = $(SELECTORS.MYNOTES_BASE).find(scope.currenttab + "-list");
265
      var notescount = el.find("li").length;
266
      var lastpage = Math.ceil(notescount / CONFIG.perpage);
267
      if (notescount > 0 && lastpage > page) {
268
        scope.displayMynotes();
269
        return false;
270
      }
271
      var arg = {
272
        contextid: CONFIG.contextid,
273
        action: "get",
274
        page: page,
275
      };
276
      this.request({
277
        params: arg,
278
        callback: function (id, ret, args) {
279
          scope.addToList(ret);
280
          scope.displayMynotes();
281
        },
282
      });
283
    },
284
    updateMynotesInfo: function (mynotescount, page) {
285
      page = parseInt(page);
286
      mynotescount = parseInt(mynotescount);
287
      var scope = this;
288
      var paging = "";
289
      if (mynotescount > CONFIG.perpage) {
290
        var pagenum = page - 1;
291
        var prevlink = "";
292
        var nextlink = "";
293
 
294
        if (page > 0) {
295
          prevlink = scope.createLink(
296
            pagenum,
297
            M.util.get_string("previouspage", "block_mynotes"),
298
            "previous"
299
          );
300
        }
301
        if (CONFIG.perpage > 0) {
302
          var lastpage = Math.ceil(mynotescount / CONFIG.perpage);
303
        } else {
304
          var lastpage = 1;
305
        }
306
        // Uncomment this line if you want to display page number
307
        //paging += '<span class="current-page">' + (page + 1) + '</span>';
308
        pagenum = page + 1;
309
        if (pagenum != lastpage) {
310
          nextlink = scope.createLink(
311
            pagenum,
312
            M.util.get_string("nextpage", "block_mynotes"),
313
            "next"
314
          );
315
        }
316
        paging = prevlink;
317
        if (prevlink != "" && nextlink != "") {
318
          paging += '<span class="separator"></span>';
319
        }
320
        paging += nextlink;
321
 
322
        paging = '<span class="paging">' + paging + "</span>";
323
      }
324
      var noteinfo = $(SELECTORS.MYNOTES_BASE).find(scope.currenttab);
325
      if (mynotescount > 0) {
326
        noteinfo
327
          .find(".count")
328
          .html(
329
            M.util.get_string("mynotescount", "block_mynotes") +
330
              "" +
331
              mynotescount
332
          );
333
      } else {
334
        noteinfo
335
          .find(".count")
336
          .html(M.util.get_string("nothingtodisplay", "block_mynotes"));
337
      }
338
      noteinfo.find(".mynotes-paging").html(paging);
339
    },
340
    /*
341
     * Render notes as html ul li element
342
     */
343
    renderMynotes: function (notes) {
344
      if (notes.length < 1) {
345
        return false;
346
      }
347
      var lists = "";
348
      var x = "";
349
      for (x in notes) {
350
        $("#mynote-" + CONFIG.instanceid + "-" + notes[x].id).remove();
351
        var deletelink =
352
          '<a href="#" id="mynote-delete-' +
353
          CONFIG.instanceid +
354
          "-" +
355
          notes[x].id +
356
          '" class="mynote-delete" title="' +
357
          strdeletenote +
358
          '">' +
359
          NODES.DELETE_ICON +
360
          "</a>";
361
        var notedetail = "";
362
        if (notes[x].coursename != "") {
363
          notedetail =
364
            '<div class="note-detail">' +
365
            notes[x].coursename +
366
            " - " +
367
            "</div>";
368
        }
369
        var userdate = '<div class="time">' + notes[x].timecreated + "</div>";
370
        var note_html =
371
          '<div class="content">' + deletelink + notes[x].content + "</div>";
372
        lists +=
373
          '<li id="mynote-' +
374
          CONFIG.instanceid +
375
          "-" +
376
          notes[x].id +
377
          '" data-itemid="' +
378
          notes[x].id +
379
          '">' +
380
          note_html +
381
          notedetail +
382
          userdate +
383
          "</li>";
384
      }
385
      return lists;
386
    },
387
    createLink: function (page, text, classname) {
388
      var classattribute =
389
        typeof classname != "undefined" ? ' class="' + classname + '"' : "";
390
      return (
391
        '<a href="' +
392
        this.api +
393
        "&page=" +
394
        page +
395
        '"' +
396
        classattribute +
397
        ">" +
398
        text +
399
        "</a>"
400
      );
401
    },
402
    displayMynotes: function () {
403
      var scope = this;
404
      var page = parseInt(
405
        $(SELECTORS.MYNOTES_BASE).find(scope.currenttab).attr("onpage")
406
      );
407
      var mynotescount = parseInt(
408
        $(SELECTORS.MYNOTES_BASE).find(scope.currenttab).attr("notes-count")
409
      );
410
      var el = $(SELECTORS.MYNOTES_BASE).find(" " + scope.currenttab + "-list");
411
      var notescount = el.find("li").length;
412
      var lastpage = Math.ceil(notescount / CONFIG.perpage);
413
 
414
      if (notescount > 0 && lastpage <= page) {
415
        page = lastpage - 1;
416
      }
417
      var upperlimit = page * CONFIG.perpage + CONFIG.perpage;
418
      var lowerlimit = page * CONFIG.perpage;
419
      el.find("li").css("display", "none");
420
      el.find("li").each(function (i, el) {
421
        if (i >= lowerlimit && i < upperlimit) {
422
          $(el).css("display", "block");
423
        }
424
      });
425
      scope.updateMynotesInfo(mynotescount, page);
426
      //panel.centerDialogue();
427
    },
428
    registerActions: function () {
429
      var scope = this;
430
 
431
      $("body").delegate("#addmynote_cancel", "click", function () {
432
        panel.hide();
433
      });
434
      $("body").delegate("#addmynote_submit", "click", function (e) {
435
        scope.saveMynotes(e);
436
      });
437
 
438
      $("body").delegate(
439
        SELECTORS.MYNOTES_BASE + " ul.tabs-menu li",
440
        "click",
441
        function (e) {
442
          $(this).addClass("current");
443
          $(this).siblings().removeClass("current");
444
          var tab = $(this).attr("id").replace("tab-", "");
445
          $(SELECTORS.MYNOTES_BASE + " .tab-content")
446
            .not("#" + tab)
447
            .css("display", "none");
448
          $(SELECTORS.MYNOTES_BASE + " #" + tab + ".tab-content").css(
449
            "display",
450
            "block"
451
          );
452
          scope.currenttab = "#" + tab;
453
 
454
          var isloaded = $(scope.currenttab).attr("data-loaded");
455
          if (typeof isloaded == "undefined" || isloaded == false) {
456
            $(SELECTORS.MYNOTES_BASE)
457
              .find(scope.currenttab)
458
              .attr("data-loaded", "true");
459
            scope.getMynotes(0);
460
          }
461
        }
462
      );
463
 
464
      $("body").delegate(
465
        "#id_mynotecontent-" + CONFIG.instanceid,
466
        "focus blur",
467
        function (e) {
468
          scope.toggle_textarea(e);
469
        }
470
      );
471
      $("body").delegate(
472
        "#id_mynotecontent-" + CONFIG.instanceid,
473
        "change keypress keyup",
474
        function (e) {
475
          scope.getWarnings(scope.checkInputText());
476
        }
477
      );
478
 
479
      $("body").delegate(
480
        SELECTORS.MYNOTES_BASE + " .mynotes-paging .paging a",
481
        "click",
482
        function (e) {
483
          e.preventDefault();
484
          var regex = new RegExp(/[\?&]page=(\d+)/);
485
          var results = regex.exec($(this).attr("href"));
486
          var page = 0;
487
          if (results[1]) {
488
            page = results[1];
489
          }
490
          $(SELECTORS.MYNOTES_BASE)
491
            .find(scope.currenttab)
492
            .attr("onpage", parseInt(page));
493
          scope.getMynotes(page);
494
        }
495
      );
496
      $("body").delegate(
497
        SELECTORS.MYNOTES_BASE + " a.mynote-delete",
498
        "click",
499
        function (e) {
500
          e.preventDefault();
501
          var nid = $(this).attr("id");
502
          if (nid != "" || nid != "undefined") {
503
            var notescount = $(SELECTORS.MYNOTES_BASE).find(
504
              SELECTORS.MYNOTES_LISTS + "-" + scope.currenttab + " > li"
505
            ).length;
506
            var id = nid.replace(
507
              "mynote-delete-" + CONFIG.instanceid + "-",
508
              ""
509
            );
510
            var arg = {
511
              contextid: CONFIG.contextid,
512
              action: "delete",
513
              noteid: id,
514
              lastnotecounts: notescount,
515
            };
516
            scope.request({
517
              params: arg,
518
              callback: function (id, ret, args) {
519
                args.scope.addToList(ret);
520
                $("#mynote-" + CONFIG.instanceid + "-" + ret.noteid).remove();
521
                args.scope.displayMynotes();
522
              },
523
            });
524
          }
525
        }
526
      );
527
    },
528
    displayDialogue: function (e) {
529
      var scope = mynotes;
530
      if (panel === null) {
531
        str
532
          .get_strings([
533
            { key: "mynotes", component: "block_mynotes" },
534
            { key: "characterlimit", component: "block_mynotes" },
535
            { key: "save", component: "block_mynotes" },
536
            { key: "cancel" },
537
            {
538
              key: "mynotessavedundertab",
539
              component: "block_mynotes",
540
              param: CONFIG.contextareas[scope.currenttabindex],
541
            },
542
            { key: "placeholdercontent", component: "block_mynotes" },
543
          ])
544
          .done(function (s) {
545
            // Create basic tab structure
546
            var el = $("<div></div>").append(
547
              $(
548
                '<div id="' +
549
                  CSS.MYNOTES_BASE +
550
                  '" class="' +
551
                  CSS.MYNOTES_BASE +
552
                  '"></div>'
553
              )
554
                .append(
555
                  '<div class="inputarea"><div class="responsetext"></div><div id="addmynote-label-' +
556
                    CONFIG.instanceid +
557
                    '">' +
558
                    s[1] +
559
                    " " +
560
                    CONFIG.maxallowedcharacters +
561
                    '<span class="warning"></span></div>' +
562
                    '<div class="textarea"><textarea id="id_mynotecontent-' +
563
                    CONFIG.instanceid +
564
                    '" name="mynotecontent" rows="2">' +
565
                    s[5] +
566
                    "</textarea></div>" +
567
                    '<p class="notesavedhint">' +
568
                    s[4] +
569
                    "</p>" +
570
                    '<p class="mdl-align"><input type="submit" id="addmynote_submit"/></p>' +
571
                    "</div>"
572
                )
573
                .append($('<ul class="tabs-menu"></ul>'))
574
                .append($('<div class="tab"></div>'))
575
            );
576
            el.find("#addmynote_submit").attr("value", s[2]);
577
            el.find("#addmynote_cancel").attr("value", s[3]);
578
            var tabsmenu = "";
579
            var tabcontents = "";
580
            var i = "";
581
            for (i in CONFIG.contextareas) {
582
              if (scope.currenttabindex == i) {
583
                tabsmenu +=
584
                  '<li class="current" id="tab-' +
585
                  CONFIG.prefix +
586
                  i +
587
                  '"><div class="menu-item">' +
588
                  CONFIG.contextareas[i] +
589
                  "</div></li>";
590
              } else {
591
                tabsmenu +=
592
                  '<li class="" id="tab-' +
593
                  CONFIG.prefix +
594
                  i +
595
                  '"><div class="menu-item">' +
596
                  CONFIG.contextareas[i] +
597
                  "</div></li>";
598
              }
599
              tabcontents +=
600
                '<div class="tab-content" id="' +
601
                CONFIG.prefix +
602
                i +
603
                '" onpage="0" notes-count="0">' +
604
                '<div class="notes-info"><div class="mynotes-paging"></div><div class="count"></div></div>' +
605
                '<ul id="' +
606
                CONFIG.prefix +
607
                i +
608
                '-list" class="mynotes_lists"></ul>' +
609
                "</div>";
610
            }
611
            el.find(".tabs-menu").append(tabsmenu);
612
            el.find(".tab").append($(tabcontents));
613
            Y.use("moodle-core-notification-dialogue", function () {
614
              panel = new M.core.dialogue({
615
                draggable: true,
616
                modal: true,
617
                closeButton: true,
618
                headerContent: M.util.get_string("mynotes", "block_mynotes"),
619
                responsive: true,
620
              });
621
              panel.set("bodyContent", el.html());
622
              if (initnotes === null) {
623
                initnotes = true;
624
                // Get initial notes
625
                scope.getMynotes(0);
626
                $(SELECTORS.MYNOTES_BASE)
627
                  .find(scope.currenttab)
628
                  .attr("data-loaded", "true");
629
                $(SELECTORS.MYNOTES_BASE)
630
                  .find(scope.currenttab)
631
                  .css("display", "block");
632
              }
633
              panel.show();
634
            });
635
            scope.registerActions();
636
          });
637
      } else {
638
        panel.show();
639
      }
640
    },
641
    /**
642
     * Initialize mynotes
643
     * @access public
644
     * @param {int} instanceid
645
     * @param {int} contextid
646
     * @param {int} maxallowedcharacters
647
     * @param {int} perpage
648
     * @param {string} editingicon_pos
649
     * @param {bool} editing
650
     * @param {string} adminurl
651
     * @param {array} contextareas
652
     * @param {string} currenttabindex
653
     */
654
    init: function (args) {
655
      CONFIG = args;
656
      CONFIG.prefix = "mynotes_";
657
      this.perpage = parseInt(CONFIG.perpage);
658
      this.currenttab = "#mynotes_" + args.currenttabindex;
659
      this.defaulttab = "#mynotes_" + args.currenttabindex;
660
      this.currenttabindex = args.currenttabindex;
661
      this.api = this.getMynotesValidatedUrl(
662
        M.cfg.wwwroot + "/blocks/mynotes/mynotes_ajax.php"
663
      );
664
 
665
      var strtitle = M.util.get_string("showmynotes", "block_mynotes");
666
      if (!CONFIG.editing) {
667
        var handler = $(
668
          '<div class="' +
669
            CSS.MYNOTES_OPENER +
670
            '" title="' +
671
            strtitle +
672
            '" alt="' +
673
            strtitle +
674
            '">' +
675
            M.util.get_string("mynotes", "block_mynotes") +
676
            "</div>"
677
        );
678
        handler.addClass(CONFIG.editingicon_pos);
679
        $("body").append(handler);
680
        handler.html('<span class="pencil">&#x270D;</span>');
681
      } else {
682
        var handler = $(
683
          '<div class="' +
684
            CSS.MYNOTES_OPENER +
685
            '" title="' +
686
            strtitle +
687
            '" alt="' +
688
            strtitle +
689
            '">' +
690
            M.util.get_string("mynotes", "block_mynotes") +
691
            "</div>"
692
        );
693
        handler.addClass(CONFIG.editingicon_pos);
694
        handler.html('<span class="pencil">&#x270D;</span>');
695
        $(".inline-" + CSS.MYNOTES_OPENER).html(handler);
696
        $(".inline-" + CSS.MYNOTES_OPENER).append(
697
          '<div class="mynotes-pos-inline-text ' +
698
            CSS.MYNOTES_OPENER +
699
            '">' +
700
            strtitle +
701
            "</div>"
702
        );
703
      }
704
      var body = $("body");
705
      body.delegate(SELECTORS.MYNOTES_OPENER, "click", this.displayDialogue);
706
    },
707
  };
708
  return mynotes;
709
});