From f2b8f9b9c89273e42b8c8489c1fc6eff8a7a5bfb Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 18 Apr 2022 13:32:21 +0200 Subject: [PATCH] pas2js: fixed av --- .../pas2js/languages/strpas2jsdesign.ru.po | 47 ++++++++++++++----- components/pas2js/pjscontroller.pp | 5 +- components/pas2js/pjsdsgnregister.pas | 10 ++-- 3 files changed, 43 insertions(+), 19 deletions(-) diff --git a/components/pas2js/languages/strpas2jsdesign.ru.po b/components/pas2js/languages/strpas2jsdesign.ru.po index 43256e9059..b0831206ef 100644 --- a/components/pas2js/languages/strpas2jsdesign.ru.po +++ b/components/pas2js/languages/strpas2jsdesign.ru.po @@ -19,15 +19,14 @@ msgstr "Создать не сценарий, а модуль JavaScript" msgid "Atom package template directory" msgstr "Каталог шаблона пакета Atom" +#: strpas2jsdesign.pjsdawebapplicationusingelectrontorunasdesktopapplicat +msgid "A Web Application using Electron to run as desktop application." +msgstr "" + #: strpas2jsdesign.pjsdbrowse msgid "Browse" msgstr "Обзор" -#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage -msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage" -msgid "Browser to open HTML page, macro $(Pas2JSBrowser)" -msgstr "Браузер для открытия страницы HTML, макрос $(Pas2JSBrowser)" - #: strpas2jsdesign.pjsdbtnselectfile msgid "Select the file" msgstr "Выбрать файл" @@ -45,6 +44,14 @@ msgstr "Создать первоначальную страницу HTML" msgid "directory \"%s\" not found" msgstr "каталог \"%s\" не найден" +#: strpas2jsdesign.pjsdelectronwebapplication +msgid "Electron Web Application" +msgstr "" + +#: strpas2jsdesign.pjsderror +msgid "Error" +msgstr "" + #: strpas2jsdesign.pjsdfilenamedoesnotstartwithpas2js msgid "filename does not start with \"pas2js\"" msgstr "имя файла не начинается с \"pas2js\"" @@ -106,6 +113,10 @@ msgstr "Пакет Atom" msgid "A pas2js program running as Atom package." msgstr "Программа pas2js, запускаемая в качестве пакета Atom." +#: strpas2jsdesign.pjsdnewprojectfile +msgid "New project file" +msgstr "" + #: strpas2jsdesign.pjsdnewvscodeextension msgid "Visual Studio Code extension" msgstr "Расширение Visual Studio Code" @@ -126,6 +137,14 @@ msgstr "Приложение Node.js" msgid "NodeJS project options" msgstr "Параметры проекта NodeJS" +#: strpas2jsdesign.pjsdoverwrite +msgid "Overwrite?" +msgstr "" + +#: strpas2jsdesign.pjsdoverwritefiles +msgid "Overwrite files:" +msgstr "" + #: strpas2jsdesign.pjsdpas2jsbrowserprojectoptions msgid "Pas2JS Browser project options" msgstr "Параметры проекта Pas2JS для браузера" @@ -156,6 +175,10 @@ msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js" msgid "Path of %s, macro $(pas2js)" msgstr "Путь к %s, макрос $(pas2js)" +#: strpas2jsdesign.pjsdpleasechooseafilewithfullpath +msgid "Please choose a file with full path." +msgstr "" + #: strpas2jsdesign.pjsdportnumbertostartallocatingfrom msgid "Port number to start allocating from, macro $(Pas2JSWebServerPort)" msgstr "Начало диапазона запрашиваемых портов, макрос $(Pas2JSWebServerPort)" @@ -176,6 +199,10 @@ msgstr "Страница HTML проекта:" msgid "Project is a Web Browser (pas2js) project" msgstr "Проект предназначен для веб-браузера (pas2js)" +#: strpas2jsdesign.pjsdprojectpascalfile +msgid "Project Pascal file" +msgstr "" + #: strpas2jsdesign.pjsdresetcompilecommand msgid "Reset Compile command" msgstr "Сбросить команду компиляции" @@ -246,10 +273,6 @@ msgstr "Отображать вывод writeln() посредством мод msgid "Use NodeJS Application object" msgstr "Использовать объект приложения для NodeJS" -#: strpas2jsdesign.pjsdusethisbrowserwhenopeningtheurlorhtmlfileofawebbro -msgid "Use this browser when opening the URL or HTML file of a web browser project" -msgstr "Браузер для открытия предназначенного для него проекта по указанному адресу либо из файла HTML" - #: strpas2jsdesign.pjsdusethisurltostartapplication msgid "Use this URL to start application" msgstr "Использовать следующий адрес для запуска приложения" @@ -274,9 +297,9 @@ msgstr "Приложение для веб-браузера" msgid "Web Project (pas2js)" msgstr "Веб-проект (pas2js)" -#: strpas2jsdesign.pjsdwebserveroptions -msgid "Web server options" -msgstr "Параметры веб-сервера" +#: strpas2jsdesign.pjsdwebserverandbrowseroptions +msgid "Web server and browser options" +msgstr "" #: strpas2jsdesign.pjsdyoucanuseidemacroslikemakeexewithoutafullpathissea #, object-pascal-format diff --git a/components/pas2js/pjscontroller.pp b/components/pas2js/pjscontroller.pp index 45bbcfbf16..82cb398076 100644 --- a/components/pas2js/pjscontroller.pp +++ b/components/pas2js/pjscontroller.pp @@ -181,6 +181,7 @@ class function TPJSController.GetProjectHTMLFilename(aProject: TLazProject): str Var I : Integer; + aFile: TLazProjectFile; begin Result:=aProject.CustomData.Values[PJSProjectHTMLFile{%H-}]; @@ -189,7 +190,9 @@ begin I:=aProject.FileCount-1; While (Result='') and (I>=0) do begin - if aProject.Files[I].CustomData[PJSIsProjectHTMLFile]='1' then + aFile:=aProject.Files[I]; + if aFile.IsPartOfProject + and (aFile.CustomData[PJSIsProjectHTMLFile]='1') then Result:=aProject.Files[I].GetFullFilename; Dec(I); end; diff --git a/components/pas2js/pjsdsgnregister.pas b/components/pas2js/pjsdsgnregister.pas index be785fda37..4298aaff99 100644 --- a/components/pas2js/pjsdsgnregister.pas +++ b/components/pas2js/pjsdsgnregister.pas @@ -167,7 +167,7 @@ type property ImagesDir: string read FImagesDir write FImagesDir; property ManifestFilename: string read FManifestFilename write FManifestFilename; property IconSizes: TWordDynArray read FIconSizes write FIconSizes; - property ServiceWorker: TProjectPas2JSServiceWorker read FServiceWorker write FServiceWorker; + property ServiceWorker: TProjectPas2JSServiceWorker read FServiceWorker write FServiceWorker; // set by Register property LPGFilename: string read FLPGFilename write FLPGFilename; end; @@ -545,8 +545,8 @@ end; constructor TMultiProjectPas2JSWebApp.Create; begin - inherited Create; FOverwrites:=TStringList.Create; + inherited Create; end; destructor TMultiProjectPas2JSWebApp.Destroy; @@ -560,7 +560,8 @@ begin inherited Clear; FProjectDir:=''; FWebDir:=''; - FOverwrites.Clear; + if FOverwrites<>nil then + FOverwrites.Clear; end; { TProjectPas2JSProgressiveWebApp } @@ -743,7 +744,6 @@ end; destructor TProjectPas2JSProgressiveWebApp.Destroy; begin - FreeAndNil(FServiceWorker); inherited Destroy; end; @@ -760,8 +760,6 @@ begin FCSSStyleFilename:='style.css'; FServiceWorkerLPR:='ServiceWorker.lpr'; FServiceWorkerJSFilename:='/ServiceWorker.js'; - FreeAndNil(FServiceWorker); - FServiceWorker:=TProjectPas2JSServiceWorker.Create; SetLength(FIconSizes,length(DefaultIconSizes)); for i:=0 to high(DefaultIconSizes) do FIconSizes[i]:=DefaultIconSizes[i];