Project

General

Profile

Feature #5077 » labelFormatting.diff

Pablo Zerón, 2018-04-18 13:51

View differences:

src/webui/static/app/dvr.js
5 5
/**
6 6
 *
7 7
 */
8

  
9
// Function to support some of the label formatting used with kodi
10
tvheadend.labelFormatting = function(description) {
11
    return description.replace(/\[COLOR\s(.*?)\]/g, '<font style="color:$1">')
12
                      .replace(/\[\/COLOR\]/g, '<\/font>')
13
                      .replace(/\[B\]/g, '<b>')
14
                      .replace(/\[\/B\]/g, '<\/b>')
15
                      .replace(/\[I\]/g, '<i>')
16
                      .replace(/\[CR\]/g, '<br>')
17
                      .replace(/\[\/I\]/g, '<\/i>')
18
                      //.replace(/(?<=\[UPPERCASE\])(.*)(?=\[\/UPPERCASE\])/g, function(match) {return match.toUpperCase();}) // Only work with Chrome
19
                      .replace(/\[UPPERCASE\](.*)\[\/UPPERCASE\]/g, function(match) {return match.toUpperCase();})
20
                      .replace(/\[UPPERCASE\]/g, '')
21
                      .replace(/\[\/UPPERCASE\]/g, '')
22
                      //.replace(/(?<=\[LOWERCASE\])(.*)(?=\[\/LOWERCASE\])/g, function(match) {return match.toLowerCase();}) // Only work with Chrome
23
                      //.replace(/\[LOWERCASE\]/g, '')
24
                      //.replace(/\[\/LOWERCASE\]/g, '')
25
                      .replace(/\[LOWERCASE\](.*)\[\/LOWERCASE\]/g, function(match) {return match.toLowerCase();})
26
                      .replace(/\[lowercase\]/g, '')
27
                      .replace(/\[\/lowercase\]/g, '')
28
                      //.replace(/(?<=\[CAPITALIZE\])(.*)(?=\[\/CAPITALIZE\])/g, function(match) {return match.split(/\s+/).map(w => w[0].toUpperCase() + w.slice(1)).join(' ');}) // Only work with Chrome
29
                      .replace(/\[CAPITALIZE\](.*)\[\/CAPITALIZE\]/g, function(match) {return match.split(/\s+/).map(w => w[0].toUpperCase() + w.slice(1)).join(' ');})
30
                      .replace(/\[CAPITALIZE\]/g, '')
31
                      .replace(/\[\/CAPITALIZE\]/g, '');
32
};
33

  
8 34
tvheadend.dvrDetails = function(uuid) {
9 35

  
10 36
    function showit(d) {
......
79 105
        if (summary && (!subtitle || subtitle != summary))
80 106
            content += '<div class="x-epg-summary">' + summary + '</div>';
81 107
        if (desc) {
82
            content += '<div class="x-epg-desc">' + desc + '</div>';
108
            content += '<div class="x-epg-desc">' + tvheadend.labelFormatting(desc) + '</div>';
83 109
            content += '<hr class="x-epg-hr"/>';
84 110
        }
85 111
        content += tvheadend.getDisplayCredits(credits);
......
124 150
                        encodeURIComponent(title)+'&searchseriesid=&tab=listseries&function=Search','_blank');
125 151
        }
126 152

  
153
        var windowHeight = Ext.getBody().getViewSize().height - 100;
154

  
127 155
        var win = new Ext.Window({
128 156
            title: title,
129 157
            iconCls: 'info',
130 158
            layout: 'fit',
131 159
            width: 650,
132
            height: 450,
160
            height: windowHeight, //450
133 161
            constrainHeader: true,
134 162
            buttonAlign: 'center',
163
            autoScroll: true,
135 164
            buttons: buttons,
136 165
            html: content
137 166
        });
src/webui/static/app/epg.js
152 152
    if (event.summary)
153 153
      content += '<div class="x-epg-summary">' + event.summary + '</div>';
154 154
    if (event.description)
155
      content += '<div class="x-epg-desc">' + event.description + '</div>';
155
      content += '<div class="x-epg-desc">' + tvheadend.labelFormatting(event.description) + '</div>';
156 156
    if (event.summary || event.description)
157 157
      content += '<hr class="x-epg-hr"/>';
158 158
    content += tvheadend.getDisplayCredits(event.credits);
......
304 304

  
305 305
    }
306 306

  
307
    var windowHeight = Ext.getBody().getViewSize().height - 100;
308

  
307 309
    var win = new Ext.Window({
308 310
        title: _('Broadcast Details'),
309 311
        iconCls: 'broadcast_details',
310 312
        layout: 'fit',
311 313
        width: 675,
312
        height: 450,
314
        height: windowHeight, //450
313 315
        constrainHeader: true,
314 316
        buttons: buttons,
315 317
        buttonAlign: 'center',
(4-4/4)