3 * Function used for manipulating publication status, and curating
4 * @author Naama Menda <nm249@cornell.edu>
8 JSAN.use('MochiKit.DOM');
9 JSAN.use('MochiKit.Visual');
10 JSAN.use('MochiKit.Async');
12 JSAN.use('CXGN.Effects');
13 JSAN.use('CXGN.Phenome.Tools');
17 //update status of pub_crator
18 updatePubCuratorStat: function(stat, pub_id) {
19 if (stat == '' || !pub_id ) { MochiKit.Logging.log('Cannot update status! '); }
21 var action = "change_stat";
22 //alert ('About to update pub_curator status to -' + stat + ' - (pub_id= ' + pub_id + ')') ;
23 new Ajax.Request('/curator/pub_curator.pl', {
24 parameters: {stat: stat, pub_id: pub_id , action: action},
25 onException: function(request) {
26 var json=request.responseText;
27 var x = eval("("+json+")");
28 MochiKit.Logging.log("Failed updating pub_curator", x.error);
30 onSuccess: function(request) {
31 var json=request.responseText;
32 var x = eval("("+json+")");
33 MochiKit.Logging.log("JSON message:", x.error);
38 //update assigned curator
39 updatePubCuratorAssigned: function(curator_id, pub_id) {
40 if (pub_id && curator_id) {
41 var action= "assign_curator";
42 new Ajax.Request('/curator/pub_curator.pl', {
43 parameters: {curator_id: curator_id, pub_id:pub_id, action: action},
44 onSuccess: function(response) {
45 var json = response.responseText;
46 var x = eval("("+json+")");
48 MochiKit.Logging.log("stored pub_curator. " , x.error);
50 onFailure: function(response) { //this does not work as expected!
51 var json = response.responseText;
52 var x = eval("("+json+")");
53 alert ("Failed assigning a pub curator! " + x.error) ;
64 // add show/hide functionality to toggle-able publications
66 jQuery('div.publication_embedded a.toggle_abstract').click(function() {
67 jQuery(this).next().toggle();