x-ƒ (x_f)

Kas jauns? 

sestdien, 19.06.2004 @1:37 pm | x-ƒ

[info]watt it kā taisās svētdien atjaunot Cibas kodu uz jaunāku versiju. Man nav zināms, kas tieši mainīsies, taču attiecībā uz S2 varētu parādīties šis tas jauns. Piemēram, komentāru saldēšana un FOAF skats. Lai nu kā, lai S2 koderi un dizaineri :) būtu gatavi, es publicēju iespējamās S2 koda izmaiņas. (Ja nu man izrādās taisnība un pēc tam slinkums.) Pieminēti tikai tie mainīgie un funkcijas, kas varētu būt izmainīti (pievienoti), salīdzinot ar pašreizējo core.

### LJ Specific Classes

class CommentInfo
"Information about comments attached to something."
{
    var bool maxcomments "Set to true if entry has reached a comment maximum.";
}

class Comment extends EntryLite
"A comment to a journal entry, or to another comment."
{
    var readonly bool frozen "True if comment is in frozen state.";
}

class FriendsPage extends RecentPage
"Friends most recent entries"
{
    var string friends_mode
    "The 'mode' of this view. An empty string indicates a normal friends view, while 'friendsfriends' indicates the Friends-of-friends view.";
    
    var bool filter_active
    "If true, some kind of filter is in effect. If this filter has a name, it will be included in [member[FriendsPage.filter_name]]";
    
    var string filter_name
    "The name of the filter in effect, if it has a name. This is only used when 'custom' [member[FriendsPage.filter_active]] is true.";
}

class YearMonth 
"A month on the [class[YearPage]]."
{
    var readonly string prev_url "A url to link to in order to view the previous month.";
    var readonly string next_url "A url to link to in order to view the next month.";
    var Date prev_date "Date of previous month, with day of zero, or null if none.";
    var Date next_date "Date of next month, with day of zero, or null if none.";
}


##[ Built-in Functions ]

function builtin clean_url (string s) : string
"Returns the given URL back if it's a valid URL.";


##[ properties ]

property builtin string PALIMGROOT {
    noui = 1;
    doc_flags = "[sys]";
    des = "The base URL of palimg files, without a trailing slash.  Example: \"http://www.livejournal.com/palimg\".";
}

property string text_max_comments {
    des = "Text when entry has reached a comment maximum";
    example = "Maximum comments reached";
}
set text_max_comments = "Maximum comments reached";

property string text_view_friendsfriends {
    des = "Title of the 'Friends of Friends' view";
    maxlength = 20;
    "size" = 15;
    example = "Friends of Friends";
}
property string text_view_friends_filter {
    des = "Title of a Friends page with an unnamed filter in effect";
    maxlength = 20;
    "size" = 15;
    example = "Friends (Custom filter)";
}
property string text_view_friendsfriends_filter {
    des = "Title of a Friends of Friends page with an unnamed filter in effect";
    maxlength = 20;
    "size" = 15;
    example = "Friends of Friends (Custom filter)";
}
set text_view_friends_filter = "Friends (Custom filter)";
set text_view_friendsfriends = "Friends of Friends";
set text_view_friendsfriends_filter = "Friends of Friends (Custom filter)";

property string text_multiform_opt_unfreeze {
    des = "Text for the comment unfreezing action";
}
set text_multiform_opt_unfreeze = "Unfreeze";

property string text_multiform_opt_freeze {
    des = "Text for the comment freezing action";
}
set text_multiform_opt_freeze = "Freeze";

property string text_comment_frozen {
    des = "Text to replace reply link with if comment is frozen";
    example = "Replies frozen";
    maxlength = "50";
}
set text_comment_frozen = "Frozen";


### Generic Page Functions

function FriendsPage::view_title() : string {
    if ($.friends_mode == "") {
        if ($.filter_active) {
            if ($.filter_name != "") {
                if ($.friends_title != "") {
                    return $.friends_title+" ("+$.filter_name+")";
                } else {
                    return $*text_view_friends+" ("+$.filter_name+")";
                }
            } else {
                return $*text_view_friends_filter;
            }
        } else {
            if ($.friends_title != "") {
                return $.friends_title;
            } elseif ($.journal.journal_type == "C") {
                return $*text_view_friends_comm;
            } else {
                return $*text_view_friends;
            }
        }
    }
    elseif ($.friends_mode == "friendsfriends") {
        if ($.filter_active) {
            if ($.filter_name != "") {
                return $*text_view_friendsfriends+" ("+$.filter_name+")";
            }
            else {
                return $*text_view_friendsfriends_filter;
            }
        }
        else {
            return $*text_view_friendsfriends;
        }
    }
    else {
        return "Unknown Friends View";
    }
}


### CommentInfo functions

function CommentInfo::print_postlink() {
    var Page p = get_page();
    if ($.maxcomments) {
        "$*text_max_comments";
    } else {
        "<a href=\"$.post_url\">"+($p.view == "friends" ? $*text_post_comment_friends : $*text_post_comment)+"</a>";
    }
}


### EntryPage functions

function EntryPage::print_comment (Comment c) {
    var Color barlight = $*color_comment_bar->clone();
    $barlight->lightness(($barlight->lightness() + 255) / 2);
    var Color barc = $c.depth % 2 ? $*color_comment_bar : $barlight;
    var string poster = defined $c.poster ? $c.poster->as_string() : "<i>$*text_poster_anonymous</i>";

    "<a name='$c.anchor'></a><div style='background-color: $barc; margin-top: 10px; width: 100%'>";
    "<table cellpadding='2' cellspacing='0' summary='0' style='width: 100%'><tr valign='top'>";
    if (defined $c.userpic and $*comment_userpic_style != "off") { 
        var int w = $c.userpic.width;
        var int h = $c.userpic.height;
        # WARNING: this will later be done by the system (it'll be a
        # constructional property), so don't copy this hack into your
        # layout layers or you'll be messed up later.
        if ($*comment_userpic_style == "small") {
            $w = $w / 2;
            $h = $h / 2;
        }
        print "<td style='width: 102px'><img src='$c.userpic.url' width='$w' height='$h' alt='' /></td>";
    }
    "<td><table style='width: 100%'><tr>";

    "<td align='left' style='width: 50%'>";
      print "<table>";
      print "<tr><th align='right'>$*text_comment_from</th><td>$poster</td></tr>\n";
      print "<tr><th align='right'>$*text_comment_date</th><td style='white-space: nowrap'>";
        print $c.time->date_format("long") + " - " + $c.time->time_format() + "</td></tr>";
      if ($c.metadata{"poster_ip"}) { print "<tr><th align='right'>$*text_comment_ipaddr</th><td>(" + $c.metadata{"poster_ip"} + ")</td></tr>"; }
    "</table></td>";

    print "<td align='right' style='width: 50%'>";
    if ($this.multiform_on) {
        " <label for='ljcomsel_$c.talkid'>$*text_multiform_check</label> ";
        $c->print_multiform_check();
    }
    $c->print_linkbar();
    "</td></tr>";

    print "<tr valign='top'><td style='width: 50%'>";
    if (defined $c.subject_icon or $c.subject != "") { "<h3>$c.subject_icon $c.subject</h3>\n"; }
    print "</td>";

    print "<td style='width:50%;' align='right'><strong>(<a href='$c.permalink_url'>$*text_permalink</a>)</strong></td></tr>\n";
    print "</table></td></tr></table></div>";

    print "<div style='margin-left: 5px'>$c.text</div>\n";
    print "<div style='margin-top: 3px; font-size: smaller'>";
    if ($c.frozen) {
        "($*text_comment_frozen) ";
    } else {
        "(<a href='$c.reply_url'>$*text_comment_reply</a>) ";
    }
    if ($c.parent_url != "") { "(<a href='$c.parent_url'>$*text_comment_parent</a>) "; }
    if ($c.thread_url != "") { "(<a href='$c.thread_url'>$*text_comment_thread</a>) "; }
    "</div>\n";
}

(Ņem vērā, ka parasti neviens neizvēlas atbildēt uz pilnīgi anonīmiem komentāriem!)

No:
Lietotājvārds:
Parole:
Ievadi te 'qws' (liidzeklis pret spambotiem):
Temats:
Tematā HTML ir aizliegts
  
Ziņa:

Gandrīz jau aizmirsu pateikt – šis lietotājs ir ieslēdzis IP adrešu noglabāšanu. Operatore Nr. 65.