Skip to content
Browse files

added translate to normal items, fixed return value of translate methods

  • Loading branch information...
1 parent 60e9ee3 commit 91b2776e380cf9868fd44ee29446af0fcc952f8f @mborho committed Jun 9, 2012
Showing with 7 additions and 0 deletions.
  1. +1 −0 lib/renderer.js
  2. +6 −0 lib/static/js/controller.js
View
1 lib/renderer.js
@@ -39,6 +39,7 @@ var Renderer = function(withTwitter) {
html += '<div class="btn-group">';
html += '<a class="btn dropdown-toggle ignore" data-toggle="dropdown" href="#"><span class="caret"></span></a>';
html += '<ul class="dropdown-menu">';
+ html += '<li><a class="ignore" href="#" onclick="return Controller.translateUrl(\''+doc.link+'\');">translate</a></li>';
if(_withTwitter) {
html += '<li><a class="ignore" href="#" onclick="return Controller.tweet(\'box-'+doc._id+'\');">tweet</a></li>';
html += '<li class="divider"></li>';
View
6 lib/static/js/controller.js
@@ -375,7 +375,13 @@ var Controller = (function(socket, toc) {
} catch(err) {
console.log(err);
}
+ return false;
},
+ translateUrl: function(url) {
+ tlateUrl = 'http://translate.google.de/translate?sl=auto&tl=de&u='+encodeURIComponent(url);
+ window.open(tlateUrl, '', '');
+ return false;
+ },
showSettings: function() {
$('#content').hide();
$('#nav').hide();

0 comments on commit 91b2776

Please sign in to comment.
Something went wrong with that request. Please try again.