changeset 1313:17f075c7fd41 redmine-2.2-integration

toggles bibtex.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 18 Jun 2013 14:59:04 +0100
parents 2abc48cc545e
children 033fecbc3438
files plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb plugins/redmine_bibliography/assets/javascripts/bibtex.js plugins/redmine_bibliography/config/locales/en.yml
diffstat 3 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb	Tue Jun 18 14:30:52 2013 +0100
+++ b/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb	Tue Jun 18 14:59:04 2013 +0100
@@ -15,9 +15,9 @@
           <%= print_ieee_format(publication) %>
        </dt>
        <dd>
-         <%= link_to("[More Details]", {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%>
+         <%= link_to(l("more_details_link"), {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%>
 
-         <%= link_to_function "[B<small>IB</small>T<sub>E</sub>X]", onclick="toggleBibtex(this)" -%>
+         <%= link_to l(:bibtex_link).html_safe, "javascript:void(0)", :class => "bibtex-link"-%>
        </dd>
        <dd class="bibtex-textarea collapsed" style="display: none;">
          <textarea readonly> <%= print_bibtex_format(publication) %> </textarea>
--- a/plugins/redmine_bibliography/assets/javascripts/bibtex.js	Tue Jun 18 14:30:52 2013 +0100
+++ b/plugins/redmine_bibliography/assets/javascripts/bibtex.js	Tue Jun 18 14:59:04 2013 +0100
@@ -1,6 +1,5 @@
-function toggleBibtex(el) {
-  var dd = Element.up(el).next('dd');
 
-  dd.toggleClassName('collapsed');
-  Effect.toggle(dd, 'slide', {duration:0.2});
-}
\ No newline at end of file
+$('.bibtex-link').live("click", function() {
+  $this = $(this);
+  $this.closest('dd').next('dd').toggle();
+});
\ No newline at end of file
--- a/plugins/redmine_bibliography/config/locales/en.yml	Tue Jun 18 14:30:52 2013 +0100
+++ b/plugins/redmine_bibliography/config/locales/en.yml	Tue Jun 18 14:59:04 2013 +0100
@@ -148,5 +148,6 @@
   mail_subject_publication_added: "You have been added as an author to a new publication"
   mail_body_publication_added: "A new publication (%{publication}) has been added to the project '%{project}.'"
 
+  bibtex_link: "[B<small>IB</small>T<sub>E</sub>X]"
+  more_details_link: "[More Details]"
 
-