# -*-s2-*- layerinfo type = "layout"; layerinfo name = "A Sturdy Gesture"; layerinfo des = "Simple boxes arranged in two columns, using the full width of the browser."; layerinfo lang = "en"; layerinfo author = "Martin Atkins"; layerinfo author_email = "mart@livejournal.com"; layerinfo redist_uniq = "sturdygesture/layout"; layerinfo previews = "sturdygesture/sturdygesture.jpg"; propgroup colors { property Color clr_page_back { des = "Page background"; } set clr_page_back = "#ffffff"; property Color clr_page_text { des = "Box border color"; } set clr_page_text = "#000000"; property Color clr_box_text { des = "Box content color"; } set clr_box_text = "#000000"; property Color clr_box_back { des = "Box background color"; } set clr_box_back = "#ffffff"; property Color clr_boxhead_text { des = "Box heading text color"; } set clr_boxhead_text = "#ffffff"; property Color clr_boxhead_back { des = "Box heading background color"; } set clr_boxhead_back = "#000000"; property Color clr_page_link { des = "Link color"; } set clr_page_link = "#0000ff"; property Color clr_page_vlink { des = "Visited link color"; } set clr_page_vlink = "#0000ff"; } propgroup fonts { property use font_base; property use font_fallback; } propgroup presentation { property string opt_navbar_pos { des = "Navigation Bar Location"; values = "left|Left|right|Right"; } set opt_navbar_pos = "left"; property bool opt_friends_colors { des = "Use friend colors on friends page"; note = "If this option is on, the titles of friends' entries will use the colors you have selected for each friend."; } set opt_friends_colors = true; property bool opt_always_userpic { des = "Always show userpics"; note = "With this off, userpics are only shown in the friends view."; } set opt_always_userpic = false; ## These have no UI, but S2 generates an empty settings page if they aren't in a group property string text_page_prev { des = "Text used to link to the previous page"; noui = 1; } property string text_page_next { des = "Text used to link to the next page"; noui = 1; } set text_page_prev = "Previous Page"; set text_page_next = "Next Page"; property string{} text_entry_links { des = "Captions for Entry Action links"; noui = 1; } set text_entry_links = {"edit_entry" => "Edit Entry", "edit_tags" => "Edit Tags", "mem_add" => "Add As Memory", "tell_friend" => "Tell a Friend", "nav_prev" => "Previous Entry", "nav_next" => "Next Entry"}; property string{} text_comment_links { des = "Captions for Comment Action links"; noui = 1; } set text_comment_links = {"delete_comment" => "Delete", "screen_comment" => "Screen", "unscreen_comment" => "Unscreen", "freeze_thread" => "Freeze", "unfreeze_thread" => "Unfreeze", }; property use use_shared_pic; property use linklist_support; property use external_stylesheet; } set tags_aware = true; function navheading(RecentNav nav, int entries) : string "i18n layers should override this to translate the skiplink box heading." { return ($nav.skip == 0 ? $entries+" most recent" : "skipped back "+$nav.skip); } function navlinktext(RecentNav nav, bool next) : string "i18n layers should override this to translate the skiplinks. If \$next is false, output 'Previous X', else 'Next X'." { return ($next ? "Next "+$nav.forward_count : "Previous "+$nav.backward_count); } function print_stylesheet() { """ body { background: $*clr_page_back; color: $*clr_page_text; """; # Ugliness if ($*font_base != "" or $*font_fallback != "none") { "font-family: "; if ($*font_base != "") { "\"$*font_base\""; if ($*font_fallback != "none") { ", "; } } if ($*font_fallback != "none") { print $*font_fallback; } ";"; } """ } a { color: $*clr_page_link; } a:visited { color: $*clr_page_vlink; } img { border: 0; } .box { border: 1px solid $*clr_page_text; margin: 1em; background: $*clr_box_back; color: $*clr_box_text; } #navbar { width: 25%; } #body { width: 75%; } #navbar .box h1, .box h2, .box h3 { font-size: 1em; background: $*clr_boxhead_back; color: $*clr_boxhead_text; padding: 3px; margin: 0; } #navbar .box h1 { text-align: center; } .box h1 a, .box h2 a, .box h3 a { color: $*clr_boxhead_text; background: $*clr_boxhead_back; } #navbar .box div.userpic { margin: 1em; text-align: center; } #navbar p { margin-left: 1em; margin-right: 1em; margin-bottom: 0; } #navbar ul, #skipbar ul { list-style: none; padding: 0; margin: 0.5em; } #navbar ul li.active, #skipbar ul li.active { font-weight: bold; } .box .entry { margin: 1em; } .box .talklinks { margin: 1em; text-align: right; clear: both; } .box .talklinks .permalink { float: left; } .box .minicomment { clear: both; } body.day #body h1 { font-size: 1.1em; font-weight: bold; } table.box, table.box td, table.box th { border: 1px solid #000000; } .metadata { margin-top: 1em; } form#postform table { background: $*clr_box_back; color: $*clr_box_text; } """; } function Page::lay_page_nav() { } function RecentPage::lay_page_nav() { if ($.nav.backward_url == "" and $.nav.forward_url == "") { return; } println "
"; println "

"+navheading($.nav,size $.entries)+"

\n\n"; println "
\n"; } function DayPage::lay_page_nav() { println "
"; } function YearPage::lay_page_nav() { println "
"; } function MonthPage::lay_page_nav() { println "
"; "
"; $.redir->print_hiddens(); if (size $.months > 1) { "\n"; } "
\n
\n"; } function EntryPage::lay_page_nav() { println "
"; if (size $.comments > 0 and not $.comment_pages.all_subitems_displayed) { "

"+lang_page_of_pages($.comment_pages.current, $.comment_pages.total)+"

\n"; } print "
"; } function Page::lay_show_firstnav() : bool { return false; } function RecentPage::lay_show_firstnav() : bool { return ((size $.entries) > 5); } function DayPage::lay_show_firstnav() : bool { return ((size $.entries) > 5); } function YearPage::lay_show_firstnav() : bool { return true; } function MonthPage::lay_show_firstnav() : bool { return true; } function EntryPage::lay_show_firstnav() : bool { return ((size $.comments) > 5); } function EntryPage::lay_show_firstnav() : bool { return false; } function Page::lay_navbar() { var string userpic; var Image up_img = $.journal.default_pic; if (defined $up_img) { $userpic = """
"""; } var string website; if ($.journal.website_url != "") { $website = """
  • $.journal.website_name
  • \n"""; } """

    $.journal.name

    $userpic
    """; if ($this->lay_show_firstnav()) { $this->lay_page_nav(); } if (size $this.linklist > 0 and $*linklist_support) { println "
    "; println "

    Links

    \n"; $this->print_linklist(); println "
    "; } ""; } function Page::print_linklist() { if (size $.linklist <= 0) { return; } var bool section_open = false; println ""; } println """
  • $l.title\n
  • "; } println ""; } function Page::print() { var string title = $this->title(); """\n\n"""; if ($*external_stylesheet) { println """"""; } else { println """"; } $this->print_head(); ""+$this->title()+""; """ """; if ($*opt_navbar_pos == "left") { $this->lay_navbar(); } "\n"; if ($*opt_navbar_pos == "right") { $this->lay_navbar(); } ""; """
    \n"; $this->print_body(); "
    "; $this->lay_page_nav(); "
    """; } function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor) { var string datetime; if ($p.view != "day") { $datetime = $e.time->date_format("med_day")+", "+$e.time->time_format(); } else { $datetime = $e.time->time_format(); } if (not (defined $bgcolor) or not $*opt_friends_colors) { $bgcolor = $*clr_boxhead_back; } if (not (defined $fgcolor) or not $*opt_friends_colors) { $fgcolor = $*clr_boxhead_text; } """

    $datetime """; if ($e.security != "") { print """"""; } if ($p.view == "friends" or $e.subject != "" or $e.poster.username != $p.journal.username) { print "
    "; if ($p.view == "friends" or $e.poster.username != $p.journal.username) { $p->print_entry_poster($e); print ": "; } print $e.subject; } "

    \n
    \n"; if (defined $e.userpic and ( $*opt_always_userpic or ($e.poster.username != $p.journal.username and $e.userpic.url != $p.journal.default_pic.url) or $p.view == "friends" or $p.view == "entry")) { """\n"""; } "$e.text"; $e->print_metadata(); """
    "; "
    "; } # print_entry(Page,Entry,Color,Color) function Entry::print_metadata() { var string caption; var string val; var Image i; if (size $.metadata == 0 and size $.tags == 0) { return; } println """
    """; if ($this.tags) { var int tcount = 0; "
    Tags: "; foreach var Tag t ($this.tags) { """"""; $tcount++; if ($tcount != size $this.tags) { ", "; } } "
    "; } if (size $.metadata != 0) { foreach var string k ($.metadata) { $caption = $k; $val = $.metadata{$k}; if ($k == "music") { $caption = $*text_meta_music; } elseif ($k == "mood") { $caption = $*text_meta_mood; if (defined $.mood_icon) { $i = $.mood_icon; $val = """ $val"""; } } println """
    $caption: $val
    """; } } println "
    "; } function Page::print_entry(Entry e) { print_entry($this, $e, null Color, null Color); } function FriendsPage::print_entry(Entry e) { var Friend f = $.friends{$e.journal.username}; print_entry($this, $e, $f.bgcolor, $f.fgcolor); } function colored_ljuser(UserLite u, Color fg, Color bg) : string { var Image uiimg = userinfoicon($u); var string dir = $u.journal_type == "C" ? "community" : "users"; return """[i]$u.username"""; } function FriendsPage::print_entry_poster(Entry e) { var Friend f = $.friends{$e.journal.username}; var Color fg; var Color bg; if ($*opt_friends_colors) { $fg = $f.fgcolor; $bg = $f.bgcolor; } else { $fg = $*clr_boxhead_text; $bg = $*clr_boxhead_back; } print colored_ljuser($e.poster, $fg, $bg); if ($e.poster.username != $e.journal.username) { " posting in "; print colored_ljuser($e.journal, $fg, $bg); } } function RecentPage::print_body() { foreach var Entry e ($.entries) { $this->print_entry($e); } } function CommentInfo::print() { if ($.enabled) { $this->print_postlink(); if ($.count > 0 or $.screened) { " | "; $this->print_readlink(); } } } function DayPage::print_body() { println """

    """+$.date->date_format("long")+"

    "; if (not $.has_entries) { print "

    $*text_noentries_day

    "; return; } foreach var Entry e ($.entries) { $this->print_entry($e); } } function EntryPage::print_body() { $this->print_entry($.entry); if ($this.multiform_on) { $this->print_multiform_start(); } if ($.entry.comments.enabled) { $this->print_comments($.comments); } if ($this.multiform_on) { "

    Mass Action on Selected Comments:

    "; "

    "; $this->print_multiform_actionline(); "

    "; "
    "; $this->print_multiform_end(); } } function EntryPage::print_comments(Comment[] cs) { if (size $cs == 0) { return; } print "
    "; foreach var Comment c ($cs) { var int indent = ($c.depth - 1) * 25; if ($c.full) { $this->print_comment($c); } else { $this->print_comment_partial($c); } } print "
    "; } function EntryPage::print_comment(Comment c) { var string datetime; $datetime = $c.time->date_format("med_day")+", "+$c.time->time_format(); """

    """; if ($c.metadata{"poster_ip"}) { print """
    (""" + $c.metadata{"poster_ip"} + """)
    """; } print $datetime; if (defined $c.subject_icon) { print """"""; } var string poster = defined $c.poster ? $c.poster->as_string() : "(Anonymous)"; print "
    "+$poster; if ($c.subject != "") { print ": "+$c.subject; } "

    \n
    \n"; if (defined $c.userpic and $*comment_userpic_style != "off") { """\n"""; } "$c.text
    "; """"; if ((size $c.replies) > 0 and $c.replies[0].full == false) { """
    \n"""; $this->print_comments($c.replies); "
    \n"; } "
    "; if ((size $c.replies) > 0 and $c.replies[0].full == true) { $this->print_comments($c.replies); } } function EntryPage::print_comment_partial(Comment c) { var string poster = defined $c.poster ? $c.poster->as_string() : "(Anonymous)"; var string subj = $c.subject != "" ? $c.subject : $*text_nosubject; print """
    $subj - $poster
    """; $this->print_comments($c.replies); } function ReplyPage::print_body() { var EntryLite c = $.replyto; var string datetime; $datetime = $c.time->date_format("med_day")+", "+$c.time->time_format(); """

    $datetime """; var string poster = defined $c.poster ? $c.poster->as_string() : "(Anonymous)"; print "
    "+$poster; if ($c.subject != "") { print ": "+$c.subject; } "

    \n
    \n"; if (defined $c.userpic and $*comment_userpic_style != "off") { """\n"""; } "$c.text
    "; if (defined $c.userpic and $*comment_userpic_style != "off") { """
    """; } "
    "; """
    \n"""; $.form->print(); "
    \n"; } function YearPage::print_body { foreach var YearMonth m ($.months) { $this->print_month($m); } } function YearPage::print_month(YearMonth m) { if (not $m.has_entries) { return; } """\n \n"""; foreach var int d (weekdays()) { "\n"; } "\n"; foreach var YearWeek w ($m.weeks) { $w->print(); } """\n"""; "
    """; print $m->month_format(); """
    "+$*lang_dayname_short[$d]+"
    $*text_view_month
    "; } function YearWeek::print() { """\n"""; if ($.pre_empty > 0) { """ \n"""; } foreach var YearDay d ($.days) { """\n"""; """
    $d.day
    \n"""; if ($d.num_entries > 0) { """
    $d.num_entries
    \n"""; } """\n"""; } if ($.post_empty > 0) { """ \n"""; } ""; } function MonthPage::print_body { """

    """+$.date->date_format($*lang_fmt_month_long)+"

    \n"; "
    "; foreach var MonthDay d ($.days) { if ($d.has_entries) { "
    "; print lang_ordinal($d.day); "
    \n
    "; $d->print_subjectlist(); "
    \n"; } } "
    \n
    \n"; } ### Handler for the theme previews function print_theme_preview() { """

    Cir zuta besho cavu mabu

    Cir zuta besho cavu mabu. Jad dop fugu hige wiju. Jam nek sapu shek noshea, moz lolle jil hattou daz. Heck mippe giffou tipe pello, govo goof wachou fenu betui, mumu niffo puffu hivoo ziv! Sap gap jozo vem sushu jiwo peru diche gese zar. Zuk kah rec sok vapui, mumu. Puw wuti mufe bak jivo, zef kazou gipwew cus. Cev lepp gik fego rer. Tucku mickou jeck helou soopp! Vowa vov fawea pip wok. Heg fum heafsum pele. Piz kuzu louw rome puir. Pashi jog huku pobi ckush. Zuj bit wido guih biha. Som veh nelo ruh ruju. Coosh jecko nuh tutt tab. Zutt ckek vano fic der, hivu?
    $*text_permalink
     
    """; }