Mercurial > hg > soundsoftware-site
annotate vendor/plugins/redmine_bibliography/assets/javascripts/authors.js @ 469:ae87ae455cfb feature_36
correctly saving authors.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 24 Jun 2011 11:23:23 +0100 |
parents | 0bb9c7baed07 |
children | 30b36ab6f15a |
rev | line source |
---|---|
luis@467 | 1 function remove_author(link){ |
luis@468 | 2 $(link).previous('input[type=hidden]').value = 1; |
luis@468 | 3 $(link).up('.author_fields').remove(); |
luis@468 | 4 } |
luis@468 | 5 |
luis@469 | 6 function remove_fields(link) { |
luis@469 | 7 $(link).previous("input[type=hidden]").value = "1"; |
luis@469 | 8 $(link).up(".fields").hide(); |
luis@469 | 9 } |
luis@469 | 10 |
luis@468 | 11 function add_fields(link, association, content) { |
luis@468 | 12 var new_id = new Date().getTime(); |
luis@468 | 13 var regexp = new RegExp("new_" + association, "g") |
luis@469 | 14 $(link).up().insert({ |
luis@469 | 15 before: content.replace(regexp, new_id) |
luis@469 | 16 }); |
luis@467 | 17 } |