web/res/metadataplayer/Annotation.js
changeset 726 d82d070cf23e
parent 719 d0d3a9369f84
child 778 525f00c2d6ac
equal deleted inserted replaced
725:796881572d91 726:d82d070cf23e
    79             description = currentAnnotation.description.replace(/(^\s+|\s+$)/g,'');
    79             description = currentAnnotation.description.replace(/(^\s+|\s+$)/g,'');
    80         if (currentAnnotation.found) {
    80         if (currentAnnotation.found) {
    81             var rgxp = _this.source.getAnnotations().regexp || /^$/,
    81             var rgxp = _this.source.getAnnotations().regexp || /^$/,
    82                 repl = '<span class="Ldt-Annotation-Highlight">$1</span>';
    82                 repl = '<span class="Ldt-Annotation-Highlight">$1</span>';
    83             title = title.replace(rgxp,repl);
    83             title = title.replace(rgxp,repl);
    84             description = description.replace(rgxp,repl);
    84             description = description.replace(rgxp,repl).replace(/[\n\r]+/gm,'<br />');
    85         }
    85         }
    86         _this.$.find(".Ldt-Annotation-Title").html(title || "(" + _this.l10n.untitled + ")");
    86         _this.$.find(".Ldt-Annotation-Title").html(title || "(" + _this.l10n.untitled + ")");
    87         if (description) {
    87         if (description) {
    88             _this.$.find(".Ldt-Annotation-Description-Block").removeClass("Ldt-Annotation-EmptyBlock");
    88             _this.$.find(".Ldt-Annotation-Description-Block").removeClass("Ldt-Annotation-EmptyBlock");
    89             _this.$.find(".Ldt-Annotation-Description").html(description);
    89             _this.$.find(".Ldt-Annotation-Description").html(description);
    98                 ? _annotation.url
    98                 ? _annotation.url
    99                 : (document.location.href.replace(/#.*$/,'') + '#id='  + _annotation.id)),
    99                 : (document.location.href.replace(/#.*$/,'') + '#id='  + _annotation.id)),
   100             _text = _this.l10n.watching + _annotation.title + (_this.site_name ? _this.l10n.on_site + _this.site_name : ''),
   100             _text = _this.l10n.watching + _annotation.title + (_this.site_name ? _this.l10n.on_site + _this.site_name : ''),
   101             _tags = _annotation.getTags(),
   101             _tags = _annotation.getTags(),
   102             _tagblock = _this.$.find(".Ldt-Annotation-Tags");
   102             _tagblock = _this.$.find(".Ldt-Annotation-Tags");
       
   103         _tagblock.empty();
   103         if (_tags.length) {
   104         if (_tags.length) {
   104             _this.$.find(".Ldt-Annotation-Tags-Block").removeClass("Ldt-Annotation-EmptyBlock");
   105             _this.$.find(".Ldt-Annotation-Tags-Block").removeClass("Ldt-Annotation-EmptyBlock");
   105             _tags.forEach(function(_tag) {
   106             _tags.forEach(function(_tag) {
   106                 var _trimmedTitle =  _tag.title.replace(/(^\s+|\s+$)/g,'');
   107                 var _trimmedTitle =  _tag.title.replace(/(^\s+|\s+$)/g,'');
   107                 if (_trimmedTitle) {
   108                 if (_trimmedTitle) {