src/cm/media/js/client/c_icomment.js
changeset 294 c2c262ac1273
parent 217 613b2f29be54
child 329 00df963f91fb
equal deleted inserted replaced
293:2c52e4453bf7 294:c2c262ac1273
   196 			}
   196 			}
   197 		}
   197 		}
   198 	},	
   198 	},	
   199 	
   199 	
   200 	onMouseEnterHeader : function () {
   200 	onMouseEnterHeader : function () {
   201 		if (readyForAction() && this.isVisible()) {
   201 		if (readyForAction() && this.isVisible() && (sv_prefix=="")) {
   202 			this.overlay.get('contentBox').query(".c-permalink").removeClass('displaynone');
   202 			this.overlay.get('contentBox').query(".c-permalink").removeClass('displaynone');
   203 		}
   203 		}
   204 	},
   204 	},
   205 	
   205 	
   206 	onMouseLeaveHeader : function () {
   206 	onMouseLeaveHeader : function () {
   207 		if (readyForAction() && this.isVisible()) {
   207 		if (readyForAction() && this.isVisible() && (sv_prefix=="")) {
   208 			this.overlay.get('contentBox').query(".c-permalink").addClass('displaynone');
   208 			this.overlay.get('contentBox').query(".c-permalink").addClass('displaynone');
   209 		}
   209 		}
   210 	},	
   210 	},	
   211 	
   211 	
   212 	setWidth : function(width) {
   212 	setWidth : function(width) {
   300 		// TITLE
   300 		// TITLE
   301 		var titleInfos = interpolate(gettext('last modified on %(date)s'),{'date':comment.modified_user_str}, true) ;
   301 		var titleInfos = interpolate(gettext('last modified on %(date)s'),{'date':comment.modified_user_str}, true) ;
   302 		
   302 		
   303 		var modifDateTooltip = (comment.modified == comment.created) ? '' : '<a title="' + titleInfos + '"> * </a>' ;
   303 		var modifDateTooltip = (comment.modified == comment.created) ? '' : '<a title="' + titleInfos + '"> * </a>' ;
   304 		var permaTitle = gettext('Permalink to this comment') ;
   304 		var permaTitle = gettext('Permalink to this comment') ;
   305 		var permalink = '<a class="c-permalink displaynone c-action" target="_blank" title="'+ permaTitle +'" href="" >¶&nbsp;</a>' ;
   305 		var permalink = "";
       
   306 		if (sv_prefix=="") {
       
   307 			permalink = '<a class="c-permalink displaynone c-action" target="_blank" title="'+ permaTitle +'" href="" >¶&nbsp;</a>' ;
       
   308 		}
   306 		
   309 		
   307 		var infos = interpolate(gettext('by %(name)s, created on %(date)s'),{'name':comment.name, 'date':comment.created_user_str}, true) ;
   310 		var infos = interpolate(gettext('by %(name)s, created on %(date)s'),{'name':comment.name, 'date':comment.created_user_str}, true) ;
   308 		
   311 		
   309 		var newTitleContent = '<span class="c-header"><div class="c-header-title">' + comment.title + permalink + '</div><div class="c-infos">' + infos + '</div></span>' ;
   312 		var newTitleContent = '<span class="c-header"><div class="c-header-title">' + comment.title + permalink + '</div><div class="c-infos">' + infos + '</div></span>' ;
   310 		
   313 		
   333 			boundingBoxNode.query('.icomment-body').appendChild(newContentNode) ;
   336 			boundingBoxNode.query('.icomment-body').appendChild(newContentNode) ;
   334 		else 
   337 		else 
   335 			prevContentNode.get('parentNode').replaceChild(newContentNode, prevContentNode) ;
   338 			prevContentNode.get('parentNode').replaceChild(newContentNode, prevContentNode) ;
   336 
   339 
   337 		// PERMALINK
   340 		// PERMALINK
   338 		boundingBoxNode.query(".c-permalink").set("href",sv_site_url + comment.permalink) ;
   341 		if (sv_prefix=="") {
       
   342 			boundingBoxNode.query(".c-permalink").set("href",sv_site_url + comment.permalink) ;
       
   343 		}
   339 
   344 
   340 		// MODERATION
   345 		// MODERATION
   341 		this.changeModeration(comment) ;
   346 		this.changeModeration(comment) ;
   342 /* useless : use implemendted permanentlink instead
   347 /* useless : use implemendted permanentlink instead
   343  * 
   348  *