Ignore:
Timestamp:
2017-03-27T18:01:36+13:00 (7 years ago)
Author:
ak19
Message:

Some commits ahead of further changes: 1. Kathy came up with better name for GS2Construct.java method (to be refactored) that's more descriptive of the multiple tasks it performs. Removed unused paramter. 2. Javascript user_comments.js displays the heading for the comments section only when appropriate, which is when there is a comment history or when the form to add a comment is shown. Otherwise only the Add Comment link will be shown. 3. Changed core.css colours of links and headings in comments section to better match GS3. 4. document.xsl needs to display usercomments section not just for simple docs but also for wrapped docs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/user_comments.js

    r31537 r31540  
    7676    var i = 0;
    7777    var looping = true;
    78     var print_heading = false; // UNUSED SECTION if(print_heading) below
    79    
     78
     79   
     80    // if there's at least one existing comment OR if the form is currently being displayed
     81    // (regardless of whether previous comments exist), display a heading for the comments section
     82    if(metatable[0].metavals[0] != undefined || document.getElementById("usercommentform") != undefined) {
     83    var heading=document.createElement("div");
     84    var attr=document.createAttribute("class");
     85    attr.nodeValue="usercommentheading";
     86    heading.setAttributeNode(attr);
     87    var txt=document.createTextNode(gs.variables["textusercommentssection"]); ///"_textusercommentssection_");
     88    heading.appendChild(txt);
     89    usercommentdiv.appendChild(heading);
     90    }
     91   
     92   
    8093    // metatable[0] = list of usernames, metatable[1] = list of timestamps, metatable[2] = list of comments
    8194    // the 3 lists/arrays should be of even length. Assuming this, loop as long as there's another username
     
    8699        }
    87100    else {
    88        
    89 // BEGIN UNUSED
    90         if(print_heading) {
    91         var heading=document.createElement("div");
    92         var attr=document.createAttribute("class");
    93         attr.nodeValue="usercommentheading";
    94         heading.setAttributeNode(attr);
    95         var txt=document.createTextNode(gs.variables["textusercommentssection"]); ///"_textusercommentssection_");
    96         heading.appendChild(txt);
    97         usercommentdiv.appendChild(heading);
    98        
    99         print_heading = false;
    100         }
    101 // END UNUSED
    102101       
    103102            var username = metaval_rec.metavalue;
Note: See TracChangeset for help on using the changeset viewer.