From 06110df08b6de7cb7278c1bf1484444c27606dc8 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 14 Jul 2014 11:58:05 +0200 Subject: [PATCH] Add notes and titles to presentation-serviceitem when creating it, and updated stageview to show title+thumbnail+notes. --- openlp/plugins/presentations/lib/mediaitem.py | 9 +++++++- openlp/plugins/remotes/html/stage.js | 22 +++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 5b503d50f..f7d924651 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -323,11 +323,18 @@ class PresentationMediaItem(MediaManagerItem): i = 1 img = doc.get_thumbnail_path(i, True) if img: + # Get titles and notes + titles, notes = doc.get_titles_and_notes() while img: - service_item.add_from_command(path, name, img) + service_item.add_from_command(path, name, img, titles[i - 1], notes[i - 1]) i += 1 img = doc.get_thumbnail_path(i, True) doc.close_presentation() + if titles.count('') != len(titles): + service_item.add_capability(ItemCapabilities.HasDisplayTitle) + if notes.count('') != len(notes): + service_item.add_capability(ItemCapabilities.HasNotes) + service_item.add_capability(ItemCapabilities.HasThumbnails) return True else: # File is no longer present diff --git a/openlp/plugins/remotes/html/stage.js b/openlp/plugins/remotes/html/stage.js index ec88706c1..921deba79 100644 --- a/openlp/plugins/remotes/html/stage.js +++ b/openlp/plugins/remotes/html/stage.js @@ -102,7 +102,21 @@ window.OpenLP = { $("#verseorder span").removeClass("currenttag"); $("#tag" + OpenLP.currentTags[OpenLP.currentSlide]).addClass("currenttag"); var slide = OpenLP.currentSlides[OpenLP.currentSlide]; - var text = slide["text"]; + var text = ""; + // use title if available + if (slide["title"]) { + text = slide["title"]; + } else { + text = slide["text"]; + } + // use thumbnail if available + if (slide["img"]) { + text += "

"; + } + // use notes if available + if (slide["notes"]) { + text += '
' + slide["notes"]; + } text = text.replace(/\n/g, "
"); $("#currentslide").html(text); text = ""; @@ -110,7 +124,11 @@ window.OpenLP = { for (var idx = OpenLP.currentSlide + 1; idx < OpenLP.currentSlides.length; idx++) { if (OpenLP.currentTags[idx] != OpenLP.currentTags[idx - 1]) text = text + "

"; - text = text + OpenLP.currentSlides[idx]["text"]; + if (OpenLP.currentSlides[idx]["title"]) { + text = text + OpenLP.currentSlides[idx]["title"]; + } else { + text = text + OpenLP.currentSlides[idx]["text"]; + } if (OpenLP.currentTags[idx] != OpenLP.currentTags[idx - 1]) text = text + "

"; else