Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
5edbf55a
Commit
5edbf55a
authored
Mar 09, 2012
by
Michal Čihař
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
8a55ff3b
37dee45d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
media/js/loader.js
media/js/loader.js
+9
-4
No files found.
media/js/loader.js
View file @
5edbf55a
...
...
@@ -2,6 +2,11 @@ function text_change(e) {
$
(
'
#id_fuzzy
'
).
attr
(
'
checked
'
,
false
);
}
function
mt_set
(
txt
)
{
$
(
'
#id_target
'
).
text
(
txt
);
$
(
'
#id_fuzzy
'
).
attr
(
'
checked
'
,
true
);
}
var
loading
=
0
;
function
inc_loading
()
{
...
...
@@ -38,7 +43,7 @@ function load_translate_apis() {
inc_loading
();
apertium
.
translate
(
data
,
'
en
'
,
target_language
,
function
(
ret
)
{
if
(
!
ret
.
error
)
{
$
(
'
#id_target
'
).
tex
t
(
ret
.
translation
);
mt_se
t
(
ret
.
translation
);
}
dec_loading
();
});
...
...
@@ -53,7 +58,7 @@ function load_translate_apis() {
get_source_string
(
function
(
data
)
{
inc_loading
();
Microsoft
.
Translator
.
translate
(
data
,
'
en
'
,
target_language
,
function
(
ret
)
{
$
(
'
#id_target
'
).
tex
t
(
ret
);
mt_se
t
(
ret
);
dec_loading
();
});
});
...
...
@@ -66,7 +71,7 @@ function load_translate_apis() {
inc_loading
();
$
.
getJSON
(
"
http://mymemory.translated.net/api/get?q=
"
+
data
+
"
&langpair=en|
"
+
target_language
,
function
(
data
)
{
if
(
data
.
responseData
!=
''
)
{
$
(
'
#id_target
'
).
tex
t
(
data
.
responseData
.
translatedText
);
mt_se
t
(
data
.
responseData
.
translatedText
);
}
dec_loading
();
});
...
...
@@ -91,7 +96,7 @@ $(function() {
$
(
'
textarea.translation
'
).
change
(
text_change
).
keypress
(
text_change
).
autogrow
().
focus
();
$
(
'
#copy-text
'
).
button
({
text
:
true
,
icons
:
{
primary
:
"
ui-icon-arrow-1-s
"
}}).
click
(
function
f
()
{
get_source_string
(
function
(
data
)
{
$
(
'
#id_target
'
).
tex
t
(
data
);
mt_se
t
(
data
);
});
return
false
;
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment