diff --git a/package-lock.json b/package-lock.json index 72011e1d..b3526269 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "freeshow", - "version": "0.5.5", + "version": "0.5.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "freeshow", - "version": "0.5.5", + "version": "0.5.6", "hasInstallScript": true, "license": "GPL-3.0", "dependencies": { diff --git a/package.json b/package.json index a83c29d5..c448c945 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "freeshow", - "version": "0.5.5", + "version": "0.5.6", "private": true, "main": "build/electron/index.js", "description": "An application for showing song lyrics and more for free!", diff --git a/public/lang/es.json b/public/lang/es.json index 0c2566ab..8d7e5576 100644 --- a/public/lang/es.json +++ b/public/lang/es.json @@ -93,8 +93,8 @@ "audio": "Audio", "to_start": "Iniciar", "nextTimer": "Temporizador de siguiente diapositiva", - "lock": "Lock", - "unlock": "Unlock" + "lock": "Bloquear", + "unlock": "Desbloquear" }, "clear": { "all": "Borrar todo", @@ -111,7 +111,7 @@ "nextTimer": "Eliminar temporizador de siguiente diapositiva", "to_start": "Eliminar inicio", "timer": "Eliminar temporizador", - "transition": "Remove transition" + "transition": "Eliminar transición" }, "media": { "_loop": "Ciclo", @@ -127,18 +127,18 @@ "folder": "Solo carpetas", "image": "Solo imágenes", "video": "Solo videos", - "fit": "Fit", - "contain": "Contain", - "fill": "Fill", - "cover": "Cover" + "fit": "Adaptar", + "contain": "Contener", + "fill": "Llenar", + "cover": "Cubrir" }, "menu": { "show": "Programa", "_title_show": "Proyectar", "edit": "Editar", "_title_edit": "Editando", - "stage": "Etapa", - "_title_stage": "Ver etapa", + "stage": "Stage", + "_title_stage": "Ver Stage", "draw": "Dibujar", "_title_draw": "Dibujando", "calendar": "Agenda", @@ -164,7 +164,7 @@ "groups": "Sin eventos", "events": "Escribir algo", "text": "Sin temporizadores en los programas de este proyecto", - "timers": "No global timers and no timers in the shows in this project" + "timers": "No hay cronómetros globales, ni cronómetros en las diapositivas de este proyecto" }, "remote": { "projects": "Proyectos", @@ -185,13 +185,13 @@ "no_show": "No se encuentra el programa", "no_layouts": "No se encuentra ningún diseño", "load": "No se puede cargar", - "bible": "Could not find local scripture", - "bible_api": "Could not load scripture from API.Bible, do you have an internet connection?", + "bible": "No se pudo encontrar la escritura local", + "bible_api": "No se pudo cargar la escritura desde la API. Biblia, ¿tiene conexión a Internet?", "not_found": "No encontrado", "display": "Ventana de resultado no puede mostrarse en esta vista", "keep_one_layout": "Usted debe tener al menos un diseño", - "video_unavailable": "Getting video unavailable? The creator has disabled embeds on the video.", - "folder_exists": "This folder does already exist" + "video_unavailable": "¿El video no está disponible? El creador ha deshabilitado las incrustaciones en el video.", + "folder_exists": "Esta carpeta ya existe" }, "meta": { "title": "Título", @@ -254,14 +254,14 @@ "all": "Todo", "unlabeled": "Sin identificar", "favourites": "Favoritos", - "song": "Canción", + "song": "Cántico", "presentation": "Presentación", "info": "Información", "scripture": "Escritura", "events": "Eventos", "pictures": "Imágenes", "videos": "Videos", - "music": "Music", + "music": "Musica", "offers": "Ofertas", "notice": "Noticia", "visuals": "Ilustraciones" @@ -285,15 +285,15 @@ "timer": "Timer", "transition": "Transición", "delete_show": "Eliminar programa", - "delete_show_confirmation": "Estás seguro de eliminar este programa", + "delete_show_confirmation": "Estás seguro de eliminar este programa?", "change_name": "Cambiar de nombre", - "choose_screen": "Choose screen", + "choose_screen": "Elegir pantalla", "import": "Importar", "export": "Exportar", - "importing": "Importing", - "import_scripture": "Import scripture", + "importing": "Importando", + "import_scripture": "Importar escritura", "player": "Reproductor", - "edit_event": "Edit event", + "edit_event": "Editar evento", "about": "Acerca de", "shortcuts": "Atajos", "icon": "Íconos", @@ -311,14 +311,14 @@ "show": "Nuevo programa", "empty_show": "Nuevo programa vacío", "project": "Nuevo proyecto", - "timer": "New timer", + "timer": "Nuevo temporizador", "category": "Nueva categoría", "private": "Nuevo programa privado", "folder": "Nueva carpeta", "slide": "Nueva diapositiva", "overlay": "Nueva capa", "template": "Nueva plantilla", - "scripture": "New scripture", + "scripture": "Nueva escritura", "event": "Nuevo evento" }, "show": { @@ -339,7 +339,7 @@ "export": "Exportar", "duplicate": "Repetir", "delete": "Eliminar", - "delete_all": "Delete all", + "delete_all": "Eliminar todos", "close": "Cerrar", "save": "Guardar", "disable": "Desactivar", @@ -379,7 +379,7 @@ "export": "Exportar", "export_as": "Exportar como", "exported": "Exportado", - "oneFile": "One file", + "oneFile": "Un archivo", "selected_shows": "Programas seleccionados", "current_project": "Proyecto en curso", "all_shows": "Todos los programas", @@ -465,7 +465,7 @@ "add_icons": "Añadir íconos", "arrange_items": "Ordenar elementos", "filters": "Filtros", - "choose_media": "Choose media" + "choose_media": "Elegir medios" }, "items": { "text": "Cuadro de texto", @@ -477,7 +477,7 @@ "live": "En vivo", "audio": "Audio", "timer": "Temporizador", - "icon": "Icon" + "icon": "Icono" }, "borders": { "solid": "Sólido", @@ -490,26 +490,26 @@ "ridge": "Cresta" }, "timer": { - "from_to": "From start to end", + "from_to": "De principio a fin", "to_time": "Towards a time", "to_event": "Time until event", - "counter": "Countdown", + "counter": "Cuenta regresiva", "time": "Hora", - "seconds": "Seconds", - "from": "From", - "to": "To", + "seconds": "Segundos", + "from": "De", + "to": "Para", "preview": "Vista previa", - "clock": "Clock", + "clock": "Reloj", "event": "Nuevo evento", - "no_events": "There are no upcomming events", + "no_events": "No hay eventos próximos", "edit": "Editar", - "create": "Create" + "create": "Crear" }, "clock": { "type": "Type", "digital": "Digital", - "analog": "Analog", - "seconds": "Seconds" + "analog": "Analógico", + "seconds": "Segundos" }, "draw": { "focus": "Enfoque", @@ -522,11 +522,11 @@ "size": "Tamaño", "radius": "Radius", "glow": "Brillo", - "hollow": "Hollow", + "hollow": "Vacío", "hold": "Fijar", "rainbow": "Arco iris", "threed": "3D", - "dots": "Dots" + "dots": "Entrecortado" }, "stage": { "slide": "Diapositiva", @@ -559,28 +559,28 @@ "calendar": "Calendario", "other": "Otro", "language": "Idioma", - "use24hClock": "Use 24-hour clock", + "use24hClock": "Usar reloj de 24 horas", "hide_output_hint": "Doble click en la ventana de salida para ocultarlo.", "show_output_hint": "Presionar ctrl/cmd mientras hace click al botón de visualización para forzarlo a mostrarse delante de pantalla.", "move_output_hint": "No se visualiza? Cambiar la posición hasta que la ventana se muestre en una segunda pantalla.", - "new_output": "New output", + "new_output": "Nueva salida", "position": "Posición", - "enabled": "Enabled", - "color_when_active": "Color when active", - "fixed": "Fixed", - "choose_screen": "Choose screen", - "lines": "Lines", - "override_with_template": "Override style with template", - "active_layers": "Active layers", + "enabled": "Activado", + "color_when_active": "Color cuando está activo", + "fixed": "Fijar", + "choose_screen": "Elegir pantalla", + "lines": "Lineas", + "override_with_template": "Anular estilo con plantilla", + "active_layers": "Capas activas", "window": "Window", "alert_updates": "Alerta cuando una nueva actualización está disponible", "disable_labels": "Etiquetas desactivadas", "group_numbers": "Números de grupo", "full_colors": "Despliega todos los grupos de colores", - "format_new_show": "Format text when creating show", + "format_new_show": "Dar formato al texto al crear una presentación", "auto_output": "Muestra la ventana de salida en la pantalla de inicio", "display_metadata": "Visualizar metadatos mientras se están mostrando", - "split_lines": "Numbers of lines when creating a show", + "split_lines": "Número de líneas al crear una presentación", "default_project_name": "Nombre predeterminado del proyecto", "resolution": "Solución", "video_extensions": "Extensiones de video", @@ -609,9 +609,9 @@ "export_all": "Exportar todo" }, "calendar": { - "type": "Type", + "type": "Tipo", "event": "Nuevo evento", - "show": "Schedule show", + "show": "Programar presentación", "name": "Nombre", "color": "Color", "time": "Hora", @@ -622,22 +622,22 @@ "location": "Ubicación", "notes": "Notas", "today": "Hoy", - "tomorrow": "Tomorrow", - "repeat": "Repeat", - "repeat_every": "Repeat every", - "repeat_until": "until", - "day": "day", - "week": "week", - "month": "month", - "year": "year", + "tomorrow": "Mañana", + "repeat": "Repetir", + "repeat_every": "Repite cada", + "repeat_until": "Repite hasta", + "day": "Dia", + "week": "Semana", + "month": "Mes", + "year": "Año", "ending_the": "the", "ending_repeated": "repeated", "ending_times": "times", "save_all": "Save and update all" }, "scripture": { - "bibles": "Bibles from API.Bible", - "custom": "Or import your own", + "bibles": "Biblias desde el API.Bible", + "custom": "O importar de forma local", "max_verses": "Cantidad máxima de versos por diapositiva", "verse_numbers": "Números de versos", "version": "Mostrar modelo", @@ -670,16 +670,16 @@ "blur": "Desenfocar", "scale": "Escalar", "spin": "Rotar", - "slide": "Slide" + "slide": "Deslizar" }, "easings": { - "linear": "Linear", - "elastic": "Elastic", - "bounce": "Bounce", - "back": "Jump", - "circ": "Circular", - "cubic": "Cubic", - "sine": "Flow" + "linear": "Lineal", + "elastic": "Elástico", + "bounce": "Rebote", + "back": "Saltar", + "circ": "Circulo", + "cubic": "Cúbico", + "sine": "Flujo" }, "month": { "1": "Enero", diff --git a/public/lang/no.json b/public/lang/no.json index 15357987..1e5c8b7a 100644 --- a/public/lang/no.json +++ b/public/lang/no.json @@ -287,7 +287,7 @@ "delete_show": "Slett show", "delete_show_confirmation": "Er du sikker på at du vil slette", "change_name": "Endre navn på", - "choose_screen": "Choose screen", + "choose_screen": "Velg skjerm", "import": "Importer", "export": "Eksporter", "importing": "Importerer", diff --git a/public/lang/pt_BR.json b/public/lang/pt_BR.json index 005604e9..1671e54b 100644 --- a/public/lang/pt_BR.json +++ b/public/lang/pt_BR.json @@ -568,6 +568,7 @@ "enabled": "Habilitado", "color_when_active": "Cor quando ativo", "fixed": "Fixado", + "choose_screen": "Selecionar tela", "lines": "Linhas", "override_with_template": "Substituir estilo com modelo", "active_layers": "Camadas ativas", diff --git a/public/lang/sk.json b/public/lang/sk.json index 429a311c..b94e4088 100644 --- a/public/lang/sk.json +++ b/public/lang/sk.json @@ -287,7 +287,7 @@ "delete_show": "Odstrániť prezentáciu", "delete_show_confirmation": "Naozaj ju chcete odstrániť?", "change_name": "Premenovať", - "choose_screen": "Choose screen", + "choose_screen": "Vyberte obrazovku", "import": "Import", "export": "Export", "importing": "Importovanie", diff --git a/src/electron/index.ts b/src/electron/index.ts index 3ea00416..9e1e96ef 100644 --- a/src/electron/index.ts +++ b/src/electron/index.ts @@ -88,7 +88,7 @@ function createLoading() { // ----- MAIN WINDOW ----- export let mainWindow: BrowserWindow | null = null -let dialogClose: boolean = false // is unsaved +export let dialogClose: boolean = false // is unsaved function createMain() { let bounds: Rectangle = config.get("bounds") let screenBounds: Rectangle = screen.getPrimaryDisplay().bounds diff --git a/src/electron/utils/files.ts b/src/electron/utils/files.ts index c9934044..0d78384e 100644 --- a/src/electron/utils/files.ts +++ b/src/electron/utils/files.ts @@ -80,7 +80,7 @@ export function selectFolderDialog(title: string = ""): string { // DATA FOLDERS export function getDocumentsFolder(p: any = null, folderName: string = "Shows"): string { - if (!p) p = path.resolve(app.getPath("documents"), folderName) + if (!p) p = path.resolve(app.getPath("documents"), "FreeShow", folderName) if (!doesPathExist(p)) p = fs.mkdirSync(p, { recursive: true }) return p } @@ -109,7 +109,11 @@ export function loadFile(p: string, contentId: string = ""): any { content = readFile(p) if (!content) return { error: "not_found", id: contentId } - content = JSON.parse(content) + try { + content = JSON.parse(content) + } catch (error) { + return { error: "not_found", id: contentId } + } if (contentId && content[0] !== contentId) return { error: "not_found", id: contentId, file_id: content[0] } return { id: contentId, content } @@ -146,9 +150,9 @@ export function getFolderContent(_e: any, folderPath: string) { } // OPEN_FOLDER -export function selectFolder(e: any, msg: { id: string; title: string | undefined }) { +export function selectFolder(e: any, msg: { channel: string; title: string | undefined }) { let folder: any = selectFolderDialog(msg.title) - if (folder) e.reply(OPEN_FOLDER, { id: msg.id, path: folder }) + if (folder) e.reply(OPEN_FOLDER, { channel: msg.channel, data: { path: folder } }) } // OPEN_FILE diff --git a/src/electron/utils/output.ts b/src/electron/utils/output.ts index 608b455b..bc44f986 100644 --- a/src/electron/utils/output.ts +++ b/src/electron/utils/output.ts @@ -1,6 +1,6 @@ import { BrowserWindow, screen } from "electron" import { join } from "path" -import { mainWindow, toApp } from ".." +import { dialogClose, mainWindow, toApp } from ".." import { MAIN, OUTPUT } from "../../types/Channels" import { Message } from "../../types/Socket" import { Output } from "./../../types/Output" @@ -71,6 +71,11 @@ function createOutputWindow(options: any) { window.on("ready-to-show", () => { mainWindow?.focus() + window?.setMenu(null) + }) + + window.on("close", (e) => { + if (!dialogClose) e.preventDefault() }) return window @@ -138,7 +143,8 @@ export function displayOutput(data: any) { let windowNotCoveringMain: boolean = xDif > 50 || yDif < -50 || (xDif < -50 && yDif > 50) // console.log(bounds, xDif, yDif, windowNotCoveringMain) if (bounds && (data.force || windowNotCoveringMain)) { - showWindow(window, !data.force) + // , !data.force + showWindow(window) if (bounds) { window?.setBounds(bounds) @@ -156,7 +162,8 @@ export function displayOutput(data: any) { toApp(OUTPUT, { channel: "DISPLAY", data }) } -function showWindow(window: BrowserWindow, fullscreen: boolean = false) { +// , fullscreen: boolean = false +function showWindow(window: BrowserWindow) { if (!window) return // TODO: output task bar // window.setVisibleOnAllWorkspaces(true) @@ -172,19 +179,19 @@ function showWindow(window: BrowserWindow, fullscreen: boolean = false) { // window.setAlwaysOnTop(true, "screen-saver", 1) // window.setAlwaysOnTop(true, 'floating') - if (process.platform === "darwin") { - setTimeout(() => { - window.maximize() - if (fullscreen) { - // ... ?? - // window.setFullScreen(true) - } - setTimeout(() => { - // focus on mac - mainWindow?.focus() - }, 10) - }, 100) - } + // if (process.platform === "darwin") { + // setTimeout(() => { + // window.maximize() + // if (fullscreen) { + // // ... ?? + // // window.setFullScreen(true) + // } + // setTimeout(() => { + // // focus on mac + // mainWindow?.focus() + // }, 10) + // }, 100) + // } window.moveTop() } @@ -192,12 +199,12 @@ function showWindow(window: BrowserWindow, fullscreen: boolean = false) { function hideWindow(window: BrowserWindow) { if (!window) return - if (process.platform === "darwin") { - // window.setFullScreen(false) - // setTimeout(() => { - window.minimize() - // }, 100) - } + // if (process.platform === "darwin") { + // // window.setFullScreen(false) + // // setTimeout(() => { + // window.minimize() + // // }, 100) + // } window.hide() } @@ -233,7 +240,9 @@ export function toggleValue({ id, key }: any) { else if (key === "disabled") window.setEnabled(!window.isEnabled()) else if (key === "menubar") window.setAutoHideMenuBar(!window.isMenuBarAutoHide()) else if (key === "workspaces") window.setVisibleOnAllWorkspaces(!window.isVisibleOnAllWorkspaces()) - // else if (key === "alwaysontop") window.setAlwaysOnTop("") + else if (key === "alwaysontop") window.isAlwaysOnTop() ? window.setAlwaysOnTop(false) : window.setAlwaysOnTop(true, "screen-saver", 1) + else if (key === "alwaysontop2") window.isAlwaysOnTop() ? window.setAlwaysOnTop(false) : window.setAlwaysOnTop(true, "pop-up-menu", 1) + // window.setVisibleOnAllWorkspaces(true, {visibleOnFullScreen: true}); let state = { maximized: window.isMaximized(), diff --git a/src/electron/utils/responses.ts b/src/electron/utils/responses.ts index 268e15d4..0be69d3f 100644 --- a/src/electron/utils/responses.ts +++ b/src/electron/utils/responses.ts @@ -39,9 +39,13 @@ export function startExport(_e: any, msg: Message) { // BIBLE export function loadScripture(e: any, msg: Message) { - let p: string = path.resolve(app.getPath("documents"), "Bibles", msg.name + ".fsb") + let p: string = path.resolve(app.getPath("documents"), "FreeShow", "Bibles", msg.name + ".fsb") let bible: any = loadFile(p, msg.id) + // pre v0.5.6 + if (bible.error) p = path.resolve(app.getPath("documents"), "Bibles", msg.name + ".fsb") + bible = loadFile(p, msg.id) + e.reply(BIBLE, bible) } diff --git a/src/frontend/App.svelte b/src/frontend/App.svelte index e9ab529d..a290fd8a 100644 --- a/src/frontend/App.svelte +++ b/src/frontend/App.svelte @@ -47,6 +47,7 @@ currentWindow, drawer, events, + loaded, os, outputDisplay, outputs, @@ -91,21 +92,28 @@ let ref = _show("active").layouts("active").ref()[0] let selection = ref.map((_: any, index: number) => ({ index })) selected.set({ id: "slide", data: selection }) + return true } else if ($activePage === "edit") { // select all elements... } } + return false }, c: () => { if ($selected.id) copy($selected) else if ($activeEdit.items) copy({ id: "item", data: $activeEdit }) else if (window.getSelection()) navigator.clipboard.writeText(window.getSelection()!.toString()) + return true + }, + v: () => { + paste() + return true }, - v: () => paste(), x: () => { copy() // TODO: delete if ($selected.id === "slide") removeSlide({ sel: $selected }) + return true }, e: () => activePopup.set("export"), i: () => activePopup.set("import"), @@ -168,12 +176,12 @@ if (document.activeElement?.classList.contains("edit") && ["a", "c", "v", "z", "y", "Z"].includes(e.key)) return if (ctrlKeys[e.key]) { - e.preventDefault() - ctrlKeys[e.key](e) + if (ctrlKeys[e.key](e)) e.preventDefault() } return } + if (e.altKey) return if (document.activeElement?.classList.contains("edit") && e.key !== "Escape") return if (document.activeElement === document.body && Object.keys(menus).includes((e.key - 1).toString())) activePage.set(menus[e.key - 1]) @@ -294,7 +302,7 @@ - {#if page === "show" || page === "edit"} + {#if $loaded && (page === "show" || page === "edit")} {/if} diff --git a/src/frontend/components/calendar/Calendar.svelte b/src/frontend/components/calendar/Calendar.svelte index 2f6edd8c..ccd14843 100644 --- a/src/frontend/components/calendar/Calendar.svelte +++ b/src/frontend/components/calendar/Calendar.svelte @@ -138,7 +138,7 @@ first = last last = $activeDays[$activeDays.length - 1] } - let temp = [] + let temp: number[] = [] let count = 0 do { diff --git a/src/frontend/components/context/ContextChild.svelte b/src/frontend/components/context/ContextChild.svelte index 00b910fb..a7e2deb6 100644 --- a/src/frontend/components/context/ContextChild.svelte +++ b/src/frontend/components/context/ContextChild.svelte @@ -70,11 +70,11 @@ {#if open} {:else if id === "media" || id === "audio"} - + diff --git a/src/frontend/components/drawer/audio/Audio.svelte b/src/frontend/components/drawer/audio/Audio.svelte index a98ff330..b506f951 100644 --- a/src/frontend/components/drawer/audio/Audio.svelte +++ b/src/frontend/components/drawer/audio/Audio.svelte @@ -1,9 +1,10 @@ + +
{#if notLoaded}
diff --git a/src/frontend/components/drawer/info/OverlayInfo.svelte b/src/frontend/components/drawer/info/OverlayInfo.svelte index 9ba60e34..1f257b18 100644 --- a/src/frontend/components/drawer/info/OverlayInfo.svelte +++ b/src/frontend/components/drawer/info/OverlayInfo.svelte @@ -4,7 +4,7 @@
- +