8
8
9
9
< body style ="height:3000px ">
10
10
11
- < h2 > Click the button below </ h2 >
11
+ < h2 > Кликните на кнопку ниже </ h2 >
12
12
13
- < input type ="button " value ="Click to show the form " id ="show-button ">
13
+ < input type ="button " value ="Кликните, чтобы увидеть форму " id ="show-button ">
14
14
15
15
16
16
< div id ="prompt-form-container ">
17
17
< form id ="prompt-form ">
18
18
< div id ="prompt-message "> </ div >
19
19
< input name ="text " type ="text ">
20
20
< input type ="submit " value ="Ok ">
21
- < input type ="button " name ="cancel " value ="Cancel ">
21
+ < input type ="button " name ="cancel " value ="Отмена ">
22
22
</ form >
23
23
</ div >
24
24
25
25
< script >
26
- // Show a half-transparent DIV to "shadow" the page
27
- // (the form is not inside, but near it, because it shouldn't be half-transparent )
26
+ // Показать полупрозрачный DIV, чтобы затенить страницу
27
+ // (форма располагается не внутри него, а рядом, потому что она не должна быть полупрозрачной )
28
28
function showCover ( ) {
29
29
let coverDiv = document . createElement ( 'div' ) ;
30
30
coverDiv . id = 'cover-div' ;
31
31
32
- // make the page unscrollable while the modal form is open
32
+ // убираем возможность прокрутки страницы во время показа модального окна с формой
33
33
document . body . style . overflowY = 'hidden' ;
34
34
35
35
document . body . append ( coverDiv ) ;
@@ -56,7 +56,7 @@ <h2>Click the button below</h2>
56
56
57
57
form . onsubmit = function ( ) {
58
58
let value = form . text . value ;
59
- if ( value == '' ) return false ; // ignore empty submit
59
+ if ( value == '' ) return false ; // игнорируем отправку пустой формы
60
60
61
61
complete ( value ) ;
62
62
return false ;
@@ -94,8 +94,8 @@ <h2>Click the button below</h2>
94
94
}
95
95
96
96
document . getElementById ( 'show-button' ) . onclick = function ( ) {
97
- showPrompt ( "Enter something <br>...smart :)" , function ( value ) {
98
- alert ( "You entered : " + value ) ;
97
+ showPrompt ( "Введите что-нибудь <br>...умное :)" , function ( value ) {
98
+ alert ( "Вы ввели : " + value ) ;
99
99
} ) ;
100
100
} ;
101
101
</ script >
0 commit comments