Allow permalink on comments even when embedfing iframe.
authorgibus
Thu, 13 Oct 2011 14:51:17 +0200
changeset 389 eecda8559c1d
parent 388 ba81ba3ed3a0
child 390 3915f9d40340
Allow permalink on comments even when embedfing iframe.
src/cm/media/js/client/c_icomment.js
--- a/src/cm/media/js/client/c_icomment.js	Sat Sep 10 21:55:14 2011 +0200
+++ b/src/cm/media/js/client/c_icomment.js	Thu Oct 13 14:51:17 2011 +0200
@@ -198,13 +198,13 @@
   },  
   
   onMouseEnterHeader : function () {
-    if (readyForAction() && this.isVisible() && (sv_prefix=="")) {
+    if (readyForAction() && this.isVisible()) {
       this.overlay.get('contentBox').query(".c-permalink").removeClass('displaynone');
     }
   },
   
   onMouseLeaveHeader : function () {
-    if (readyForAction() && this.isVisible() && (sv_prefix=="")) {
+    if (readyForAction() && this.isVisible()) {
       this.overlay.get('contentBox').query(".c-permalink").addClass('displaynone');
     }
   },  
@@ -302,10 +302,7 @@
     
     var modifDateTooltip = (comment.modified == comment.created) ? '' : '<a title="' + titleInfos + '"> * </a>' ;
     var permaTitle = gettext('Permalink to this comment') ;
-    var permalink = "";
-    if (sv_prefix=="") {
-      permalink = '<a class="c-permalink displaynone c-action" target="_blank" title="'+ permaTitle +'" href="" >¶&nbsp;</a>' ;
-    }
+    var permalink = '<a class="c-permalink displaynone c-action" target="_blank" title="'+ permaTitle +'" href="" >¶&nbsp;</a>' ;
     
     var infos = interpolate(gettext('by %(name)s, created on %(date)s'),{'name':comment.name, 'date':comment.created_user_str}, true) ;
     
@@ -341,6 +338,9 @@
     if (sv_prefix=="") {
       boundingBoxNode.query(".c-permalink").set("href",sv_site_url + comment.permalink) ;
     }
+    else {
+      boundingBoxNode.query(".c-permalink").set("href", top.location.href + '?comment_id_key=' + comment.id_key) ;
+    }
 
     // MODERATION
     this.changeModeration(comment) ;