pas2js: added TMultiProjectPas2JSWebApp

This commit is contained in:
mattias 2022-04-18 10:27:20 +02:00
parent 7da59fbd6c
commit f54488e9b9
11 changed files with 492 additions and 323 deletions

View File

@ -23,11 +23,6 @@ msgstr "Répertoire des modèles de paquets Atom"
msgid "Browse"
msgstr "Parcourir"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr "Navigateur pour ouvrir la page HTML, macro $(Pas2JSBrowser)"
#: strpas2jsdesign.pjsdbtnselectfile
msgid "Select the file"
msgstr ""
@ -45,6 +40,10 @@ msgstr "Créer la page initiale HTML"
msgid "directory \"%s\" not found"
msgstr "répertoire \"%s\" non trouvé"
#: strpas2jsdesign.pjsderror
msgid "Error"
msgstr ""
#: strpas2jsdesign.pjsdfilenamedoesnotstartwithpas2js
msgid "filename does not start with \"pas2js\""
msgstr "le nom de fichier ne commence pas par \"pas2js\""
@ -103,6 +102,10 @@ msgstr "Paquet Atom"
msgid "A pas2js program running as Atom package."
msgstr "Un programme pas2js exécuté en tant que paquet Atom."
#: strpas2jsdesign.pjsdnewprojectfile
msgid "New project file"
msgstr ""
#: strpas2jsdesign.pjsdnewvscodeextension
msgid "Visual Studio Code extension"
msgstr "Extension de code Visual Studio"
@ -123,6 +126,14 @@ msgstr "Application Node.js"
msgid "NodeJS project options"
msgstr "Options du projet NodeJS"
#: strpas2jsdesign.pjsdoverwrite
msgid "Overwrite?"
msgstr ""
#: strpas2jsdesign.pjsdoverwritefiles
msgid "Overwrite files:"
msgstr ""
#: strpas2jsdesign.pjsdpas2jsbrowserprojectoptions
msgid "Pas2JS Browser project options"
msgstr "Options du projet de navigateur Pas2JS"
@ -153,6 +164,10 @@ msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr "Chemin de %s, macro $(pas2js)"
#: strpas2jsdesign.pjsdpleasechooseafilewithfullpath
msgid "Please choose a file with full path."
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
msgid "Port number to start allocating from, macro $(Pas2JSWebServerPort)"
msgstr "Numéro de port pour l'allocation, macro $(Pas2JSWebServerPort)"
@ -173,6 +188,10 @@ msgstr "Page du projet HTML :"
msgid "Project is a Web Browser (pas2js) project"
msgstr "Le projet est un projet de navigateur Web (pas2js)"
#: strpas2jsdesign.pjsdprojectpascalfile
msgid "Project Pascal file"
msgstr ""
#: strpas2jsdesign.pjsdresetcompilecommand
msgid "Reset Compile command"
msgstr "Réinitialiser la commande de compilation"
@ -245,10 +264,6 @@ msgstr "Utiliser l'unité de la console du navigateur pour afficher la sortie wr
msgid "Use NodeJS Application object"
msgstr "Utiliser l'objet application NodeJS"
#: strpas2jsdesign.pjsdusethisbrowserwhenopeningtheurlorhtmlfileofawebbro
msgid "Use this browser when opening the URL or HTML file of a web browser project"
msgstr "Utiliser ce navigateur lors de l'ouverture de l'URL ou du fichier HTML d'un projet de navigateur Web"
#: strpas2jsdesign.pjsdusethisurltostartapplication
msgid "Use this URL to start application"
msgstr "Utiliser cette URL pour démarrer l'application"
@ -273,8 +288,8 @@ msgstr "Application navigateur Web"
msgid "Web Project (pas2js)"
msgstr "Projet Web (pas2js)"
#: strpas2jsdesign.pjsdwebserveroptions
msgid "Web server options"
#: strpas2jsdesign.pjsdwebserverandbrowseroptions
msgid "Web server and browser options"
msgstr ""
#: strpas2jsdesign.pjsdyoucanuseidemacroslikemakeexewithoutafullpathissea

View File

@ -23,11 +23,6 @@ msgstr ""
msgid "Browse"
msgstr "Böngészés"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr "Böngésző a HTML lapok megnyitásához, makró $(Pas2JSBrowser)"
#: strpas2jsdesign.pjsdbtnselectfile
msgid "Select the file"
msgstr ""
@ -45,6 +40,10 @@ msgstr "Kezdő HTML lap létrehozása"
msgid "directory \"%s\" not found"
msgstr "a(z) \"%s\" könyvtár nem található"
#: strpas2jsdesign.pjsderror
msgid "Error"
msgstr ""
#: strpas2jsdesign.pjsdfilenamedoesnotstartwithpas2js
msgid "filename does not start with \"pas2js\""
msgstr "a fájlnév eleje nem \"pas2js\""
@ -103,6 +102,10 @@ msgstr ""
msgid "A pas2js program running as Atom package."
msgstr ""
#: strpas2jsdesign.pjsdnewprojectfile
msgid "New project file"
msgstr ""
#: strpas2jsdesign.pjsdnewvscodeextension
msgid "Visual Studio Code extension"
msgstr ""
@ -125,6 +128,14 @@ msgstr "Node.js alkalmazás"
msgid "NodeJS project options"
msgstr "NodeJS projekt beállítások"
#: strpas2jsdesign.pjsdoverwrite
msgid "Overwrite?"
msgstr ""
#: strpas2jsdesign.pjsdoverwritefiles
msgid "Overwrite files:"
msgstr ""
#: strpas2jsdesign.pjsdpas2jsbrowserprojectoptions
msgid "Pas2JS Browser project options"
msgstr "Pas2JS projekt beállítások"
@ -155,6 +166,10 @@ msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr "%s útvonala, makró $(pas2js)"
#: strpas2jsdesign.pjsdpleasechooseafilewithfullpath
msgid "Please choose a file with full path."
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
msgid "Port number to start allocating from, macro $(Pas2JSWebServerPort)"
msgstr "A portok lefoglalása e porttól kezdődik, makró $(Pas2JSWebServerPort)"
@ -175,6 +190,10 @@ msgstr "A projekt HTML lapja:"
msgid "Project is a Web Browser (pas2js) project"
msgstr "A projekt egy webböngészős (pas2js) projekt"
#: strpas2jsdesign.pjsdprojectpascalfile
msgid "Project Pascal file"
msgstr ""
#: strpas2jsdesign.pjsdresetcompilecommand
msgid "Reset Compile command"
msgstr "A fordítás parancs alaphelyzetbe állítása"
@ -247,10 +266,6 @@ msgstr "Böngészőkonzol használata a writeln() kimenet megjelenítésére"
msgid "Use NodeJS Application object"
msgstr "NodeJS alkalmazásobjektum használata"
#: strpas2jsdesign.pjsdusethisbrowserwhenopeningtheurlorhtmlfileofawebbro
msgid "Use this browser when opening the URL or HTML file of a web browser project"
msgstr "Ez a böngésző legyen használva amikor egy böngészős projekt URL-je vagy HTML lapja megnyitásra kerül"
#: strpas2jsdesign.pjsdusethisurltostartapplication
msgid "Use this URL to start application"
msgstr "Az alkalmazás indításához ezt az URL-t használja"
@ -277,8 +292,8 @@ msgstr "Webböngésző alkalmazás"
msgid "Web Project (pas2js)"
msgstr "Web projekt (pas2js)"
#: strpas2jsdesign.pjsdwebserveroptions
msgid "Web server options"
#: strpas2jsdesign.pjsdwebserverandbrowseroptions
msgid "Web server and browser options"
msgstr ""
#: strpas2jsdesign.pjsdyoucanuseidemacroslikemakeexewithoutafullpathissea

View File

@ -13,11 +13,6 @@ msgstr ""
msgid "Browse"
msgstr ""
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdbtnselectfile
msgid "Select the file"
msgstr ""
@ -35,6 +30,10 @@ msgstr ""
msgid "directory \"%s\" not found"
msgstr ""
#: strpas2jsdesign.pjsderror
msgid "Error"
msgstr ""
#: strpas2jsdesign.pjsdfilenamedoesnotstartwithpas2js
msgid "filename does not start with \"pas2js\""
msgstr ""
@ -93,6 +92,10 @@ msgstr ""
msgid "A pas2js program running as Atom package."
msgstr ""
#: strpas2jsdesign.pjsdnewprojectfile
msgid "New project file"
msgstr ""
#: strpas2jsdesign.pjsdnewvscodeextension
msgid "Visual Studio Code extension"
msgstr ""
@ -113,6 +116,14 @@ msgstr ""
msgid "NodeJS project options"
msgstr ""
#: strpas2jsdesign.pjsdoverwrite
msgid "Overwrite?"
msgstr ""
#: strpas2jsdesign.pjsdoverwritefiles
msgid "Overwrite files:"
msgstr ""
#: strpas2jsdesign.pjsdpas2jsbrowserprojectoptions
msgid "Pas2JS Browser project options"
msgstr ""
@ -143,6 +154,10 @@ msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpleasechooseafilewithfullpath
msgid "Please choose a file with full path."
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
msgid "Port number to start allocating from, macro $(Pas2JSWebServerPort)"
msgstr ""
@ -163,6 +178,10 @@ msgstr ""
msgid "Project is a Web Browser (pas2js) project"
msgstr ""
#: strpas2jsdesign.pjsdprojectpascalfile
msgid "Project Pascal file"
msgstr ""
#: strpas2jsdesign.pjsdresetcompilecommand
msgid "Reset Compile command"
msgstr ""
@ -233,10 +252,6 @@ msgstr ""
msgid "Use NodeJS Application object"
msgstr ""
#: strpas2jsdesign.pjsdusethisbrowserwhenopeningtheurlorhtmlfileofawebbro
msgid "Use this browser when opening the URL or HTML file of a web browser project"
msgstr ""
#: strpas2jsdesign.pjsdusethisurltostartapplication
msgid "Use this URL to start application"
msgstr ""
@ -261,8 +276,8 @@ msgstr ""
msgid "Web Project (pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdwebserveroptions
msgid "Web server options"
#: strpas2jsdesign.pjsdwebserverandbrowseroptions
msgid "Web server and browser options"
msgstr ""
#: strpas2jsdesign.pjsdyoucanuseidemacroslikemakeexewithoutafullpathissea

View File

@ -23,11 +23,6 @@ msgstr "Diretório de modelos de pacote do Atom"
msgid "Browse"
msgstr "Navegar"
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr "Navegador para abrir páginas HTML, macro $(Pas2JSBrowser)"
#: strpas2jsdesign.pjsdbtnselectfile
msgid "Select the file"
msgstr ""
@ -45,6 +40,10 @@ msgstr "Criar página HTML inicial"
msgid "directory \"%s\" not found"
msgstr "diretório \"%s\" não encontrado"
#: strpas2jsdesign.pjsderror
msgid "Error"
msgstr ""
#: strpas2jsdesign.pjsdfilenamedoesnotstartwithpas2js
msgid "filename does not start with \"pas2js\""
msgstr "nome de arquivo não se inicia com \"pas2js\""
@ -103,6 +102,10 @@ msgstr "Pacote Atom"
msgid "A pas2js program running as Atom package."
msgstr "Um programa pas2js executando como um pacote Atom"
#: strpas2jsdesign.pjsdnewprojectfile
msgid "New project file"
msgstr ""
#: strpas2jsdesign.pjsdnewvscodeextension
msgid "Visual Studio Code extension"
msgstr "Extensão de código do Visual Studio"
@ -125,6 +128,14 @@ msgstr "Aplicação Node.js"
msgid "NodeJS project options"
msgstr "Opções de projeto NodeJS"
#: strpas2jsdesign.pjsdoverwrite
msgid "Overwrite?"
msgstr ""
#: strpas2jsdesign.pjsdoverwritefiles
msgid "Overwrite files:"
msgstr ""
#: strpas2jsdesign.pjsdpas2jsbrowserprojectoptions
msgid "Pas2JS Browser project options"
msgstr "Navegador de opções de projeto Pas2JS"
@ -155,6 +166,10 @@ msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr "Caminho de %s, macro $(pas2js)"
#: strpas2jsdesign.pjsdpleasechooseafilewithfullpath
msgid "Please choose a file with full path."
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
msgid "Port number to start allocating from, macro $(Pas2JSWebServerPort)"
msgstr "Número de porta de onde iniciar alocação, macro $(Pas2JSWebServerPort)"
@ -175,6 +190,10 @@ msgstr "Página HTML do projeto:"
msgid "Project is a Web Browser (pas2js) project"
msgstr "Projeto é uma Navegador Web (pas2js)"
#: strpas2jsdesign.pjsdprojectpascalfile
msgid "Project Pascal file"
msgstr ""
#: strpas2jsdesign.pjsdresetcompilecommand
msgid "Reset Compile command"
msgstr "Comando redefinir compilação"
@ -246,10 +265,6 @@ msgstr "Usar a unidade \"Browser Console\" para exibir saídas \"writeln()\""
msgid "Use NodeJS Application object"
msgstr "Usar objeto \"NodeJS Application\""
#: strpas2jsdesign.pjsdusethisbrowserwhenopeningtheurlorhtmlfileofawebbro
msgid "Use this browser when opening the URL or HTML file of a web browser project"
msgstr "Usar este navegador ao abrir a URL ou arquivo HTML de um projeto de navegador web"
#: strpas2jsdesign.pjsdusethisurltostartapplication
msgid "Use this URL to start application"
msgstr "Usar esta URL para iniciar a aplicação"
@ -276,8 +291,8 @@ msgstr "Aplicação navegador web"
msgid "Web Project (pas2js)"
msgstr "Projeto Web (pas2js)"
#: strpas2jsdesign.pjsdwebserveroptions
msgid "Web server options"
#: strpas2jsdesign.pjsdwebserverandbrowseroptions
msgid "Web server and browser options"
msgstr ""
#: strpas2jsdesign.pjsdyoucanuseidemacroslikemakeexewithoutafullpathissea

View File

@ -23,11 +23,6 @@ msgstr ""
msgid "Browse"
msgstr ""
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdbtnselectfile
msgid "Select the file"
msgstr ""
@ -45,6 +40,10 @@ msgstr ""
msgid "directory \"%s\" not found"
msgstr ""
#: strpas2jsdesign.pjsderror
msgid "Error"
msgstr ""
#: strpas2jsdesign.pjsdfilenamedoesnotstartwithpas2js
msgid "filename does not start with \"pas2js\""
msgstr ""
@ -103,6 +102,10 @@ msgstr ""
msgid "A pas2js program running as Atom package."
msgstr ""
#: strpas2jsdesign.pjsdnewprojectfile
msgid "New project file"
msgstr ""
#: strpas2jsdesign.pjsdnewvscodeextension
msgid "Visual Studio Code extension"
msgstr ""
@ -125,6 +128,14 @@ msgstr "Node.js uygulaması"
msgid "NodeJS project options"
msgstr ""
#: strpas2jsdesign.pjsdoverwrite
msgid "Overwrite?"
msgstr ""
#: strpas2jsdesign.pjsdoverwritefiles
msgid "Overwrite files:"
msgstr ""
#: strpas2jsdesign.pjsdpas2jsbrowserprojectoptions
msgid "Pas2JS Browser project options"
msgstr ""
@ -155,6 +166,10 @@ msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpleasechooseafilewithfullpath
msgid "Please choose a file with full path."
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
msgid "Port number to start allocating from, macro $(Pas2JSWebServerPort)"
msgstr ""
@ -175,6 +190,10 @@ msgstr ""
msgid "Project is a Web Browser (pas2js) project"
msgstr ""
#: strpas2jsdesign.pjsdprojectpascalfile
msgid "Project Pascal file"
msgstr ""
#: strpas2jsdesign.pjsdresetcompilecommand
msgid "Reset Compile command"
msgstr ""
@ -245,10 +264,6 @@ msgstr ""
msgid "Use NodeJS Application object"
msgstr ""
#: strpas2jsdesign.pjsdusethisbrowserwhenopeningtheurlorhtmlfileofawebbro
msgid "Use this browser when opening the URL or HTML file of a web browser project"
msgstr ""
#: strpas2jsdesign.pjsdusethisurltostartapplication
msgid "Use this URL to start application"
msgstr ""
@ -275,8 +290,8 @@ msgstr "Web Tarayıcı Uygulaması"
msgid "Web Project (pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdwebserveroptions
msgid "Web server options"
#: strpas2jsdesign.pjsdwebserverandbrowseroptions
msgid "Web server and browser options"
msgstr ""
#: strpas2jsdesign.pjsdyoucanuseidemacroslikemakeexewithoutafullpathissea

View File

@ -25,11 +25,6 @@ msgstr "Тека шаблонів пакунка Atom"
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 ""
@ -47,6 +42,10 @@ msgstr "Створити початкову HTML-сторінку"
msgid "directory \"%s\" not found"
msgstr "теку \"%s\" не знайдено"
#: strpas2jsdesign.pjsderror
msgid "Error"
msgstr ""
#: strpas2jsdesign.pjsdfilenamedoesnotstartwithpas2js
msgid "filename does not start with \"pas2js\""
msgstr "назва файлу не починається з \"pas2js\""
@ -105,6 +104,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"
@ -125,6 +128,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"
@ -155,6 +166,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)"
@ -175,6 +190,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 "Скинути команду компіляції"
@ -247,10 +266,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 "Для відкривання URL або HTML-файлів проєкту веб-оглядача використовувати цей оглядач"
#: strpas2jsdesign.pjsdusethisurltostartapplication
msgid "Use this URL to start application"
msgstr "Для запуску застосунку використати цей URL"
@ -275,8 +290,8 @@ msgstr "Додаток для веб-оглядача"
msgid "Web Project (pas2js)"
msgstr "Веб-проєкт (pas2js)"
#: strpas2jsdesign.pjsdwebserveroptions
msgid "Web server options"
#: strpas2jsdesign.pjsdwebserverandbrowseroptions
msgid "Web server and browser options"
msgstr ""
#: strpas2jsdesign.pjsdyoucanuseidemacroslikemakeexewithoutafullpathissea

View File

@ -24,11 +24,6 @@ msgstr ""
msgid "Browse"
msgstr ""
#: strpas2jsdesign.pjsdbrowsertoopenhtmlpage
msgctxt "strpas2jsdesign.pjsdbrowsertoopenhtmlpage"
msgid "Browser to open HTML page, macro $(Pas2JSBrowser)"
msgstr ""
#: strpas2jsdesign.pjsdbtnselectfile
msgid "Select the file"
msgstr ""
@ -46,6 +41,10 @@ msgstr ""
msgid "directory \"%s\" not found"
msgstr ""
#: strpas2jsdesign.pjsderror
msgid "Error"
msgstr ""
#: strpas2jsdesign.pjsdfilenamedoesnotstartwithpas2js
msgid "filename does not start with \"pas2js\""
msgstr ""
@ -104,6 +103,10 @@ msgstr ""
msgid "A pas2js program running as Atom package."
msgstr ""
#: strpas2jsdesign.pjsdnewprojectfile
msgid "New project file"
msgstr ""
#: strpas2jsdesign.pjsdnewvscodeextension
msgid "Visual Studio Code extension"
msgstr ""
@ -126,6 +129,14 @@ msgstr "Node.js应用程序"
msgid "NodeJS project options"
msgstr ""
#: strpas2jsdesign.pjsdoverwrite
msgid "Overwrite?"
msgstr ""
#: strpas2jsdesign.pjsdoverwritefiles
msgid "Overwrite files:"
msgstr ""
#: strpas2jsdesign.pjsdpas2jsbrowserprojectoptions
msgid "Pas2JS Browser project options"
msgstr ""
@ -156,6 +167,10 @@ msgctxt "strpas2jsdesign.pjsdpathofxmacropas2js"
msgid "Path of %s, macro $(pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdpleasechooseafilewithfullpath
msgid "Please choose a file with full path."
msgstr ""
#: strpas2jsdesign.pjsdportnumbertostartallocatingfrom
msgid "Port number to start allocating from, macro $(Pas2JSWebServerPort)"
msgstr ""
@ -176,6 +191,10 @@ msgstr ""
msgid "Project is a Web Browser (pas2js) project"
msgstr ""
#: strpas2jsdesign.pjsdprojectpascalfile
msgid "Project Pascal file"
msgstr ""
#: strpas2jsdesign.pjsdresetcompilecommand
msgid "Reset Compile command"
msgstr ""
@ -246,10 +265,6 @@ msgstr ""
msgid "Use NodeJS Application object"
msgstr ""
#: strpas2jsdesign.pjsdusethisbrowserwhenopeningtheurlorhtmlfileofawebbro
msgid "Use this browser when opening the URL or HTML file of a web browser project"
msgstr ""
#: strpas2jsdesign.pjsdusethisurltostartapplication
msgid "Use this URL to start application"
msgstr ""
@ -276,8 +291,8 @@ msgstr "网页浏览器(Web Browser)应用程序"
msgid "Web Project (pas2js)"
msgstr ""
#: strpas2jsdesign.pjsdwebserveroptions
msgid "Web server options"
#: strpas2jsdesign.pjsdwebserverandbrowseroptions
msgid "Web server and browser options"
msgstr ""
#: strpas2jsdesign.pjsdyoucanuseidemacroslikemakeexewithoutafullpathissea

View File

@ -85,58 +85,13 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
Caption = 'Standard server port'
ParentColor = False
end
object BrowserComboBox: TComboBox
AnchorSideLeft.Control = BrowserLabel
AnchorSideTop.Control = BrowserLabel
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = BBrowserBrowseButton
Left = 6
Height = 30
Top = 150
Width = 470
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 2
ItemHeight = 0
TabOrder = 3
Text = 'BrowserComboBox'
end
object BrowserLabel: TLabel
object NodeJSLabel: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ServerPortSpinEdit
AnchorSideTop.Side = asrBottom
Left = 6
Height = 15
Top = 133
Width = 258
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Browser to launch when opening project HTML'
ParentColor = False
end
object BBrowserBrowseButton: TButton
AnchorSideTop.Control = BrowserComboBox
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = BrowserComboBox
AnchorSideBottom.Side = asrBottom
Left = 476
Height = 30
Top = 150
Width = 25
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 6
Caption = '...'
OnClick = BBrowserBrowseButtonClick
TabOrder = 4
end
object NodeJSLabel: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = BrowserComboBox
AnchorSideTop.Side = asrBottom
Left = 6
Height = 15
Top = 186
Width = 105
BorderSpacing.Left = 6
BorderSpacing.Top = 6
@ -150,12 +105,12 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideRight.Control = NodeJSBrowseButton
Left = 6
Height = 30
Top = 203
Top = 150
Width = 470
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 2
ItemHeight = 0
TabOrder = 5
TabOrder = 3
Text = 'NodeJSComboBox'
end
object NodeJSBrowseButton: TButton
@ -166,14 +121,14 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideBottom.Side = asrBottom
Left = 476
Height = 30
Top = 203
Top = 150
Width = 25
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 6
Caption = '...'
OnClick = NodeJSBrowseButtonClick
TabOrder = 6
TabOrder = 4
end
object lblAtomTemplateDir: TLabel
AnchorSideLeft.Control = Owner
@ -181,7 +136,7 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Side = asrBottom
Left = 6
Height = 15
Top = 239
Top = 186
Width = 185
BorderSpacing.Left = 6
BorderSpacing.Top = 6
@ -195,12 +150,12 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideRight.Control = NodeJSBrowseButton
Left = 6
Height = 30
Top = 256
Top = 203
Width = 470
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 2
ItemHeight = 0
TabOrder = 7
TabOrder = 5
Text = 'AtomTemplateDirComboBox'
end
object AtomTemplateDirBrowseButton: TButton
@ -211,14 +166,14 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideBottom.Side = asrBottom
Left = 476
Height = 30
Top = 256
Top = 203
Width = 25
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 6
Caption = '...'
OnClick = AtomTemplateDirBrowseButtonClick
TabOrder = 8
TabOrder = 6
end
object lblVSCodeTemplateDir: TLabel
AnchorSideLeft.Control = Owner
@ -226,7 +181,7 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideTop.Side = asrBottom
Left = 6
Height = 15
Top = 292
Top = 239
Width = 209
BorderSpacing.Left = 6
BorderSpacing.Top = 6
@ -240,12 +195,12 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideRight.Control = NodeJSBrowseButton
Left = 6
Height = 30
Top = 309
Top = 256
Width = 470
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 2
ItemHeight = 0
TabOrder = 9
TabOrder = 7
Text = 'VSCodeTemplateDirComboBox'
end
object VSCodeTemplateDirBrowseButton: TButton
@ -256,14 +211,14 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
AnchorSideBottom.Side = asrBottom
Left = 476
Height = 30
Top = 309
Top = 256
Width = 25
Anchors = [akTop, akRight, akBottom]
AutoSize = True
BorderSpacing.Right = 6
Caption = '...'
OnClick = VSCodeTemplateDirBrowseButtonClick
TabOrder = 10
TabOrder = 8
end
object SimpleWebServerLinkLabel: TLabel
AnchorSideLeft.Control = Owner
@ -273,10 +228,10 @@ object Pas2jsOptionsFrame: TPas2jsOptionsFrame
Left = 6
Height = 15
Top = 59
Width = 107
Width = 178
BorderSpacing.Left = 6
BorderSpacing.Top = 6
Caption = 'Web server options'
Caption = 'Web server and browser options'
Font.Color = clBlue
ParentColor = False
ParentFont = False

View File

@ -27,9 +27,6 @@ Type
SimpleWebServerLinkLabel: TLabel;
VSCodeTemplateDirBrowseButton: TButton;
VSCodeTemplateDirComboBox: TComboBox;
BBrowserBrowseButton: TButton;
BrowserComboBox: TComboBox;
BrowserLabel: TLabel;
lblVSCodeTemplateDir: TLabel;
NodeJSBrowseButton: TButton;
AtomTemplateDirBrowseButton: TButton;
@ -155,7 +152,6 @@ begin
OpenDialog.Title:=pjsdSelectBrowserExecutable;
if OpenDialog.Execute then begin
AFilename:=CleanAndExpandFilename(OpenDialog.Filename);
SetComboBoxText(BrowserComboBox,AFilename,cstFilename,30);
PJSOptions.BrowserFileName:=AFileName;
end;
finally
@ -210,13 +206,10 @@ begin
pjsdYouCanUseIDEMacrosLikeMakeExeWithoutAFullPathIsSea, [DefPas2jsExe]);
Pas2jsPathBrowseButton.Hint:=pjsdBrowse;
SimpleWebServerLinkLabel.Caption:=pjsdWebServerOptions;
SimpleWebServerLinkLabel.Caption:=pjsdWebServerAndBrowserOptions;
ServerPortLabel.Caption:=pjsdPortNumberToStartAllocatingFrom;
ServerPortLabel.Hint:=pjsdServerInstancesWillBeStartedWithAPortStartingFromT;
BrowserLabel.Caption:=pjsdBrowserToOpenHTMLPage;
BrowserLabel.Hint:=pjsdUseThisBrowserWhenOpeningTheURLOrHTMLFileOfAWebBro;
NodeJSLabel.Caption:=pjsdPathOfNodeJsExecutable;
lblAtomTemplateDir.Caption := pjsdAtomPackageTemplateDirectory;
@ -227,7 +220,6 @@ procedure TPas2jsOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
begin
SetComboBoxText(Pas2jsPathComboBox,PJSOptions.CompilerFilename,cstFilename,30);
ServerPortSpinEdit.Value:=PJSOptions.StartAtPort;
SetComboBoxText(BrowserComboBox,PJSOptions.BrowserFileName,cstFilename,30);
SetComboBoxText(NodeJSComboBox,PJSOptions.NodejsFileName,cstFilename,30);
SetComboBoxText(AtomTemplateDirComboBox,PJSOptions.AtomTemplateDir,cstFilename,30);
SetComboBoxText(VSCodeTemplateDirComboBox,PJSOptions.VSCodeTemplateDir,cstFilename,30);
@ -237,7 +229,6 @@ procedure TPas2jsOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
begin
PJSOptions.CompilerFilename:=Pas2jsPathComboBox.Text;
PJSOptions.StartAtPort:=ServerPortSpinEdit.Value;
PJSOptions.BrowserFileName:=BrowserComboBox.Text;
PJSOptions.NodeJSFileName:=NodeJSComboBox.Text;
PJSOptions.AtomTemplateDir:=AtomTemplateDirComboBox.Text;
PJSOptions.VSCodeTemplateDir:=VSCodeTemplateDirComboBox.Text;

View File

@ -105,23 +105,46 @@ type
function CreateStartFiles(AProject: TLazProject): TModalResult; override;
end;
{ TMultiProjectPas2JSWebApp }
TMultiProjectPas2JSWebApp = class(TProjectPas2JSWebApp)
private
FOverwrites: TStrings;
FProjectDir: string;
FWebDir: string;
procedure SetOverwrites(const AValue: TStrings);
protected
function CheckOverwriteFile(aFilename: string): string;
function CheckOverwriteDir(aDir: string): string;
function FileToWebFile(aFilename: string): string; virtual;
function InteractiveForceDir(Dir: string; AutoDelete: boolean): boolean; virtual;
function InteractiveSaveFile(aFilename: string): boolean; virtual;
function InteractiveCopyFile(Src, Dest: string): boolean; virtual;
function ShowModalOptions(Frm: TWebBrowserProjectOptionsForm
): TModalResult; override;
function ProjectDirSelected: boolean; virtual;
public
constructor Create; override;
destructor Destroy; override;
procedure Clear; override;
property ProjectDir: string read FProjectDir write FProjectDir;
property WebDir: string read FWebDir write FWebDir;
property Overwrites: TStrings read FOverwrites write SetOverwrites; // list of overwrite warnings
end;
{ TProjectPas2JSProgressiveWebApp }
TProjectPas2JSProgressiveWebApp = class(TProjectPas2JSWebApp)
TProjectPas2JSProgressiveWebApp = class(TMultiProjectPas2JSWebApp)
private
FCSSStyleFilename: string;
FIconSizes: TWordDynArray;
FImagesDir: string;
FManifestFilename: string;
FProjectDir: string;
FServiceWorker: TProjectPas2JSServiceWorker;
FServiceWorkerLPR: string;
FWebDir: string;
protected
function FileToWebFile(aFilename: string): string; virtual;
procedure AddHTMLHead(Src: TStringList); override;
function ShowModalOptions(Frm: TWebBrowserProjectOptionsForm
): TModalResult; override;
function ProjectDirSelected: boolean; override;
function CreateManifestFile(AProject: TLazProject; AFileName: String
): TLazProjectFile; virtual;
function CreateCSSStyle(AProject: TLazProject; AFileName: String
@ -129,9 +152,27 @@ type
function CreateProjectGroup(AProject: TLazProject): boolean; virtual;
function CopyFavIcon: boolean; virtual;
function CopyIcons: boolean; virtual;
function InteractiveForceDir(Dir: string; AutoDelete: boolean): boolean; virtual;
function InteractiveSaveFile(aFilename: string): boolean; virtual;
function InteractiveCopyFile(Src, Dest: string): boolean; virtual;
public
constructor Create; override;
destructor Destroy; override;
procedure Clear; override;
function GetLocalizedName: string; override;
function GetLocalizedDescription: string; override;
function InitProject(AProject: TLazProject): TModalResult; override;
function CreateStartFiles(AProject: TLazProject): TModalResult; override;
property ServiceWorkerLPR: string read FServiceWorkerLPR write FServiceWorkerLPR;
property CSSStyleFilename: string read FCSSStyleFilename write FCSSStyleFilename;
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;
end;
{ TProjectPas2JSElectronWebApp }
TProjectPas2JSElectronWebApp = class(TMultiProjectPas2JSWebApp)
private
protected
public
constructor Create; override;
procedure Clear; override;
@ -139,14 +180,6 @@ type
function GetLocalizedDescription: string; override;
function InitProject(AProject: TLazProject): TModalResult; override;
function CreateStartFiles(AProject: TLazProject): TModalResult; override;
property ProjectDir: string read FProjectDir write FProjectDir;
property ServiceWorkerLPR: string read FServiceWorkerLPR write FServiceWorkerLPR;
property CSSStyleFilename: string read FCSSStyleFilename write FCSSStyleFilename;
property ImagesDir: string read FImagesDir write FImagesDir;
property WebDir: string read FWebDir write FWebDir;
property ManifestFilename: string read FManifestFilename write FManifestFilename;
property IconSizes: TWordDynArray read FIconSizes write FIconSizes;
property ServiceWorker: TProjectPas2JSServiceWorker read FServiceWorker write FServiceWorker;
end;
{ TProjectPas2JSNodeJSApp }
@ -272,6 +305,7 @@ begin
SrvWorker:=TProjectPas2JSServiceWorker.Create;
RegisterProjectDescriptor(SrvWorker);
PWA.ServiceWorker:=SrvWorker;
RegisterProjectDescriptor(TProjectPas2JSElectronWebApp.Create);
RegisterProjectDescriptor(TProjectPas2JSNodeJSApp.Create);
RegisterProjectDescriptor(TProjectPas2JSModuleApp.Create);
Pas2JSHTMLClassDef:=TPas2JSHTMLClassDef.Create;
@ -297,15 +331,225 @@ begin
ProjectInspectorItemsMenuRoot.AddHandlerOnShow(@Pas2JSHandler.OnPrjInspPopup);
end;
{ TProjectPas2JSProgressiveWebApp }
{ TProjectPas2JSElectronWebApp }
function TProjectPas2JSProgressiveWebApp.FileToWebFile(aFilename: string
constructor TProjectPas2JSElectronWebApp.Create;
begin
inherited Create;
end;
procedure TProjectPas2JSElectronWebApp.Clear;
begin
inherited Clear;
end;
function TProjectPas2JSElectronWebApp.GetLocalizedName: string;
begin
Result:=inherited GetLocalizedName;
end;
function TProjectPas2JSElectronWebApp.GetLocalizedDescription: string;
begin
Result:=inherited GetLocalizedDescription;
end;
function TProjectPas2JSElectronWebApp.InitProject(AProject: TLazProject
): TModalResult;
begin
Result:=inherited InitProject(AProject);
end;
function TProjectPas2JSElectronWebApp.CreateStartFiles(AProject: TLazProject
): TModalResult;
begin
Result:=inherited CreateStartFiles(AProject);
end;
{ TMultiProjectPas2JSWebApp }
procedure TMultiProjectPas2JSWebApp.SetOverwrites(const AValue: TStrings);
begin
if FOverwrites=AValue then Exit;
FOverwrites.Assign(AValue);
end;
function TMultiProjectPas2JSWebApp.CheckOverwriteFile(aFilename: string
): string;
begin
if FileExists(aFilename) then
Overwrites.Add(aFilename);
Result:=aFilename;
end;
function TMultiProjectPas2JSWebApp.CheckOverwriteDir(aDir: string): string;
begin
aDir:=ChompPathDelim(aDir);
if FileExists(aDir) and not DirectoryExistsUTF8(aDir) then
Overwrites.Add(aDir);
Result:=AppendPathDelim(aDir);
end;
function TMultiProjectPas2JSWebApp.FileToWebFile(aFilename: string): string;
begin
Result:=CreateRelativePath(aFilename,WebDir);
Result:=FilenameToURLPath(Result);
end;
function TMultiProjectPas2JSWebApp.InteractiveForceDir(Dir: string;
AutoDelete: boolean): boolean;
begin
Dir:=ChompPathDelim(Dir);
if DirectoryExistsUTF8(Dir) then
exit(true);
Result:=false;
if FileExists(Dir) then
begin
if AutoDelete then
begin
debugln(['Info: [TMultiProjectPas2JSWebApp.InteractiveForceDir] DeleteFile "',Dir,'"']);
if not DeleteFileUTF8(Dir) then
begin
IDEMessageDialog('Error','Unable to create directory "'+Dir+'", because unable to delete file.',mtError,[mbOK]);
exit;
end;
end
else
begin
IDEMessageDialog('Error','Unable to create directory "'+Dir+'", because file already exists.',mtError,[mbOK]);
exit;
end;
end;
debugln(['Info: [TMultiProjectPas2JSWebApp.InteractiveForceDir] ForceDirectories "',Dir,'"']);
if not ForceDirectoriesUTF8(Dir) then
begin
IDEMessageDialog('Error','Unable to create directory "'+Dir+'".',mtError,[mbOK]);
exit;
end;
Result:=true;
end;
function TMultiProjectPas2JSWebApp.InteractiveSaveFile(aFilename: string
): boolean;
var
Code: TCodeBuffer;
begin
Result:=false;
Code:=CodeToolBoss.FindFile(aFilename);
if Code=nil then
begin
debugln(['Error: [TMultiProjectPas2JSWebApp.SaveFile] 20220404130903 "',aFilename,'"']);
IDEMessageDialog('Error','File missing in codetools: "'+aFilename+'"',mtError,[mbOk]);
exit;
end;
debugln(['Info: [TMultiProjectPas2JSWebApp.InteractiveSaveFile] saving "',Code.Filename,'"']);
if not Code.Save then
begin
IDEMessageDialog('Error','Unable to write file "'+aFilename+'"',mtError,[mbOk]);
exit;
end;
Result:=true;
end;
function TMultiProjectPas2JSWebApp.InteractiveCopyFile(Src, Dest: string
): boolean;
begin
debugln(['Info: [TMultiProjectPas2JSWebApp.InteractiveCopyFile] CopyFile "',Src,'" -> "',Dest,'"']);
if CopyFile(Src,Dest) then
exit(true);
IDEMessageDialog('Error','Unable to copy file'+sLineBreak
+Src+sLineBreak
+'to'+sLineBreak
+Dest,mtError,[mbOk]);
Result:=false;
end;
function TMultiProjectPas2JSWebApp.ShowModalOptions(
Frm: TWebBrowserProjectOptionsForm): TModalResult;
var
CurProjDir: String;
SaveDlg: TIDESaveDialog;
begin
// hide unsupported options
Frm.HideWASM;
Frm.HideModule;
Result:=inherited ShowModalOptions(Frm);
if Result<>mrOk then exit;
SaveDlg:=IDESaveDialogClass.Create(nil);
try
InitIDEFileDialog(SaveDlg);
SaveDlg.Title:=pjsdNewProjectFile+' (.lpr)';
SaveDlg.Filter:=pjsdProjectPascalFile+' (*.lpr;*.pas)|*.lpr;*.pas';
if not SaveDlg.Execute then
exit(mrCancel);
MainSrcFileName:=SaveDlg.FileName;
if not FilenameIsAbsolute(MainSrcFileName) then
begin
IDEMessageDialog(pjsdError, pjsdPleaseChooseAFileWithFullPath,
mtError, [mbOk]);
exit(mrCancel);
end;
MainSrcFileName:=CleanAndExpandFilename(MainSrcFileName);
if CompareFileExt(MainSrcFileName,'.lpi')=0 then
MainSrcFileName:=ChangeFileExt(MainSrcFileName,'.lpr');
if ExtractFileExt(MainSrcFileName)='' then
MainSrcFileName:=MainSrcFileName+'.lpr';
if CompareFilenames(ExtractFileNameOnly(MainSrcFileName),MainSrcName)<>0 then
MainSrcName:=ExtractFileNameOnly(MainSrcFileName);
CurProjDir:=ExtractFilePath(MainSrcFileName);
if CurProjDir='' then exit(mrCancel);
CurProjDir:=AppendPathDelim(CurProjDir);
ProjectDir:=CurProjDir;
CheckOverwriteFile(MainSrcFileName);
CheckOverwriteFile(ChangeFileExt(MainSrcFileName,'.lpi'));
ProjectDirSelected;
if Overwrites.Count>0 then
begin
if IDEMessageDialog(pjsdOverwrite, pjsdOverwriteFiles+sLineBreak+
Overwrites.Text,
mtConfirmation,[mbOk,mbCancel])<>mrOk then
exit(mrCancel);
end;
finally
SaveDlg.Free;
end;
end;
function TMultiProjectPas2JSWebApp.ProjectDirSelected: boolean;
begin
Result:=true;
end;
constructor TMultiProjectPas2JSWebApp.Create;
begin
inherited Create;
FOverwrites:=TStringList.Create;
end;
destructor TMultiProjectPas2JSWebApp.Destroy;
begin
FreeAndNil(FOverwrites);
inherited Destroy;
end;
procedure TMultiProjectPas2JSWebApp.Clear;
begin
inherited Clear;
FProjectDir:='';
FWebDir:='';
FOverwrites.Clear;
end;
{ TProjectPas2JSProgressiveWebApp }
procedure TProjectPas2JSProgressiveWebApp.AddHTMLHead(Src: TStringList);
var
i: Integer;
@ -324,91 +568,20 @@ begin
end;
end;
function TProjectPas2JSProgressiveWebApp.ShowModalOptions(
Frm: TWebBrowserProjectOptionsForm): TModalResult;
var
CurProjDir: String;
Overwrites: TStringList;
SaveDlg: TIDESaveDialog;
function CheckOverwriteFile(aFilename: string): string;
begin
if FileExists(aFilename) then
Overwrites.Add(aFilename);
Result:=aFilename;
end;
function CheckOverwriteDir(aDir: string): string;
begin
aDir:=ChompPathDelim(aDir);
if FileExists(aDir) and not DirectoryExistsUTF8(aDir) then
Overwrites.Add(aDir);
Result:=AppendPathDelim(aDir);
end;
function TProjectPas2JSProgressiveWebApp.ProjectDirSelected: boolean;
begin
// hide unsupported options
Frm.HideWASM;
Frm.HideModule;
Result:=true;
ScriptFilename:=ExtractFileNameOnly(MainSrcFileName)+'.js';
Result:=inherited ShowModalOptions(Frm);
if Result<>mrOk then exit;
ServiceWorkerLPR:=CheckOverwriteFile(ProjectDir+ServiceWorkerLPR);
CheckOverwriteFile(ChangeFileExt(ServiceWorkerLPR,'.lpi'));
SaveDlg:=IDESaveDialogClass.Create(nil);
Overwrites:=TStringList.Create;
try
InitIDEFileDialog(SaveDlg);
SaveDlg.Title:='New project file (.lpr)';
SaveDlg.Filter:='Project Pascal file (*.lpr;*.pas)|*.lpr;*.pas';
WebDir:=CheckOverwriteDir(ProjectDir+WebDir);
ImagesDir:=CheckOverwriteDir(WebDir+ImagesDir);
if not SaveDlg.Execute then
exit(mrCancel);
MainSrcFileName:=SaveDlg.FileName;
if not FilenameIsAbsolute(MainSrcFileName) then
begin
IDEMessageDialog('Error','Please choose a file with full path.',mtError,[mbOk]);
exit(mrCancel);
end;
MainSrcFileName:=CleanAndExpandFilename(MainSrcFileName);
if CompareFileExt(MainSrcFileName,'.lpi')=0 then
MainSrcFileName:=ChangeFileExt(MainSrcFileName,'.lpr');
if ExtractFileExt(MainSrcFileName)='' then
MainSrcFileName:=MainSrcFileName+'.lpr';
CurProjDir:=ExtractFilePath(MainSrcFileName);
if CurProjDir='' then exit(mrCancel);
CurProjDir:=AppendPathDelim(CurProjDir);
ProjectDir:=CurProjDir;
CheckOverwriteFile(MainSrcFileName);
CheckOverwriteFile(ChangeFileExt(MainSrcFileName,'.lpi'));
ScriptFilename:=ExtractFileNameOnly(MainSrcFileName)+'.js';
ServiceWorkerLPR:=CheckOverwriteFile(ProjectDir+ServiceWorkerLPR);
CheckOverwriteFile(ChangeFileExt(ServiceWorkerLPR,'.lpi'));
WebDir:=CheckOverwriteDir(CurProjDir+WebDir);
ImagesDir:=CheckOverwriteDir(WebDir+ImagesDir);
HTMLFilename:=CheckOverwriteFile(WebDir+HTMLFilename);
ManifestFilename:=CheckOverwriteFile(WebDir+ManifestFilename);
CSSStyleFilename:=CheckOverwriteFile(WebDir+CSSStyleFilename);
if Overwrites.Count>0 then
begin
if IDEMessageDialog('Overwrite?','Overwrite files:'+sLineBreak+Overwrites.Text,
mtConfirmation,[mbOk,mbCancel])<>mrOk then
exit(mrCancel);
end;
finally
SaveDlg.Free;
Overwrites.Free;
end;
if CompareFilenames(ExtractFileNameOnly(MainSrcFileName),MainSrcName)<>0 then
MainSrcName:=ExtractFileNameOnly(MainSrcFileName);
HTMLFilename:=CheckOverwriteFile(WebDir+HTMLFilename);
ManifestFilename:=CheckOverwriteFile(WebDir+ManifestFilename);
CSSStyleFilename:=CheckOverwriteFile(WebDir+CSSStyleFilename);
end;
function TProjectPas2JSProgressiveWebApp.CreateManifestFile(
@ -518,73 +691,6 @@ begin
Result:=true;
end;
function TProjectPas2JSProgressiveWebApp.InteractiveForceDir(Dir: string;
AutoDelete: boolean): boolean;
begin
Dir:=ChompPathDelim(Dir);
if DirectoryExistsUTF8(Dir) then
exit(true);
Result:=false;
if FileExists(Dir) then
begin
if AutoDelete then
begin
debugln(['Info: [TProjectPas2JSProgressiveWebApp.InteractiveForceDir] DeleteFile "',Dir,'"']);
if not DeleteFileUTF8(Dir) then
begin
IDEMessageDialog('Error','Unable to create directory "'+Dir+'", because unable to delete file.',mtError,[mbOK]);
exit;
end;
end
else
begin
IDEMessageDialog('Error','Unable to create directory "'+Dir+'", because file already exists.',mtError,[mbOK]);
exit;
end;
end;
debugln(['Info: [TProjectPas2JSProgressiveWebApp.InteractiveForceDir] ForceDirectories "',Dir,'"']);
if not ForceDirectoriesUTF8(Dir) then
begin
IDEMessageDialog('Error','Unable to create directory "'+Dir+'".',mtError,[mbOK]);
exit;
end;
Result:=true;
end;
function TProjectPas2JSProgressiveWebApp.InteractiveSaveFile(aFilename: string): boolean;
var
Code: TCodeBuffer;
begin
Result:=false;
Code:=CodeToolBoss.FindFile(aFilename);
if Code=nil then
begin
debugln(['Error: [TProjectPas2JSProgressiveWebApp.SaveFile] 20220404130903 "',aFilename,'"']);
IDEMessageDialog('Error','File missing in codetools: "'+aFilename+'"',mtError,[mbOk]);
exit;
end;
debugln(['Info: [TProjectPas2JSProgressiveWebApp.InteractiveSaveFile] saving "',Code.Filename,'"']);
if not Code.Save then
begin
IDEMessageDialog('Error','Unable to write file "'+aFilename+'"',mtError,[mbOk]);
exit;
end;
Result:=true;
end;
function TProjectPas2JSProgressiveWebApp.InteractiveCopyFile(Src, Dest: string
): boolean;
begin
debugln(['Info: [TProjectPas2JSProgressiveWebApp.InteractiveCopyFile] CopyFile "',Src,'" -> "',Dest,'"']);
if CopyFile(Src,Dest) then
exit(true);
IDEMessageDialog('Error','Unable to copy file'+sLineBreak
+Src+sLineBreak
+'to'+sLineBreak
+Dest,mtError,[mbOk]);
Result:=false;
end;
function TProjectPas2JSProgressiveWebApp.CreateProjectGroup(
AProject: TLazProject): boolean;
var
@ -619,7 +725,12 @@ constructor TProjectPas2JSProgressiveWebApp.Create;
begin
inherited Create;
Name:=ProjDescNamePas2JSProgressiveWebApp;
Clear;
end;
destructor TProjectPas2JSProgressiveWebApp.Destroy;
begin
FreeAndNil(FServiceWorker);
inherited Destroy;
end;
procedure TProjectPas2JSProgressiveWebApp.Clear;
@ -635,9 +746,12 @@ 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];
FOverwrites.Clear;
end;
function TProjectPas2JSProgressiveWebApp.GetLocalizedName: string;
@ -1370,13 +1484,14 @@ constructor TProjectPas2JSWebApp.Create;
begin
inherited Create;
Name:=ProjDescNamePas2JSWebApp;
Flags:=DefaultProjectNoApplicationFlags-[pfRunnable];
FMainSrcName:='Project1';
Clear;
end;
procedure TProjectPas2JSWebApp.Clear;
begin
// Reset options
Flags:=DefaultProjectNoApplicationFlags-[pfRunnable];
FMainSrcName:='Project1';
FOptions:=[baoCreateHtml,baoMaintainHTML,baoStartServer];
ProjectPort:=0;
ProjectURL:='';

View File

@ -11,6 +11,12 @@ Resourcestring
pjsdWebApplication = 'Web Browser Application';
pjsdWebAppDescription = 'A pas2js program running in the browser.';
pjsdProgressiveWebApplication = 'Progressive Web Application';
pjsdOverwrite = 'Overwrite?';
pjsdError = 'Error';
pjsdNewProjectFile = 'New project file';
pjsdProjectPascalFile = 'Project Pascal file';
pjsdPleaseChooseAFileWithFullPath = 'Please choose a file with full path.';
pjsdOverwriteFiles = 'Overwrite files:';
pjsdProgressiveWebAppDescription = 'A Web Application using a service worker, a manifest, and more to be installable.';
pjsdServiceWorker = 'Pas2JS Service Worker';
pjsdServiceWorkerDescription = 'A pas2js program running as cache for a web app. It does not run standalone.';
@ -34,15 +40,12 @@ Resourcestring
+'macros like $MakeExe(). Without a full path, %s is searched in PATH.';
pjsdPathOfXMacroPas2js = 'Path of %s, macro $(pas2js)';
pjsdBrowse = 'Browse';
pjsdWebServerAndBrowserOptions = 'Web server and browser options';
pjsdPortNumberToStartAllocatingFrom = 'Port number to start allocating '
+'from, macro $(Pas2JSWebServerPort)';
pjsdWebServerOptions = 'Web server options';
pjsdServerInstancesWillBeStartedWithAPortStartingFromT = 'Server instances '
+'will be started with a port starting from this number, increasing per '
+'new project';
pjsdBrowserToOpenHTMLPage = 'Browser to open HTML page, macro $(Pas2JSBrowser)';
pjsdUseThisBrowserWhenOpeningTheURLOrHTMLFileOfAWebBro = 'Use this browser '
+'when opening the URL or HTML file of a web browser project';
pjsdPathOfNodeJsExecutable = 'Path of Node.js executable, macro $(Pas2JSNodeJS)';
pjsdAtomPackageTemplateDirectory = 'Atom package template directory';
pjsdVisualStudioCodeExtensionTemplateDirectory = 'Visual Studio Code '