Toggle navigation
Toggle navigation
This project
Loading...
Sign in
민병수
/
Voicoding
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
천현우
2021-06-08 00:00:58 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
14a6ce7586a3ecc760c8c712d32f0bcd61ac1401
14a6ce75
1 parent
8452b897
TTP: update TTP functions, insert/delete tab
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
Manual.txt
Voicoding_web/js/ide.js
voicoding.js
Manual.txt
View file @
14a6ce7
'기본 함수 사용',
'인풋', -> input()
'스플릿', -> .split()
'프린트', -> print(
'섬', -> sum(
'맥스', -> max(
...
...
Voicoding_web/js/ide.js
View file @
14a6ce7
...
...
@@ -1368,15 +1368,23 @@ function transcribeText() {
}
let
input_line
=
""
function
uploadSoundData
(
blob
)
{
let
tab
=
''
;
let
before_val
=
''
;
let
chk
=
1
;
let
tmp
=
[];
async
function
uploadSoundData
(
blob
)
{
let
filename
=
new
Date
().
toISOString
();
let
xhr
=
new
XMLHttpRequest
();
let
formData
=
new
FormData
();
xhr
.
onload
=
function
(
e
)
{
if
(
this
.
readyState
===
4
)
{
let
transcript
=
JSON
.
parse
(
e
.
target
.
responseText
)
let
transcript
=
JSON
.
parse
(
e
.
target
.
responseText
)
+
''
;
document
.
getElementById
(
"output"
).
innerHTML
+=
`
${
cnt
++
}
:
${
transcript
}
<br><br>`
;
uploadTranscriptData
(
transcript
);
tmp
=
transcript
.
split
(
' '
);
if
(
tmp
[
0
]
==
'종료'
)
tab
=
tab
.
slice
(
1
);
else
{
uploadTranscriptData
(
tab
,
transcript
);
}
}
};
formData
.
append
(
"audio_data"
,
blob
,
filename
);
...
...
@@ -1384,7 +1392,7 @@ function uploadSoundData(blob) {
xhr
.
send
(
formData
);
}
function
uploadTranscriptData
(
txt
)
{
async
function
uploadTranscriptData
(
tabs
,
txt
)
{
let
request
=
new
XMLHttpRequest
();
let
form
=
new
FormData
();
request
.
onload
=
function
(
e
)
{
...
...
@@ -1392,9 +1400,13 @@ function uploadTranscriptData(txt) {
console
.
log
(
e
.
target
.
responseText
)
input_line
+=
e
.
target
.
responseText
;
sourceEditor
.
setValue
(
input_line
);
if
((
tmp
[
0
]
==
'함수'
||
tmp
[
0
]
==
'반복문'
||
tmp
[
0
]
==
'조건문'
)
&&
e
.
target
.
responseText
!=
''
)
{
tab
+=
'\t'
;
}
}
};
form
.
append
(
"transcript_data"
,
txt
);
form
.
append
(
"tabs"
,
tabs
);
request
.
open
(
"POST"
,
"/ttp"
,
true
);
request
.
send
(
form
);
}
\ No newline at end of file
...
...
voicoding.js
View file @
14a6ce7
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment