From bb0afa772abfda8b801e81d02b88964fd0cb2a2b Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Sun, 28 Mar 2021 14:07:36 +0200 Subject: [PATCH 1/6] Copy first text element directly to notes including formatting --- lib/editPro7.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/editPro7.js b/lib/editPro7.js index 8a39e4e..0c9a056 100644 --- a/lib/editPro7.js +++ b/lib/editPro7.js @@ -45,13 +45,17 @@ async function fillNotesSub(presentation) { // Filter slides with text if (action.type === 'ACTION_TYPE_PRESENTATION_SLIDE' && action.slide.presentation.baseSlide.elements !== undefined) { - // Get text from RTF - let text = await getText(action.slide.presentation.baseSlide.elements[0].element.text.rtfData); + // // Get text from RTF + // let text = await getText(action.slide.presentation.baseSlide.elements[0].element.text.rtfData); + // + // // Reassemble RTF for notes + // let buffer = Buffer.from(notesStyle + text + '}'); // Encode base64 + // action.slide.presentation.notes = { + // 'rtfData': buffer.toString('base64') + // }; - // Reassemble RTF for notes - let buffer = Buffer.from(notesStyle + text + '}'); // Encode base64 action.slide.presentation.notes = { - 'rtfData': buffer.toString('base64') + 'rtfData': action.slide.presentation.baseSlide.elements[0].element.text.rtfData }; } } From ccca2fb3edef734f96ba34a50326b118095492fd Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Sun, 28 Mar 2021 15:04:23 +0200 Subject: [PATCH 2/6] Auto-size main window --- main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 79be76f..9c9adb4 100644 --- a/main.js +++ b/main.js @@ -19,8 +19,9 @@ let mainWindow; function createWindow() { // Create the browser window. mainWindow = new BrowserWindow({ - width: 700, - height: 550, + useContentSize: true + // width: 700, + // height: 550, }); // and load the index.html of the app. @@ -57,7 +58,7 @@ ipcMain.on('open-file-dialog', (event, selection) => { }); // Show error messages -ipcMain.on('open-error-dialog', (event, error) => { +ipcMain.on('open-error-dialog', (event, error) => { console.error('Error:', error); // Log for developing purposes dialog.showErrorBox('Oops! Something went wrong!', error); }); From 4483e263408eb3aeb465f9f04ca909f3057ba28f Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Sun, 28 Mar 2021 15:20:18 +0200 Subject: [PATCH 3/6] Hide menu bar --- main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 9c9adb4..29e7192 100644 --- a/main.js +++ b/main.js @@ -19,7 +19,8 @@ let mainWindow; function createWindow() { // Create the browser window. mainWindow = new BrowserWindow({ - useContentSize: true + useContentSize: true, + autoHideMenuBar: true // width: 700, // height: 550, }); From 991b0080260e7b80de86b0f5ed136c2c5a31cb24 Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Sun, 28 Mar 2021 15:20:34 +0200 Subject: [PATCH 4/6] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index df3f7a6..8149df8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "ProPresenter-Suite", "productName": "ProPresenter Suite", "description": "Functions to manipulate ProPresenter 6/7 files", - "version": "2.0.0", + "version": "2.0.1", "main": "main.js", "scripts": { "start": "electron .", From 3491a7ae07446d4587ad11175b4ff62e9873ea90 Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Sun, 28 Mar 2021 19:19:06 +0200 Subject: [PATCH 5/6] Fill notes with or without formatting depending on platform --- lib/editPro7.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/lib/editPro7.js b/lib/editPro7.js index 0c9a056..7f01340 100644 --- a/lib/editPro7.js +++ b/lib/editPro7.js @@ -45,18 +45,20 @@ async function fillNotesSub(presentation) { // Filter slides with text if (action.type === 'ACTION_TYPE_PRESENTATION_SLIDE' && action.slide.presentation.baseSlide.elements !== undefined) { - // // Get text from RTF - // let text = await getText(action.slide.presentation.baseSlide.elements[0].element.text.rtfData); - // - // // Reassemble RTF for notes - // let buffer = Buffer.from(notesStyle + text + '}'); // Encode base64 - // action.slide.presentation.notes = { - // 'rtfData': buffer.toString('base64') - // }; - - action.slide.presentation.notes = { - 'rtfData': action.slide.presentation.baseSlide.elements[0].element.text.rtfData - }; + if (process.platform === 'darwin') { // If platform is macOS extract text from RTF and copy to slide notes with pre-defined formatting + // Get text from RTF + let text = await getText(action.slide.presentation.baseSlide.elements[0].element.text.rtfData); + + // Reassemble RTF for notes + let buffer = Buffer.from(notesStyle + text + '}'); // Encode base64 + action.slide.presentation.notes = { + 'rtfData': buffer.toString('base64') + }; + } else { // If platform is Windows simply copy text with formatting to slide notes + action.slide.presentation.notes = { + 'rtfData': action.slide.presentation.baseSlide.elements[0].element.text.rtfData + }; + } } } } @@ -72,7 +74,10 @@ async function mergeLanguages(paths) { // cues Array does not represent order of slides; order of slides is defined in cueGroups Array // Create lists of cue identifiers from cueGroups Array with index of cue in cues Array - let cueIds = [[], []]; + let cueIds = [ + [], + [] + ]; presentations.forEach((presentation, i) => { presentation.cueGroups.forEach(cueGroup => { cueGroup.cueIdentifiers.forEach(id => { From e2fb5495b3da406436155e0d5bd732b5b7d31a24 Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Tue, 30 Mar 2021 21:36:07 +0200 Subject: [PATCH 6/6] Adjust window size --- main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 29e7192..0adb6e1 100644 --- a/main.js +++ b/main.js @@ -19,10 +19,12 @@ let mainWindow; function createWindow() { // Create the browser window. mainWindow = new BrowserWindow({ + width: 700, + height: 507, useContentSize: true, + minWidth: 700, + minHeight: 507, autoHideMenuBar: true - // width: 700, - // height: 550, }); // and load the index.html of the app.