Ignore:
Timestamp:
2013-05-03T21:28:37+12:00 (11 years ago)
Author:
ak19
Message:

Username field should not be cleared as it's no longer hidden and stores the logged in user. Also added a logout for the add comments feature, but there's probably a better way to do this, though the admin pages don't provide a logout and require you to log in repeatedly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/macros/document.dm

    r27294 r27297  
    164164<input type="submit" value="_textaddcomment_" onclick="addUserComment(document.AddUserCommentForm.username.value, document.AddUserCommentForm.comment.value, document.AddUserCommentForm.d.value, document); return false;">
    165165<label id="usercommentfeedback"></label>
     166
     167<!--<div id="usercommentlogoutlink"><a href="_doc-url_&amp;un=">_text-usercomment-logout_</a></div>-->
     168<div id="usercommentlogoutlink"><a href="#" onclick="javascript:logout(); return false;">_text-usercomment-logout_</a></div>
    166169</form>
    167170
     
    260263
    261264        // GSAPI already knows the collection
    262         gsapi.setMetadataArray(docArray, "accumulate", "import|archives|index");       
    263         doc.AddUserCommentForm.comment.value = "";
    264         doc.AddUserCommentForm.username.value = "";
     265        gsapi.setMetadataArray(docArray, "accumulate", "import|archives|index");
     266
     267        // clear the comment field as it has now been submitted, but not the username field
     268        // as the user is logged in, so they should be able to commit again under their username.
     269        doc.AddUserCommentForm.comment.value = "";
    265270        doc.getElementById("usercommentfeedback").innerHTML = "_textcommentsubmitted_";
    266271
Note: See TracChangeset for help on using the changeset viewer.