Version at: 24/11/2014, 00:15

#Bookmarklets

A bookmarklet is a tool that you can keep on your bookmarks bar that performs an action when you click on it.

To install a Tatoeba bookmarklet easily, see "Drag-and-Drop" immediately below. For a more involved procedure, see "Build Bookmarklet by Copying Its Contents".

A bookmarklet will work the same way for any browser. It does not require you to install any browser extension.

## Drag-and-Drop

If your bookmarks/favorites toolbar is not displayed already, open it by right-clicking in the toolbar area and checking "Bookmarks Toolbar" or "Favorites Toolbar". Then go to [Tools for Tatoeba.org Members](http://bit.ly/tatoebatools) and drag one or more bookmarklets from the top of the page to your bookmarks toolbar.

##Build a Custom Bookmarklet by Copying Its Contents
If you want to build a custom bookmarklet by copying its contents rather than performing drag-and-drop on a premade one, create a bookmark from any web page, change the name as desired, and set the "Location" or "URL" field to the bookmarklet string. (You can find the contents of Tatoeba link boomarklets at [List of Tatoeba bookmarklets](bookmarklet-details).)

##Customize a Bookmarklet by Editing Its Contents
If you have a bookmarklet on your bookmarks/favorites toolbar and want to edit its contents, right-click on the bookmarklet, select "Properties", and edit the contents of the "Location" or "URL" field. For example, imagine that you want to customize the [Random Page of Untranslated Sentences](http://en.wiki.tatoeba.org/articles/show/bookmarklet-details#random-page-of-untranslated-sentences) bookmarklet to search for a random page of sentences not translated from Spanish to Portuguese rather than from Esperanto to English. You would simply replace the instances of "epo" with "spa", and "eng" with "por".

##See Also
See the [Wikipedia page on bookmarklets](http://en.wikipedia.org/wiki/Bookmarklet) or [this short introduction](http://betterexplained.com/articles/how-to-make-a-bookmarklet-for-your-web-application/) for more details on bookmarklets in general.

version at: 21/02/2016, 20:19

#Bookmarklets

A bookmarklet is a tool that you can keep on your bookmarks bar that performs an action when you click on it.

To install a Tatoeba bookmarklet easily, see "Drag-and-Drop" immediately below. For a more involved procedure, see "Build Bookmarklet by Copying Its Contents".

A bookmarklet will work the same way for any browser. It does not require you to install any browser extension.

## Drag-and-Drop

If your bookmarks/favorites toolbar is not displayed already, open it by right-clicking in the toolbar area and checking "Bookmarks Toolbar" or "Favorites Toolbar". Then go to [Tools for Tatoeba.org Members](http://bit.ly/tatoebatools) and drag one or more bookmarklets from the top of the page to your bookmarks toolbar.

##Build a Custom Bookmarklet by Copying Its Contents
If you want to build a custom bookmarklet by copying its contents rather than performing drag-and-drop on a premade one, create a bookmark from any web page, change the name as desired, and set the "Location" or "URL" field to the bookmarklet string. (You can find the contents of Tatoeba link boomarklets at [List of Tatoeba bookmarklets](bookmarklet-details).)

##Customize a Bookmarklet by Editing Its Contents
If you have a bookmarklet on your bookmarks/favorites toolbar and want to edit its contents, right-click on the bookmarklet, select "Properties", and edit the contents of the "Location" or "URL" field. For example, imagine that you want to customize the [Random Page of Untranslated Sentences](http://en.wiki.tatoeba.org/articles/show/bookmarklet-details#random-page-of-untranslated-sentences) bookmarklet to search for a random page of sentences not translated from Spanish to Portuguese rather than from Esperanto to English. You would simply replace the instances of "epo" with "spa", and "eng" with "por".

## Link To This Sentence
The following bookmarklet should be executed from the page for a sentence (A) to which you want to link another sentence (B). It prompts you for the URL or sentence number of sentence B.
 
`javascript:var%20a=window.prompt('Enter%20the%20URL%20or%20number%20of%20the%20sentence%20to%20link%20to%20this%20one','');if(a!=null){var%20t=/(http:\/\/tatoeba.org\/[a-z]{3}\/sentences\/show\/)?([1-9][0-9]*)/;var%20r=a.match(t);if(r!=null){var%20an=r[2];location.href=location.href.replace('sentences/show','links/add')+'/'+an};}`

## Go To A Random Page of Sentences in a Specified Language
If you click on this bookmarklet, it will bring you to a random page within the first N pages of the specified language. The example here will take you to a random page within the first 400 pages of Esperanto sentences that have not been translated into English.


*     To change the source language, edit the string "epo".
*     To change the destination language, edit the string "eng".
*     To change the minimum page number, edit the string "1".
*     To change the maximum page number, edit the string "100".

`javascript:var%20p=Math.floor((Math.random()*400)+1);location.href="htt"+"p://t"+"atoeba.org/eng/sentences/show_all_in/epo/und/eng/indifferent/page:"+p;`


##See Also
See the [Wikipedia page on bookmarklets](http://en.wikipedia.org/wiki/Bookmarklet) or [this short introduction](http://betterexplained.com/articles/how-to-make-a-bookmarklet-for-your-web-application/) for more details on bookmarklets in general.

Note

The lines in green are the lines that have been added in the new version. The lines in red are those that have been removed.