Sha256: 57b43144b72b73d5bca1f3bd4265186a74f4b59be5d2b3211bc45ce0eec4b196

Contents?: true

Size: 879 Bytes

Versions: 24

Compression:

Stored size: 879 Bytes

Contents

// short hand for $(document).ready();
$(function() {

   $('.trophy-class').click(function(){
      var uid=$("#current_user").html();
      $.ajax({
         url:"/users/"+uid+"/trophy",
         type:"post",
         data: "file_id="+this.id,
         success:function(data) {
           var oldclass = $('#'+data.trophy.generic_file_id).find('i').attr("class");
           if (oldclass.indexOf("trophy-on") != -1){
             $('#'+data.trophy.generic_file_id).find('i').attr("title", "Highlight work");
           } else {
             $('#'+data.trophy.generic_file_id).find('i').attr("title", "Unhighlight work");
           }

           $('#'+data.trophy.generic_file_id).find('i').toggleClass("trophy-on");
           $('#'+data.trophy.generic_file_id).find('i').toggleClass("trophy-off");
         }
      })
    });

}); //closing function at the top of the page


Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
sufia-3.5.0 app/assets/javascripts/sufia/trophy.js
sufia-3.4.0 app/assets/javascripts/sufia/trophy.js
sufia-3.4.0.rc4 app/assets/javascripts/sufia/trophy.js
sufia-3.4.0.rc3 app/assets/javascripts/sufia/trophy.js
sufia-3.3.1 app/assets/javascripts/sufia/trophy.js
sufia-3.4.0.rc2 app/assets/javascripts/sufia/trophy.js
sufia-3.4.0.rc1 app/assets/javascripts/sufia/trophy.js
sufia-3.3.0 app/assets/javascripts/sufia/trophy.js
sufia-3.2.1 app/assets/javascripts/sufia/trophy.js
sufia-3.1.3 app/assets/javascripts/sufia/trophy.js
sufia-3.1.2 app/assets/javascripts/sufia/trophy.js
sufia-3.1.1 app/assets/javascripts/sufia/trophy.js
sufia-3.1.0 app/assets/javascripts/sufia/trophy.js
sufia-3.0.0 app/assets/javascripts/sufia/trophy.js
sufia-2.0.1 app/assets/javascripts/sufia/trophy.js
sufia-2.0.0 app/assets/javascripts/sufia/trophy.js
sufia-1.3.0 app/assets/javascripts/sufia/trophy.js
sufia-1.2.0 app/assets/javascripts/sufia/trophy.js
sufia-1.1.0 app/assets/javascripts/sufia/trophy.js
sufia-1.0.0 app/assets/javascripts/sufia/trophy.js