- Timestamp:
- 2013-04-25T14:54:29+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/macros/document.dm
r27257 r27258 125 125 ####################################################################### 126 126 127 # For 127 # Display the add-user-comment form on actual document pages and not when browsing/searching 128 # This means the form should only be displayed on pages where the _cgiargd_ (the docid) is set 129 130 # For getting the submitbutton to make Ajax calls, see 128 131 # http://stackoverflow.com/questions/4264091/input-type-submit-instead-of-input-type-button-with-ajax 129 132 # http://stackoverflow.com/questions/8869341/ajax-form-submit-with-submit-button 130 133 131 134 _usercomment_ { 135 136 _If_(_cgiargd_, 132 137 133 138 <form name="AddUserCommentForm"> … … 141 146 <input type="submit" value="_textaddcomment_" onclick="addUserComment(document.AddUserCommentForm.username.value, document.AddUserCommentForm.comment.value, document.AddUserCommentForm.d.value); return false;"> 142 147 </form> 143 148 ) 144 149 <script type="text/javascript"> 145 150 function addUserComment(_username, _comment, _docid) \{ 151 // Need to the add user comment meta of username, timestamp and comment to the 152 // topmost section of the document. So only get the docId up to any period mark: 153 var period = _docid.indexOf("."); 154 if(period != -1) \{ 155 _docid = _docid.substring(0, period); 156 \} 146 157 147 158 // Want to store username, timestamp and comment in import/metadata.xml, archives/doc.xml … … 183 194 184 195 var comment_rec = \{ 185 metaname: " comment",196 metaname: "usercomment", 186 197 metavals: [_comment] 187 198 \}; … … 203 214 </script> 204 215 } 216 205 217 206 218 #######################################################################
Note:
See TracChangeset
for help on using the changeset viewer.