getting file size for all dict files to be downloaded. coming to be 400mb or so.
[worddb.git] / static / js / jquery.etymology.js
blobff3d12fdbb2f1c782dc91c6ece7ad6c9dbbb17f7
1 jQuery.fn.etymologyzer = function(options){
2 return this.each(function(i, o){
3 // UI to add relation thing
4 options.relation_name = get_relation_name(o);
5 options.word = get_word_id(o);
6 jQuery("div.etymology", o).prepend(
7 '<img class="edit_etymology" \
8 src="/media/img/admin/icon_changelink.gif">'
9 );
10 jQuery("div.etymology", o).after(
11 '<div class="etymology_editor">\
12 <form method="post" action="/w/ajax/word/update-etymology/">\
13 <img class="sider" src="/media/img/admin/icon_deletelink.gif">\
14 <textarea name="etymology"></textarea>\
15 <input type="hidden" name="word">\
16 <input type="submit" class="change_it" value="Change it">\
17 <a href="#f" class="not_really">Not really</a>\
18 </form>\
19 </div>'
21 var editor = $("div.etymology_editor", o);
22 $("input[@name=word]", editor).val(options.word);
23 $("div.etymology", o).unbind().click(function(){
24 $("textarea", editor).val($(".content", o).text());
25 $("div.etymology", o).hide();
26 editor.show();
27 return false;
28 });
29 $(".not_really, .sider", editor).unbind().click(function(){
30 $("div.etymology", o).show();
31 editor.hide();
32 return false;
33 });
34 $("dd", o).hide();
35 $("dd:first", o).show();
36 $("dt:first", o).css({ "text-decoration": "none", "cursor": "default" });
37 $("dt", o).click(function(){
38 $("dd", o).hide();
39 $("dt").css({ "text-decoration": "underline", "cursor": "pointer" });
40 $(this).css({
41 "text-decoration": "none", "cursor": "default"
42 }).next().show();
43 });
44 });