# -*-s2-*- layerinfo type = "layout"; layerinfo name = "Clean and Simple"; layerinfo redist_uniq = "cleansimple/layout"; layerinfo author_name = "Martin Atkins"; layerinfo previews = "cleansimple/cleansimple.jpg"; layerinfo des = "A simple layout with a left sidebar, a heading bar and configurable margins."; propgroup colors { property Color body_bgcolor { des = "Page border color"; note = "If you set the border size to 'None', this won't show up."; s1color = "stronger_back"; } property Color entry_bgcolor { des = "Background of entries"; s1color = "page_back"; } property Color entry_fgcolor { des = "Text color of entries"; s1color = "page_text"; } property Color meta_color { des = "Color of entry headings and meta-information"; s1color = "page_text_em"; } property Color link_color { des = "Link color"; s1color = "page_link"; } property Color vlink_color { des = "Visited link color"; s1color = "page_vlink"; } property Color alink_color { des = "Active link color"; s1color = "page_alink"; } property Color topbar_bgcolor { des = "Background color of titlebar and userpic"; s1color = "strong_back"; } property Color topbar_fgcolor { des = "Titlebar text color"; s1color = "strong_text"; } property Color navbar_bgcolor { des = "Background color of sidebar"; s1color = "weak_back"; } property Color navbar_fgcolor { des = "Sidebar text color"; s1color = "weak_text"; } property string opt_navbar_pos { des = "Side Navbar Position"; values = "left|Left|right|Right"; } property Color comment_bar_one_bgcolor { des = "Alternating background color for comment bars (one)"; } property Color comment_bar_two_fgcolor { des = "Text color on alternating comment bars (one)"; } property Color comment_bar_two_bgcolor { des = "Alternating background color for comment bars (two)"; } property Color comment_bar_one_fgcolor { des = "Text color on alternating comment bars (two)"; } property Color comment_bar_screened_bgcolor { des = "Background bar color for screened comments"; } property Color comment_bar_screened_fgcolor { des = "Text color on background bar for screened comments"; } } set body_bgcolor = "#6666cc"; set entry_bgcolor = "#ffffff"; set entry_fgcolor = "#000000"; set meta_color = "#c00000"; set link_color = "#000050"; set vlink_color = "#500050"; set alink_color = "#00ffff"; set topbar_bgcolor = "#c0c0ff"; set topbar_fgcolor = "#000000"; set navbar_bgcolor = "#eeeeff"; set navbar_fgcolor = "#000000"; set comment_bar_one_bgcolor = "#c0c0ff"; set comment_bar_one_fgcolor = "#000000"; set comment_bar_two_bgcolor = "#eeeeff"; set comment_bar_two_fgcolor = "#000000"; set comment_bar_screened_bgcolor = "#dddddd"; set comment_bar_screened_fgcolor = "#000000"; set tags_aware = true; propgroup fonts { property use font_base; property use font_fallback; property string font_topbar_base { des = "Preferred font for top bar"; note = "As with the main font, leave blank if you don't care."; } property string font_topbar_fallback { des = "Alternative font style for top bar"; values = "sans-serif|Sans-serif|serif|Serif|cursive|Cursive|monospace|Monospaced|none|Use browser's default"; } property string font_sidebar_base { des = "Preferred font for side navigation bar"; note = "As with the main font, leave blank if you don't care."; } property string font_sidebar_fallback { des = "Alternative font style for side navigation bar"; values = "sans-serif|Sans-serif|serif|Serif|cursive|Cursive|monospace|Monospaced|none|Use browser's default"; } } set font_topbar_fallback = "none"; set font_sidebar_fallback = "none"; propgroup presentation { property string opt_daylines_style { des = "Style of Lines Around Day Headings"; values = "solid|Solid|dashed|Dashed|dotted|Dotted|double|Double|hidden|Invisible"; } property use page_recent_items; property use page_friends_items; property string opt_margin_size { des = "Size of page border"; values = "0|None|5px|Tiny|25px|Small|50px|Medium|75px|Large|100px|Extra Large"; } property use view_entry_disabled; property use use_shared_pic; property bool show_entrynav_icons { des = "Toggle to show the next, memory, edit, etc icons on the entry view page"; } property string page_background_image { des = "URL to an image to be used for the page background"; } property use linklist_support; property use external_stylesheet; } set opt_navbar_pos = "left"; set opt_daylines_style = "dashed"; set opt_margin_size = "50px"; set view_entry_disabled = false; set show_entrynav_icons = true; set page_background_image = ""; set linklist_support = false; propgroup text { property use text_post_comment; property use text_read_comments; property use text_post_comment_friends; property use text_read_comments_friends; } function css_fontspec(string base, string fallback) "Prints a CSS font-family specification based on the base and fallback given" { if ($base != "" or $fallback != "none") { "font-family: "; if ($base != "") { "\"$base\""; if ($fallback != "none") { ", "; } } if ($fallback != "none") { print $fallback; } ";"; } } function print_stylesheet () { var string bgimg = clean_url($*page_background_image) != "" ? "url($*page_background_image)" : "none"; """ body { background: $*body_bgcolor $bgimg; color: $*entry_fgcolor; padding: $*opt_margin_size; margin: 0; """; css_fontspec($*font_base,$*font_fallback); """ } a:link { color: $*link_color; background: transparent; } a:visited { color: $*vlink_color; background: transparent; } a:active { color: $*alink_color; background: transparent; } img { vertical-align: absmiddle; } table { width: 100%; } pre { text-align: left; } #topbar { background: $*topbar_bgcolor none; color: $*topbar_fgcolor; """; css_fontspec($*font_topbar_base,$*font_topbar_fallback); """ } #topbar h1 { margin-top: 5px; margin-bottom: 0; text-align: center; font-size: 1.5em; } #topbar h2 { margin-top: 0; margin-bottom: 5px; text-align: center; font-size: 1.25em; } #navbar { background: $*navbar_bgcolor none; color: $*navbar_fgcolor; width: 25%; """; css_fontspec($*font_sidebar_base,$*font_sidebar_fallback); """ } #navbar ul { list-style: none; margin: 10px; } #navbar ul li { margin: 0; } #navbar ul li.active { font-weight: bold; } #navbar a:link, #navbar a:active, #navbar a:visited { background: $*navbar_bgcolor none; color: $*navbar_fgcolor; text-decoration: none; } #navbar a:hover { text-decoration: underline; } #userlinklist ul { margin-top: 0; margin-bottom: 0; } #mainstuff { width: 75%; background: $*entry_bgcolor none; color: $*entry_fgcolor; } #userpic { text-align: center; margin: 10px; } #userpic img { border: 2px solid $*topbar_bgcolor; background: $*topbar_bgcolor none; color: $*topbar_fgcolor; } #entries { margin: 10px; } #range { margin-bottom: 0.5em; } .day { border-top: 1px $*opt_daylines_style $*entry_fgcolor; clear: both; } .day h3 { border-bottom: 1px $*opt_daylines_style $*entry_fgcolor; padding: 2px; margin: 0; font-size: 1.1em; text-align: center; } address { text-align: center; font-style: normal; font-size: 0.95em; } /* entries */ .entrytext { padding: 2px; text-align: justify; } .entry { clear: both; } .entrytext p, .entrytext ul, .entrytext ol, .entrytext table { margin-top: 0.5em; margin-bottom: 0.5em; } .entryheading { font-weight: bold; } .timestamp, .subject, .altposter { font-weight: bold; color: $*meta_color; background: $*entry_bgcolor; } .altposter a { color: $*meta_color; background: $*entry_bgcolor; text-decoration: underline; } .altposter img { border: 2px $*navbar_fgcolor solid; background: $*navbar_bgcolor none; color: $*navbar_fgcolor; } .talklinks { font-size: 0.75em; text-align: right; margin-bottom: 2px; clear: right; } .frienduserpic { border: 2px solid $*topbar_bgcolor; background: $*topbar_bgcolor none; color: $*topbar_fgcolor; } """; } function Page::lay_viewspec_nav() { # Intentionally blank } function RecentPage::lay_viewspec_nav() { # FIXME: There is currently no decent way to i18nize this if ($.nav.forward_url != "" or $.nav.backward_url != "") { ""; } } # This DEFINITELY should be in core function Page::lay_view_name(string view) : string "Don't bother overriding this, because it'll be deleted as soon as core can do it" { if ($view == "recent") { return $*text_view_recent; } elseif ($view == "friends") { return $*text_view_friends; } elseif ($view == "userinfo") { return $*text_view_userinfo; } elseif ($view == "archive") { return $*text_view_archive; } else { return "Something"; } } function Page::lay_viewspec_heading() : string "Returns some text to display under the main heading. Overridden in subclasses." { return ""; } function RecentPage::lay_viewspec_heading() : string { return $*text_view_recent; } function FriendsPage::lay_viewspec_heading() : string { if ($.journal.journal_type == "C") { return $*text_view_friends_comm; } else { return $*text_view_friends; } } function DayPage::lay_viewspec_heading() : string { return $*text_view_archive; } function YearPage::lay_viewspec_heading() : string { return $*text_view_archive; } function MonthPage::lay_viewspec_heading() : string { return $*text_view_archive; } function Page::print_linklist() { if (size $.linklist <= 0) { return; } elseif (not $*linklist_support) { return; } var bool section_open = false; println ""; } println """
  • $l.title\n
  • "; } println ""; } function Page::lay_print_navbar() { var string userpic; var Image up_img = $.journal.default_pic; if (defined $up_img) { $userpic = """
    """; } var string website_name = $.journal.website_name ? $.journal.website_name : $*text_website_default_name; var string website; if ($.journal.website_url != "") { $website = """
  • $website_name
  • """; } """ """; $this->lay_viewspec_nav(); "$userpic"; $this->print_linklist(); ""; } function Page::print () { var string title = $this->title(); """\n\n"""; if ($*external_stylesheet) { println """"""; } else { println """"; } $this->print_head(); """$title """; if ($*opt_navbar_pos == "left") { $this->lay_print_navbar(); } """ """; if ($*opt_navbar_pos == "right") { $this->lay_print_navbar(); } """
    """; "

    $.journal.name

    "; "

    " + $this->lay_viewspec_heading() + "

    "; """
    """; $this->print_body(); """
    """; server_sig(); """
    """; } function print_entry (Page p, Entry e, Color bgcolor, Color fgcolor, bool hide_text) { var string time = $e.time->time_format(); if ($e.new_day) { """

    """+$e.time->date_format("long")+"

    "; } """
    """; if ($p.view == "entry" and $*show_entrynav_icons) { print "
    "; $e->print_linkbar(); print "
    "; } """"""; if ($p.view == "friends") { if ($e.poster.username != $e.journal.username) { ""+$e.poster.username; ", posting in "; } "$e.journal.username @ "; } else { if ($e.poster.username != $e.journal.username) { ""; if (defined $e.userpic) { """"""; } "$e.poster.username @ "; } } ""+$e.time->time_format()+": "; if ($e.security) { $e.security_icon->print(); } if ($e.subject) { " $e.subject"; } println ""+($e.subject != "" ? "
    " : ""); if ($p.view == "friends" and defined $e.userpic) { """"""; } if (not $hide_text) { print "$e.text

    "; if (size $e.metadata) { """
    """; foreach var string k ($e.metadata) { var string text = $k; var string val = $e.metadata{$k}; if ($k == "mood") { $text = $*text_meta_mood; } elseif ($k == "music") { $text = $*text_meta_music; } if ($k == "mood" and defined $e.mood_icon) { var Image i = $e.mood_icon; $val = " $val"; } """
    $text: $val
    """; } "
    \n"; } if ($e.tags) { var int tcount = 0; "Tags: "; foreach var Tag t ($e.tags) { """"""; $tcount++; if ($tcount != size $e.tags) { ", "; } } "
    "; } } $e.comments->print(); "\n"; "
    "; if ($e.end_day) { "
    "; } } function Page::print_entry (Entry e) { print_entry($this, $e, null Color, null Color, false); } function FriendsPage::print_entry (Entry e) { var Friend f = $.friends{$e.journal.username}; print_entry($this, $e, $f.bgcolor, $f.fgcolor, false); } function CommentInfo::print () { if (not $.enabled) { return; } """"; } # This should really be provided in core function RecentPage::lay_range_text() : string { if ($.nav.skip == 0) { return "You are viewing the most recent "+(size $.entries)+" entries"; } else { return "You are viewing "+(size $.entries)+" entries, $.nav.skip into the past"; } } function RecentPage::print_body () { """

    """+$this->lay_range_text()+"""

    """; foreach var Entry e ($.entries) { $this->print_entry($e); } } function YearPage::print_year_links () { """"; } function YearPage::print_month (YearMonth m) { if (not $m.has_entries) { return; } """
    """; """"""; """"""; foreach var int d (weekdays()) { """\n"; } ""; foreach var YearWeek w ($m.weeks) { $w->print(); } "
    """; ""; print $m->month_format(); """ (...)
    """; print $*lang_dayname_short[$d]; "
    "; } function YearPage::lay_viewspec_nav() { $this->print_year_links(); } function YearPage::print_body() { "

    $.year

    "; foreach var YearMonth m ($.months) { $this->print_month($m); } } function YearWeek::print () { ""; if ($.pre_empty) { " "; } foreach var YearDay d ($.days) { """$d.day"""; if ($d.num_entries) { """
    $d.num_entries
    """; } else { "
     
    "; } ""; } if ($.post_empty) { " "; } ""; } function DayPage::lay_viewspec_nav() { """ """; } function DayPage::print_body() { if (not $.has_entries) { println $*text_noentries_day; } foreach var Entry e ($.entries) { $this->print_entry($e); } println "
    "; } function EntryPage::print_body () { set_handler("unscreen_comment_#", [ [ "style_bgcolor", "cmtbar#", "$*comment_bar_one_bgcolor", ], [ "style_color", "cmtbar#", "$*comment_bar_one_fgcolor", ], ]); set_handler("screen_comment_#", [ [ "style_bgcolor", "cmtbar#", "$*comment_bar_screened_bgcolor", ], [ "style_color", "cmtbar#", "$*comment_bar_screened_fgcolor", ], ]); print_entry($this, $.entry, null Color, null Color, $.viewing_thread); if ($.entry.comments.enabled and $.comment_pages.total_subitems > 0) { $this->print_multiform_start(); """

    Comments

    """; if ($.comment_pages.total_subitems > 0) { $.comment_pages->print(); $this->print_comments($.comments); } if ($this.multiform_on) { """

    Mass Action

    """; $this->print_multiform_actionline(); $this->print_multiform_end(); } } } # Clean style. Hate to clutter it up with this: function EntryPage::print_comment (Comment c) { var Color background; var Color color; if ($c.screened) { $background = $*comment_bar_screened_bgcolor; $color = $*comment_bar_screened_fgcolor; } elseif ($c.depth % 2) { $background = $*comment_bar_one_bgcolor; $color = $*comment_bar_one_fgcolor; } else { $background = $*comment_bar_two_bgcolor; $color = $*comment_bar_two_fgcolor; } var string poster = defined $c.poster ? $c.poster->as_string() : "(Anonymous)"; var string sub_icon; if (defined $c.subject_icon) { $sub_icon = $c.subject_icon->as_string(); } "
    "; ""; 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 ""; } "
    [User Picture]"; ### From, date, etc ""; ### Gadgets ""; ### Subject / icon print ""; ### Permalink print ""; print "
    "; print ""; print "\n"; print ""; if ($c.metadata{"poster_ip"}) { print ""; } "
    From:$poster
    Date:"; print $c.time->date_format("long") + " - " + $c.time->time_format() + "
    IP Address:(" + $c.metadata{"poster_ip"} + ")
    "; if ($this.multiform_on) { " "; $c->print_multiform_check(); } $c->print_linkbar(); "
    "; print (defined $c.subject_icon or $c.subject != "") ? "

    $c.subject_icon $c.subject

    " : ""; print "
    (Link)
    "; print "
    $c.text
    "; print "
    "; if ($c.frozen) { print "(Replies frozen) "; } else { print "(Reply to this) "; } if ($c.parent_url != "") { "(Parent) "; } if ($c.thread_url != "") { "(Thread) "; } "
    "; } function ReplyPage::print_body () { var string time = $.replyto.time->time_format(); """
    """; if (not $.entry.comments.enabled) { print "$*text_reply_nocomments_header
    $*text_reply_nocomments
    "; return; } ""; print defined $.replyto.poster ? $.replyto.poster->as_string() : "(Anonymous)"; " @ "; "$time: "; if ($.replyto.subject) { " $.replyto.subject"; } println ""+($.replyto.subject ? "
    " : ""); if (defined $.replyto.userpic) { """"""; } print $.replyto.text; """"""; ""; """

    Reply

    """; $.form->print(); } function print_theme_preview () { print """

    John Doe

    Recent Entries

    December 17th, 2002

    06:42 pm: Neque porro quisquam… Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit
    """; }