-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jugyo
committed
Jan 20, 2011
1 parent
802a0b7
commit fbd36a5
Showing
3 changed files
with
36 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,9 +1,10 @@ | |||
h2 Example | #welcome | ||
span ➜ | h2 Example | ||
a href="/I%20am%20a%20pen!" "I am a pen!" | span ➜ | ||
a href="/I%20am%20a%20pen!" "I am a pen!" | |||
|
|
||
h2 by URL | h2 by URL | ||
img src="/by_url.png" | img src="/by_url.png" | ||
|
|
||
h2 by the Bookmarklet | h2 by the Bookmarklet | ||
img src="/by_bookmarklet.png" | img src="/by_bookmarklet.png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,21 +1,25 @@ | |||
.source = text | #content | ||
.source = text | |||
|
|
||
.arrow ⬇ | .arrow ⬇ | ||
|
|
||
.target | .target | ||
#google-translate-result ... | #google-translate-result ... | ||
#powerd-by-google-translate-api | #powerd-by-google-translate-api | ||
span powerd by | span powerd by | ||
a href="http://code.google.com/intl/ja/apis/language/translate/overview.html" Google Translate API | a href="http://code.google.com/intl/ja/apis/language/translate/overview.html" Google Translate API | ||
|
|
||
javascript: |
|
||
function googleTranslate(response) { | javascript: | ||
var result = response.data.translations[0].translatedText; | function googleTranslate(response) { | ||
$('#google-translate-result').text(result); | var result = response.data.translations[0].translatedText; | ||
} | $('#google-translate-result').text(result); | ||
$(function() { | } | ||
$('<script>').attr({ | $(function() { | ||
type: "text/javascript", | $('<script>').attr({ | ||
src: "https://www.googleapis.com/language/translate/v2?key=AIzaSyDf3VkeewjJd884BrTyOBiw-1KggQ0537g&source=#{source}&target=#{target}&callback=googleTranslate&q=#{text}" | type: "text/javascript", | ||
}).appendTo($('head')); | src: "https://www.googleapis.com/language/translate/v2?key=AIzaSyDf3VkeewjJd884BrTyOBiw-1KggQ0537g&source=#{source}&target=#{target}&callback=googleTranslate&q=#{text}" | ||
}); | }).appendTo($('head')); | ||
}); | |||
.clear |