Treat slide notes and servicemanager notes differently in the web remote and stage view. Fixes bug 1390015

Fixes: https://launchpad.net/bugs/1390015
This commit is contained in:
Tomas Groth 2014-11-25 16:00:27 +01:00
parent 80a8434458
commit 8a08be836d
3 changed files with 10 additions and 8 deletions

View File

@ -67,8 +67,12 @@ window.OpenLP = {
var ul = $("#service-manager > div[data-role=content] > ul[data-role=listview]"); var ul = $("#service-manager > div[data-role=content] > ul[data-role=listview]");
ul.html(""); ul.html("");
$.each(data.results.items, function (idx, value) { $.each(data.results.items, function (idx, value) {
var text = value["title"];
if (value["notes"]) {
text += ' - ' + value["notes"];
}
var li = $("<li data-icon=\"false\">").append( var li = $("<li data-icon=\"false\">").append(
$("<a href=\"#\">").attr("value", parseInt(idx, 10)).text(value["title"])); $("<a href=\"#\">").attr("value", parseInt(idx, 10)).text(text));
li.attr("uuid", value["id"]) li.attr("uuid", value["id"])
li.children("a").click(OpenLP.setItem); li.children("a").click(OpenLP.setItem);
ul.append(li); ul.append(li);
@ -98,8 +102,8 @@ window.OpenLP = {
} else { } else {
text += slide["text"]; text += slide["text"];
} }
if (slide["notes"]) { if (slide["slide_notes"]) {
text += ("<div style='font-size:smaller;font-weight:normal'>" + slide["notes"] + "</div>"); text += ("<div style='font-size:smaller;font-weight:normal'>" + slide["slide_notes"] + "</div>");
} }
text = text.replace(/\n/g, '<br />'); text = text.replace(/\n/g, '<br />');
if (slide["img"]) { if (slide["img"]) {

View File

@ -114,8 +114,8 @@ window.OpenLP = {
text += "<br /><img src='" + slide["img"].replace("/thumbnails/", "/thumbnails320x240/") + "'><br />"; text += "<br /><img src='" + slide["img"].replace("/thumbnails/", "/thumbnails320x240/") + "'><br />";
} }
// use notes if available // use notes if available
if (slide["notes"]) { if (slide["slide_notes"]) {
text += '<br />' + slide["notes"]; text += '<br />' + slide["slide_notes"];
} }
text = text.replace(/\n/g, "<br />"); text = text.replace(/\n/g, "<br />");
$("#currentslide").html(text); $("#currentslide").html(text);

View File

@ -521,7 +521,7 @@ class HttpRouter(RegistryProperties):
if current_item.is_capable(ItemCapabilities.HasDisplayTitle): if current_item.is_capable(ItemCapabilities.HasDisplayTitle):
item['title'] = str(frame['display_title']) item['title'] = str(frame['display_title'])
if current_item.is_capable(ItemCapabilities.HasNotes): if current_item.is_capable(ItemCapabilities.HasNotes):
item['notes'] = str(frame['notes']) item['slide_notes'] = str(frame['notes'])
if current_item.is_capable(ItemCapabilities.HasThumbnails) and \ if current_item.is_capable(ItemCapabilities.HasThumbnails) and \
Settings().value('remotes/thumbnails'): Settings().value('remotes/thumbnails'):
# If the file is under our app directory tree send the portion after the match # If the file is under our app directory tree send the portion after the match
@ -531,8 +531,6 @@ class HttpRouter(RegistryProperties):
item['text'] = str(frame['title']) item['text'] = str(frame['title'])
item['html'] = str(frame['title']) item['html'] = str(frame['title'])
item['selected'] = (self.live_controller.selected_row == index) item['selected'] = (self.live_controller.selected_row == index)
if current_item.notes:
item['notes'] = item.get('notes', '') + '\n' + current_item.notes
data.append(item) data.append(item)
json_data = {'results': {'slides': data}} json_data = {'results': {'slides': data}}
if current_item: if current_item: