Skip to content

Commit

Permalink
Adding js-app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Mar 3, 2024
1 parent 715e92a commit 0fac2d4
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 15 deletions.
39 changes: 39 additions & 0 deletions js.drafts/js-app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

class Frames {
constructor(control){
this.control = control;
this.wizard = Luwrain.createWizardArea({
input: (event)=>this.onInput(event, control)
});
this.greeting().show();
this.control.setLayout(this.wizard);
}

greeting(){
return this.wizard.createFrame()
.addText("Создадим скрипт вашего первого приложения для LUWRAIN! Мастер, в котором вы сейчас находитесь, задаст несколько вопросов и составит его начальный текст. Используйте клавиши со стрелками для навигации и обращайте внимание на звуки. Элементы, которые являются кнопками, выделяются особым звуковым сигналом.")
.addInput("Имя приложения:", "Моё первое приложение")
.addClickable("Продолжить", ()=>{
this.appType().show();
});
}

appType(){
return this.wizard.createFrame()
.addText("Сейчас необходимо выбрать тип вашего приложения.")
.addClickable("Продолжить", ()=>{
Luwrain.message("хаха");
});
}

onInput(event, control){
if (event.code == "ESCAPE"){
control.close();
return true;
}
return false;
}
}

Luwrain.launchApp(Frames);

15 changes: 5 additions & 10 deletions js/core-announcements.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019-2022 Michael Pozhidaev <[email protected]>
Copyright 2019-2024 Michael Pozhidaev <[email protected]>
This file is part of LUWRAIN.
Expand All @@ -14,13 +14,8 @@
General Public License for more details.
*/

Luwrain.addHook("luwrain.announcement", (text, announcementClass, announcementSubclass)=>{
/*
var listening = '' + Luwrain.prop.luwrain.area.listening + '';
if (listening === 'true')
return;
if (text.match("RT @[a-zA-Z0-9_]+: .*"))
text = text.substring(text.indexOf(":") + 1);
*/
Luwrain.message(text);
Luwrain.addHook("luwrain.announcement", (args)=>{
if (args.component == "vk")
return true;
Luwrain.message(args.text);
});
2 changes: 1 addition & 1 deletion js/i18n-ru-desktop.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019-2022 Michael Pozhidaev <[email protected]>
Copyright 2019-2024 Michael Pozhidaev <[email protected]>
This file is part of LUWRAIN.
Expand Down
2 changes: 1 addition & 1 deletion js/i18n-ru-text.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019-2022 Michael Pozhidaev <[email protected]>
Copyright 2019-2024 Michael Pozhidaev <[email protected]>
This file is part of LUWRAIN.
Expand Down
4 changes: 2 additions & 2 deletions js/i18n-ru.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019-2022 Michael Pozhidaev <[email protected]>
Copyright 2019-2024 Michael Pozhidaev <[email protected]>
This file is part of LUWRAIN.
Expand All @@ -14,7 +14,7 @@
General Public License for more details.
*/

Luwrain.addHook("luwrain.i18n.ru.speech.natural.pre", function(text){
Luwrain.addHook("luwrain.i18n.ru.speech.natural.pre", (text)=>{
var res = "";
for(var i = 0;i < text.length;i++)
{
Expand Down
2 changes: 1 addition & 1 deletion js/ru-programming.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019-2022 Michael Pozhidaev <[email protected]>
Copyright 2019-2024 Michael Pozhidaev <[email protected]>
This file is part of LUWRAIN.
Expand Down

0 comments on commit 0fac2d4

Please sign in to comment.