Comic Fury Webcomic Hosting - Enabling "edit" on comments

You are not logged in. Log in, Register, More info
Forum > Layouts, HTML, CSS & Javascript > Enabling "edit" on comments
Pages: [1]

"Enabling "edit" on comments", 12th Jul 2012, 1:42 AM #1
view

User avatar
Posts: 186
Referrals: 0
Registration date: 8th May 2011
Location: United States
Hmmmm, I made a new comic 'cause the old one is just about done. A lot of the syntax has been changed, which is fine, but I really need to know how to allow my users to edit their own comments. There doesn't appear to be a setting for it in the webcomic controls.

The default code in the template is

<span class="[v:l.editclass]"><a href="[v:l.editlink]" onclick='window.open("[v:l.editlink]","edit","menubar=no,width=530,height=360,toolbar=no"); return false;' target="windowedit">edit</a> </span> 


Which is fine, except it doesn't appear to trigger. "reply" still exists, and that code is

<a href="[v:l.replylink]" onclick='window.open("[v:l.replylink]","reply","menubar=no,width=530,height=360,toolbar=no"); return false;' target="windowreply">reply</a>


It's not inside a span with a template class, but is otherwise very similar.

Advice?
12th Jul 2012, 2:17 AM #2
Magravan♂
Ma-Ma-Magravan!
User avatar
Posts: 2669
Referrals: 26
Registration date: 13th Oct 2009
Location: Canada
Aren't they able to edit them so long as they are logged in?
_______________________
image
Completed!
In a world of intelligent, human-looking zombies, their only hope might be the one human they didn't "Enlighten".

Avatar: By Kristy of Wake the Sleepers
12th Jul 2012, 2:20 AM #3
MatthewJA♂
Matt Damon
User avatar
Posts: 4686
Referrals: 14
Registration date: 26th Sep 2010
Location: Canberra, Australia
I briefly see the edit button for all users.
Are you by chance using some javascript to hide it on comments that aren't yours?

e: Looking at the source, it seems that something is setting the edit span to "display:none" just after page load. As I do not have a comment on the page I can't tell if that's for everyone's comments or just ones that aren't mine.
_______________________
image
image
12th Jul 2012, 2:24 AM #4
view

User avatar
Posts: 186
Referrals: 0
Registration date: 8th May 2011
Location: United States
I'm using the complete default "caffeine addict" layout.

Should I just switch to a different layout?

It's hard for me to debug, because I can personally see it. But some of my users are complaining that they can't see it, or that it flashes and goes away.
12th Jul 2012, 2:25 AM #5
MatthewJA♂
Matt Damon
User avatar
Posts: 4686
Referrals: 14
Registration date: 26th Sep 2010
Location: Canberra, Australia
this comic, right?

It's definitely javascript. When I disable javascript on my browser, the edit links appear. Allow me to make a test comment...
_______________________
image
image
12th Jul 2012, 2:27 AM #6
view

User avatar
Posts: 186
Referrals: 0
Registration date: 8th May 2011
Location: United States


That is the one, and you can see the comments at the end there.

I haven't changed anything, but I noticed the behavior was changing. Or erratic. Originally, I also could not edit.
12th Jul 2012, 2:29 AM #7
MatthewJA♂
Matt Damon
User avatar
Posts: 4686
Referrals: 14
Registration date: 26th Sep 2010
Location: Canberra, Australia
Hrm. The delete button and the reply button show up for me. You can delete comments now... That never used to work, iirc. If it was a recent change, maybe it broke it?
Could you post the entire comic page HTML?
_______________________
image
image
12th Jul 2012, 2:34 AM #8
view

User avatar
Posts: 186
Referrals: 0
Registration date: 8th May 2011
Location: United States
MatthewJA:Hrm. The delete button and the reply button show up for me. You can delete comments now... That never used to work, iirc. If it was a recent change, maybe it broke it?
Could you post the entire comic page HTML?


I'll be completely honest: I haven't edited anything, and would be happy to change to any layout that works, as long as it doesn't have a large "above comic" screen footprint.

The default caffeine addict layout has the Comic Strip Display of:

    <div class="title">Comic [v:comicnumber] - [v:comictitle]</div>
    <div class="titlesub"><b>[v:posttime]</b>
     [c:usechapters] <!--comment:[this one checks if the webcomic uses chapters]-->
      [c:haschapter] <!--comment:[this one checks if the comic strip is in a chapter]-->
       in <a href="[v:chapterlink]">[v:chaptername]</a>
      [/]
     [/]
    </div>
    <div id="comicimagewrap">[v:comicimage]</div>
    [c:allowratings]
     <div id="comicrating"><b>Average Rating:</b> [v:rating] <span id="votenumber">([v:votecount] votes)</span> <a href="[v:ratelink]" onclick='window.open("[v:ratelink]","edit","menubar=no,width=530,height=360,toolbar=no"); return false;' target="window" id="ratelink">Rate this comic</a></div>
    [/]



    <div id="comicnav">
      <a href="/comics/first/" rel="start" class="comicnavlink">&lt;&lt;</a>
      <a href="[v:prevcomic]" rel="prev" class="comicnavlink">&lt;</a>

    <!--comment:[comic dropdown:]-->
    <select onchange="jumpTo(this.options[selectedIndex].value);">
     [l:archive]
      <option value="[v:l.comicurl]" [c:l.currentcomic]selected="selected"[/]>[v:l.comictitle]</option>
     [/]
    </select>

      <a href="[v:nextcomic]" rel="next" class="comicnavlink">&gt;</a>
      <a href="/comics/" rel="index" class="comicnavlink">&gt;&gt;</a>
    </div>

    <div id="saveplace"><a href="#" onclick="savePlace(this,[v:comicid]);return false;">Save My Place</a> | <a href="#" onclick="loadPlace();return false;">Load My Place</a></div>


    [c:authornotes]
     <div class="title">Author Notes:</div>
     <div class="authornotes">
      [l:authornotes]

         <div class="comment">
           <div class="commentdata">
            <span class="authordata">
              <a href="[v:l.profilelink]"><b>[v:l.authorname]</b></a>
            </span>
            <span class="postdate">[v:l.posttime]</span>
            <span class="commentcontrol [v:l.controlclass]">
              <span class="[v:l.editclass]"><a href="[v:l.editlink]" onclick='window.open("[v:l.editlink]","edit","menubar=no,width=530,height=360,toolbar=no"); return false;' target="windowedit">edit</a></span> 
              <span class="[v:l.deleteclass]"><a href="[v:l.deletelink]" onclick='window.open("[v:l.deletelink]","delete","menubar=no,width=530,height=360,toolbar=no"); return false;' target="windowdelete">delete</a></span>
            </span>
           </div>
          [c:l.avatar]
           <div class="avatar">
            <img src="[v:l.avatar]" alt="[v:l.authorname]" /><br />
           </div>
          [/]
          <span class="notecontent">
           [v:l.comment]
          </span>
         </div>

      [/]
      <div class="clear"></div>
     </div>
    [/]



    [c:showpermalinks]
     <div class="title">Permalinks</div>
     <div id="permalinkbox">

      <b>Copy this comic strip into LiveJournal, your blog or Myspace with this code:</b><br />
      <div class="permalinkcode">
       &lt;a href=&quot;[v:permalink]&quot;>&lt;img src=&quot;[v:comicimageurl]&quot; alt=&quot;[v:webcomicname] - [v:comictitle]&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
       &lt;br /&gt;<br />&lt;a href=&quot;[v:permalink]&quot;&gt;[v:comictitle]&lt;/a&gt;
      </div><br />

      <b>Or into forums with this code:</b><br />
       <div class="permalinkcode">
        [URL=[v:permalink]]	[IMG][v:comicimageurl][/IMG]	[/URL]<br />
        [URL=[v:permalink]][v:comictitle][/URL]
       </div><br />
      </div>
     [/]




     [c:showcomments]
      [c:comments]
       <div class="title">User comments:</div>

       [c:allowcomments]
        <div class="postcomment"><a href="[v:commentlink]" onclick='window.open("[v:commentlink]","edit","menubar=no,width=530,height=360,toolbar=no"); return false;' target="window">Post a Comment</a></div>
        [c:!allowguestcomments]
         (You have to be registered at <a href="http://comicfury.com">ComicFury</a> to leave a comment!)
        [/]
       [/]

       <div class="comments">
        [l:comments]

         <div class="comment [c:l.is_reply]reply[/]">
           <div class="commentdata">
            <span class="authordata">
             [c:!l.isguest]
              <a href="[v:l.profilelink]"><b>[v:l.authorname]</b></a>
             [/]
             [c:l.isguest]
              <b>[v:l.authorname]</b> (Guest)
             [/]
            </span>
            <span class="postdate">[v:l.posttime]</span>
            <span class="commentcontrol [v:l.controlclass]">
              <span class="[v:l.editclass]"><a href="[v:l.editlink]" onclick='window.open("[v:l.editlink]","edit","menubar=no,width=530,height=360,toolbar=no"); return false;' target="windowedit">edit</a> </span> 
              <span class="[v:l.deleteclass]"><a href="[v:l.deletelink]" onclick='window.open("[v:l.deletelink]","delete","menubar=no,width=530,height=360,toolbar=no"); return false;' target="windowdelete">delete</a></span>
              <a href="[v:l.replylink]" onclick='window.open("[v:l.replylink]","reply","menubar=no,width=530,height=360,toolbar=no"); return false;' target="windowreply">reply</a>
            </span>
           </div>
          [c:l.avatar]
           <div class="avatar">
            <img src="[v:l.avatar]" alt="[v:l.authorname]" /><br />
           </div>
          [/]
          <span class="notecontent">
           [v:l.comment]
          </span>
         </div>

        [/]
       </div>
       <div class="clear"></div>
      [/]
     [/]

     [c:allowcomments]
      <div class="postcomment"><a href="[v:commentlink]" onclick='window.open("[v:commentlink]","edit","menubar=no,width=530,height=360,toolbar=no"); return false;' target="window">Post a Comment</a></div>
      [c:!allowguestcomments]
       (You have to be registered at <a href="http://comicfury.com">ComicFury</a> to leave a comment!)
      [/]
     [/]
12th Jul 2012, 2:47 AM #9
MatthewJA♂
Matt Damon
User avatar
Posts: 4686
Referrals: 14
Registration date: 26th Sep 2010
Location: Canberra, Australia
function appendStyle() {
	var addcss = document.createElement('style');
	addcss.type = 'text/css';
	
			var addstyles = '.cce,.ccd,.ccde { display:none; } { display:inline !important; } .ccde4761 { display:inline !important; }, .cce4761 { display:inline !important; } .ccd4761 { display:inline !important; }';
			
	if (addcss.styleSheet) addcss.styleSheet.cssText = addstyles;
	else addcss.appendChild(document.createTextNode(addstyles));

	document.getElementsByTagName("head")[0].appendChild(addcss);
}
window.onload = function() { appendStyle() };
	


There's a piece of javascript (above) in the cf javascript file in the header which seems to be the problem

I believe that this line:
.cce4761 { display:inline !important; }
is not executing correctly.

The file is hosted on CF itself, so Kyo'd need to change it. I think the problem is the comma here:
.ccde4761 { display:inline !important; }, .cce4761 { display:inline !important; }


If you go into developer tools in your browser, navigate to the final <style> section of the head (which this script adds), and delete the comma, the edit link magically reappears.

Kyooooo


e: Explanation: This script seems to hide the delete and edit buttons for comments that aren't yours. That's why it's got my user id (4761) in it above, because I accessed it. It works by hiding edit and delete buttons, then reshowing them if they apply to you.
A temporary fix would be changing [v:l.editclass] to [v:l.deleteclass].
_______________________
image
image
12th Jul 2012, 2:54 AM #10
view

User avatar
Posts: 186
Referrals: 0
Registration date: 8th May 2011
Location: United States
If I'm the only person this has happened to, it may be easiest for me to change layouts.

Well, it's not blowing things up, it's just a weird erratic bug. So I'll wait until I hear from Kyo.
12th Jul 2012, 2:59 AM #11
TheOneBlueGecko♀
Team Gecko
User avatar
Posts: 1381
Referrals: 0
Registration date: 14th Feb 2012
Location: California
I know for the comics I have commented on recently some of them have an edit comment option for me and some don't. I can't honestly say this is different, but I feel like I could have edited them in the past.
_______________________
I support our new pirate overlords.
Comic Tumblr
12th Jul 2012, 3:01 AM #12
view

User avatar
Posts: 186
Referrals: 0
Registration date: 8th May 2011
Location: United States
TheOneBlueGecko:I know for the comics I have commented on recently some of them have an edit comment option for me and some don't. I can't honestly say this is different, but I feel like I could have edited them in the past.


My old comic has an edit button that works, but it does it in a different way because it's ancient.
Forum > Layouts, HTML, CSS & Javascript > Enabling "edit" on comments
Pages: [1]