Revision 718:378aca14739f vendor/plugins/redmine_bibliography/assets
| vendor/plugins/redmine_bibliography/assets/javascripts/authors.js | ||
|---|---|---|
| 3 | 3 |
$(link).up(".fields").hide();
|
| 4 | 4 |
} |
| 5 | 5 |
|
| 6 |
function add_fields(link, association, content) {
|
|
| 7 |
var new_id = new Date().getTime(); |
|
| 8 |
var regexp = new RegExp("new_" + association, "g")
|
|
| 9 |
$(link).insert({
|
|
| 10 |
before: content.replace(regexp, new_id) |
|
| 11 |
}); |
|
| 6 |
function add_author_fields(link, association, content, action) {
|
|
| 7 |
var new_id = new Date().getTime(); |
|
| 8 |
var regexp = new RegExp("new_" + association, "g");
|
|
| 9 |
$(link).insert({
|
|
| 10 |
before: content.replace(regexp, new_id) |
|
| 11 |
}); |
|
| 12 |
if(action != "new"){
|
|
| 13 |
toggle_save_author(new_id, $(link)); |
|
| 14 |
}; |
|
| 12 | 15 |
} |
| 13 | 16 |
|
| 14 | 17 |
function identify_author_status(status, object_id) {
|
| ... | ... | |
| 57 | 60 |
toggle_div("publication_authorships_attributes_" + form_object_id +"_search_author");
|
| 58 | 61 |
} |
| 59 | 62 |
|
| 60 |
function edit_author(form_object_id){}
|
|
| 63 |
function hide_all_bibtex_required_fields(){$$('p.bibtex').each(function(s){s.hide()})}
|
|
| 61 | 64 |
|
| 62 |
function hide_all_bibtex_required_fields() {
|
|
| 63 |
$$('input.bibtex').each(function(s){
|
|
| 64 |
s.up('p').hide();
|
|
| 65 |
})} |
|
| 66 |
|
|
| 67 |
function show_all_required_bibtex_fields(entrytype_fields) {
|
|
| 68 |
$$('input.bibtex').each(function(s){
|
|
| 69 |
if(entrytype_fields.indexOf(s.id.split('_').last()) == -1){s.up('p').hide()};
|
|
| 65 |
// entrytype_fields is a jsno array with the fields requires by the selected bibtex entry |
|
| 66 |
function show_required_bibtex_fields(entrytype_fields) {
|
|
| 67 |
$$('p.bibtex').each(function(s){
|
|
| 68 |
if(entrytype_fields.indexOf(s.down('input').id.split('_').last()) != -1){
|
|
| 69 |
s.show(); |
|
| 70 |
} |
|
| 71 |
else {
|
|
| 72 |
s.hide(); |
|
| 73 |
} |
|
| 70 | 74 |
}) |
| 71 | 75 |
} |
| 72 | 76 |
|
Also available in: Unified diff