?

Log in

No account? Create an account

Previous Entry | Next Entry

I'm trying to change the separator between the links in the entry link bar to a middle dot (·), the way it is on my main journal, snakeling (which is in Flexible Squares, not Expressive). So far I'm failing, but I don't understand why.

Here's the code I'm using, with the part I changed in green:

function Comment::print_linkbar() {
    var Link link;
    var string sep  = """<span class="separator">&middot;</span>""";
    var string url  = "";
    var string text = "";

    var string{} link_caption = {
        # TODO: These should really be separate properties
        "delete_comment"   => $*text_multiform_opt_delete,
        "freeze_thread"    => $*text_multiform_opt_freeze,
        "unfreeze_thread"  => $*text_multiform_opt_unfreeze,
        "screen_comment"   => $*text_multiform_opt_screen,
        "unscreen_comment" => $*text_multiform_opt_unscreen,
        "watch_comments"   => $*text_multiform_opt_track,
        "unwatch_comments" => $*text_multiform_opt_untrack,
    };

    foreach var string link_key ($.link_keyseq) {
        $link = $this->get_link($link_key);
        if (defined $link) {
            $url  = $link.url;
            $text = $link_caption{$link_key} != "" ? $link_caption{$link_key} : $link.caption;
            print safe """ $sep <a href="$url">$text</a>""";
        }
    }
}

It compiles okay, but I'm not seeing any changes. Help?

The full layer can be found under #8792113.

Comments

( 3 comments — Leave a comment )
av8rmike
Aug. 1st, 2007 12:31 am (UTC)
Apparently, "print safe" strips out the higher-byte HTML characters too. Try taking out the safe keyword in the last line. Since you've changed EntryPage::print_comment() too, you should see the dot between the first two links.
av8rmike
Aug. 1st, 2007 12:50 am (UTC)
And I just realized you kept saying "entry linkbar" not comment. The entry linkbar doesn't use the pipe character as a separator, it actually uses CSS borders on <LI> elements. First, put this in your custom CSS:
.asset-meta-list .item { border-left-style: none;}
then, re-write the Entry::print_linkbar to print the dot separator with each element. I'm assuming you can do that on your own. ;)
snakelings_recs
Aug. 1st, 2007 09:27 am (UTC)
Thanks for your help; the Expressive stylesheet drives me crazy :D

For the record, here are my modifications:
function Entry::print_linkbar() {
    var Link link;
    var string url = "";
    var string text = "";

    print """<div class="asset-meta">\n""";
    print """<ul class="asset-meta-list">\n""";

    $.comments->print();

    var string{} link_caption = {
        "edit_entry" => $*text_edit_entry,
        "edit_tags" => $*text_edit_tags,
        "mem_add" => $*text_mem_add,
        "watch_comments" => $*text_watch_comments,
        "unwatch_comments" => $*text_unwatch_comments,
    };

    foreach var string link_key ($.link_keyseq) {
        $link = $this->get_link($link_key);
        if (defined $link) {
            $url = $link.url;
            $text = $link_caption{$link_key} != "" ? $link_caption{$link_key} : $link.caption;
            print """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$url">$text</a> &middot;  </li>""";
        }
    }
    print """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$.permalink_url">$*text_permalink</a></li>""";
    println "\n</ul>\n</div>\n";
}


function CommentInfo::print() {
    if ($.show_readlink)   {
        """<li class="asset-meta-comments item asset-meta-no-comments">"""; $this->print_readlink(); " &middot;  </li>\n";
    }
    if ($.show_postlink) {
        """<li class="asset-meta-comments item asset-meta-no-comments">"""; $this->print_postlink(); " &middot; </li>\n";
    }
}
Plus a couple of CSS changes:
.asset-meta-list .item { 
   border-left-style: none;
   padding: 0;
   }
I think I took out a safe in Entry::print_linkbar(), too.
( 3 comments — Leave a comment )

Latest Month

March 2016
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  

S2 Help Communities

Tags

Powered by LiveJournal.com
Designed by chasethestars