includes/clientside/static/comments.js
changeset 1223 7dca925b0209
parent 1173 b5b8e7ab0914
child 1227 bdac73ed481e
equal deleted inserted replaced
1222:d1ded7b4c775 1223:7dca925b0209
   397   {
   397   {
   398     document.getElementById('subject_' + data.id).innerHTML = data.subj;
   398     document.getElementById('subject_' + data.id).innerHTML = data.subj;
   399   }
   399   }
   400   if ( data.approved && data.approved != '1' )
   400   if ( data.approved && data.approved != '1' )
   401   {
   401   {
   402     document.getElementById('subject_' + data.id).innerHTML += ' <span style="color: #D84308">' + $lang.get('comment_msg_note_unapp') + '</span>';
   402     document.getElementById('subject_' + data.id).innerHTML += ' <span style="color: #D84308">' + ( data.approved == '2' ? $lang.get('comment_msg_note_spam') : $lang.get('comment_msg_note_unapp') ) + '</span>';
   403   }
   403   }
   404   if ( data.approved && ( typeof(data.approve_updated) == 'string' && data.approve_updated == 'yes' ) )
   404   if ( data.approved && ( typeof(data.approve_updated) == 'string' && data.approve_updated == 'yes' ) )
   405   {
   405   {
   406     var appr = ( data.approved == '1' ) ? $lang.get('comment_btn_mod_unapprove') : $lang.get('comment_btn_mod_approve');
   406     var appr = ( data.approved == '1' ) ? $lang.get('comment_btn_mod_unapprove') : $lang.get('comment_btn_mod_approve');
   407     document.getElementById('comment_approve_'+data.id).innerHTML = appr;
   407     document.getElementById('comment_approve_'+data.id).innerHTML = appr;
   493   tplvars.NAME = data.name;
   493   tplvars.NAME = data.name;
   494   if ( data.user_id > 1 )
   494   if ( data.user_id > 1 )
   495     tplvars.NAME = '<a href="' + makeUrlNS('User', data.name) + '">' + data.name + '</a>';
   495     tplvars.NAME = '<a href="' + makeUrlNS('User', data.name) + '">' + data.name + '</a>';
   496   
   496   
   497   if ( data.approved != '1' )
   497   if ( data.approved != '1' )
   498     tplvars.SUBJECT += ' <span style="color: #D84308">' + $lang.get('comment_msg_note_unapp') + '</span>';
   498     tplvars.SUBJECT += ' <span style="color: #D84308">' + ( data.approved == '2' ? $lang.get('comment_msg_note_spam') : $lang.get('comment_msg_note_unapp') ) + '</span>';
   499   
   499   
   500   // Name
   500   // Name
   501   tplvars.NAME = data.name;
   501   tplvars.NAME = data.name;
   502   if ( data.user_id > 1 )
   502   if ( data.user_id > 1 )
   503     tplvars.NAME = '<a href="' + makeUrlNS('User', data.name) + '" style="' + data.rank_data.rank_style + '">' + data.name + '</a>';
   503     tplvars.NAME = '<a href="' + makeUrlNS('User', data.name) + '" style="' + data.rank_data.rank_style + '">' + data.name + '</a>';
   518     tplvars.USER_LEVEL += '<br />';
   518     tplvars.USER_LEVEL += '<br />';
   519   if ( data.rank_data.rank_title )
   519   if ( data.rank_data.rank_title )
   520     tplvars.USER_LEVEL += $lang.get(data.rank_data.rank_title);
   520     tplvars.USER_LEVEL += $lang.get(data.rank_data.rank_title);
   521   
   521   
   522   // Send PM link
   522   // Send PM link
   523   tplvars.SEND_PM_LINK=(data.user_id>1)?'<a onclick="window.open(this.href); return false;" href="'+ makeUrlNS('Special', 'PrivateMessages/Compose/To/' + ( data.name.replace(/ /g, '_') )) +'">' + $lang.get('comment_btn_send_privmsg') + '</a><br />':'';
   523   tplvars.SEND_PM_LINK=(data.user_id>1)?'<a class="abutton icon abutton_blue" style="background-image: url(' + cdnPath + '/images/icons/send_pm.png);" onclick="window.open(this.href); return false;" href="'+ makeUrlNS('Special', 'PrivateMessages/Compose/To/' + ( data.name.replace(/ /g, '_') )) +'">' + $lang.get('comment_btn_send_privmsg') + '</a><br /><br />':'';
   524   
   524   
   525   // Add buddy link
   525   // Add buddy link
   526   tplvars.ADD_BUDDY_LINK=(data.user_id>1)?'<a onclick="window.open(this.href); return false;" href="'+ makeUrlNS('Special', 'PrivateMessages/FriendList/Add/' + ( data.name.replace(/ /g, '_') )) +'">' + $lang.get('comment_btn_add_buddy') + '</a><br />':'';
   526   tplvars.ADD_BUDDY_LINK=(data.user_id>1)?'<a class="abutton icon abutton_green" style="background-image: url(' + cdnPath + '/images/icons/add_buddy.png);" onclick="window.open(this.href); return false;" href="'+ makeUrlNS('Special', 'PrivateMessages/FriendList/Add/' + ( data.name.replace(/ /g, '_') )) +'">' + $lang.get('comment_btn_add_buddy') + '</a><br />':'';
   527   
   527   
   528   // Edit link
   528   // Edit link
   529   tplvars.EDIT_LINK='<a href="#edit_'+i+'" onclick="editComment(\''+i+'\', this); return false;" id="cmteditlink_'+i+'">' + $lang.get('comment_btn_edit') + '</a>';
   529   tplvars.EDIT_LINK='<a href="#edit_'+i+'" onclick="editComment(\''+i+'\', this); return false;" id="cmteditlink_'+i+'">' + $lang.get('comment_btn_edit') + '</a>';
   530   
   530   
   531   // Delete link
   531   // Delete link